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>2015-11-09 22:59:42 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-11-09 23:00:53 +0300
commit9c6fe810a3cae2a5498f5760822b7a7e4a82bf4f (patch)
treefae726eb9d43fe1bf587bd952506954efd7268e4 /source/blender/makesrna/intern/rna_ID.c
parentf761ae8f116909f1d5c92398f8a4812a5fad8ca4 (diff)
Fake user: add BKE_library helpers to set/clear that flag.
Since it also involves usercount manipulation, safer and cleaner to do it in BKE_library...
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 43ffc7743c5..e1e892a6b65 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -223,13 +223,11 @@ void rna_ID_fake_user_set(PointerRNA *ptr, int value)
{
ID *id = (ID *)ptr->data;
- if (value && !(id->flag & LIB_FAKEUSER)) {
- id->flag |= LIB_FAKEUSER;
- id_us_plus(id);
+ if (value) {
+ id_fake_user_set(id);
}
- else if (!value && (id->flag & LIB_FAKEUSER)) {
- id->flag &= ~LIB_FAKEUSER;
- id_us_min(id);
+ else {
+ id_fake_user_clear(id);
}
}
@@ -329,8 +327,8 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag)
static void rna_ID_user_clear(ID *id)
{
+ id_fake_user_clear(id);
id->us = 0; /* don't save */
- id->flag &= ~LIB_FAKEUSER;
}
static AnimData * rna_ID_animation_data_create(ID *id, Main *bmain)