Blender Git Commit Log

Git Commits -> Revision e125305

Revision e125305 by Campbell Barton (master)
March 16, 2021, 04:17 (GMT)
Fix T86332: Error using lambda in annotations in Python 3.10

Callbacks used in `bpy.props` didn't hold a references to the functions
they used.

While this has been the case since early 2.5x it didn't cause any
problems as long as the class held a reference.

With Python 3.10 or when using `from __future__ import annotations`,
the annotations are no longer owned by the class once evaluated.

Resolve this by holding a reference in the module, which now supports
traverse & clear callbacks so the objects are visible to Python's
garbage collector.

Also refactor storage of Python data, moving from an array into a struct.

Commit Details:

Full Hash: e125305af41a7360c52b9a38024b7e24fde06d70
Parent Commit: be51d67
Lines Changed: +245, -140

9 Modified Paths:

/source/blender/makesrna/intern/makesrna.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_access.c (+0, -9) (Diff)
/source/blender/makesrna/intern/rna_define.c (+17, -6) (Diff)
/source/blender/makesrna/intern/rna_internal_types.h (+0, -1) (Diff)
/source/blender/makesrna/RNA_access.h (+0, -1) (Diff)
/source/blender/makesrna/RNA_define.h (+3, -2) (Diff)
/source/blender/python/intern/bpy_interface.c (+4, -0) (Diff)
/source/blender/python/intern/bpy_props.c (+219, -120) (Diff)
/source/blender/python/intern/bpy_props.h (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021