Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r--source/blender/makesdna/DNA_ID.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 265baa16cc5..51c47e917f1 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -314,6 +314,20 @@ typedef struct ID {
*/
struct ID *orig_id;
+ /**
+ * Holds the #PyObject reference to the ID (initialized on demand).
+ *
+ * This isn't essential, it could be removed however it gives some advantages:
+ *
+ * - Every time the #ID is accessed a #BPy_StructRNA doesn't have to be created & destroyed
+ * (consider all the polling and drawing functions that access ID's).
+ *
+ * - When this #ID is deleted, the #BPy_StructRNA can be invalidated
+ * so accessing it from Python raises an exception instead of crashing.
+ *
+ * This is of limited benefit though, as it doesn't apply to non #ID data
+ * that references this ID (the bones of an armature or the modifiers of an object for e.g.).
+ */
void *py_instance;
void *_pad1;
} ID;