diff options
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index fd4c1e251e4..7dfc863b847 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -609,12 +609,8 @@ void DepsgraphNodeBuilder::build_object(int base_index, build_particle_systems(object, is_visible); } /* Proxy object to copy from. */ - if (object->proxy_from != NULL) { - build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY, is_visible); - } - if (object->proxy_group != NULL) { - build_object(-1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY, is_visible); - } + build_object_proxy_from(object, is_visible); + build_object_proxy_group(object, is_visible); /* Object dupligroup. */ if (object->instance_collection != NULL) { const bool is_current_parent_collection_visible = is_parent_collection_visible_; @@ -653,6 +649,22 @@ void DepsgraphNodeBuilder::build_object_flags(int base_index, is_from_set)); } +void DepsgraphNodeBuilder::build_object_proxy_from(Object *object, bool is_visible) +{ + if (object->proxy_from == NULL) { + return; + } + build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY, is_visible); +} + +void DepsgraphNodeBuilder::build_object_proxy_group(Object *object, bool is_visible) +{ + if (object->proxy_group == NULL) { + return; + } + build_object(-1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY, is_visible); +} + void DepsgraphNodeBuilder::build_object_data(Object *object, bool is_object_visible) { if (object->data == NULL) { @@ -900,19 +912,17 @@ void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index { /* Create data node for this driver */ ID *id_cow = get_cow_id(id); - ChannelDriver *driver_orig = fcurve->driver; /* TODO(sergey): ideally we could pass the COW of fcu, but since it * has not yet been allocated at this point we can't. As a workaround * the animation systems allocates an array so we can do a fast lookup * with the driver index. */ - ensure_operation_node( - id, - NodeType::PARAMETERS, - OperationCode::DRIVER, - function_bind(BKE_animsys_eval_driver, _1, id_cow, driver_index, driver_orig), - fcurve->rna_path ? fcurve->rna_path : "", - fcurve->array_index); + ensure_operation_node(id, + NodeType::PARAMETERS, + OperationCode::DRIVER, + function_bind(BKE_animsys_eval_driver, _1, id_cow, driver_index, fcurve), + fcurve->rna_path ? fcurve->rna_path : "", + fcurve->array_index); build_driver_variables(id, fcurve); } @@ -1155,7 +1165,7 @@ void DepsgraphNodeBuilder::build_particle_settings(ParticleSettings *particle_se &particle_settings->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_EVAL); op_node->set_as_exit(); /* Texture slots. */ - for (int mtex_index = 0; mtex_index < MAX_MTEX; ++mtex_index) { + for (int mtex_index = 0; mtex_index < MAX_MTEX; mtex_index++) { MTex *mtex = particle_settings->mtex[mtex_index]; if (mtex == NULL || mtex->tex == NULL) { continue; @@ -1436,7 +1446,7 @@ void DepsgraphNodeBuilder::build_material(Material *material) void DepsgraphNodeBuilder::build_materials(Material **materials, int num_materials) { - for (int i = 0; i < num_materials; ++i) { + for (int i = 0; i < num_materials; i++) { if (materials[i] == NULL) { continue; } |