Reference/Release Notes/2.80/Python API
Blender 2.80: Python API Changes
Blender 2.80 is an API breaking release. Addons and scripts will need to be updated to run on 2.80, both to handle the new features and adapt to changes to make the API more consistent and reliable.
Please note: Blender 2.80 is now in the beta stage of development and is being prepared for a final release. Add-on authors can now work on updating their code to run on 2.80. The Python API should be considered mostly stable, but there may be some minor chages related to bug fixing and user feedback. Breaking changes may still happen, but will be kept to a minimum.
Module and class registration has been changed, all addons need to be updated to handle these.
The new view layers, collections, selection and dependency graph systems require updates to scripts.
A few changes were made to the Mesh API, mainly the data structures for triangles tessellation.
New toolbar, property layouts and icons require addon updates.
Blender was upgraded to the OpenGL core profile, which affects addons.
A new API to run functions in specific time intervals.
Various helper Python modules have been added, removed or changed.
A few terms have been renamed in the user interface, and the Python API follows along. The main ones are:
- Lamp to Light
- Group to Collection
- Dupli to Instance
- Render Layer to View Layer
Keyword Only Arguments
All keyword arguments must be given as keywords and cannot be passed by position:
context.scene.frame_set(10, 0.25) noise.noise(position, noise.types.BLENDER)
context.scene.frame_set(10, subframe=0.25) noise.noise(position, noise_basis='BLENDER')
Matrix multiplication previously used *, scripts should now use @ for multiplication (per PEP 465). This applies to:
- Vector * Vector
- Quaternion * Vector
- Matrix * Vector
- Vector * Matrix
- Matrix * Matrix
Note: In the future * will be used for element-wise multiplication
mat = Matrix() vec = Vector() result = mat * vec
mat = Matrix() vec = Vector() result = mat @ vec
Using the 2.7x syntax in 2.80 or later will result in this error:
TypeError: Element-wise multiplication: not supported between 'xxx' and 'yyy' types
Removed: object.select_by_layer Replaced: view3d.viewnumpad (use view3d.view_axis or view3d.view_camera instead)
Replaced: SpaceView3D.viewport_shader -> SpaceView3D.shading.type
- Bone and PoseBone have new utility methods for bone-specific math and B-Bone shape. (a58f0eea4f)