From 4acf0f05a1ec0b96c4a2e9c3628190f52a3590e2 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 6 Jan 2016 19:34:42 +0100 Subject: '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 --- release/scripts/modules/bpy_types.py | 1 + 1 file changed, 1 insertion(+) (limited to 'release') diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 1c08fc5e51f..830db976822 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -26,6 +26,7 @@ StructMetaPropGroup = bpy_types.bpy_struct_meta_idprop # StructRNA = bpy_types.Struct bpy_types.BlendDataLibraries.load = _bpy._library_load +bpy_types.BlendData.user_map = _bpy._rna_id_collection_user_map class Context(StructRNA): -- cgit v1.2.3