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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-01-06 21:34:42 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-06 21:48:10 +0300
commit4acf0f05a1ec0b96c4a2e9c3628190f52a3590e2 (patch)
tree6c58b90f9133ce30d3e7b125181c5c267885b698 /source/blender/python/intern/bpy_rna_id_collection.h
parentea7a2766f6054bf991dee746408f45c535c324b5 (diff)
'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
Diffstat (limited to 'source/blender/python/intern/bpy_rna_id_collection.h')
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.h b/source/blender/python/intern/bpy_rna_id_collection.h
new file mode 100644
index 00000000000..c293289c821
--- /dev/null
+++ b/source/blender/python/intern/bpy_rna_id_collection.h
@@ -0,0 +1,32 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Bastien Montagne
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/bpy_rna_id_collection.h
+ * \ingroup pythonintern
+ */
+
+#ifndef __BPY_RNA_ID_COLLECTION_H__
+#define __BPY_RNA_ID_COLLECTION_H__
+
+int BPY_rna_id_collection_module(PyObject *);
+
+#endif /* __BPY_RNA_ID_COLLECTION_H__ */