Blender Git Loki

Git Commits -> Revision 4acf0f0

Revision 4acf0f0 by Bastien Montagne (master)
January 6, 2016, 18:48 (GMT)
'users of ID' py API.

This mainly adds bpy.data.user_map() method, which goes over the whole Main database
to build a mapping (dict) {ID: {users_of_that_ID}}.

Very handy to check and debug ID usages, but could also be really valuable for py addons
creating temporary scenes, or some exporters, etc.

Note: current code in master's libquery misses some IDs (and reports some it should not,
like nodetrees), this is fixed in id-remap but still needs serious review before going to master.
This basically means that current bpy.data.user_map() **will not** report a complete and exhaustive
state of dependencies between IDs. Should work OK in most cases though.

Original work/idea comes from id-remap branch, was heavily reworked by @campbellbarton
and myself for master.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D1678

Commit Details:

Full Hash: 4acf0f05a1ec0b96c4a2e9c3628190f52a3590e2
Parent Commit: ea7a276
Lines Changed: +434, -0

2 Added Paths:

/source/blender/python/intern/bpy_rna_id_collection.c (+271, -0) (View)
/source/blender/python/intern/bpy_rna_id_collection.h (+32, -0) (View)

8 Modified Paths:

/release/scripts/modules/bpy_types.py (+1, -0) (Diff)
/source/blender/blenkernel/BKE_library_query.h (+2, -0) (Diff)
/source/blender/blenkernel/intern/library_query.c (+46, -0) (Diff)
/source/blender/makesrna/intern/rna_ID.c (+9, -0) (Diff)
/source/blender/python/intern/bpy.c (+2, -0) (Diff)
/source/blender/python/intern/bpy_rna.c (+64, -0) (Diff)
/source/blender/python/intern/bpy_rna.h (+5, -0) (Diff)
/source/blender/python/intern/CMakeLists.txt (+2, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021