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:
authorJulian Eisel <julian@blender.org>2021-04-20 23:43:43 +0300
committerJulian Eisel <julian@blender.org>2021-04-20 23:43:43 +0300
commitc5cabb6eb712ffc1f541b8b1adc8b17ea76b069f (patch)
tree09352e4dad1f93f3b7815346c918813b6aa7956f /source/blender/makesrna/intern/rna_ID.c
parent557b3d2762a62af80b4ef0778e012d6eff2c6a47 (diff)
Correction to previous commit: Avoid unnecessary notifier
Not a big deal, but nice to avoid notifiers when no change was done.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r--source/blender/makesrna/intern/rna_ID.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index e1480dc2822..3c641c6ec1a 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -579,18 +579,18 @@ static ID *rna_ID_copy(ID *id, Main *bmain)
static void rna_ID_mark_asset(ID *id, bContext *C)
{
- ED_asset_mark_id(C, id);
-
- WM_main_add_notifier(NC_ID | NA_EDITED, NULL);
- WM_main_add_notifier(NC_ASSET | NA_ADDED, NULL);
+ if (ED_asset_mark_id(C, id)) {
+ WM_main_add_notifier(NC_ID | NA_EDITED, NULL);
+ WM_main_add_notifier(NC_ASSET | NA_ADDED, NULL);
+ }
}
static void rna_ID_clear_asset(ID *id)
{
- ED_asset_clear_id(id);
-
- WM_main_add_notifier(NC_ID | NA_EDITED, NULL);
- WM_main_add_notifier(NC_ASSET | NA_REMOVED, NULL);
+ if (ED_asset_clear_id(id)) {
+ WM_main_add_notifier(NC_ID | NA_EDITED, NULL);
+ WM_main_add_notifier(NC_ASSET | NA_REMOVED, NULL);
+ }
}
static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages)