Reference/Release Notes/2.90/Python API
Blender 2.90: Python API
With the new operator search that only searches through menus, add-ons that expose operators only through search need to be updated. In general it is good practice to always expose operators through menus so users can find them.
For more obscure operators that are for example intended mainly for developers, we recommend adding them in the
TOPBAR_MT_app_system menu. This is accessible through the System menu under the Blender icon in the top bar.
relative_remapboolean argument has been replaced by
path_remapenumeration which can select different kinds of path remapping on write.
BevelModifier.use_custom_profileproperty is now part of a new a
profile_typeenum. (6703c7f7f1) This applies to the bevel tool as well.
- The bevel operator's
vertex_onlyproperty was changed to a new
- The modifier apply operator's
apply_asargument was moved to a new operator
modifier_apply_as_shapekey. The new operator can also save to a shapekey without removing the modifier (01c8aa12a1)
- Columns and rows can now group together related settings with a heading. For example:
The layout system will try to insert the heading to the left column of a property split layout, but may insert the heading as usual column or row item as fallback.
col = layout.column(heading="Tooltips") col.prop(view, "show_tooltips") col.prop(view, "show_tooltips_python")
UILayout.prop_decorator(data, property, index=-1)got added to allow manual insertion of decorators (to set keyframes or indicate other animation states for the property). There must be an item with the same parameters within the root layout for this to work.
- Checkboxes respect
UILayout.use_property_splitnow. With that some layout conventions changed:
- Related checkboxes should be grouped together in a column with a heading (see above).
- In cases where a checkbox controls the availability of a single property, the checkbox should be in a row together with the property:
Decorator items have to be manually inserted with some boilerplate code, which looks like this:It is important that the decorator is inserted to a row-layout that is the parent of the row-layout for the checkbox and the actual property.
row = layout.row(align=True, heading="Auto Smooth") row.use_property_decorate = False # Don't automatically insert decorators. sub = row.row(align=True) sub.prop(mesh, "use_auto_smooth", text="") subsub = sub.row(align=True) subsub.active = mesh.use_auto_smooth and not mesh.has_custom_normals subsub.prop(mesh, "auto_smooth_angle", text="") row.prop_decorator(mesh, "auto_smooth_angle")
- Checkboxes with property splitting often look bad if placed alone in a layout, or within flow layouts. In these cases
UILayout.use_property_splitshould be disabled or a fixed, non-flow layout be used.
- In the event a Python script causes Blender to crash, Blender's crash log will include a Python stack-trace so Python developers can find what caused the error (e9c4325515).
- Mathutils: element-wise multiplication for vectors matrices and quaternions (fa7ace2215).
constraints.copy()methods for objects and bones to duplicate a constraint with all its settings, including from other objects. (64a584b38a)
Screen.is_scrubbing, indicating when the user is scrubbing through time in the timeline, dopesheet, graph editor, etc. (2be7a11e43)
Sequences.new_movie()support for creating movie strips with missing files, consistent with image and sound strips.
MovieSequence.reload_if_needed()to try and reload movie strips, in case the missing file has appeared. This makes it possible to create a movie strip for video files that are synced between computers via some network connection. (b9f565881e)
- Drivers get a
depsgraphvariable in their local scope. See the Animation-Rigging release notes for more details.
smoothstepfunctions (inspired by GLSL
smoothstep), which are also made available to drivers. (f8cc01595d)
- Option to use OpenGL context in