new bone properties
- bone.basename (name without the extension), "Some.Bone.001" --> "Some.Bone"
- bone.children_recursive_basename, gives a chain of children that have the same basename
- the scripts path set in the user preferences or ~/.blender/scripts/ui (io, op, io etc..) will be used to load scripts.
- the default home dir part probably only works in *nix os's
- Added a missing sync callback to vector.toTuple()
- retopo operator to convert grease pencil drawn topology into geometry, not in the convert menu yet since its not quite finished, use the operator search menu for retopo. will test this week and see what needs fixing.
[#20123] "Import" menu entry becomes empty
[#20141] In Object menu Make Links appears twice - SVN 24970
also moved OBJs name cleaning func to bpy.utils.clean_name(name, replace="_")
these are applied by adding constraints, drivers, control bones etc. making it possible to re-apply changes & improvements to many rigs at once.
testcase makes a finger rig (like in BBB) from 3 bones, the base tagged with an id property "type":"finger".
still missing is a way to update the driver dep's
also fixed an error in the property UI when the active bone is not on the active layer.
This means you can have a pose bone for eg and get the path...
pose.bones["Bone"]
uses rna internal functions, so will work for sequence strips etc.
- StructRNA.get(), used for getting ID props without exceptions...
val = C.object["someKey"]
or..
val = C.object.get("someKey", "defaultValue") # wont raise an error
- change rna property for testing if rna props are editable, test the flag rather then calling the function since the function depends on blenders state.
- fix a python exception with the ID-Property popup UI (when editing in more then 1 step)
- remove functions such as operator_int(), operator_enum(), operator_string
this mixed with keyword arguments in a way that made them hard to read.
Instead, have operator() always return properties rather then needing an argument.
- rename prop_pointer() --> prop_object(), pointer is more a C thing.
- missed item_enumR(), rename to prop_enum()
- path functions bpy.utils.script_paths(), bpy.utils_preset_paths(subdir)
- further simplified presets, use a generic draw function for preset menus and define the preset subdir and operator in the class
- 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
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
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
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
- bpy is now a python package, this makes it easier to add utility modules and adjust python startup which was previously using verbose Py/C api. Access should not be any slower since both C and Python modules use dictionary access.
- loop over scripts and load via python (currently F8 reload isnt working, will add back shortly)
- the C module is kept but renamed to _bpy and not meant for direct access from anything but the bpy package.
- bpy_types.py is an exception since it runs before the bpy package is initialized.
this way the UI scripts are less likely to fail silently and wont let typos work ok.
also allow subclassing of the context, added a copy function,
bpy.context.copy(), returns the context as a python dict to be modified and used in python.
This also showed up an invalid brush member in the screen context.
- python defined classes will be used when available (otherwise automaically generated metaclasses are made as before)
- use properties rather then functions for python defined rna class's
- call the classes getattr AFTER doing an RNA lookup, avoids setting and clearing exceptions for most attribute lookups, tested UI scripts are ~25% faster.
- extending rna py classes this way is a nicer alternative to modifying the generated metaclasses in place.
Example class
--- snip
class Object(bpy.types.ID):
def _get_children(self):
return [child for child in bpy.data.objects if child.parent == self]
children = property(_get_children)
--- snip
The C initialization function looks in bpy_types.py for classes matching RNA structure names, using them when available.
This means all objects in python will be instances of these classes.
Python properties/funcs defined in ID py class will also be available for subclasses for eg. (Group Mesh etc)