Blender Git Loki

Git Commits -> Revision 3ed5c9a

Revision 3ed5c9a by Campbell Barton (master)
July 26, 2017, 13:49 (GMT)
PyAPI: Store PyInstances for ID's

This means once an ID is created,
it will keep using the same PyObject instance.

This has some advantages:
- Avoids unnecessary re-creation of instances on UI poll / redraw.
- Accessing free'd ID's gives an exception instead of crashing.
(long standing annoyance!, though this only applies to ID's
and not yet other data that uses the ID's - vertices for eg).
- Allows using instance comparison (a little faster).

Note that the instances won't be kept between undo.

Commit Details:

Full Hash: 3ed5c9a610b348841f1e48736f02d73976f034d4
Parent Commit: 40a45e3
Lines Changed: +22, -7

7 Modified Paths:

/source/blender/blenloader/intern/readfile.c (+1, -0) (Diff)
/source/blender/makesdna/DNA_ID.h (+1, -0) (Diff)
/source/blender/makesdna/DNA_object_types.h (+3, -3) (Diff)
/source/blender/makesdna/DNA_scene_types.h (+3, -3) (Diff)
/source/blender/makesdna/DNA_text_types.h (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+12, -0) (Diff)
/source/blender/makesrna/intern/rna_internal.h (+1, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021