diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-02 16:53:29 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-02 16:58:53 +0300 |
commit | 263f56ba493ae3c9b87e4df095b158af9805d552 (patch) | |
tree | 73f3f6fd55e53b7cbfd0324bf59fbec10cfeff5d /source/blender/makesrna | |
parent | 3d5f5c2d9a5f1c04ea4d8722bfcb78ea7eedfa8b (diff) |
Add RNA accessor for 'extra user' ID tag,
Not expected to be used directly by users, but very handy to have around
for investigations and debugging.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index e2ce1f23a33..b65e08311fe 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -586,6 +586,18 @@ void rna_ID_fake_user_set(PointerRNA *ptr, bool value) } } +void rna_ID_extra_user_set(PointerRNA *ptr, bool value) +{ + ID *id = (ID *)ptr->data; + + if (value) { + id_us_ensure_real(id); + } + else { + id_us_clear_real(id); + } +} + IDProperty **rna_PropertyGroup_idprops(PointerRNA *ptr) { return (IDProperty **)&ptr->data; @@ -1959,6 +1971,14 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_FAKE_USER_OFF, true); RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set"); + prop = RNA_def_property(srna, "use_extra_user", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "tag", LIB_TAG_EXTRAUSER); + RNA_def_property_ui_text( + prop, + "Extra User", + "Indicates wether an extra user is set or not (mainly for internal/debug usages)"); + RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_extra_user_set"); + prop = RNA_def_property(srna, "is_embedded_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_EMBEDDED_DATA); RNA_def_property_clear_flag(prop, PROP_EDITABLE); |