Dev:Ref/Release Notes/2.79/PythonAPI

= Blender 2.79: Python API =

Breaking Changes

 * Switched default value of  parameter of   functions from   to.

Data-block Pointer Properties
Custom properties can now store pointers to data-blocks like objects, materials, etc. For this the a  with a datablock type can be created.

Forward Compatibility
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 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.

Render Passes
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. ,)

Changes:
 * The properties  and   have been removed from the   struct.
 * The function  has been added to the   struct, and   has been deprecated.
 * now supports custom properties, which allows render engines to add their own pass options.
 * has three new functions:
 * , 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 ) and optionally which render layer it should be added to.
 * , 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  for each one.
 * should 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

 * to make a single ID block local.
 * Inserting entries in the right click menu (and retrieving data from the UI element that you clicked on the entry). Example in docs.
 * ID property arrays support the Python buffer protocol. This makes it possible to create and access those arrays much more efficiently.