2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * The Original Code is Copyright (C) 2013 Blender Foundation.
17 * All rights reserved.
19 * Original Author: Joshua Leung
22 /** \file blender/depsgraph/intern/builder/deg_builder_nodes.cc
25 * Methods for constructing depsgraph's nodes
28 #include "intern/builder/deg_builder_nodes.h"
33 #include "MEM_guardedalloc.h"
35 #include "BLI_blenlib.h"
36 #include "BLI_string.h"
37 #include "BLI_utildefines.h"
40 #include "DNA_action_types.h"
41 #include "DNA_anim_types.h"
42 #include "DNA_armature_types.h"
43 #include "DNA_cachefile_types.h"
44 #include "DNA_camera_types.h"
45 #include "DNA_collection_types.h"
46 #include "DNA_constraint_types.h"
47 #include "DNA_curve_types.h"
48 #include "DNA_effect_types.h"
49 #include "DNA_gpencil_types.h"
50 #include "DNA_key_types.h"
51 #include "DNA_lamp_types.h"
52 #include "DNA_material_types.h"
53 #include "DNA_mask_types.h"
54 #include "DNA_mesh_types.h"
55 #include "DNA_meta_types.h"
56 #include "DNA_movieclip_types.h"
57 #include "DNA_node_types.h"
58 #include "DNA_particle_types.h"
59 #include "DNA_object_types.h"
60 #include "DNA_lightprobe_types.h"
61 #include "DNA_rigidbody_types.h"
62 #include "DNA_scene_types.h"
63 #include "DNA_speaker_types.h"
64 #include "DNA_texture_types.h"
65 #include "DNA_world_types.h"
67 #include "BKE_action.h"
68 #include "BKE_armature.h"
69 #include "BKE_animsys.h"
70 #include "BKE_collection.h"
71 #include "BKE_constraint.h"
72 #include "BKE_curve.h"
73 #include "BKE_effect.h"
74 #include "BKE_fcurve.h"
75 #include "BKE_gpencil.h"
76 #include "BKE_gpencil_modifier.h"
77 #include "BKE_idcode.h"
79 #include "BKE_lattice.h"
81 #include "BKE_material.h"
83 #include "BKE_mball.h"
84 #include "BKE_modifier.h"
85 #include "BKE_movieclip.h"
87 #include "BKE_object.h"
88 #include "BKE_particle.h"
89 #include "BKE_pointcache.h"
90 #include "BKE_rigidbody.h"
91 #include "BKE_shader_fx.h"
92 #include "BKE_sound.h"
93 #include "BKE_tracking.h"
94 #include "BKE_world.h"
96 #include "RNA_access.h"
97 #include "RNA_types.h"
100 #include "DEG_depsgraph.h"
101 #include "DEG_depsgraph_build.h"
103 #include "intern/builder/deg_builder.h"
104 #include "intern/depsgraph.h"
105 #include "intern/eval/deg_eval_copy_on_write.h"
106 #include "intern/node/deg_node.h"
107 #include "intern/node/deg_node_component.h"
108 #include "intern/node/deg_node_id.h"
109 #include "intern/node/deg_node_operation.h"
110 #include "intern/depsgraph_type.h"
116 void free_copy_on_write_datablock(void *id_info_v)
118 DepsgraphNodeBuilder::IDInfo *id_info =
119 (DepsgraphNodeBuilder::IDInfo *)id_info_v;
120 if (id_info->id_cow != NULL) {
121 deg_free_copy_on_write_datablock(id_info->id_cow);
122 MEM_freeN(id_info->id_cow);
132 /* **** General purpose functions **** */
134 DepsgraphNodeBuilder::DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph)
139 view_layer_index_(-1),
141 is_parent_collection_visible_(true),
146 DepsgraphNodeBuilder::~DepsgraphNodeBuilder()
148 if (id_info_hash_ != NULL) {
149 BLI_ghash_free(id_info_hash_, NULL, free_copy_on_write_datablock);
153 IDNode *DepsgraphNodeBuilder::add_id_node(ID *id)
155 IDNode *id_node = NULL;
157 IDComponentsMask previously_visible_components_mask = 0;
158 uint32_t previous_eval_flags = 0;
159 uint64_t previous_customdata_mask = 0;
160 IDInfo *id_info = (IDInfo *)BLI_ghash_lookup(id_info_hash_, id);
161 if (id_info != NULL) {
162 id_cow = id_info->id_cow;
163 previously_visible_components_mask =
164 id_info->previously_visible_components_mask;
165 previous_eval_flags = id_info->previous_eval_flags;
166 previous_customdata_mask = id_info->previous_customdata_mask;
167 /* Tag ID info to not free the CoW ID pointer. */
168 id_info->id_cow = NULL;
170 id_node = graph_->add_id_node(id, id_cow);
171 id_node->previously_visible_components_mask =
172 previously_visible_components_mask;
173 id_node->previous_eval_flags = previous_eval_flags;
174 id_node->previous_customdata_mask = previous_customdata_mask;
175 /* Currently all ID nodes are supposed to have copy-on-write logic.
177 * NOTE: Zero number of components indicates that ID node was just created. */
178 if (BLI_ghash_len(id_node->components) == 0) {
179 ComponentNode *comp_cow =
180 id_node->add_component(NodeType::COPY_ON_WRITE);
181 OperationNode *op_cow = comp_cow->add_operation(
182 function_bind(deg_evaluate_copy_on_write, _1, id_node),
183 OperationCode::COPY_ON_WRITE,
185 graph_->operations.push_back(op_cow);
190 IDNode *DepsgraphNodeBuilder::find_id_node(ID *id)
192 return graph_->find_id_node(id);
195 TimeSourceNode *DepsgraphNodeBuilder::add_time_source()
197 return graph_->add_time_source();
200 ComponentNode *DepsgraphNodeBuilder::add_component_node(
203 const char *comp_name)
205 IDNode *id_node = add_id_node(id);
206 ComponentNode *comp_node = id_node->add_component(comp_type, comp_name);
207 comp_node->owner = id_node;
211 OperationNode *DepsgraphNodeBuilder::add_operation_node(
212 ComponentNode *comp_node,
213 const DepsEvalOperationCb& op,
214 OperationCode opcode,
218 OperationNode *op_node = comp_node->find_operation(opcode,
221 if (op_node == NULL) {
222 op_node = comp_node->add_operation(op, opcode, name, name_tag);
223 graph_->operations.push_back(op_node);
227 "add_operation: Operation already exists - %s has %s at %p\n",
228 comp_node->identifier().c_str(),
229 op_node->identifier().c_str(),
231 BLI_assert(!"Should not happen!");
236 OperationNode *DepsgraphNodeBuilder::add_operation_node(
239 const char *comp_name,
240 const DepsEvalOperationCb& op,
241 OperationCode opcode,
245 ComponentNode *comp_node = add_component_node(id, comp_type, comp_name);
246 return add_operation_node(comp_node, op, opcode, name, name_tag);
249 OperationNode *DepsgraphNodeBuilder::add_operation_node(
252 const DepsEvalOperationCb& op,
253 OperationCode opcode,
257 return add_operation_node(id,
266 OperationNode *DepsgraphNodeBuilder::ensure_operation_node(
269 const DepsEvalOperationCb& op,
270 OperationCode opcode,
274 OperationNode *operation =
275 find_operation_node(id, comp_type, opcode, name, name_tag);
276 if (operation != NULL) {
279 return add_operation_node(id, comp_type, op, opcode, name, name_tag);
282 bool DepsgraphNodeBuilder::has_operation_node(ID *id,
284 const char *comp_name,
285 OperationCode opcode,
289 return find_operation_node(id,
297 OperationNode *DepsgraphNodeBuilder::find_operation_node(
300 const char *comp_name,
301 OperationCode opcode,
305 ComponentNode *comp_node = add_component_node(id, comp_type, comp_name);
306 return comp_node->find_operation(opcode, name, name_tag);
309 OperationNode *DepsgraphNodeBuilder::find_operation_node(
312 OperationCode opcode,
316 return find_operation_node(id, comp_type, "", opcode, name, name_tag);
319 ID *DepsgraphNodeBuilder::get_cow_id(const ID *id_orig) const
321 return graph_->get_cow_id(id_orig);
324 ID *DepsgraphNodeBuilder::ensure_cow_id(ID *id_orig)
326 if (id_orig->tag & LIB_TAG_COPIED_ON_WRITE) {
327 /* ID is already remapped to copy-on-write. */
330 IDNode *id_node = add_id_node(id_orig);
331 return id_node->id_cow;
334 /* **** Build functions for entity nodes **** */
336 void DepsgraphNodeBuilder::begin_build()
338 /* Store existing copy-on-write versions of datablock, so we can re-use
339 * them for new ID nodes. */
340 id_info_hash_ = BLI_ghash_ptr_new("Depsgraph id hash");
341 for (IDNode *id_node : graph_->id_nodes) {
342 IDInfo *id_info = (IDInfo *)MEM_mallocN(
343 sizeof(IDInfo), "depsgraph id info");
344 if (deg_copy_on_write_is_expanded(id_node->id_cow) &&
345 id_node->id_orig != id_node->id_cow)
347 id_info->id_cow = id_node->id_cow;
350 id_info->id_cow = NULL;
352 id_info->previously_visible_components_mask =
353 id_node->visible_components_mask;
354 id_info->previous_eval_flags = id_node->eval_flags;
355 id_info->previous_customdata_mask = id_node->customdata_mask;
356 BLI_ghash_insert(id_info_hash_, id_node->id_orig, id_info);
357 id_node->id_cow = NULL;
360 GSET_FOREACH_BEGIN(OperationNode *, op_node, graph_->entry_tags)
362 ComponentNode *comp_node = op_node->owner;
363 IDNode *id_node = comp_node->owner;
365 SavedEntryTag entry_tag;
366 entry_tag.id_orig = id_node->id_orig;
367 entry_tag.component_type = comp_node->type;
368 entry_tag.opcode = op_node->opcode;
369 entry_tag.name = op_node->name;
370 entry_tag.name_tag = op_node->name_tag;
371 saved_entry_tags_.push_back(entry_tag);
375 /* Make sure graph has no nodes left from previous state. */
376 graph_->clear_all_nodes();
377 graph_->operations.clear();
378 BLI_gset_clear(graph_->entry_tags, NULL);
381 void DepsgraphNodeBuilder::end_build()
383 for (const SavedEntryTag& entry_tag : saved_entry_tags_) {
384 IDNode *id_node = find_id_node(entry_tag.id_orig);
385 if (id_node == NULL) {
388 ComponentNode *comp_node =
389 id_node->find_component(entry_tag.component_type);
390 if (comp_node == NULL) {
393 OperationNode *op_node = comp_node->find_operation(entry_tag.opcode, entry_tag.name, entry_tag.name_tag);
394 if (op_node == NULL) {
397 /* Since the tag is coming from a saved copy of entry tags, this means
398 * that originally node was explicitly tagged for user update. */
399 op_node->tag_update(graph_, DEG_UPDATE_SOURCE_USER_EDIT);
403 void DepsgraphNodeBuilder::build_id(ID *id)
408 switch (GS(id->name)) {
410 build_action((bAction *)id);
413 build_armature((bArmature *)id);
416 build_camera((Camera *)id);
419 build_collection(NULL, (Collection *)id);
422 /* TODO(sergey): Get visibility from a "parent" somehow.
424 * NOTE: Using `false` visibility here should be fine, since if this
425 * driver affects on something invisible we don't really care if the
426 * driver gets evaluated (and even don't want this to force object
427 * to become visible).
429 * If this happened to be affecting visible object, then it is up to
430 * deg_graph_build_flush_visibility() to ensure visibility of the
432 build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, false);
435 build_shapekeys((Key *)id);
438 build_lamp((Lamp *)id);
441 build_lightprobe((LightProbe *)id);
444 build_nodetree((bNodeTree *)id);
447 build_material((Material *)id);
450 build_texture((Tex *)id);
453 build_image((Image *)id);
456 build_world((World *)id);
459 build_mask((Mask *)id);
462 build_movieclip((MovieClip *)id);
468 /* TODO(sergey): Get visibility from a "parent" somehow.
470 * NOTE: Similarly to above, we don't want false-positives on
472 build_object_data_geometry_datablock(id, false);
475 build_speaker((Speaker *)id);
478 /* Not a part of dependency graph. */
481 build_cachefile((CacheFile *)id);
484 fprintf(stderr, "Unhandled ID %s\n", id->name);
485 BLI_assert(!"Should never happen");
490 void DepsgraphNodeBuilder::build_collection(
491 LayerCollection *from_layer_collection,
492 Collection *collection)
494 const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT)
495 ? COLLECTION_RESTRICT_VIEW
496 : COLLECTION_RESTRICT_RENDER;
497 const bool is_collection_restricted = (collection->flag & restrict_flag);
498 const bool is_collection_visible =
499 !is_collection_restricted && is_parent_collection_visible_;
501 if (built_map_.checkIsBuiltAndTag(collection)) {
502 id_node = find_id_node(&collection->id);
503 if (is_collection_visible &&
504 id_node->is_directly_visible == false &&
505 id_node->is_collection_fully_expanded == true)
507 /* Collection became visible, make sure nested collections and
508 * objects are poked with the new visibility flag, since they
509 * might become visible too. */
516 /* Collection itself. */
517 id_node = add_id_node(&collection->id);
518 id_node->is_directly_visible = is_collection_visible;
520 if (from_layer_collection != NULL) {
521 /* If we came from layer collection we don't go deeper, view layer
522 * builder takes care of going deeper. */
526 Collection *current_state_collection = collection_;
527 const bool is_current_parent_collection_visible =
528 is_parent_collection_visible_;
529 /* Modify state as we've entered new collection/ */
530 collection_ = collection;
531 is_parent_collection_visible_ = is_collection_visible;
532 /* Build collection objects. */
533 LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) {
535 -1, cob->ob, DEG_ID_LINKED_INDIRECTLY, is_collection_visible);
537 /* Build child collections. */
538 LISTBASE_FOREACH (CollectionChild *, child, &collection->children) {
539 build_collection(NULL, child->collection);
542 collection_ = current_state_collection;
543 is_parent_collection_visible_ = is_current_parent_collection_visible;
544 id_node->is_collection_fully_expanded = true;
547 void DepsgraphNodeBuilder::build_object(int base_index,
549 eDepsNode_LinkedState_Type linked_state,
552 const bool has_object = built_map_.checkIsBuiltAndTag(object);
553 /* Skip rest of components if the ID node was already there. */
555 IDNode *id_node = find_id_node(&object->id);
556 /* We need to build some extra stuff if object becomes linked
558 if (id_node->linked_state == DEG_ID_LINKED_INDIRECTLY) {
559 build_object_flags(base_index, object, linked_state);
561 id_node->linked_state = max(id_node->linked_state, linked_state);
562 if (id_node->linked_state == DEG_ID_LINKED_DIRECTLY) {
563 id_node->is_directly_visible |= is_visible;
567 /* Create ID node for object and begin init. */
568 IDNode *id_node = add_id_node(&object->id);
569 Object *object_cow = get_cow_datablock(object);
570 id_node->linked_state = linked_state;
571 if (object == scene_->camera) {
572 id_node->is_directly_visible = true;
575 id_node->is_directly_visible = is_visible;
577 /* Various flags, flushing from bases/collections. */
578 build_object_flags(base_index, object, linked_state);
580 build_object_transform(object);
582 if (object->parent != NULL) {
584 -1, object->parent, DEG_ID_LINKED_INDIRECTLY, is_visible);
587 if (object->modifiers.first != NULL) {
588 BuilderWalkUserData data;
590 data.is_parent_visible = is_visible;
591 modifiers_foreachIDLink(object, modifier_walk, &data);
593 /* Grease Pencil Modifiers. */
594 if (object->greasepencil_modifiers.first != NULL) {
595 BuilderWalkUserData data;
597 data.is_parent_visible = is_visible;
598 BKE_gpencil_modifiers_foreachIDLink(object, modifier_walk, &data);
601 if (object->shader_fx.first != NULL) {
602 BuilderWalkUserData data;
604 data.is_parent_visible = is_visible;
605 BKE_shaderfx_foreachIDLink(object, modifier_walk, &data);
608 if (object->constraints.first != NULL) {
609 BuilderWalkUserData data;
611 data.is_parent_visible = is_visible;
612 BKE_constraints_id_loop(&object->constraints, constraint_walk, &data);
615 build_object_data(object, is_visible);
616 /* Build animation data,
618 * Do it now because it's possible object data will affect
619 * on object's level animation, for example in case of rebuilding
621 OperationNode *op_node = add_operation_node(&object->id,
622 NodeType::PARAMETERS,
624 OperationCode::PARAMETERS_EVAL);
625 op_node->set_as_exit();
626 build_animdata(&object->id);
627 /* Particle systems. */
628 if (object->particlesystem.first != NULL) {
629 build_particle_systems(object, is_visible);
631 /* Proxy object to copy from. */
632 if (object->proxy_from != NULL) {
634 -1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY, is_visible);
636 if (object->proxy_group != NULL) {
638 -1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY, is_visible);
640 /* Object dupligroup. */
641 if (object->dup_group != NULL) {
642 const bool is_current_parent_collection_visible =
643 is_parent_collection_visible_;
644 is_parent_collection_visible_ = is_visible;
645 build_collection(NULL, object->dup_group);
646 is_parent_collection_visible_ = is_current_parent_collection_visible;
647 add_operation_node(&object->id,
650 OperationCode::PLACEHOLDER,
653 /* Syncronization back to original object. */
654 add_operation_node(&object->id,
655 NodeType::SYNCHRONIZATION,
656 function_bind(BKE_object_synchronize_to_original,
659 OperationCode::SYNCHRONIZE_TO_ORIGINAL);
662 void DepsgraphNodeBuilder::build_object_flags(
665 eDepsNode_LinkedState_Type linked_state)
667 if (base_index == -1) {
670 Scene *scene_cow = get_cow_datablock(scene_);
671 Object *object_cow = get_cow_datablock(object);
672 const bool is_from_set = (linked_state == DEG_ID_LINKED_VIA_SET);
673 /* TODO(sergey): Is this really best component to be used? */
674 add_operation_node(&object->id,
675 NodeType::OBJECT_FROM_LAYER,
676 function_bind(BKE_object_eval_flush_base_flags,
680 object_cow, base_index,
682 OperationCode::OBJECT_BASE_FLAGS);
685 void DepsgraphNodeBuilder::build_object_data(
686 Object *object, bool is_object_visible)
688 if (object->data == NULL) {
691 /* type-specific data. */
692 switch (object->type) {
700 build_object_data_geometry(object, is_object_visible);
703 if (ID_IS_LINKED(object) && object->proxy_from != NULL) {
704 build_proxy_rig(object);
707 build_rig(object, is_object_visible);
711 build_object_data_lamp(object);
714 build_object_data_camera(object);
717 build_object_data_lightprobe(object);
720 build_object_data_speaker(object);
724 ID *obdata = (ID *)object->data;
725 if (built_map_.checkIsBuilt(obdata) == 0) {
726 build_animdata(obdata);
733 void DepsgraphNodeBuilder::build_object_data_camera(Object *object)
735 Camera *camera = (Camera *)object->data;
736 build_camera(camera);
739 void DepsgraphNodeBuilder::build_object_data_lamp(Object *object)
741 Lamp *lamp = (Lamp *)object->data;
745 void DepsgraphNodeBuilder::build_object_data_lightprobe(Object *object)
747 LightProbe *probe = (LightProbe *)object->data;
748 build_lightprobe(probe);
749 add_operation_node(&object->id,
750 NodeType::PARAMETERS,
752 OperationCode::LIGHT_PROBE_EVAL);
755 void DepsgraphNodeBuilder::build_object_data_speaker(Object *object)
757 Speaker *speaker = (Speaker *)object->data;
758 build_speaker(speaker);
759 add_operation_node(&object->id,
760 NodeType::PARAMETERS,
762 OperationCode::SPEAKER_EVAL);
765 void DepsgraphNodeBuilder::build_object_transform(Object *object)
767 OperationNode *op_node;
768 Object *ob_cow = get_cow_datablock(object);
770 /* local transforms (from transform channels - loc/rot/scale + deltas) */
771 op_node = add_operation_node(&object->id, NodeType::TRANSFORM,
772 function_bind(BKE_object_eval_local_transform,
775 OperationCode::TRANSFORM_LOCAL);
776 op_node->set_as_entry();
779 if (object->parent != NULL) {
780 add_operation_node(&object->id, NodeType::TRANSFORM,
781 function_bind(BKE_object_eval_parent,
784 OperationCode::TRANSFORM_PARENT);
787 /* object constraints */
788 if (object->constraints.first != NULL) {
789 build_object_constraints(object);
792 /* Rest of transformation update. */
793 add_operation_node(&object->id, NodeType::TRANSFORM,
794 function_bind(BKE_object_eval_uber_transform,
797 OperationCode::TRANSFORM_OBJECT_UBEREVAL);
799 /* object transform is done */
800 op_node = add_operation_node(&object->id, NodeType::TRANSFORM,
801 function_bind(BKE_object_eval_transform_final,
804 OperationCode::TRANSFORM_FINAL);
805 op_node->set_as_exit();
809 * Constraints Graph Notes
811 * For constraints, we currently only add a operation node to the Transform
812 * or Bone components (depending on whichever type of owner we have).
813 * This represents the entire constraints stack, which is for now just
814 * executed as a single monolithic block. At least initially, this should
815 * be sufficient for ensuring that the porting/refactoring process remains
818 * However, when the time comes for developing "node-based" constraints,
819 * we'll need to split this up into pre/post nodes for "constraint stack
820 * evaluation" + operation nodes for each constraint (i.e. the contents
821 * of the loop body used in the current "solve_constraints()" operation).
823 * -- Aligorith, August 2013
825 void DepsgraphNodeBuilder::build_object_constraints(Object *object)
827 /* create node for constraint stack */
828 add_operation_node(&object->id, NodeType::TRANSFORM,
829 function_bind(BKE_object_eval_constraints,
831 get_cow_datablock(scene_),
832 get_cow_datablock(object)),
833 OperationCode::TRANSFORM_CONSTRAINTS);
836 void DepsgraphNodeBuilder::build_object_pointcache(Object *object)
838 if (!BKE_ptcache_object_has(scene_, object, 0)) {
841 Scene *scene_cow = get_cow_datablock(scene_);
842 Object *object_cow = get_cow_datablock(object);
843 add_operation_node(&object->id,
844 NodeType::POINT_CACHE,
845 function_bind(BKE_object_eval_ptcache_reset,
849 OperationCode::POINT_CACHE_RESET);
853 * Build graph nodes for AnimData block
854 * \param id: ID-Block which hosts the AnimData
856 void DepsgraphNodeBuilder::build_animdata(ID *id)
858 AnimData *adt = BKE_animdata_from_id(id);
862 if (adt->action != NULL) {
863 build_action(adt->action);
866 if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
867 (void) add_id_node(id);
868 ID *id_cow = get_cow_id(id);
870 // XXX: Hook up specific update callbacks for special properties which
873 /* actions and NLA - as a single unit for now, as it gets complicated to
874 * schedule otherwise. */
875 if ((adt->action) || (adt->nla_tracks.first)) {
876 /* create the node */
877 add_operation_node(id, NodeType::ANIMATION,
878 function_bind(BKE_animsys_eval_animdata,
881 OperationCode::ANIMATION,
884 /* TODO: for each channel affected, we might also want to add some
885 * support for running RNA update callbacks on them
886 * (which will be needed for proper handling of drivers later) */
889 /* NLA strips contain actions */
890 LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
891 build_animdata_nlastrip_targets(&nlt->strips);
895 int driver_index = 0;
896 LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
898 build_driver(id, fcu, driver_index++);
903 void DepsgraphNodeBuilder::build_animdata_nlastrip_targets(ListBase *strips)
905 LISTBASE_FOREACH (NlaStrip *, strip, strips) {
906 if (strip->act != NULL) {
907 build_action(strip->act);
909 else if (strip->strips.first != NULL) {
910 build_animdata_nlastrip_targets(&strip->strips);
915 void DepsgraphNodeBuilder::build_action(bAction *action)
917 if (built_map_.checkIsBuiltAndTag(action)) {
920 add_operation_node(&action->id,
923 OperationCode::ANIMATION);
927 * Build graph node(s) for Driver
928 * \param id: ID-Block that driver is attached to
929 * \param fcu: Driver-FCurve
930 * \param driver_index: Index in animation data drivers list
932 void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index)
934 /* Create data node for this driver */
935 ID *id_cow = get_cow_id(id);
936 ChannelDriver *driver_orig = fcurve->driver;
938 /* TODO(sergey): ideally we could pass the COW of fcu, but since it
939 * has not yet been allocated at this point we can't. As a workaround
940 * the animation systems allocates an array so we can do a fast lookup
941 * with the driver index. */
942 ensure_operation_node(id,
943 NodeType::PARAMETERS,
944 function_bind(BKE_animsys_eval_driver, _1, id_cow, driver_index, driver_orig),
945 OperationCode::DRIVER,
946 fcurve->rna_path ? fcurve->rna_path : "",
947 fcurve->array_index);
948 build_driver_variables(id, fcurve);
951 void DepsgraphNodeBuilder::build_driver_variables(ID * id, FCurve *fcurve)
953 build_driver_id_property(id, fcurve->rna_path);
954 LISTBASE_FOREACH (DriverVar *, dvar, &fcurve->driver->variables) {
955 DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
957 if (dtar->id == NULL) {
961 build_driver_id_property(dtar->id, dtar->rna_path);
962 /* Corresponds to dtar_id_ensure_proxy_from(). */
963 if ((GS(dtar->id->name) == ID_OB) &&
964 (((Object *)dtar->id)->proxy_from != NULL))
966 Object *proxy_from = ((Object *)dtar->id)->proxy_from;
967 build_id(&proxy_from->id);
968 build_driver_id_property(&proxy_from->id, dtar->rna_path);
971 DRIVER_TARGETS_LOOPER_END;
975 void DepsgraphNodeBuilder::build_driver_id_property(ID *id,
976 const char *rna_path)
978 if (id == NULL || rna_path == NULL) {
981 PointerRNA id_ptr, ptr;
983 RNA_id_pointer_create(id, &id_ptr);
984 if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, NULL)) {
990 if (!RNA_property_is_idprop(prop)) {
993 const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop);
994 ensure_operation_node(id,
995 NodeType::PARAMETERS,
997 OperationCode::ID_PROPERTY,
1001 /* Recursively build graph for world */
1002 void DepsgraphNodeBuilder::build_world(World *world)
1004 if (built_map_.checkIsBuiltAndTag(world)) {
1008 add_id_node(&world->id);
1009 World *world_cow = get_cow_datablock(world);
1010 /* Shading update. */
1011 add_operation_node(&world->id,
1013 function_bind(BKE_world_eval,
1016 OperationCode::WORLD_UPDATE);
1018 build_animdata(&world->id);
1019 /* World's nodetree. */
1020 build_nodetree(world->nodetree);
1023 /* Rigidbody Simulation - Scene Level */
1024 void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
1026 RigidBodyWorld *rbw = scene->rigidbody_world;
1027 Scene *scene_cow = get_cow_datablock(scene);
1030 * Rigidbody Simulation Nodes
1031 * ==========================
1033 * There are 3 nodes related to Rigidbody Simulation:
1034 * 1) "Initialize/Rebuild World" - this is called sparingly, only when the
1035 * simulation needs to be rebuilt (mainly after file reload, or moving
1036 * back to start frame)
1037 * 2) "Do Simulation" - perform a simulation step - interleaved between the
1038 * evaluation steps for clusters of objects (i.e. between those affected
1039 * and/or not affected by the sim for instance).
1041 * 3) "Pull Results" - grab the specific transforms applied for a specific
1042 * object - performed as part of object's transform-stack building. */
1044 /* Create nodes --------------------------------------------------------- */
1046 /* XXX: is this the right component, or do we want to use another one
1049 /* Init/rebuild operation. */
1050 add_operation_node(&scene->id, NodeType::TRANSFORM,
1051 function_bind(BKE_rigidbody_rebuild_sim, _1, scene_cow),
1052 OperationCode::RIGIDBODY_REBUILD);
1053 /* Do-sim operation. */
1054 OperationNode *sim_node = add_operation_node(
1055 &scene->id, NodeType::TRANSFORM,
1056 function_bind(BKE_rigidbody_eval_simulation, _1, scene_cow),
1057 OperationCode::RIGIDBODY_SIM);
1058 sim_node->set_as_entry();
1059 sim_node->set_as_exit();
1060 sim_node->owner->entry_operation = sim_node;
1061 /* Objects - simulation participants. */
1062 if (rbw->group != NULL) {
1063 build_collection(NULL, rbw->group);
1064 FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object)
1066 if (object->type != OB_MESH) {
1069 /* 2) create operation for flushing results */
1070 /* object's transform component - where the rigidbody operation
1072 add_operation_node(&object->id, NodeType::TRANSFORM,
1074 BKE_rigidbody_object_sync_transforms,
1077 get_cow_datablock(object)),
1078 OperationCode::RIGIDBODY_TRANSFORM_COPY);
1080 FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
1083 if (rbw->constraints != NULL) {
1084 FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, object)
1086 RigidBodyCon *rbc = object->rigidbody_constraint;
1087 if (rbc == NULL || rbc->ob1 == NULL || rbc->ob2 == NULL) {
1088 /* When either ob1 or ob2 is NULL, the constraint doesn't work. */
1091 /* Make sure indirectly linked objects are fully built. */
1092 build_object(-1, object, DEG_ID_LINKED_INDIRECTLY, false);
1093 build_object(-1, rbc->ob1, DEG_ID_LINKED_INDIRECTLY, false);
1094 build_object(-1, rbc->ob2, DEG_ID_LINKED_INDIRECTLY, false);
1096 FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
1100 void DepsgraphNodeBuilder::build_particle_systems(Object *object,
1101 bool is_object_visible)
1104 * Particle Systems Nodes
1105 * ======================
1107 * There are two types of nodes associated with representing
1109 * 1) Component (EVAL_PARTICLES) - This is the particle-system
1110 * evaluation context for an object. It acts as the container
1111 * for all the nodes associated with a particular set of particle
1113 * 2) Particle System Eval Operation - This operation node acts as a
1114 * blackbox evaluation step for one particle system referenced by
1115 * the particle systems stack. All dependencies link to this operation. */
1116 /* Component for all particle systems. */
1117 ComponentNode *psys_comp =
1118 add_component_node(&object->id, NodeType::PARTICLE_SYSTEM);
1120 Object *ob_cow = get_cow_datablock(object);
1121 OperationNode *op_node;
1122 op_node = add_operation_node(psys_comp,
1123 function_bind(BKE_particle_system_eval_init,
1126 OperationCode::PARTICLE_SYSTEM_INIT);
1127 op_node->set_as_entry();
1128 /* Build all particle systems. */
1129 LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
1130 ParticleSettings *part = psys->part;
1131 /* Build particle settings operations.
1133 * NOTE: The call itself ensures settings are only build once. */
1134 build_particle_settings(part);
1135 /* Particle system evaluation. */
1136 add_operation_node(psys_comp,
1138 OperationCode::PARTICLE_SYSTEM_EVAL,
1140 /* Keyed particle targets. */
1141 if (part->phystype == PART_PHYS_KEYED) {
1142 LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) {
1143 if (particle_target->ob == NULL ||
1144 particle_target->ob == object)
1149 particle_target->ob,
1150 DEG_ID_LINKED_INDIRECTLY,
1154 /* Visualization of particle system. */
1155 switch (part->ren_as) {
1157 if (part->dup_ob != NULL) {
1160 DEG_ID_LINKED_INDIRECTLY,
1165 if (part->dup_group != NULL) {
1166 build_collection(NULL, part->dup_group);
1171 op_node = add_operation_node(psys_comp,
1173 OperationCode::PARTICLE_SYSTEM_DONE);
1174 op_node->set_as_exit();
1177 void DepsgraphNodeBuilder::build_particle_settings(
1178 ParticleSettings *particle_settings) {
1179 if (built_map_.checkIsBuiltAndTag(particle_settings)) {
1182 /* Make sure we've got proper copied ID pointer. */
1183 add_id_node(&particle_settings->id);
1184 ParticleSettings *particle_settings_cow =
1185 get_cow_datablock(particle_settings);
1186 /* Animation data. */
1187 build_animdata(&particle_settings->id);
1188 /* Parameters change. */
1189 OperationNode *op_node;
1190 op_node = add_operation_node(&particle_settings->id,
1191 NodeType::PARTICLE_SETTINGS,
1193 OperationCode::PARTICLE_SETTINGS_INIT);
1194 op_node->set_as_entry();
1195 add_operation_node(&particle_settings->id,
1196 NodeType::PARTICLE_SETTINGS,
1197 function_bind(BKE_particle_settings_eval_reset,
1199 particle_settings_cow),
1200 OperationCode::PARTICLE_SETTINGS_RESET);
1201 op_node = add_operation_node(&particle_settings->id,
1202 NodeType::PARTICLE_SETTINGS,
1204 OperationCode::PARTICLE_SETTINGS_EVAL);
1205 op_node->set_as_exit();
1206 /* Texture slots. */
1207 for (int mtex_index = 0; mtex_index < MAX_MTEX; ++mtex_index) {
1208 MTex *mtex = particle_settings->mtex[mtex_index];
1209 if (mtex == NULL || mtex->tex == NULL) {
1212 build_texture(mtex->tex);
1217 void DepsgraphNodeBuilder::build_shapekeys(Key *key)
1219 if (built_map_.checkIsBuiltAndTag(key)) {
1222 build_animdata(&key->id);
1223 /* This is an exit operation for the entire key datablock, is what is used
1224 * as dependency for modifiers evaluation. */
1225 add_operation_node(&key->id,
1228 OperationCode::GEOMETRY_SHAPEKEY);
1229 /* Create per-key block properties, allowing tricky inter-dependnecies for
1230 * drivers evaluation. */
1231 LISTBASE_FOREACH (KeyBlock *, key_block, &key->block) {
1232 add_operation_node(&key->id,
1233 NodeType::PARAMETERS,
1235 OperationCode::PARAMETERS_EVAL,
1240 /* ObData Geometry Evaluation */
1241 // XXX: what happens if the datablock is shared!
1242 void DepsgraphNodeBuilder::build_object_data_geometry(
1244 bool is_object_visible)
1246 OperationNode *op_node;
1247 Scene *scene_cow = get_cow_datablock(scene_);
1248 Object *object_cow = get_cow_datablock(object);
1249 /* Temporary uber-update node, which does everything.
1250 * It is for the being we're porting old dependencies into the new system.
1251 * We'll get rid of this node as soon as all the granular update functions
1254 * TODO(sergey): Get rid of this node. */
1255 op_node = add_operation_node(&object->id,
1257 function_bind(BKE_object_eval_uber_data,
1261 OperationCode::GEOMETRY_EVAL);
1262 op_node->set_as_exit();
1264 op_node = add_operation_node(&object->id,
1267 OperationCode::PLACEHOLDER,
1269 op_node->set_as_entry();
1271 if (object->totcol != 0) {
1272 if (object->type == OB_MESH) {
1273 add_operation_node(&object->id,
1275 function_bind(BKE_object_eval_update_shading,
1278 OperationCode::SHADING);
1280 for (int a = 1; a <= object->totcol; a++) {
1281 Material *ma = give_current_material(object, a);
1288 build_object_pointcache(object);
1290 build_object_data_geometry_datablock((ID *)object->data, is_object_visible);
1293 void DepsgraphNodeBuilder::build_object_data_geometry_datablock(
1295 bool is_object_visible)
1297 if (built_map_.checkIsBuiltAndTag(obdata)) {
1300 OperationNode *op_node;
1301 /* Make sure we've got an ID node before requesting CoW pointer. */
1302 (void) add_id_node((ID *)obdata);
1303 ID *obdata_cow = get_cow_id(obdata);
1305 build_animdata(obdata);
1307 Key *key = BKE_key_from_id(obdata);
1309 build_shapekeys(key);
1311 /* Nodes for result of obdata's evaluation, and geometry
1312 * evaluation on object. */
1313 const ID_Type id_type = GS(obdata->name);
1317 op_node = add_operation_node(obdata,
1319 function_bind(BKE_mesh_eval_geometry,
1321 (Mesh *)obdata_cow),
1322 OperationCode::PLACEHOLDER,
1324 op_node->set_as_entry();
1329 op_node = add_operation_node(obdata,
1332 OperationCode::PLACEHOLDER,
1334 op_node->set_as_entry();
1339 op_node = add_operation_node(obdata,
1341 function_bind(BKE_curve_eval_geometry,
1343 (Curve *)obdata_cow),
1344 OperationCode::PLACEHOLDER,
1346 op_node->set_as_entry();
1347 /* Make sure objects used for bevel.taper are in the graph.
1348 * NOTE: This objects might be not linked to the scene. */
1349 Curve *cu = (Curve *)obdata;
1350 if (cu->bevobj != NULL) {
1353 DEG_ID_LINKED_INDIRECTLY,
1356 if (cu->taperobj != NULL) {
1359 DEG_ID_LINKED_INDIRECTLY,
1362 if (cu->textoncurve != NULL) {
1365 DEG_ID_LINKED_INDIRECTLY,
1372 op_node = add_operation_node(obdata,
1374 function_bind(BKE_lattice_eval_geometry,
1376 (Lattice *)obdata_cow),
1377 OperationCode::PLACEHOLDER,
1379 op_node->set_as_entry();
1385 /* GPencil evaluation operations. */
1386 op_node = add_operation_node(obdata,
1388 function_bind(BKE_gpencil_eval_geometry,
1390 (bGPdata *)obdata_cow),
1391 OperationCode::PLACEHOLDER,
1393 op_node->set_as_entry();
1397 BLI_assert(!"Should not happen");
1400 op_node = add_operation_node(obdata, NodeType::GEOMETRY, NULL,
1401 OperationCode::PLACEHOLDER, "Eval Done");
1402 op_node->set_as_exit();
1403 /* Parameters for driver sources. */
1404 add_operation_node(obdata,
1405 NodeType::PARAMETERS,
1407 OperationCode::PARAMETERS_EVAL);
1409 add_operation_node(obdata,
1410 NodeType::BATCH_CACHE,
1411 function_bind(BKE_object_data_select_update,
1414 OperationCode::GEOMETRY_SELECT_UPDATE);
1417 void DepsgraphNodeBuilder::build_armature(bArmature *armature)
1419 if (built_map_.checkIsBuiltAndTag(armature)) {
1422 build_animdata(&armature->id);
1423 /* Make sure pose is up-to-date with armature updates. */
1424 add_operation_node(&armature->id,
1425 NodeType::PARAMETERS,
1427 OperationCode::PLACEHOLDER,
1431 void DepsgraphNodeBuilder::build_camera(Camera *camera)
1433 if (built_map_.checkIsBuiltAndTag(camera)) {
1436 OperationNode *op_node;
1437 build_animdata(&camera->id);
1438 op_node = add_operation_node(&camera->id,
1439 NodeType::PARAMETERS,
1441 OperationCode::PARAMETERS_EVAL);
1442 op_node->set_as_exit();
1445 void DepsgraphNodeBuilder::build_lamp(Lamp *lamp)
1447 if (built_map_.checkIsBuiltAndTag(lamp)) {
1450 OperationNode *op_node;
1451 build_animdata(&lamp->id);
1452 op_node = add_operation_node(&lamp->id,
1453 NodeType::PARAMETERS,
1455 OperationCode::PARAMETERS_EVAL);
1456 /* NOTE: We mark this node as both entry and exit. This way we have a
1457 * node to link all dependencies for shading (which includes relation to the
1458 * lamp object, and incldues relation from node tree) without adding a
1459 * dedicated component type. */
1460 op_node->set_as_entry();
1461 op_node->set_as_exit();
1462 /* lamp's nodetree */
1463 build_nodetree(lamp->nodetree);
1466 void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
1468 if (ntree == NULL) {
1471 if (built_map_.checkIsBuiltAndTag(ntree)) {
1474 /* nodetree itself */
1475 add_id_node(&ntree->id);
1476 bNodeTree *ntree_cow = get_cow_datablock(ntree);
1478 build_animdata(&ntree->id);
1479 /* Shading update. */
1480 add_operation_node(&ntree->id,
1483 OperationCode::MATERIAL_UPDATE);
1484 /* NOTE: We really pass original and CoW node trees here, this is how the
1485 * callback works. Ideally we need to find a better way for that. */
1486 add_operation_node(&ntree->id,
1487 NodeType::SHADING_PARAMETERS,
1488 function_bind(BKE_nodetree_shading_params_eval,
1492 OperationCode::MATERIAL_UPDATE);
1493 /* nodetree's nodes... */
1494 LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
1499 ID_Type id_type = GS(id->name);
1500 if (id_type == ID_MA) {
1501 build_material((Material *)id);
1503 else if (id_type == ID_TE) {
1504 build_texture((Tex *)id);
1506 else if (id_type == ID_IM) {
1507 build_image((Image *)id);
1509 else if (id_type == ID_OB) {
1510 /* TODO(sergey): Use visibility of owner of the node tree. */
1511 build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, true);
1513 else if (id_type == ID_SCE) {
1514 /* Scenes are used by compositor trees, and handled by render
1515 * pipeline. No need to build dependencies for them here. */
1517 else if (id_type == ID_TXT) {
1518 /* Ignore script nodes. */
1520 else if (id_type == ID_MSK) {
1521 build_mask((Mask *)id);
1523 else if (id_type == ID_MC) {
1524 build_movieclip((MovieClip *)id);
1526 else if (bnode->type == NODE_GROUP) {
1527 bNodeTree *group_ntree = (bNodeTree *)id;
1528 build_nodetree(group_ntree);
1531 BLI_assert(!"Unknown ID type used for node");
1535 // TODO: link from nodetree to owner_component?
1538 /* Recursively build graph for material */
1539 void DepsgraphNodeBuilder::build_material(Material *material)
1541 if (built_map_.checkIsBuiltAndTag(material)) {
1544 /* Material itself. */
1545 add_id_node(&material->id);
1546 Material *material_cow = get_cow_datablock(material);
1547 /* Shading update. */
1548 add_operation_node(&material->id,
1550 function_bind(BKE_material_eval,
1553 OperationCode::MATERIAL_UPDATE);
1554 /* Material animation. */
1555 build_animdata(&material->id);
1556 /* Material's nodetree. */
1557 build_nodetree(material->nodetree);
1560 /* Recursively build graph for texture */
1561 void DepsgraphNodeBuilder::build_texture(Tex *texture)
1563 if (built_map_.checkIsBuiltAndTag(texture)) {
1566 /* Texture itself. */
1567 build_animdata(&texture->id);
1568 /* Texture's nodetree. */
1569 build_nodetree(texture->nodetree);
1570 /* Special cases for different IDs which texture uses. */
1571 if (texture->type == TEX_IMAGE) {
1572 if (texture->ima != NULL) {
1573 build_image(texture->ima);
1576 add_operation_node(&texture->id,
1577 NodeType::GENERIC_DATABLOCK,
1579 OperationCode::GENERIC_DATABLOCK_UPDATE);
1582 void DepsgraphNodeBuilder::build_image(Image *image) {
1583 if (built_map_.checkIsBuiltAndTag(image)) {
1586 add_operation_node(&image->id,
1587 NodeType::GENERIC_DATABLOCK,
1589 OperationCode::GENERIC_DATABLOCK_UPDATE);
1592 void DepsgraphNodeBuilder::build_compositor(Scene *scene)
1594 /* For now, just a plain wrapper? */
1595 // TODO: create compositing component?
1596 // XXX: component type undefined!
1597 //graph->get_node(&scene->id, NULL, NodeType::COMPOSITING, NULL);
1599 /* for now, nodetrees are just parameters; compositing occurs in internals
1601 add_component_node(&scene->id, NodeType::PARAMETERS);
1602 build_nodetree(scene->nodetree);
1605 void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
1607 if (built_map_.checkIsBuiltAndTag(gpd)) {
1610 ID *gpd_id = &gpd->id;
1612 /* TODO(sergey): what about multiple users of same datablock? This should
1613 * only get added once. */
1615 /* The main reason Grease Pencil is included here is because the animation
1616 * (and drivers) need to be hosted somewhere. */
1617 build_animdata(gpd_id);
1620 void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
1622 if (built_map_.checkIsBuiltAndTag(cache_file)) {
1625 ID *cache_file_id = &cache_file->id;
1627 build_animdata(cache_file_id);
1628 /* Cache evaluation itself. */
1629 add_operation_node(cache_file_id, NodeType::CACHE, NULL,
1630 OperationCode::PLACEHOLDER, "Cache File Update");
1633 void DepsgraphNodeBuilder::build_mask(Mask *mask)
1635 if (built_map_.checkIsBuiltAndTag(mask)) {
1638 ID *mask_id = &mask->id;
1639 Mask *mask_cow = get_cow_datablock(mask);
1640 /* F-Curve based animation. */
1641 build_animdata(mask_id);
1642 /* Animation based on mask's shapes. */
1643 add_operation_node(mask_id,
1644 NodeType::ANIMATION,
1645 function_bind(BKE_mask_eval_animation, _1, mask_cow),
1646 OperationCode::MASK_ANIMATION);
1647 /* Final mask evaluation. */
1648 add_operation_node(mask_id,
1649 NodeType::PARAMETERS,
1650 function_bind(BKE_mask_eval_update, _1, mask_cow),
1651 OperationCode::MASK_EVAL);
1654 void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip)
1656 if (built_map_.checkIsBuiltAndTag(clip)) {
1659 ID *clip_id = &clip->id;
1660 MovieClip *clip_cow = (MovieClip *)ensure_cow_id(clip_id);
1662 build_animdata(clip_id);
1663 /* Movie clip evaluation. */
1664 add_operation_node(clip_id,
1665 NodeType::PARAMETERS,
1666 function_bind(BKE_movieclip_eval_update, _1, clip_cow),
1667 OperationCode::MOVIECLIP_EVAL);
1669 add_operation_node(clip_id,
1670 NodeType::BATCH_CACHE,
1671 function_bind(BKE_movieclip_eval_selection_update, _1, clip_cow),
1672 OperationCode::MOVIECLIP_SELECT_UPDATE);
1675 void DepsgraphNodeBuilder::build_lightprobe(LightProbe *probe)
1677 if (built_map_.checkIsBuiltAndTag(probe)) {
1680 /* Placeholder so we can add relations and tag ID node for update. */
1681 add_operation_node(&probe->id,
1682 NodeType::PARAMETERS,
1684 OperationCode::LIGHT_PROBE_EVAL);
1686 build_animdata(&probe->id);
1689 void DepsgraphNodeBuilder::build_speaker(Speaker *speaker)
1691 if (built_map_.checkIsBuiltAndTag(speaker)) {
1694 /* Placeholder so we can add relations and tag ID node for update. */
1695 add_operation_node(&speaker->id,
1696 NodeType::PARAMETERS,
1698 OperationCode::SPEAKER_EVAL);
1699 build_animdata(&speaker->id);
1702 /* **** ID traversal callbacks functions **** */
1704 void DepsgraphNodeBuilder::modifier_walk(void *user_data,
1705 struct Object * /*object*/,
1709 BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
1714 switch (GS(id->name)) {
1716 /* Special case for object, so we take owner visibility into
1718 data->builder->build_object(-1,
1720 DEG_ID_LINKED_INDIRECTLY,
1721 data->is_parent_visible);
1724 data->builder->build_id(id);
1729 void DepsgraphNodeBuilder::constraint_walk(bConstraint * /*con*/,
1731 bool /*is_reference*/,
1734 BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
1739 switch (GS(id->name)) {
1741 /* Special case for object, so we take owner visibility into
1743 data->builder->build_object(-1,
1745 DEG_ID_LINKED_INDIRECTLY,
1746 data->is_parent_visible);
1749 data->builder->build_id(id);