diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-06 21:34:42 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-06 21:48:10 +0300 |
commit | 4acf0f05a1ec0b96c4a2e9c3628190f52a3590e2 (patch) | |
tree | 6c58b90f9133ce30d3e7b125181c5c267885b698 /source/blender/python/intern/bpy_rna.h | |
parent | ea7a2766f6054bf991dee746408f45c535c324b5 (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.h')
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index f546c2955e5..c5d4a346f56 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -184,6 +184,11 @@ bool pyrna_id_FromPyObject(PyObject *obj, struct ID **id); int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const char *error_prefix); PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); +unsigned int *pyrna_set_to_enum_bitmap( + struct EnumPropertyItem *items, PyObject *value, + int type_size, bool type_convert_sign, + int bitmap_size, + const char *error_prefix); PyObject *pyrna_enum_bitfield_to_py(struct EnumPropertyItem *items, int value); int pyrna_set_to_enum_bitfield(EnumPropertyItem *items, PyObject *value, int *r_value, const char *error_prefix); |