Commit Graph

14807 Commits

Author SHA1 Message Date
Kent Mein
edc06b0b5b A couple of small fixes to clear up some warnings.
BOP_Merge2.cpp 
	had same variable name at different scopes so I renamed a couple.
resources.c 
	added include that was missing.  (This maybe was going to move? the old one
	was commented out)
ed_markers.c
	initalized a var that needed it.

Kent
2008-12-03 17:36:30 +00:00
Ton Roosendaal
4e6b6dd3f9 2.5
- Tooltips now respect view2d view (rna viewer).
- Bugfix in viewd.c UI_view2d_view_to_region() (typo)
2008-12-03 17:11:50 +00:00
Ton Roosendaal
880710cfb0 2.5
Fix crashing in pop-up menus when click.
There's something wrong still in handling menu itself, need Brecht
too look at that... probably a wrong return value somewhere.
2008-12-03 15:49:41 +00:00
Ton Roosendaal
1c81b97481 2.5
Error in commit that made notifier calls easier; forgot to add the
check for global vs local notifiers.
2008-12-03 15:05:06 +00:00
Ton Roosendaal
444e1d198e 2.5
Fix: the main button handler was swallowing all events. Now every button
type returns 'handled' only if it did something, so other events get nicely
processed.

This will enable MMB pan in dataviewer.
2008-12-03 14:22:42 +00:00
Ton Roosendaal
167ac3606b 2.5
- Made view2d manipulations redraw on area level
- simplified call to send Notifiers:

  WM_event_add_notifier(bContext *C, int type, int value, void *data)

  This brings back more control to WM, no context messing within
  operators. :) Handlers that execute operators will be responsible
  for delivering correct contextes.

  In general: should lead to making context not exposed, but only 
  readable via some callbacks.
2008-12-03 13:44:16 +00:00
Ton Roosendaal
d8ed4c389c 2.5 fixes
- View2d bug: it was taking sliders into account for setting the 
  window matrix, which it shouldn't (glViewport does). This caused
  error offset in drawing, like for current-frame scrolling.

- Current frame scrolling in TimeWindow back on window level.
  (used to crash, but that was fixed in WM)

- Made UI_view2d_region_to_view accept ints, no shorts

- removed debug function in interface_ops.c
2008-12-03 13:14:01 +00:00
Joshua Leung
92cbb4b033 View2D - assorted wip changes (nothing to see here) 2008-12-03 09:06:30 +00:00
Brecht Van Lommel
8f1847e4c3 RNA: review of commits in the past days, check the diffs for the
many small changes, but the two bigger ones are:

* Sensors and controllers now use inheritance, rather than pointing
  to the data in a separate struct. Had to add some new RNA define
  functionality to support this better.
* DNA_meta_types.h was marked as done but still missing many things,
  now completed.
2008-12-02 23:45:11 +00:00
Ton Roosendaal
d27c9f9d76 2.5
- after closing button (having used it), it sends empty mousemove for 
  invoking new modal handler on same button. Don't know better solution
  for now, at least this way WM handles everything. :)

- experiment: moved button handlers to area level, that way it respects
  handlers on higher hierarchical level, like moving area edges.
  Als interesting is that you can have a button active (texteditor) and
  use a similar button in other area.
  This can also be done on region level even.

On todo: proper notifier events for redraw! Don't want all areas to draw
on simple refreshes
2008-12-02 18:49:58 +00:00
Campbell Barton
6a6b386832 Made PyRNA props iterable, so you can do things like...
for ob in bpy.objects:
	print(ob.name)

for i, lay in bpy.scenes["Scene"].layer:
	print('%d %d' % i, lay)
2008-12-02 15:27:10 +00:00
Campbell Barton
9f27be3b2d Added RNA functions from PyRNA
* RNA_property_enum_value
* RNA_property_enum_identifier
To get an enum string from a value and a value from an enum.

BPy_StructRNA types (objects, meshes, images etc) can now be used as dictionary keys.
2008-12-02 14:36:35 +00:00
Ton Roosendaal
54908979c5 Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module

