diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 16:16:10 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 17:46:25 +0300 |
commit | 272da2790bde3947e2d922d549041f5fef7ee9da (patch) | |
tree | bb4db2ff97cff8e35f90d4761e21e25f2f704e16 /source/blender | |
parent | 81324dbfbfa9991bcc73217090bccbfeaf3875c9 (diff) |
Depsgraph: Correct wrong base_flags for objects coming from set scene
Diffstat (limited to 'source/blender')
4 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index a77174ec36d..31125545670 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -211,7 +211,8 @@ void BKE_object_data_select_update(const struct EvaluationContext *eval_ctx, struct ID *object_data); void BKE_object_eval_flush_base_flags(const struct EvaluationContext *eval_ctx, - struct Object *object, struct Base *base); + struct Object *object, struct Base *base, + const bool is_from_set); void BKE_object_handle_data_update( const struct EvaluationContext *eval_ctx, diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 85f207509c2..2c0ff76d0e6 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -423,7 +423,7 @@ void BKE_object_data_select_update(const EvaluationContext *UNUSED(eval_ctx), } void BKE_object_eval_flush_base_flags(const EvaluationContext *UNUSED(eval_ctx), - Object *object, Base *base) + Object *object, Base *base, bool is_from_set) { /* Make sure we have the base collection settings is already populated. * This will fail when BKE_layer_eval_layer_collection_pre hasn't run yet @@ -431,5 +431,9 @@ void BKE_object_eval_flush_base_flags(const EvaluationContext *UNUSED(eval_ctx), BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group)); /* Copy flags and settings from base. */ object->base_flag = base->flag; + if (is_from_set) { + object->base_flag |= BASE_FROM_SET; + object->base_flag &= ~(BASE_SELECTED | BASE_SELECTABLED); + } object->base_collection_properties = base->collection_properties; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index b863f40ba84..c0bad457b6f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -411,7 +411,7 @@ void DepsgraphNodeBuilder::build_object(Base *base, * directly. */ if (id_node->linked_state == DEG_ID_LINKED_INDIRECTLY) { - build_object_flags(base, object); + build_object_flags(base, object, linked_state); } id_node->linked_state = max(id_node->linked_state, linked_state); return; @@ -422,7 +422,7 @@ void DepsgraphNodeBuilder::build_object(Base *base, id_node->linked_state = linked_state; object->customdata_mask = 0; /* Various flags, flushing from bases/collections. */ - build_object_flags(base, object); + build_object_flags(base, object, linked_state); /* Transform. */ build_object_transform(object); /* Parent. */ @@ -469,17 +469,21 @@ void DepsgraphNodeBuilder::build_object(Base *base, } } -void DepsgraphNodeBuilder::build_object_flags(Base *base, Object *object) +void DepsgraphNodeBuilder::build_object_flags( + Base *base, + Object *object, + eDepsNode_LinkedState_Type linked_state) { if (base == NULL) { return; } /* TODO(sergey): Is this really best component to be used? */ Object *object_cow = get_cow_datablock(object); + const bool is_from_set = (linked_state == DEG_ID_LINKED_VIA_SET); add_operation_node(&object->id, DEG_NODE_TYPE_LAYER_COLLECTIONS, function_bind(BKE_object_eval_flush_base_flags, - _1, object_cow, base), + _1, object_cow, base, is_from_set), DEG_OPCODE_OBJECT_BASE_FLAGS); } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index a68f756f6ca..0b7b00a2ed8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -165,7 +165,9 @@ struct DepsgraphNodeBuilder { void build_object(Base *base, Object *object, eDepsNode_LinkedState_Type linked_state); - void build_object_flags(Base *base, Object *object); + void build_object_flags(Base *base, + Object *object, + eDepsNode_LinkedState_Type linked_state); void build_object_data(Object *object); void build_object_transform(Object *object); void build_object_constraints(Object *object); |