Reference/Release Notes/2.91/Python API
Blender 2.91: Python API
- The Principled BSDF shader has a new Emission Strength input. Material importers and exporters need to be updated to take this into account. (b248ec9b24)
Scene Ray Cast
The first parameter to the
scene.ray_cast() function has changed (e03d53874d, A82ed41ec63). It now receives a Depsgraph instead of a View Layer. This made it possible to fix a crash, and also fixes potential issues when ray-casting is done while rendering (for example from a custom driver function).
# Old call example: context.scene.ray_cast(context.view_layer, ...) # New call example: context.scene.ray_cast(context.view_layer.depsgraph, ...)
The other parameters and the return value has remained the same.
Struct.is_property_set, so it's possible to test if an operator's property is being reused from the last time it was called (d3bcbe10c2).
wm.read_homefilenow has a
use_factory_startupargument, which can be used as a faster alternative when resetting the file contents for tests since
wm.read_factory_settingsresets preferences (re-registering all add-ons) (cf67ba848f).
UILayout.introspect()for scripts to access the UI layout (for testing/debugging) (428a1aaf73).
Mesh.attributesAPI for accessing custom geometry attributes on meshes. This replaces
polygon_layers_string, which are now deprecated. Instead
.attributesprovides a single list of geometry attributes for all combinations of geometry element and data types. Further, the data types have been extended with 3D Float Vector, Byte Color and Float Color. (565510b565)
VolumeGrids.save()function to save volume grids and metadata to disk. (fc76750fc7)
- Custom property names can no longer contain
\. These characters can cause problems with drivers and Python and may not have worked properly in the past. (cbae82ba96)
- Actions are bound to the type of the datablock they're assigned to; a Camera Data action cannot be asigned to an Object. This "locking" used to happen when the animation was evaluated; now it happens when the Action is assigned. (64583f3e8d)
sys.executablenow points to the Python interpreter (instead of the Blender executable) (04c5471cee). This resolves
multiprocessingwhich failed to spawn new processes on WIN32.
bpy.app.binary_path_pythonhas been deprecated (use
- Since porting
bpy.ops.uv.smart_projectto C (850234c1b1),
angle_limithas to be given in radians.