This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)

Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
  such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
  (needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
  dangerous thing anyway, and you should leave that to the event system.
  Now, if a handler modal() call gets a cancel/finish return, it frees 
  itself in event system. WM_event_remove_modal_handler was a confusing 
  call anyway!

Todo:

- allow button-activate to refresh after using button 
- re-enable arrow keys for menus
  (do both after commit)

- review return values of operator callbacks in interface_ops.c

* Fixes in WM system

- Freeing areas/regions/windows, also on quit, now correctly closes 
  running modal handlers
- On starting a modal handler, the handler now stores previous area
  and region context, so they send proper notifiers etc.

* Other fixes

- Area-split operator had bug, wrong minimal size checking. This
  solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
  later re-use or saving.
2008-12-02 14:22:52 +00:00
Joshua Leung
c4fe6d0f00 RNA - Wrapped a few more simple Object transforms.
Note: Rotations are still exposed directly in radians. We should probably do some wrapping around this, perhaps at UI-level?
2008-12-02 10:10:07 +00:00
Joshua Leung
628d7013e2 View2D - Some more tweaks...
* Improved scrollbar drawing a bit more - only cosmetic lines
* Added new view2d view-matrix api method to only use 'cur' coordinates on one axis, for use when drawing markers, etc. that need to be glued to a certain time but stay fixed in space in another dimension. This should improve the sitation for drawing markers
* To aid testing, adding markers now sets the marker to have frame number as it's "name". This will need to be removed later...
2008-12-02 09:43:23 +00:00
Campbell Barton
f8d5883a5b mingw was giving errors...
source\blender\python\intern\bpy_rna.c:1018: error: initializer element is not constant
source\blender\python\intern\bpy_rna.c:1018: error: (near initialization for `pyrna_prop_Type.tp_get

Assign get generic get/sets before PyType_Ready runs
2008-12-02 09:35:29 +00:00
Hamed Zaghaghi
6780c0b12a * rna_property completed
CAUTION: some defines like PROP_INT in DNA_property_types.h are the same 
as enums in RNA_types.h, and may be encounter hidden errors in future.
2008-12-02 01:05:23 +00:00
Nathan Letwory
accfa06ede * after discussion with cambo on IRC, change the #ifndef's to #undefs instead:
Pre-Python 3.0 has strings default non-unicode, so checks and handling should be done so too.
2008-12-01 23:38:22 +00:00
Nathan Letwory
d1e75c215b * make sure there are no redefinitions (I'm using py2.5 and ie PyUnicode_Check define exists 2008-12-01 22:20:18 +00:00
Andrea Weikert
23a77e7688 RNA
* DNA_packedFile_types: added rna definitions for packed files
* also experimentally filled in correct struct 'PackedFile' in image rna for testing.
* updated MSVC projectfiles (also for rna_curve.c and rna_vfont.c)

Note:
I removed PackedFile->flags, I did grep through source and a complete recompile of blender trunk svn without them too, so they obviously aren't needed anymore. A bit of cleaning up :)
2008-12-01 21:23:58 +00:00
Juho Vepsalainen
31ffe5b65e RNA: Added missing *srna's to curve functions. 2008-12-01 21:19:36 +00:00
Nathan Letwory
d18f26f679 * add debug symbols when building BF_DEBUG=True 2008-12-01 21:13:49 +00:00
Andrea Weikert
a821b7e5d1 == MSVC9 projectfiles ==
- update for several new rna files.
2008-12-01 20:53:01 +00:00
Juho Vepsalainen
1ebf257bf4 RNA: Curves and VFont
Implemented RNA wrappers for curves and VFont. Only issue I could
not yet solve is related to struct CharInfo curinfo; . This particular
line proved to be hard to wrap and I therefore marked it as a TODO
should someone want to fix this issue.

I also cleaned up makesrna.c a bit by unifying brush/meta parts
under one call just the way it is done in the case of other
wrappers.
2008-12-01 19:02:27 +00:00
Campbell Barton
6a73a27d81 PyRNA structs and properties can now be subtyped to add functionality in python.
rna_actuator.c was missing an enum
2008-12-01 16:59:18 +00:00
Nathan Letwory
7c94f5314b * ray_mirror naming for property grouping 2008-12-01 14:36:14 +00:00
Juho Vepsalainen
5a8e8906bb RNA:
Implemented RNA wrapper for ModifierData.

Note that actual interface to access data of any specific modifier is
still missing. I also marked a couple of parts as TODO that should be
reviewed to decide whether or not to expose those specific parts
via RNA.
2008-12-01 13:01:48 +00:00
Joshua Leung
1a354bd310 View2D - Zoom + More Scrollbar work
* Added basic (non-modal) zoom operators that use a uniform scale factor, with zoom centered using the view center as scaling point. Use Scrollwheel up/down and Pad +/- to use this.

* Added back the 'button'/bubble for the scrollbars. I've added dark lines on either end of it for some later work on zooming widgets.
This is not the final form they'll take. I still need to decide how to handle those scrollbars which act as grid-markers too (showing timescale, etc.), before trying to integrate that with some fancy scrollbar drawing (rounded, etc.)

Assorted changes:
* Moved vertical scrollbar for Outliner to right hand side
* Made Timeline use standard scrollbars, and turned on various clamping options
* Fixed ortho-matrix corrections for scrollbars, and added pixel offsets
* Made Timeline markers sit more snugly on the scrollbar. They were a bit far out...
* Fixed memory leak with view2d keymaps not being freed when Blender exited
2008-12-01 11:37:05 +00:00
Matt Ebb
3ff7c28e7b * Added checkmarks to 'table buttons' as used in RNA viewer. Helps to distinguish them
a bit better.
2008-12-01 06:53:00 +00:00
Juho Vepsalainen
12a45b3174 RNA: brush wrapping
Wrapped most of brush. Brush is still missing a link to texture and to
BrushClone. Also PAINT_TOOL_DRAW etc. flags found on DNA_brush_types.h
need to be associated to a brush somehow. Currently they are linked
to a brush via ImagePaintSettings.

Also changed identifiers in metaball wrapping to conform with the
standards.
2008-12-01 06:52:18 +00:00
Willian Padovani Germano
669c7a9922 RNA
* Tiny updates/fixes to Ipo wrapping.
2008-12-01 00:48:54 +00:00
Joshua Leung
70fd53b469 View2D - Another WIP commit
* Start of basic scrollbar drawing. This will be improved. Only Outliner shows these for now, as although the Timeline should show them, the old files didn't have them turned on. 

* Tidied up the view-panning operator
- Fixed naming convention
- Added user-adjustable properties (deltax, deltay in screenspace)

* Added ctrl-scrollwheel (horizontal) and shift-scrollwheel (vertical) scroll operators. These use the view-panning code too. 
Unfortunately, I haven't been able to figure out why the WHEELMOUSEDOWN events don't seem to be triggering the operators!
2008-12-01 00:20:19 +00:00
Willian Padovani Germano
3f0d3e0a50 RNA
- Minor updates to Camera and start of Ipo (+ IpoDriver and IpoCurve) wrappings.
2008-11-30 23:27:10 +00:00
Hamed Zaghaghi
e66fff7906 * added rna_world with porperties of two first panel in the current UI 2008-11-30 22:48:43 +00:00
Juho Vepsalainen
cfa5c7c396 RNA: Support for Metaballs and Metaelements. I did not figure out a way to test latter but hopefully it works as well. 2008-11-30 20:18:55 +00:00
Hamed Zaghaghi
255bc067ec * changed NULL properties into UnknownProperty
* added rna_property.c and rna_actuator
* enabled access to properties and actuators from object
Note that because we have RNA_Property in the RNA itself, you can find 
properties in gamelogic of and object under the name of RNA_GameProperty
2008-11-30 19:52:21 +00:00
Brecht Van Lommel
9cb9bf7da3 RNA:
* DNA_image_types.h done, except for some properties not being editable.
2008-11-30 18:39:49 +00:00
Andrea Weikert
a141e44e55 RNA
* DNA_lattice_types: added rna definitions for lattice u,v,w and some flags
* updated MSVC projectfiles
2008-11-30 16:38:56 +00:00
Brecht Van Lommel
42aa747ec0 RNA
* DNA_radio_types.h: done. (patch by Jorge Bernal). Also adds
  some #defines in the radiosity DNA since it was using hardcoded
  values.
* Added an "UnknownType" which has no properties, useful as a
  placeholder for pointers that have no defined type yet.
* Sort a few lists in the code alphabetically.
2008-11-30 15:55:14 +00:00
Hamed Zaghaghi
5464c2e4a8 * controller structs, bController, bExpressionCont and bPythoncont RNFied\n*controllers are available in objects\n* some typos in rna_sensor 2008-11-30 14:40:00 +00:00
Campbell Barton
3a22ddeb04 PyRNA epydoc style docstrings.
examples...

RNA Lamp: Lamp
==============
@ivar rna_type: RNA type definition. *readonly*
@type rna_type: PyRNA PointerProperty
@ivar name: Unique datablock ID name. (22 maximum length)
@type name: string
@ivar adapt_thresh: Threshold for Adaptive Sampling. in (0.000, 1.000)
@type adapt_thresh: float
@ivar area_shape: Shape of the Area lamp
@type area_shape: enum in [SQUARE, RECTANGLE]
@ivar area_size: Size of the area of the Area Lamp. in (0.000, 100.000)
@type area_size: float
@ivar area_sizey: Size of the area of the Area Lamp. in (0.000, 100.000)
@type area_sizey: float
- snip

RNA Object: Object
==================
@ivar rna_type: RNA type definition. *readonly*
@type rna_type: PyRNA PointerProperty
@ivar name: Unique datablock ID name. (22 maximum length)
@type name: string
@ivar data: Object data. *readonly*
@type data: PyRNA PointerProperty
@ivar fake_user: Saves this datablock even if it has no users
@type fake_user: bool
@ivar library: Library file the datablock is linked from. *readonly*
@type library: PyRNA PointerProperty
@ivar loc:  in (-inf, inf)
@type loc: float[3]
2008-11-30 14:00:14 +00:00
Joseph Eagar
141f5f73f2 scons build dir was assumed to be relative, this isn't always the case. also, defined BF_PROFILE_FLAGS for win32-ming. 2008-11-30 13:25:59 +00:00
Hamed Zaghaghi
3c4132177f completed, remaining sensors added, random, radar, message, joystick and others 2008-11-30 12:00:03 +00:00
Andrea Weikert
743f3b7222 == MSVC projectfiles ==
== MSVC projectfiles ==
- update for python RNA API
- update for editors: ed_util.c
- fixed RNA_rna library project, doesn't need the c files included in rna.c
2008-11-30 11:55:44 +00:00
Hamed Zaghaghi
6580e96e8e 3 another sensors added: delay, actuator, porperty 2008-11-30 09:00:32 +00:00
Joshua Leung
43b26b72ab View2D - Initial commit of Pan-View Operator
* Moved View2D data from space-data to ARegion (aka regions). This has been done because drawing occurs in regions not areas anymore. The View2D struct is currently stored in the ARegion struct (not as pointer), given that most of the regions in use will be 2D anyway (only the 3d-view's "window" region is the exception).
Added version patch code for outliner and timeline only for now. Headers are also likely to need this.

* Added separate keymap for View2D operators. All regions that use View2D will need this added. This includes headers too. 

* Pan view operator (ED_View2D_OT_view_pan), currently works for Outliner and Timeline. Use MMB-drag as before. 
- It currently doesn't exposed any parameters for redo (via RNA-ID-Props), but only uses some customdata. Suggestions on what these parameters could be are welcomed. 
- I've yet to implement the necessary axis-locking features for this panning (which is required in Timeline for example to prevent vertical panning, which moves the markers out of view).
2008-11-30 06:15:33 +00:00
Campbell Barton
970fa83fab Added Group type to RNA 2008-11-30 05:07:57 +00:00
Campbell Barton
18f3e5d69f PyRNA
Can now assign RNA arrays from python lists of bools/ints/floats
 eg -> rna.scenes["Scene"].layer = [True] * 20

Also added exceptions when trying to set readonly properties.
2008-11-30 03:52:07 +00:00
Campbell Barton
bc99bbde21 mistake in comparing pointers. (causing memfree prints) 2008-11-30 02:30:34 +00:00
Brecht Van Lommel
244cce0bd0 RNA: some fixes for lamp UI text. (Michael Fox) 2008-11-30 01:31:05 +00:00