From 5d15e68743fc92b41a85ef4180628427ab3b86da Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 13 Aug 2018 16:59:42 -0300 Subject: Fix viewport selection of markers not updating in all editors This includes selections both in the clip editor as the viewport. The selection is implemented as a synchronization function called from the eval selection update node in depsgraph. --- source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 7 ++++++- source/blender/depsgraph/intern/depsgraph_tag.cc | 4 ++++ source/blender/depsgraph/intern/depsgraph_type_defines.cc | 1 + source/blender/depsgraph/intern/depsgraph_types.h | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 53612a66e5d..8d2960d1587 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1502,7 +1502,7 @@ void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip) return; } ID *clip_id = &clip->id; - MovieClip *clip_cow = get_cow_datablock(clip); + MovieClip *clip_cow = (MovieClip *)ensure_cow_id(clip_id); /* Animation. */ build_animdata(clip_id); /* Movie clip evaluation. */ @@ -1510,6 +1510,11 @@ void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip) DEG_NODE_TYPE_PARAMETERS, function_bind(BKE_movieclip_eval_update, _1, clip_cow), DEG_OPCODE_MOVIECLIP_EVAL); + + add_operation_node(clip_id, + DEG_NODE_TYPE_BATCH_CACHE, + function_bind(BKE_movieclip_eval_selection_update, _1, clip_cow), + DEG_OPCODE_MOVIECLIP_SELECT_UPDATE); } void DepsgraphNodeBuilder::build_lightprobe(LightProbe *probe) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index e4659a7a94d..e2c28f0d1e1 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -152,6 +152,10 @@ void depsgraph_select_tag_to_component_opcode( *component_type = DEG_NODE_TYPE_OBJECT_FROM_LAYER; *operation_code = DEG_OPCODE_OBJECT_BASE_FLAGS; } + else if (id_type == ID_MC) { + *component_type = DEG_NODE_TYPE_BATCH_CACHE; + *operation_code = DEG_OPCODE_MOVIECLIP_SELECT_UPDATE; + } else { *component_type = DEG_NODE_TYPE_BATCH_CACHE; *operation_code = DEG_OPCODE_GEOMETRY_SELECT_UPDATE; diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cc b/source/blender/depsgraph/intern/depsgraph_type_defines.cc index 6d7f86581d9..7abde2e865c 100644 --- a/source/blender/depsgraph/intern/depsgraph_type_defines.cc +++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cc @@ -175,6 +175,7 @@ const char *operationCodeAsString(eDepsOperation_Code opcode) STRINGIFY_OPCODE(WORLD_UPDATE); /* Movie clip. */ STRINGIFY_OPCODE(MOVIECLIP_EVAL); + STRINGIFY_OPCODE(MOVIECLIP_SELECT_UPDATE); case DEG_NUM_OPCODES: return "SpecialCase"; #undef STRINGIFY_OPCODE diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h index 6577e742266..b19eb619fac 100644 --- a/source/blender/depsgraph/intern/depsgraph_types.h +++ b/source/blender/depsgraph/intern/depsgraph_types.h @@ -152,7 +152,7 @@ typedef enum eDepsNode_Type { DEG_NODE_TYPE_SHADING_PARAMETERS, /* Cache Component */ DEG_NODE_TYPE_CACHE, - /* Batch Cache Component */ + /* Batch Cache Component - TODO (dfelinto/sergey) rename to make it more generic. */ DEG_NODE_TYPE_BATCH_CACHE, /* Total number of meaningful node types. */ @@ -274,6 +274,7 @@ typedef enum eDepsOperation_Code { /* Movie clips. ------------------------------------ */ DEG_OPCODE_MOVIECLIP_EVAL, + DEG_OPCODE_MOVIECLIP_SELECT_UPDATE, DEG_NUM_OPCODES, } eDepsOperation_Code; -- cgit v1.2.3