Reference/Release Notes/2.93/Python API
< Reference | Release Notes | 2.93
Blender 2.93: Python API
Python 3.9
Python was upgraded to version 3.9.1.
GPU
The gpu module has been enhanced to cover more functionality that previously was only available through bgl. (4430e8a008, 6c6b1c015b)
The bgl module will be deprecated in Blender 3.0, in preparation of future Vulkan support. Add-ons should switch to using the gpu module, so that they will work with both OpenGL and Vulkan.
- New
statesub-module for changing drawing state. - New
texturesub-module, including a function to create textures from image datablocks. - New
GPUFrameBuffer - New
GPUUniformBuf
Other Additions
- New
RenderEngine.bl_use_custom_freestyleoption. By default this is disabled, and Freestyle rendering will be done by Eevee. If enabled, the render engine will be called to render the Freestyle geometry. (1428544528) - New
to_curvemethod in Object ID. The method is analogous toto_meshand can be used to get the splines representing a text object or to get the splines after spline modifiers are applied. (f2c0bbed1c) - New
CurveMapping.reset_viewmethod (3eb8307160). - New
CurveProfile.reset_viewmethod (7e3efac9a8). - New
BlendFile.temp_datamethod, providing a context manager to temporarily load blend file data without linking/appending it into the current file (9e09214979). - UI: Add support for
bl_descriptionand python doc-strings for panel classes. (8971018eb6)
Other Changes
- UTF8 is now the default encoding on all platforms, matching the behavior of running
python -X utf8. See PEP-540 (df135b74fc). - The
deformparameter of the Bmeshfrom_objectmethod is now deprecated, always assumed to be True, and will be removed in version 3.0. (4b0871af87) - The intermediate representation of
bpy.props, typically defined in a classes annotations before registration is now using a new typebpy.props._PropertyDeferred. While this is not considered part of the stable API, some scripts depended on this (c44c611c6d) bpy.ops.mesh.primitive_grid_addthe resulting subdivision levels has been changed by n+1 (rB4d3cdb32).- Remove support for non-annotation properties in classes as this was only enabled while porting scripts to 2.8x API (afa5da9ce0)
- Scripts that dynamically generate types will need to be updated, see the following example for reference:
-
- Before (2.92 or older)
import bpy settings_class = type( "TestClass", (bpy.types.PropertyGroup,), { "test": bpy.props.StringProperty(default="test"), }, ) bpy.utils.register_class(settings_class) bpy.types.WindowManager.example = bpy.props.PointerProperty(type=settings_class) print(bpy.context.window_manager.example.test)
- After (2.93 and newer)
import bpy settings_class = type( "TestClass", (bpy.types.PropertyGroup,), { "__annotations__": { "test": bpy.props.StringProperty(default="test"), }, }, ) bpy.utils.register_class(settings_class) bpy.types.WindowManager.example = bpy.props.PointerProperty(type=settings_class) print(bpy.context.window_manager.example.test)