Blender 2.79: Python API
- Switched default value of
Data-block Pointer Properties
Custom properties can now store pointers to data-blocks like objects, materials, etc. For this the a
PointerProperty with a datablock type can be created.
Unfortunately, this new custom property type revealed a critical bug in current code, which crashes Blender on unknown property types. This bug has been fixed in 15189baa52 for the future, but it is impossible to fix this for existing releases.
This means that trying to load a .blend file using new data-block custom properties will crash on any version prior to 2.79.
For more technical details about the problem, see #51260.
Render passes are now identified exclusively by their name, the type property has been removed. The purpose of that change is to allow external rendering engines to produce arbitrary render passes and return them to Blender, rather than being limited to the 31 types of passes exposed by Blender before. (4cf7fc3b3a),)
- The properties
debug_typehave been removed from the
- The function
find_by_namehas been added to the
find_by_typehas been deprecated.
SceneRenderLayernow supports custom properties, which allows render engines to add their own pass options.
RenderEnginehas three new functions:
add_pass, which can be called by the render engine while rendering to add a render pass to the render result by providing its name, amount of channels, characters identifying the channels (like
RGBA) and optionally which render layer it should be added to.
update_render_passes, which has to be implemented by render engines that use render passes. It's purpose is to inform Blender of which passes will be generated given the current options, which is does by calling
register_passfor each one.
register_passshould be called by update_render_passes to inform Blender about a pass that will be generated by passing the name, channels and data type (used to determine the compositor output socket).
- 31 pass names are reserved to represent the former 31 pass types. Render Engines may provide these passes, but should consider that they will be associated with the legacy pass types (for example, compositor node connections will be preserved).
Other New APIs
bpy.types.ID.make_local()to make a single ID block local. (592e9e9245)
- Inserting entries in the right click menu (and retrieving data from the UI element that you clicked on the entry). Example in
- ID property arrays support the Python buffer protocol. This makes it possible to create and access those arrays much more efficiently. (73a9ff0d2d)