[Bf-blender-cvs] [50d30cc5fd7] master: Depsgraph: Need to tag relations for update after new clip was added
Sergey Sharybin
noreply at git.blender.org
Wed Oct 25 14:20:26 CEST 2017
Commit: 50d30cc5fd7367618c90313fa55454f0b167c4b5
Author: Sergey Sharybin
Date: Wed Oct 25 14:18:21 2017 +0200
Branches: master
https://developer.blender.org/rB50d30cc5fd7367618c90313fa55454f0b167c4b5
Depsgraph: Need to tag relations for update after new clip was added
===================================================================
M source/blender/editors/space_clip/clip_ops.c
M source/blender/makesrna/intern/rna_main_api.c
===================================================================
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 970eae0ad14..7d8dd629562 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -56,6 +56,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_depsgraph.h"
#include "BKE_report.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -247,6 +248,7 @@ static int open_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_MOVIECLIP | NA_ADDED, clip);
+ DAG_relations_tag_update(bmain);
MEM_freeN(op->customdata);
return OPERATOR_FINISHED;
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index dc3bbf6ca45..7e2ced81a6d 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -543,9 +543,13 @@ static MovieClip *rna_Main_movieclip_load(Main *bmain, ReportList *reports, cons
clip = BKE_movieclip_file_add(bmain, filepath);
}
- if (!clip)
+ if (clip != NULL) {
+ DAG_relations_tag_update(bmain);
+ }
+ else {
BKE_reportf(reports, RPT_ERROR, "Cannot read '%s': %s", filepath,
errno ? strerror(errno) : TIP_("unable to load movie clip"));
+ }
id_us_min((ID *)clip);
return clip;
More information about the Bf-blender-cvs
mailing list