Skip to content

Blender 4.2: Python API & Text Editor

Text Editor

  • Support for GLSL syntax highlighting (462c144f41)

Additions

bpy.utils Module

  • The EXTENSIONS option has been removed from bpy.utils.user_resource() (6bfc8612bf).
  • Add bpy.utils.register_cli_command & unregister_cli_command so scripts can define their own command line functionality via (-c, --command). (9372e0dfe0)

Animation

  • rna_struct.keyframe_insert() now has a new, optional keyword argument keytype to set the key type (1315991ecb). This makes it possible to set the new key's type directly. Example: bpy.context.object.keyframe_insert("location", keytype='JITTER').

Breaking changes

bpy.utils Module

  • The AUTOSAVE option has been removed from bpy.utils.user_resource() (6bfc8612bf).

Render Settings

  • Motion Blur settings have been de-duplicated between Cycles and EEVEE and moved to bpy.types.RenderSettings. (74b8f99b43)
    • scene.cycles.motion_blur_position -> scene.render.motion_blur_position
    • scene.eevee.use_motion_blur -> scene.render.user_motion_blur
    • scene.eevee.motion_blur_position -> scene.render.motion_blur_position
    • scene.eevee.motion_blur_shutter -> scene.render.motion_blur_shutter

Nodes

  • Unused parent argument removed from the NodeTreeInterface.new_panel function for creating node group panels. (#118792)
  • Some node properties have been renamed to fix name collisions (deb332601c):
    • Compositor Box/Ellipse Mask node: width -> mask_width (same for height)
    • Shader AOV Output node: name -> aov_name
    • Geometry Color node: color -> value

Image Object Operators

  • The "add image object" operator has been deduplicated and unified into one operator: object.empty_image_add. (013cd3d1ba)
    Previously there were two operators to add image empties (object.load_reference_image and object.load_background_image) with a separate operator for dropping (object.drop_named_image).
  • The "add/remove background image from camera" operator has been renamed to clarify that this is only for the camera object (013cd3d1ba):
    • view3d.background_image_add -> view3d.camera_background_image_add.
    • view3d.background_image_remove -> view3d.camera_background_image_remove.

Layout Panels

  • Added support for "layout panels" in popups (support for "operator dialogs", "redo popups" & popovers). (aa03646a74, 02681bd44d)