Reference/Release Notes/2.93/Python API

= 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`. 

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 `state` sub-module for changing drawing state.
 * New `texture` sub-module, including a function to create textures from image datablocks.
 * New `GPUFrameBuffer`
 * New `GPUUniformBuf`

Other Additions

 * New `RenderEngine.bl_use_custom_freestyle` option. 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.
 * New `to_curve` method in Object ID. The method is analogous to `to_mesh` and can be used to get the splines representing a text object or to get the splines after spline modifiers are applied.
 * New `CurveMapping.reset_view` method.
 * New `CurveProfile.reset_view` method.
 * New `BlendFile.temp_data` method, providing a context manager to temporarily load blend file data without linking/appending it into the current file.
 * UI: Add support for `bl_description` and python doc-strings for panel classes.

Other Changes

 * UTF8 is now the default encoding on all platforms, matching the behavior of running `python -X utf8`. See PEP-540.
 * The `deform` parameter of the Bmesh `from_object` method is now deprecated, always assumed to be True, and will be removed in version 3.0.
 * The intermediate representation of `bpy.props`, typically defined in a classes annotations before registration is now using a new type `bpy.props._PropertyDeferred`. While this is not considered part of the stable API, some scripts depended on this
 * `bpy.ops.mesh.primitive_grid_add` the resulting subdivision levels has been changed by n+1.
 * Remove support for non-annotation properties in classes as this was only enabled while porting scripts to 2.8x API
 * Scripts that dynamically generate types will need to be updated, see the following example for reference:
 * Before (2.92 or older)
 * After (2.93 and newer)
 * Before (2.92 or older)
 * After (2.93 and newer)
 * After (2.93 and newer)