* Driver F-Curves were not getting fixed by the "FCurve/Driver Version
Fix" tool. This was causing problems such as shapekey drivers from
older (2.56 compatible rigs) failing to run. As well as renaming the
paths for these Driver F-Curves, the "disabled" flags also get cleared
from these drivers so that they can be run again
* "Revive Disabled F-Curves" operator in Animation Editors can now be
used to revive disabled drivers too.
move calls to the classes register/unregister function into register_class() / unregister_class() and add docs.
also other minor changes:
- remove face sorting keybinding, was Ctrl+Alt+F, this is quite and obscure feature and face order normally doesn't matter, so access from Face menu is enough.
- add commented out call to mesh.validate() in addon template since its useful to correct incomplete meshes during development.
ui/ --> startup/bl_ui
op/ --> startup/bl_operators
scripts/startup/ is now the only auto-loading script dir which gives some speedup for blender loading too.
~/.blender/2.56/scripts/startup works for auto-loading scripts too.
Modified to only do one lookup.
from Martin:
"Basically, what it does is allow you to add register and unregister class methods to rna types, this way you don't have to rely on module register/unregister methods to setup your types properly (and it makes them easier to move around when reorganizing code and easier to understand what a type does when reading code). This is especially nice for PropertyGroup classes that are added as properties to existing types, you can easily see in their register methods where they are added and removed in their unregister method. Obviously, those two methods are optional, so current code still works fine."
'create' was used as prefix and suffix, change dupli list functions to use as suffix, this matches obj.animation_data_create() & obj.animation_data_clear().
obj.create_dupli_list() --> obj.dupli_list_create()
obj.free_dupli_list() --> obj.dupli_list_clear()
Don't use 'create' for object to mesh function since other uses of this are for createing data which stays attached, instead use mathutils style naming convention.
obj.create_mesh() --> obj.to_mesh()
this is not well suited to RNA so this is a native python api.
This uses:
bpy.data.libraries.load(filepath, link=False, relative=False)
however the return value needs to use pythons context manager, this means the library loading is confined to a block of code and python cant leave a half loaded library state.
eg, load a single scene we know the name of:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = ["Scene"]
eg, load all scenes:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = data_from.scenes
eg, load all objects starting with 'A'
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.objects = [name for name in data_from.objects if name.startswith("A")]
As you can see gives 2 objects like 'bpy.data', but containing lists of strings which can be moved from one into another.
- use own OrderedDictMini class, pythons collections.OrderedDict is overkill, 179 sloc. replaced with own, 11 lines.
- remove code which stored the class file & line per RNA subclass, this was useful but would raise its own exception every time to generate a stack trace to get the class info so we could use of the class failed to register. the class stores its module & name which can be enough to find where it was defined.
adding meshes in C does:
Add Empty Mesh -> Enter Editmode -> Create Mesh
while python does:
Add Generated Mesh -> Enter Editmode
problem with this is there is no empty undo state for undo-redo to use so it always gave a duplicate mesh on redo-ing.
workaround by adding an empty mesh, do an undo push, and join the generated mesh into the empty one.
this would be fixed if undo stack spanned modes.
would stop the entire menu from drawing if they raised an exception.
now print the exception and continue.
Also added a verbose argument for bpy.utils.(un)register_module() to help test whats being registered.
- KeyingSetInfo classes are now collected like Panels, Operators etc so bpy.utils.register_module() can be used.
- move bpy.types.register() to bpy.utils.register_class
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.
TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
- bpy.data.*.load() functions were only accepting UTF-8 paths.
- rna functions/properties now accept byte values rather then strings for file paths.
- bpy.path.resolve_ncase now supports byte objects.
- enabling/disabling no longer prints in the terminal unless in debug mode.
- remove 'header' struct from BLI_storage_types.h, from revision 2 and is not used.
- Add GCC property to guardedalloc to warn if the return value from allocation functions isn't used.
Also added bpy.path.display_name_from_filepath(), since filepaths are not ensured to be utf8.
same as calling: os.path.splitext(os.path.basename(name))[0].encode("utf8", "replace").decode("utf8")
[#25284] Traceback error on "System Info" script
- Align was only working on mesh objects, now operate on all objects, missing boundbox's are treated as single points.
- obj.bound_box was returning all nan's for object types with no boundbox.
- ENUM_FLAG type enums were showing no text when displayed in operator redo panel.
- reload() has been removed from pythons builtins. use imp.reload() instead (still need to apply globally).
- fixed own mistake, not ignoring 'filter_glob' as a keyword argument (broke fbx, obj, 3ds export)
Added convenience function to operators, 'as_keywords()', so operator settings can be passed directly to a function as keyword arguments.
The problem in this case was that dictionary access to operator properties was not returning rna-property defaults, so as_keywords() ensures all defaults are set.
This added a poll function to the Panel base class but this means that all panels register as having a poll() function which is called a lot and does nothing, raising an exception and removing it because of how python implements hasattr().
Found when checking why exceptions were continuously raised on redraw.
Martin, can you check on netrender?
[#24601] Net rendering master node fails to send/retrieve files to/from slaves
Both Reported by Dan McGrath
The second might not actually be fixed with this, but now there is better error checking and reporting.
Misc: add poll method in Panel base class, to better support mixins with different inheritance order.
WM_operator_poll() could fail in cases WM_operator_name_call() would succeed because calling the operator would setup the context before calling poll.
this would result in python raising an invalid error or menu items being greyed out.
now python can also check with an operator context:
bpy.ops.object.editmode_toggle.poll('INVOKE_SCREEN')
- Setting operator properties was broken because of bpy_types.py meta-classing (surprising this wasn't noticed before!)
- Presets now use a dialog with an OK button.
- Presets use a check function on the filename so invalid chars are replaced editing.
- Submit docs operator was broken.
now addon path is created using the same path functions and selecting where to save the startup.blend
also made some minor changes to path handling funcs.