Commit Graph

10 Commits

Author SHA1 Message Date
Campbell Barton
34e7eb1676 use a metaclass to have operator attributes register and display in the order defined. 2009-11-20 20:58:46 +00:00
Campbell Barton
512c06afdb - StructRNA's __dir__ was missing members from its classes __dict__
- property editor can now set button min/max values and edit the tooltip
- custom props tooltips were not displayed
- cleanup the property UI 
- remove hacks that were used for editing (edit is now a popup operator)
- object.children was broken
2009-11-19 18:22:21 +00:00
Campbell Barton
e61c90e416 operators were copying the properties from the rna operator into the class instance.
however this meant the invoke function could not modify properties for exec to use (unless it called exec directly after)
since the popup for eg would re-instance the python class each time.

now use the operator properties directly through rna without an automatic copy.

now an operator attribute is accessed like this...
self.path --> self.properties.path
2009-11-19 17:12:08 +00:00
Campbell Barton
ae5a814f26 ID properties that are displayed via RNA can now define their own UI settings,
only implimented min/max precision & step.

at the moment there is no way to edit these other then via python

example of setting UI limits...

>>> C.object['foo'] = 0.5
>>> C.object['_RNA_UI'] = {'foo': {'step': 0.5, 'soft_max': 10.0, 'soft_min': 0.0, 'precision': 2, 'description': 'Some setting'}}

Also fixed typo's: precission -> precision
2009-11-18 20:01:35 +00:00
Campbell Barton
318e9aa5d1 - rna attribute setting problem, class instances could not set their own attributes because they are blocked by our own internal setattr.
this could be supported again easily however it leads typo's & api changes not showing any errors.

  This broke povray export.
  Solution for now is to allow setting private properties starting with '_'

  eg, 
    ob = bpy.context.object
    
    ob._foo = [1,2,3] # this is a python list, it will stay only as long as this PyObject is active
    ob.foo = 1 # raises an error!, only for rna properties
    ob["foo"] = 1 # converts to an ID property and is saved

    using the underscore like this should really be used for classes internally.

- povray failed on armatures

- menu key wasn't using WM_keymap_add_menu
2009-11-18 08:40:18 +00:00
Campbell Barton
2ae15e39ad make animation system and rna internals use getattr style syntax for user defined properties
bone["foo"] rather then bone.foo
matches python and avoids naming collisions
2009-11-17 20:46:59 +00:00
Campbell Barton
64104524cc fix for error editing a string property with quotes 2009-11-17 13:18:26 +00:00
Campbell Barton
f7682e2e0f - in pose mode, pose bone properties are edited rather then armature bone
- new id property array method convert_to_pyobject()
- editing an array in the UI broke
- fixed for own error when updating ID prop api
2009-11-17 12:54:29 +00:00
Campbell Barton
cf26cdd508 nicer UI, allow editing of values without pressing edit for basic types 2009-11-17 10:30:54 +00:00
Campbell Barton
7636d17af6 property editor for bone and object ID props, add/remove/edit
good example of how editing NON rna data results in very weired scripts :/
2009-11-16 22:53:28 +00:00