Blender  V2.93
deg_builder_nodes.cc
Go to the documentation of this file.
1 /*
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.
6  *
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.
11  *
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.
15  *
16  * The Original Code is Copyright (C) 2013 Blender Foundation.
17  * All rights reserved.
18  */
19 
27 
28 #include <cstdio>
29 #include <cstdlib>
30 
31 #include "MEM_guardedalloc.h"
32 
33 #include "BLI_blenlib.h"
34 #include "BLI_string.h"
35 #include "BLI_utildefines.h"
36 
37 #include "DNA_action_types.h"
38 #include "DNA_anim_types.h"
39 #include "DNA_armature_types.h"
40 #include "DNA_cachefile_types.h"
41 #include "DNA_camera_types.h"
42 #include "DNA_collection_types.h"
43 #include "DNA_constraint_types.h"
44 #include "DNA_curve_types.h"
45 #include "DNA_effect_types.h"
46 #include "DNA_gpencil_types.h"
47 #include "DNA_key_types.h"
48 #include "DNA_light_types.h"
49 #include "DNA_lightprobe_types.h"
50 #include "DNA_linestyle_types.h"
51 #include "DNA_mask_types.h"
52 #include "DNA_material_types.h"
53 #include "DNA_mesh_types.h"
54 #include "DNA_meta_types.h"
55 #include "DNA_movieclip_types.h"
56 #include "DNA_node_types.h"
57 #include "DNA_object_types.h"
58 #include "DNA_particle_types.h"
59 #include "DNA_rigidbody_types.h"
60 #include "DNA_scene_types.h"
61 #include "DNA_sequence_types.h"
62 #include "DNA_simulation_types.h"
63 #include "DNA_sound_types.h"
64 #include "DNA_speaker_types.h"
65 #include "DNA_texture_types.h"
66 #include "DNA_world_types.h"
67 
68 #include "BKE_action.h"
69 #include "BKE_anim_data.h"
70 #include "BKE_animsys.h"
71 #include "BKE_armature.h"
72 #include "BKE_cachefile.h"
73 #include "BKE_collection.h"
74 #include "BKE_constraint.h"
75 #include "BKE_curve.h"
76 #include "BKE_effect.h"
77 #include "BKE_fcurve_driver.h"
78 #include "BKE_gpencil.h"
79 #include "BKE_gpencil_modifier.h"
80 #include "BKE_idprop.h"
81 #include "BKE_idtype.h"
82 #include "BKE_image.h"
83 #include "BKE_key.h"
84 #include "BKE_lattice.h"
85 #include "BKE_layer.h"
86 #include "BKE_lib_id.h"
87 #include "BKE_light.h"
88 #include "BKE_mask.h"
89 #include "BKE_material.h"
90 #include "BKE_mball.h"
91 #include "BKE_mesh.h"
92 #include "BKE_modifier.h"
93 #include "BKE_movieclip.h"
94 #include "BKE_node.h"
95 #include "BKE_object.h"
96 #include "BKE_particle.h"
97 #include "BKE_pointcache.h"
98 #include "BKE_rigidbody.h"
99 #include "BKE_scene.h"
100 #include "BKE_shader_fx.h"
101 #include "BKE_simulation.h"
102 #include "BKE_sound.h"
103 #include "BKE_tracking.h"
104 #include "BKE_volume.h"
105 #include "BKE_world.h"
106 
107 #include "RNA_access.h"
108 #include "RNA_types.h"
109 
110 #include "DEG_depsgraph.h"
111 #include "DEG_depsgraph_build.h"
112 
113 #include "SEQ_iterator.h"
114 
116 #include "intern/depsgraph.h"
117 #include "intern/depsgraph_type.h"
119 #include "intern/node/deg_node.h"
121 #include "intern/node/deg_node_id.h"
123 
124 namespace blender::deg {
125 
126 /* ************ */
127 /* Node Builder */
128 
129 /* **** General purpose functions **** */
130 
132  Depsgraph *graph,
133  DepsgraphBuilderCache *cache)
134  : DepsgraphBuilder(bmain, graph, cache),
135  scene_(nullptr),
136  view_layer_(nullptr),
137  view_layer_index_(-1),
138  collection_(nullptr),
139  is_parent_collection_visible_(true)
140 {
141 }
142 
144 {
145  for (IDInfo *id_info : id_info_hash_.values()) {
146  if (id_info->id_cow != nullptr) {
147  deg_free_copy_on_write_datablock(id_info->id_cow);
148  MEM_freeN(id_info->id_cow);
149  }
150  MEM_freeN(id_info);
151  }
152 }
153 
155 {
157 
158  const ID_Type id_type = GS(id->name);
159  IDNode *id_node = nullptr;
160  ID *id_cow = nullptr;
161  IDComponentsMask previously_visible_components_mask = 0;
162  uint32_t previous_eval_flags = 0;
163  DEGCustomDataMeshMasks previous_customdata_masks;
164  IDInfo *id_info = id_info_hash_.lookup_default(id->session_uuid, nullptr);
165  if (id_info != nullptr) {
166  id_cow = id_info->id_cow;
167  previously_visible_components_mask = id_info->previously_visible_components_mask;
168  previous_eval_flags = id_info->previous_eval_flags;
169  previous_customdata_masks = id_info->previous_customdata_masks;
170  /* Tag ID info to not free the CoW ID pointer. */
171  id_info->id_cow = nullptr;
172  }
173  id_node = graph_->add_id_node(id, id_cow);
174  id_node->previously_visible_components_mask = previously_visible_components_mask;
175  id_node->previous_eval_flags = previous_eval_flags;
176  id_node->previous_customdata_masks = previous_customdata_masks;
177  /* NOTE: Zero number of components indicates that ID node was just created. */
178  if (id_node->components.is_empty() && deg_copy_on_write_is_needed(id_type)) {
179  ComponentNode *comp_cow = id_node->add_component(NodeType::COPY_ON_WRITE);
180  OperationNode *op_cow = comp_cow->add_operation(
183  "",
184  -1);
185  graph_->operations.append(op_cow);
186  }
187  return id_node;
188 }
189 
191 {
192  return graph_->find_id_node(id);
193 }
194 
196 {
197  return graph_->add_time_source();
198 }
199 
201  NodeType comp_type,
202  const char *comp_name)
203 {
204  IDNode *id_node = add_id_node(id);
205  ComponentNode *comp_node = id_node->add_component(comp_type, comp_name);
206  comp_node->owner = id_node;
207  return comp_node;
208 }
209 
211  OperationCode opcode,
212  const DepsEvalOperationCb &op,
213  const char *name,
214  int name_tag)
215 {
216  OperationNode *op_node = comp_node->find_operation(opcode, name, name_tag);
217  if (op_node == nullptr) {
218  op_node = comp_node->add_operation(op, opcode, name, name_tag);
219  graph_->operations.append(op_node);
220  }
221  else {
222  fprintf(stderr,
223  "add_operation: Operation already exists - %s has %s at %p\n",
224  comp_node->identifier().c_str(),
225  op_node->identifier().c_str(),
226  op_node);
227  BLI_assert(!"Should not happen!");
228  }
229  return op_node;
230 }
231 
233  NodeType comp_type,
234  const char *comp_name,
235  OperationCode opcode,
236  const DepsEvalOperationCb &op,
237  const char *name,
238  int name_tag)
239 {
240  ComponentNode *comp_node = add_component_node(id, comp_type, comp_name);
241  return add_operation_node(comp_node, opcode, op, name, name_tag);
242 }
243 
245  NodeType comp_type,
246  OperationCode opcode,
247  const DepsEvalOperationCb &op,
248  const char *name,
249  int name_tag)
250 {
251  return add_operation_node(id, comp_type, "", opcode, op, name, name_tag);
252 }
253 
255  NodeType comp_type,
256  const char *comp_name,
257  OperationCode opcode,
258  const DepsEvalOperationCb &op,
259  const char *name,
260  int name_tag)
261 {
262  OperationNode *operation = find_operation_node(id, comp_type, comp_name, opcode, name, name_tag);
263  if (operation != nullptr) {
264  return operation;
265  }
266  return add_operation_node(id, comp_type, comp_name, opcode, op, name, name_tag);
267 }
268 
270  NodeType comp_type,
271  OperationCode opcode,
272  const DepsEvalOperationCb &op,
273  const char *name,
274  int name_tag)
275 {
276  OperationNode *operation = find_operation_node(id, comp_type, opcode, name, name_tag);
277  if (operation != nullptr) {
278  return operation;
279  }
280  return add_operation_node(id, comp_type, opcode, op, name, name_tag);
281 }
282 
284  NodeType comp_type,
285  const char *comp_name,
286  OperationCode opcode,
287  const char *name,
288  int name_tag)
289 {
290  return find_operation_node(id, comp_type, comp_name, opcode, name, name_tag) != nullptr;
291 }
292 
294  NodeType comp_type,
295  const char *comp_name,
296  OperationCode opcode,
297  const char *name,
298  int name_tag)
299 {
300  ComponentNode *comp_node = add_component_node(id, comp_type, comp_name);
301  return comp_node->find_operation(opcode, name, name_tag);
302 }
303 
305  ID *id, NodeType comp_type, OperationCode opcode, const char *name, int name_tag)
306 {
307  return find_operation_node(id, comp_type, "", opcode, name, name_tag);
308 }
309 
310 ID *DepsgraphNodeBuilder::get_cow_id(const ID *id_orig) const
311 {
312  return graph_->get_cow_id(id_orig);
313 }
314 
316 {
317  if (id_orig->tag & LIB_TAG_COPIED_ON_WRITE) {
318  /* ID is already remapped to copy-on-write. */
319  return id_orig;
320  }
321  IDNode *id_node = add_id_node(id_orig);
322  return id_node->id_cow;
323 }
324 
325 /* **** Build functions for entity nodes **** */
326 
328 {
329  /* Store existing copy-on-write versions of datablock, so we can re-use
330  * them for new ID nodes. */
331  for (IDNode *id_node : graph_->id_nodes) {
332  /* It is possible that the ID does not need to have CoW version in which case id_cow is the
333  * same as id_orig. Additionally, such ID might have been removed, which makes the check
334  * for whether id_cow is expanded to access freed memory. In order to deal with this we
335  * check whether CoW is needed based on a scalar value which does not lead to access of
336  * possibly deleted memory.
337  * Additionally, this saves some space in the map by skipping mapping for datablocks which
338  * do not need CoW, */
339  if (!deg_copy_on_write_is_needed(id_node->id_type)) {
340  id_node->id_cow = nullptr;
341  continue;
342  }
343 
344  IDInfo *id_info = (IDInfo *)MEM_mallocN(sizeof(IDInfo), "depsgraph id info");
345  if (deg_copy_on_write_is_expanded(id_node->id_cow) && id_node->id_orig != id_node->id_cow) {
346  id_info->id_cow = id_node->id_cow;
347  }
348  else {
349  id_info->id_cow = nullptr;
350  }
351  id_info->previously_visible_components_mask = id_node->visible_components_mask;
352  id_info->previous_eval_flags = id_node->eval_flags;
353  id_info->previous_customdata_masks = id_node->customdata_masks;
354  BLI_assert(!id_info_hash_.contains(id_node->id_orig_session_uuid));
355  id_info_hash_.add_new(id_node->id_orig_session_uuid, id_info);
356  id_node->id_cow = nullptr;
357  }
358 
359  for (OperationNode *op_node : graph_->entry_tags) {
360  ComponentNode *comp_node = op_node->owner;
361  IDNode *id_node = comp_node->owner;
362 
363  SavedEntryTag entry_tag;
364  entry_tag.id_orig = id_node->id_orig;
365  entry_tag.component_type = comp_node->type;
366  entry_tag.opcode = op_node->opcode;
367  entry_tag.name = op_node->name;
368  entry_tag.name_tag = op_node->name_tag;
369  saved_entry_tags_.append(entry_tag);
370  }
371 
372  /* Make sure graph has no nodes left from previous state. */
375  graph_->entry_tags.clear();
376 }
377 
379 {
380  for (const SavedEntryTag &entry_tag : saved_entry_tags_) {
381  IDNode *id_node = find_id_node(entry_tag.id_orig);
382  if (id_node == nullptr) {
383  continue;
384  }
385  ComponentNode *comp_node = id_node->find_component(entry_tag.component_type);
386  if (comp_node == nullptr) {
387  continue;
388  }
389  OperationNode *op_node = comp_node->find_operation(
390  entry_tag.opcode, entry_tag.name.c_str(), entry_tag.name_tag);
391  if (op_node == nullptr) {
392  continue;
393  }
394  /* Since the tag is coming from a saved copy of entry tags, this means
395  * that originally node was explicitly tagged for user update. */
397  }
398 }
399 
401 {
402  if (id == nullptr) {
403  return;
404  }
405 
406  const ID_Type id_type = GS(id->name);
407  switch (id_type) {
408  case ID_AC:
409  build_action((bAction *)id);
410  break;
411  case ID_AR:
412  build_armature((bArmature *)id);
413  break;
414  case ID_CA:
415  build_camera((Camera *)id);
416  break;
417  case ID_GR:
418  build_collection(nullptr, (Collection *)id);
419  break;
420  case ID_OB:
421  /* TODO(sergey): Get visibility from a "parent" somehow.
422  *
423  * NOTE: Using `false` visibility here should be fine, since if this
424  * driver affects on something invisible we don't really care if the
425  * driver gets evaluated (and even don't want this to force object
426  * to become visible).
427  *
428  * If this happened to be affecting visible object, then it is up to
429  * deg_graph_build_flush_visibility() to ensure visibility of the
430  * object is true. */
431  build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, false);
432  break;
433  case ID_KE:
434  build_shapekeys((Key *)id);
435  break;
436  case ID_LA:
437  build_light((Light *)id);
438  break;
439  case ID_LP:
441  break;
442  case ID_NT:
443  build_nodetree((bNodeTree *)id);
444  break;
445  case ID_MA:
446  build_material((Material *)id);
447  break;
448  case ID_TE:
449  build_texture((Tex *)id);
450  break;
451  case ID_IM:
452  build_image((Image *)id);
453  break;
454  case ID_WO:
455  build_world((World *)id);
456  break;
457  case ID_MSK:
458  build_mask((Mask *)id);
459  break;
460  case ID_LS:
462  break;
463  case ID_MC:
464  build_movieclip((MovieClip *)id);
465  break;
466  case ID_ME:
467  case ID_MB:
468  case ID_CU:
469  case ID_LT:
470  case ID_GD:
471  case ID_HA:
472  case ID_PT:
473  case ID_VO:
474  /* TODO(sergey): Get visibility from a "parent" somehow.
475  *
476  * NOTE: Similarly to above, we don't want false-positives on
477  * visibility. */
479  break;
480  case ID_SPK:
481  build_speaker((Speaker *)id);
482  break;
483  case ID_SO:
484  build_sound((bSound *)id);
485  break;
486  case ID_TXT:
487  /* Not a part of dependency graph. */
488  break;
489  case ID_CF:
490  build_cachefile((CacheFile *)id);
491  break;
492  case ID_SCE:
494  break;
495  case ID_SIM:
497  break;
498  case ID_PA:
500  break;
501 
502  case ID_LI:
503  case ID_IP:
504  case ID_SCR:
505  case ID_VF:
506  case ID_BR:
507  case ID_WM:
508  case ID_PAL:
509  case ID_PC:
510  case ID_WS:
512  build_generic_id(id);
513  break;
514  }
515 }
516 
518 {
519  if (built_map_.checkIsBuiltAndTag(id)) {
520  return;
521  }
522 
524  build_animdata(id);
525  build_parameters(id);
526 }
527 
528 static void build_idproperties_callback(IDProperty *id_property, void *user_data)
529 {
530  DepsgraphNodeBuilder *builder = reinterpret_cast<DepsgraphNodeBuilder *>(user_data);
531  BLI_assert(id_property->type == IDP_ID);
532  builder->build_id(reinterpret_cast<ID *>(id_property->data.pointer));
533 }
534 
536 {
538 }
539 
541  Collection *collection)
542 {
543  const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? COLLECTION_RESTRICT_VIEWPORT :
545  const bool is_collection_restricted = (collection->flag & restrict_flag);
546  const bool is_collection_visible = !is_collection_restricted && is_parent_collection_visible_;
547  IDNode *id_node;
548  if (built_map_.checkIsBuiltAndTag(collection)) {
549  id_node = find_id_node(&collection->id);
550  if (is_collection_visible && id_node->is_directly_visible == false &&
551  id_node->is_collection_fully_expanded == true) {
552  /* Collection became visible, make sure nested collections and
553  * objects are poked with the new visibility flag, since they
554  * might become visible too. */
555  }
556  else if (from_layer_collection == nullptr && !id_node->is_collection_fully_expanded) {
557  /* Initially collection was built from layer now, and was requested
558  * to not recurse into object. But now it's asked to recurse into all objects. */
559  }
560  else {
561  return;
562  }
563  }
564  else {
565  /* Collection itself. */
566  id_node = add_id_node(&collection->id);
567  id_node->is_directly_visible = is_collection_visible;
568 
569  build_idproperties(collection->id.properties);
571  }
572  if (from_layer_collection != nullptr) {
573  /* If we came from layer collection we don't go deeper, view layer
574  * builder takes care of going deeper. */
575  return;
576  }
577  /* Backup state. */
578  Collection *current_state_collection = collection_;
579  const bool is_current_parent_collection_visible = is_parent_collection_visible_;
580  /* Modify state as we've entered new collection/ */
581  collection_ = collection;
582  is_parent_collection_visible_ = is_collection_visible;
583  /* Build collection objects. */
584  LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) {
585  build_object(-1, cob->ob, DEG_ID_LINKED_INDIRECTLY, is_collection_visible);
586  }
587  /* Build child collections. */
588  LISTBASE_FOREACH (CollectionChild *, child, &collection->children) {
589  build_collection(nullptr, child->collection);
590  }
591  /* Restore state. */
592  collection_ = current_state_collection;
593  is_parent_collection_visible_ = is_current_parent_collection_visible;
594  id_node->is_collection_fully_expanded = true;
595 }
596 
598  Object *object,
599  eDepsNode_LinkedState_Type linked_state,
600  bool is_visible)
601 {
602  if (object->proxy != nullptr) {
603  object->proxy->proxy_from = object;
604  }
605  const bool has_object = built_map_.checkIsBuiltAndTag(object);
606 
607  /* When there is already object in the dependency graph accumulate visibility an linked state
608  * flags. Only do it on the object itself (apart from very special cases) and leave dealing with
609  * visibility of dependencies to the visibility flush step which happens at the end of the build
610  * process. */
611  if (has_object) {
612  IDNode *id_node = find_id_node(&object->id);
613  if (id_node->linked_state == DEG_ID_LINKED_INDIRECTLY) {
614  build_object_flags(base_index, object, linked_state);
615  }
616  id_node->linked_state = max(id_node->linked_state, linked_state);
617  id_node->is_directly_visible |= is_visible;
618  id_node->has_base |= (base_index != -1);
619 
620  /* There is no relation path which will connect current object with all the ones which come
621  * via the instanced collection, so build the collection again. Note that it will do check
622  * whether visibility update is needed on its own. */
623  build_object_instance_collection(object, is_visible);
624 
625  return;
626  }
627 
628  /* Create ID node for object and begin init. */
629  IDNode *id_node = add_id_node(&object->id);
630  Object *object_cow = get_cow_datablock(object);
631  id_node->linked_state = linked_state;
632  /* NOTE: Scene is nullptr when building dependency graph for render pipeline.
633  * Probably need to assign that to something non-nullptr, but then the logic here will still be
634  * somewhat weird. */
635  if (scene_ != nullptr && object == scene_->camera) {
636  id_node->is_directly_visible = true;
637  }
638  else {
639  id_node->is_directly_visible = is_visible;
640  }
641  id_node->has_base |= (base_index != -1);
642  /* Various flags, flushing from bases/collections. */
643  build_object_from_layer(base_index, object, linked_state);
644  /* Transform. */
645  build_object_transform(object);
646  /* Parent. */
647  if (object->parent != nullptr) {
648  build_object(-1, object->parent, DEG_ID_LINKED_INDIRECTLY, is_visible);
649  }
650  /* Modifiers. */
651  if (object->modifiers.first != nullptr) {
653  data.builder = this;
654  data.is_parent_visible = is_visible;
656  }
657  /* Grease Pencil Modifiers. */
658  if (object->greasepencil_modifiers.first != nullptr) {
660  data.builder = this;
661  data.is_parent_visible = is_visible;
663  }
664  /* Shader FX. */
665  if (object->shader_fx.first != nullptr) {
667  data.builder = this;
668  data.is_parent_visible = is_visible;
670  }
671  /* Constraints. */
672  if (object->constraints.first != nullptr) {
674  data.builder = this;
675  data.is_parent_visible = is_visible;
677  }
678  /* Object data. */
679  build_object_data(object, is_visible);
680  /* Parameters, used by both drivers/animation and also to inform dependency
681  * from object's data. */
682  build_parameters(&object->id);
684  /* Build animation data,
685  *
686  * Do it now because it's possible object data will affect
687  * on object's level animation, for example in case of rebuilding
688  * pose for proxy. */
689  build_animdata(&object->id);
690  /* Particle systems. */
691  if (object->particlesystem.first != nullptr) {
692  build_particle_systems(object, is_visible);
693  }
694  /* Force field Texture. */
695  if ((object->pd != nullptr) && (object->pd->forcefield == PFIELD_TEXTURE) &&
696  (object->pd->tex != nullptr)) {
697  build_texture(object->pd->tex);
698  }
699  /* Proxy object to copy from. */
700  build_object_proxy_from(object, is_visible);
701  build_object_proxy_group(object, is_visible);
702  /* Object dupligroup. */
703  if (object->instance_collection != nullptr) {
704  build_object_instance_collection(object, is_visible);
708  }
709  /* Synchronization back to original object. */
710  add_operation_node(&object->id,
713  [object_cow](::Depsgraph *depsgraph) {
714  BKE_object_sync_to_original(depsgraph, object_cow);
715  });
716 }
717 
719  Object *object,
720  eDepsNode_LinkedState_Type linked_state)
721 {
722 
723  OperationNode *entry_node = add_operation_node(
725  entry_node->set_as_entry();
726  OperationNode *exit_node = add_operation_node(
728  exit_node->set_as_exit();
729 
730  build_object_flags(base_index, object, linked_state);
731 }
732 
734  Object *object,
735  eDepsNode_LinkedState_Type linked_state)
736 {
737  if (base_index == -1) {
738  return;
739  }
740  Scene *scene_cow = get_cow_datablock(scene_);
741  Object *object_cow = get_cow_datablock(object);
742  const bool is_from_set = (linked_state == DEG_ID_LINKED_VIA_SET);
743  /* TODO(sergey): Is this really best component to be used? */
745  &object->id,
748  [view_layer_index = view_layer_index_, scene_cow, object_cow, base_index, is_from_set](
749  ::Depsgraph *depsgraph) {
750  BKE_object_eval_eval_base_flags(
751  depsgraph, scene_cow, view_layer_index, object_cow, base_index, is_from_set);
752  });
753 }
754 
755 void DepsgraphNodeBuilder::build_object_proxy_from(Object *object, bool is_object_visible)
756 {
757  if (object->proxy_from == nullptr) {
758  return;
759  }
760  build_object(-1, object->proxy_from, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
761 }
762 
763 void DepsgraphNodeBuilder::build_object_proxy_group(Object *object, bool is_object_visible)
764 {
765  if (object->proxy_group == nullptr) {
766  return;
767  }
768  build_object(-1, object->proxy_group, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
769 }
770 
772 {
773  if (object->instance_collection == nullptr) {
774  return;
775  }
776  const bool is_current_parent_collection_visible = is_parent_collection_visible_;
777  is_parent_collection_visible_ = is_object_visible;
778  build_collection(nullptr, object->instance_collection);
779  is_parent_collection_visible_ = is_current_parent_collection_visible;
780 }
781 
782 void DepsgraphNodeBuilder::build_object_data(Object *object, bool is_object_visible)
783 {
784  if (object->data == nullptr) {
785  return;
786  }
787  /* type-specific data. */
788  switch (object->type) {
789  case OB_MESH:
790  case OB_CURVE:
791  case OB_FONT:
792  case OB_SURF:
793  case OB_MBALL:
794  case OB_LATTICE:
795  case OB_GPENCIL:
796  case OB_HAIR:
797  case OB_POINTCLOUD:
798  case OB_VOLUME:
799  build_object_data_geometry(object, is_object_visible);
800  break;
801  case OB_ARMATURE:
802  if (ID_IS_LINKED(object) && object->proxy_from != nullptr) {
803  build_proxy_rig(object, is_object_visible);
804  }
805  else {
806  build_rig(object, is_object_visible);
807  }
808  break;
809  case OB_LAMP:
810  build_object_data_light(object);
811  break;
812  case OB_CAMERA:
813  build_object_data_camera(object);
814  break;
815  case OB_LIGHTPROBE:
817  break;
818  case OB_SPEAKER:
820  break;
821  default: {
822  ID *obdata = (ID *)object->data;
823  if (!built_map_.checkIsBuilt(obdata)) {
824  build_animdata(obdata);
825  }
826  break;
827  }
828  }
829  /* Materials. */
830  Material ***materials_ptr = BKE_object_material_array_p(object);
831  if (materials_ptr != nullptr) {
832  short *num_materials_ptr = BKE_object_material_len_p(object);
833  build_materials(*materials_ptr, *num_materials_ptr);
834  }
835 }
836 
838 {
839  Camera *camera = (Camera *)object->data;
840  build_camera(camera);
841 }
842 
844 {
845  Light *lamp = (Light *)object->data;
846  build_light(lamp);
847 }
848 
850 {
851  LightProbe *probe = (LightProbe *)object->data;
852  build_lightprobe(probe);
854 }
855 
857 {
858  Speaker *speaker = (Speaker *)object->data;
859  build_speaker(speaker);
861 }
862 
864 {
865  OperationNode *op_node;
866  Object *ob_cow = get_cow_datablock(object);
867  /* Transform entry operation. */
869  op_node->set_as_entry();
870  /* Local transforms (from transform channels - loc/rot/scale + deltas). */
872  &object->id,
875  [ob_cow](::Depsgraph *depsgraph) { BKE_object_eval_local_transform(depsgraph, ob_cow); });
876  /* Object parent. */
877  if (object->parent != nullptr) {
879  &object->id,
882  [ob_cow](::Depsgraph *depsgraph) { BKE_object_eval_parent(depsgraph, ob_cow); });
883  }
884  /* Object constraints. */
885  if (object->constraints.first != nullptr) {
886  build_object_constraints(object);
887  }
888  /* Rest of transformation update. */
890  &object->id,
893  [ob_cow](::Depsgraph *depsgraph) { BKE_object_eval_uber_transform(depsgraph, ob_cow); });
894  /* Operation to take of rigid body simulation. soft bodies and other friends
895  * in the context of point cache invalidation. */
897  /* Object transform is done. */
898  op_node = add_operation_node(
899  &object->id,
902  [ob_cow](::Depsgraph *depsgraph) { BKE_object_eval_transform_final(depsgraph, ob_cow); });
903  op_node->set_as_exit();
904 }
905 
924 {
925  /* create node for constraint stack */
926  Scene *scene_cow = get_cow_datablock(scene_);
927  Object *object_cow = get_cow_datablock(object);
928  add_operation_node(&object->id,
931  [scene_cow, object_cow](::Depsgraph *depsgraph) {
932  BKE_object_eval_constraints(depsgraph, scene_cow, object_cow);
933  });
934 }
935 
937 {
938  if (!BKE_ptcache_object_has(scene_, object, 0)) {
939  return;
940  }
941  Scene *scene_cow = get_cow_datablock(scene_);
942  Object *object_cow = get_cow_datablock(object);
943  add_operation_node(&object->id,
946  [scene_cow, object_cow](::Depsgraph *depsgraph) {
947  BKE_object_eval_ptcache_reset(depsgraph, scene_cow, object_cow);
948  });
949 }
950 
956 {
957  /* Special handling for animated images/sequences. */
959  /* Regular animation. */
960  AnimData *adt = BKE_animdata_from_id(id);
961  if (adt == nullptr) {
962  return;
963  }
964  if (adt->action != nullptr) {
965  build_action(adt->action);
966  }
967  /* Make sure ID node exists. */
968  (void)add_id_node(id);
969  ID *id_cow = get_cow_id(id);
970  if (adt->action != nullptr || !BLI_listbase_is_empty(&adt->nla_tracks)) {
971  OperationNode *operation_node;
972  /* Explicit entry operation. */
974  operation_node->set_as_entry();
975  /* All the evaluation nodes. */
979  });
980  /* Explicit exit operation. */
982  operation_node->set_as_exit();
983  }
984  /* NLA strips contain actions. */
985  LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
986  build_animdata_nlastrip_targets(&nlt->strips);
987  }
988  /* Drivers. */
989  int driver_index = 0;
990  LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
991  /* create driver */
992  build_driver(id, fcu, driver_index++);
993  }
994 }
995 
997 {
998  LISTBASE_FOREACH (NlaStrip *, strip, strips) {
999  if (strip->act != nullptr) {
1000  build_action(strip->act);
1001  }
1002  else if (strip->strips.first != nullptr) {
1003  build_animdata_nlastrip_targets(&strip->strips);
1004  }
1005  }
1006 }
1007 
1012 {
1014  ID *id_cow = get_cow_id(id);
1016  id,
1019  [id_cow](::Depsgraph *depsgraph) { BKE_image_user_id_eval_animation(depsgraph, id_cow); });
1020  }
1021 }
1022 
1024 {
1025  if (built_map_.checkIsBuiltAndTag(action)) {
1026  return;
1027  }
1028  build_idproperties(action->id.properties);
1030 }
1031 
1038 void DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcurve, int driver_index)
1039 {
1040  /* Create data node for this driver */
1041  ID *id_cow = get_cow_id(id);
1042 
1043  /* TODO(sergey): ideally we could pass the COW of fcu, but since it
1044  * has not yet been allocated at this point we can't. As a workaround
1045  * the animation systems allocates an array so we can do a fast lookup
1046  * with the driver index. */
1048  id,
1051  [id_cow, driver_index, fcurve](::Depsgraph *depsgraph) {
1052  BKE_animsys_eval_driver(depsgraph, id_cow, driver_index, fcurve);
1053  },
1054  fcurve->rna_path ? fcurve->rna_path : "",
1055  fcurve->array_index);
1056  build_driver_variables(id, fcurve);
1057 }
1058 
1060 {
1061  build_driver_id_property(id, fcurve->rna_path);
1062  LISTBASE_FOREACH (DriverVar *, dvar, &fcurve->driver->variables) {
1064  if (dtar->id == nullptr) {
1065  continue;
1066  }
1067  build_id(dtar->id);
1068  build_driver_id_property(dtar->id, dtar->rna_path);
1069  /* Corresponds to dtar_id_ensure_proxy_from(). */
1070  if ((GS(dtar->id->name) == ID_OB) && (((Object *)dtar->id)->proxy_from != nullptr)) {
1071  Object *proxy_from = ((Object *)dtar->id)->proxy_from;
1072  build_id(&proxy_from->id);
1073  build_driver_id_property(&proxy_from->id, dtar->rna_path);
1074  }
1075  }
1077  }
1078 }
1079 
1081 {
1082  if (id == nullptr || rna_path == nullptr) {
1083  return;
1084  }
1085  PointerRNA id_ptr, ptr;
1086  PropertyRNA *prop;
1087  int index;
1088  RNA_id_pointer_create(id, &id_ptr);
1089  if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, &index)) {
1090  return;
1091  }
1092  if (prop == nullptr) {
1093  return;
1094  }
1095  if (!RNA_property_is_idprop(prop)) {
1096  return;
1097  }
1098  const char *prop_identifier = RNA_property_identifier((PropertyRNA *)prop);
1099  /* Custom properties of bones are placed in their components to improve granularity. */
1101  const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr.data);
1103  id, NodeType::BONE, pchan->name, OperationCode::ID_PROPERTY, nullptr, prop_identifier);
1104  }
1105  else {
1107  id, NodeType::PARAMETERS, OperationCode::ID_PROPERTY, nullptr, prop_identifier);
1108  }
1109 }
1110 
1112 {
1113  (void)add_id_node(id);
1114  OperationNode *op_node;
1115  /* Explicit entry. */
1117  op_node->set_as_entry();
1118  /* Generic evaluation node. */
1120  /* Explicit exit operation. */
1122  op_node->set_as_exit();
1123 }
1124 
1126 {
1127  /* Object dimensions (bounding box) node. Will depend on both geometry and transform. */
1129 }
1130 
1131 /* Recursively build graph for world */
1133 {
1135  return;
1136  }
1137  /* World itself. */
1138  add_id_node(&world->id);
1139  World *world_cow = get_cow_datablock(world);
1140  /* Shading update. */
1142  &world->id,
1145  [world_cow](::Depsgraph *depsgraph) { BKE_world_eval(depsgraph, world_cow); });
1147  /* Animation. */
1148  build_animdata(&world->id);
1150  /* World's nodetree. */
1152 }
1153 
1154 /* Rigidbody Simulation - Scene Level */
1156 {
1158  Scene *scene_cow = get_cow_datablock(scene);
1159 
1175  /* Create nodes --------------------------------------------------------- */
1176 
1177  /* XXX: is this the right component, or do we want to use another one
1178  * instead? */
1179 
1180  /* Init/rebuild operation. */
1182  &scene->id,
1185  [scene_cow](::Depsgraph *depsgraph) { BKE_rigidbody_rebuild_sim(depsgraph, scene_cow); });
1186  /* Do-sim operation. */
1187  OperationNode *sim_node = add_operation_node(&scene->id,
1190  [scene_cow](::Depsgraph *depsgraph) {
1191  BKE_rigidbody_eval_simulation(depsgraph,
1192  scene_cow);
1193  });
1194  sim_node->set_as_entry();
1195  sim_node->set_as_exit();
1196  sim_node->owner->entry_operation = sim_node;
1197  /* Objects - simulation participants. */
1198  if (rbw->group != nullptr) {
1199  build_collection(nullptr, rbw->group);
1201  if (object->type != OB_MESH) {
1202  continue;
1203  }
1204  if (object->rigidbody_object == nullptr) {
1205  continue;
1206  }
1207 
1208  if (object->rigidbody_object->type == RBO_TYPE_PASSIVE) {
1209  continue;
1210  }
1211 
1212  /* Create operation for flushing results. */
1213  /* Object's transform component - where the rigidbody operation
1214  * lives. */
1215  Object *object_cow = get_cow_datablock(object);
1216  add_operation_node(&object->id,
1219  [scene_cow, object_cow](::Depsgraph *depsgraph) {
1220  BKE_rigidbody_object_sync_transforms(depsgraph, scene_cow, object_cow);
1221  });
1222  }
1224  }
1225  /* Constraints. */
1226  if (rbw->constraints != nullptr) {
1228  RigidBodyCon *rbc = object->rigidbody_constraint;
1229  if (rbc == nullptr || rbc->ob1 == nullptr || rbc->ob2 == nullptr) {
1230  /* When either ob1 or ob2 is nullptr, the constraint doesn't work. */
1231  continue;
1232  }
1233  /* Make sure indirectly linked objects are fully built. */
1234  build_object(-1, object, DEG_ID_LINKED_INDIRECTLY, false);
1235  build_object(-1, rbc->ob1, DEG_ID_LINKED_INDIRECTLY, false);
1236  build_object(-1, rbc->ob2, DEG_ID_LINKED_INDIRECTLY, false);
1237  }
1239  }
1240 }
1241 
1242 void DepsgraphNodeBuilder::build_particle_systems(Object *object, bool is_object_visible)
1243 {
1257  /* Component for all particle systems. */
1259 
1260  Object *ob_cow = get_cow_datablock(object);
1261  OperationNode *op_node;
1262  op_node = add_operation_node(
1263  psys_comp, OperationCode::PARTICLE_SYSTEM_INIT, [ob_cow](::Depsgraph *depsgraph) {
1265  });
1266  op_node->set_as_entry();
1267  /* Build all particle systems. */
1268  LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
1269  ParticleSettings *part = psys->part;
1270  /* Build particle settings operations.
1271  *
1272  * NOTE: The call itself ensures settings are only build once. */
1274  /* Particle system evaluation. */
1275  add_operation_node(psys_comp, OperationCode::PARTICLE_SYSTEM_EVAL, nullptr, psys->name);
1276  /* Keyed particle targets. */
1278  LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) {
1279  if (ELEM(particle_target->ob, nullptr, object)) {
1280  continue;
1281  }
1282  build_object(-1, particle_target->ob, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
1283  }
1284  }
1285  /* Visualization of particle system. */
1286  switch (part->ren_as) {
1287  case PART_DRAW_OB:
1288  if (part->instance_object != nullptr) {
1289  build_object(-1, part->instance_object, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
1290  }
1291  break;
1292  case PART_DRAW_GR:
1293  if (part->instance_collection != nullptr) {
1294  build_collection(nullptr, part->instance_collection);
1295  }
1296  break;
1297  }
1298  }
1300  op_node->set_as_exit();
1301 }
1302 
1304 {
1305  if (built_map_.checkIsBuiltAndTag(particle_settings)) {
1306  return;
1307  }
1308  /* Make sure we've got proper copied ID pointer. */
1309  add_id_node(&particle_settings->id);
1310  ParticleSettings *particle_settings_cow = get_cow_datablock(particle_settings);
1311  /* Animation data. */
1312  build_animdata(&particle_settings->id);
1313  build_parameters(&particle_settings->id);
1314  /* Parameters change. */
1315  OperationNode *op_node;
1316  op_node = add_operation_node(
1318  op_node->set_as_entry();
1319  add_operation_node(&particle_settings->id,
1322  [particle_settings_cow](::Depsgraph *depsgraph) {
1323  BKE_particle_settings_eval_reset(depsgraph, particle_settings_cow);
1324  });
1325  op_node = add_operation_node(
1327  op_node->set_as_exit();
1328  /* Texture slots. */
1329  for (MTex *mtex : particle_settings->mtex) {
1330  if (mtex == nullptr || mtex->tex == nullptr) {
1331  continue;
1332  }
1333  build_texture(mtex->tex);
1334  }
1335 }
1336 
1337 /* Shapekeys */
1339 {
1340  if (built_map_.checkIsBuiltAndTag(key)) {
1341  return;
1342  }
1344  build_animdata(&key->id);
1345  build_parameters(&key->id);
1346  /* This is an exit operation for the entire key datablock, is what is used
1347  * as dependency for modifiers evaluation. */
1349  /* Create per-key block properties, allowing tricky inter-dependencies for
1350  * drivers evaluation. */
1351  LISTBASE_FOREACH (KeyBlock *, key_block, &key->block) {
1353  &key->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL, nullptr, key_block->name);
1354  }
1355 }
1356 
1357 /* ObData Geometry Evaluation */
1358 // XXX: what happens if the datablock is shared!
1359 void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_object_visible)
1360 {
1361  OperationNode *op_node;
1362  Scene *scene_cow = get_cow_datablock(scene_);
1363  Object *object_cow = get_cow_datablock(object);
1364  /* Entry operation, takes care of initialization, and some other
1365  * relations which needs to be run prior actual geometry evaluation. */
1367  op_node->set_as_entry();
1368  /* Geometry evaluation. */
1369  op_node = add_operation_node(&object->id,
1372  [scene_cow, object_cow](::Depsgraph *depsgraph) {
1373  BKE_object_eval_uber_data(depsgraph, scene_cow, object_cow);
1374  });
1375  op_node->set_as_exit();
1376  /* Materials. */
1377  build_materials(object->mat, object->totcol);
1378  /* Point caches. */
1379  build_object_pointcache(object);
1380  /* Geometry. */
1381  build_object_data_geometry_datablock((ID *)object->data, is_object_visible);
1382  build_dimensions(object);
1383  /* Batch cache. */
1385  &object->id,
1388  [object_cow](::Depsgraph *depsgraph) { BKE_object_select_update(depsgraph, object_cow); });
1389 }
1390 
1392 {
1393  if (built_map_.checkIsBuiltAndTag(obdata)) {
1394  return;
1395  }
1396  OperationNode *op_node;
1397  /* Make sure we've got an ID node before requesting CoW pointer. */
1398  (void)add_id_node((ID *)obdata);
1399  ID *obdata_cow = get_cow_id(obdata);
1400  build_idproperties(obdata->properties);
1401  /* Animation. */
1402  build_animdata(obdata);
1403  /* ShapeKeys */
1404  Key *key = BKE_key_from_id(obdata);
1405  if (key) {
1406  build_shapekeys(key);
1407  }
1408  /* Nodes for result of obdata's evaluation, and geometry
1409  * evaluation on object. */
1410  const ID_Type id_type = GS(obdata->name);
1411  switch (id_type) {
1412  case ID_ME: {
1413  op_node = add_operation_node(obdata,
1416  [obdata_cow](::Depsgraph *depsgraph) {
1417  BKE_mesh_eval_geometry(depsgraph, (Mesh *)obdata_cow);
1418  });
1419  op_node->set_as_entry();
1420  break;
1421  }
1422  case ID_MB: {
1424  op_node->set_as_entry();
1425  break;
1426  }
1427  case ID_CU: {
1428  op_node = add_operation_node(obdata,
1431  [obdata_cow](::Depsgraph *depsgraph) {
1432  BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
1433  });
1434  op_node->set_as_entry();
1435  /* Make sure objects used for bevel.taper are in the graph.
1436  * NOTE: This objects might be not linked to the scene. */
1437  Curve *cu = (Curve *)obdata;
1438  if (cu->bevobj != nullptr) {
1439  build_object(-1, cu->bevobj, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
1440  }
1441  if (cu->taperobj != nullptr) {
1442  build_object(-1, cu->taperobj, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
1443  }
1444  if (cu->textoncurve != nullptr) {
1445  build_object(-1, cu->textoncurve, DEG_ID_LINKED_INDIRECTLY, is_object_visible);
1446  }
1447  break;
1448  }
1449  case ID_LT: {
1450  op_node = add_operation_node(obdata,
1453  [obdata_cow](::Depsgraph *depsgraph) {
1455  });
1456  op_node->set_as_entry();
1457  break;
1458  }
1459 
1460  case ID_GD: {
1461  /* GPencil evaluation operations. */
1462  op_node = add_operation_node(obdata,
1465  [obdata_cow](::Depsgraph *depsgraph) {
1467  (bGPdata *)obdata_cow);
1468  });
1469  op_node->set_as_entry();
1470  break;
1471  }
1472  case ID_HA: {
1474  op_node->set_as_entry();
1475  break;
1476  }
1477  case ID_PT: {
1479  op_node->set_as_entry();
1480  break;
1481  }
1482  case ID_VO: {
1483  /* Volume frame update. */
1484  op_node = add_operation_node(obdata,
1487  [obdata_cow](::Depsgraph *depsgraph) {
1488  BKE_volume_eval_geometry(depsgraph, (Volume *)obdata_cow);
1489  });
1490  op_node->set_as_entry();
1491  break;
1492  }
1493  default:
1494  BLI_assert(!"Should not happen");
1495  break;
1496  }
1498  op_node->set_as_exit();
1499  /* Parameters for driver sources. */
1500  build_parameters(obdata);
1501  /* Batch cache. */
1502  add_operation_node(obdata,
1505  [obdata_cow](::Depsgraph *depsgraph) {
1507  });
1508 }
1509 
1511 {
1512  if (built_map_.checkIsBuiltAndTag(armature)) {
1513  return;
1514  }
1515  build_idproperties(armature->id.properties);
1516  build_animdata(&armature->id);
1517  build_parameters(&armature->id);
1518  /* Make sure pose is up-to-date with armature updates. */
1519  bArmature *armature_cow = (bArmature *)get_cow_id(&armature->id);
1520  add_operation_node(&armature->id,
1523  [armature_cow](::Depsgraph *depsgraph) {
1524  BKE_armature_refresh_layer_used(depsgraph, armature_cow);
1525  });
1526  build_armature_bones(&armature->bonebase);
1527 }
1528 
1530 {
1531  LISTBASE_FOREACH (Bone *, bone, bones) {
1532  build_idproperties(bone->prop);
1533  build_armature_bones(&bone->childbase);
1534  }
1535 }
1536 
1538 {
1539  if (built_map_.checkIsBuiltAndTag(camera)) {
1540  return;
1541  }
1542  build_idproperties(camera->id.properties);
1543  build_animdata(&camera->id);
1544  build_parameters(&camera->id);
1545  if (camera->dof.focus_object != nullptr) {
1547  }
1548 }
1549 
1551 {
1553  return;
1554  }
1556  build_animdata(&lamp->id);
1558  /* light's nodetree */
1560 
1561  Light *lamp_cow = get_cow_datablock(lamp);
1565  [lamp_cow](::Depsgraph *depsgraph) { BKE_light_eval(depsgraph, lamp_cow); });
1566 }
1567 
1569 {
1570  build_idproperties(socket->prop);
1571 
1572  if (socket->type == SOCK_OBJECT) {
1573  build_id((ID *)((bNodeSocketValueObject *)socket->default_value)->value);
1574  }
1575  else if (socket->type == SOCK_IMAGE) {
1576  build_id((ID *)((bNodeSocketValueImage *)socket->default_value)->value);
1577  }
1578  else if (socket->type == SOCK_COLLECTION) {
1579  build_id((ID *)((bNodeSocketValueCollection *)socket->default_value)->value);
1580  }
1581 }
1582 
1584 {
1585  if (ntree == nullptr) {
1586  return;
1587  }
1589  return;
1590  }
1591  /* nodetree itself */
1592  add_id_node(&ntree->id);
1593  /* General parameters. */
1596  /* Animation, */
1597  build_animdata(&ntree->id);
1598  /* Shading update. */
1601  /* nodetree's nodes... */
1602  LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
1603  build_idproperties(bnode->prop);
1604  LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) {
1605  build_nodetree_socket(socket);
1606  }
1607  LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->outputs) {
1608  build_nodetree_socket(socket);
1609  }
1610 
1611  ID *id = bnode->id;
1612  if (id == nullptr) {
1613  continue;
1614  }
1615  ID_Type id_type = GS(id->name);
1616  if (id_type == ID_MA) {
1617  build_material((Material *)id);
1618  }
1619  else if (id_type == ID_TE) {
1620  build_texture((Tex *)id);
1621  }
1622  else if (id_type == ID_IM) {
1623  build_image((Image *)id);
1624  }
1625  else if (id_type == ID_OB) {
1626  /* TODO(sergey): Use visibility of owner of the node tree. */
1627  build_object(-1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, true);
1628  }
1629  else if (id_type == ID_SCE) {
1630  Scene *node_scene = (Scene *)id;
1631  build_scene_parameters(node_scene);
1632  /* Camera is used by defocus node.
1633  *
1634  * On the one hand it's annoying to always pull it in, but on another hand it's also annoying
1635  * to have hardcoded node-type exception here. */
1636  if (node_scene->camera != nullptr) {
1637  /* TODO(sergey): Use visibility of owner of the node tree. */
1638  build_object(-1, node_scene->camera, DEG_ID_LINKED_INDIRECTLY, true);
1639  }
1640  }
1641  else if (id_type == ID_TXT) {
1642  /* Ignore script nodes. */
1643  }
1644  else if (id_type == ID_MSK) {
1645  build_mask((Mask *)id);
1646  }
1647  else if (id_type == ID_MC) {
1648  build_movieclip((MovieClip *)id);
1649  }
1650  else if (ELEM(bnode->type, NODE_GROUP, NODE_CUSTOM_GROUP)) {
1651  bNodeTree *group_ntree = (bNodeTree *)id;
1652  build_nodetree(group_ntree);
1653  }
1654  else {
1655  BLI_assert(!"Unknown ID type used for node");
1656  }
1657  }
1658 
1659  LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->inputs) {
1660  build_idproperties(socket->prop);
1661  }
1662  LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->outputs) {
1663  build_idproperties(socket->prop);
1664  }
1665 
1666  // TODO: link from nodetree to owner_component?
1667 }
1668 
1669 /* Recursively build graph for material */
1671 {
1673  return;
1674  }
1675  /* Material itself. */
1676  add_id_node(&material->id);
1677  Material *material_cow = get_cow_datablock(material);
1678  /* Shading update. */
1680  &material->id,
1683  [material_cow](::Depsgraph *depsgraph) { BKE_material_eval(depsgraph, material_cow); });
1685  /* Material animation. */
1688  /* Material's nodetree. */
1690 }
1691 
1692 void DepsgraphNodeBuilder::build_materials(Material **materials, int num_materials)
1693 {
1694  for (int i = 0; i < num_materials; i++) {
1695  if (materials[i] == nullptr) {
1696  continue;
1697  }
1698  build_material(materials[i]);
1699  }
1700 }
1701 
1702 /* Recursively build graph for texture */
1704 {
1706  return;
1707  }
1708  /* Texture itself. */
1709  add_id_node(&texture->id);
1710  build_idproperties(texture->id.properties);
1711  build_animdata(&texture->id);
1712  build_parameters(&texture->id);
1713  /* Texture's nodetree. */
1714  build_nodetree(texture->nodetree);
1715  /* Special cases for different IDs which texture uses. */
1716  if (texture->type == TEX_IMAGE) {
1717  if (texture->ima != nullptr) {
1718  build_image(texture->ima);
1719  }
1720  }
1723 }
1724 
1726 {
1727  if (built_map_.checkIsBuiltAndTag(image)) {
1728  return;
1729  }
1730  build_parameters(&image->id);
1734 }
1735 
1737 {
1738  if (built_map_.checkIsBuiltAndTag(cache_file)) {
1739  return;
1740  }
1741  ID *cache_file_id = &cache_file->id;
1742  add_id_node(cache_file_id);
1743  CacheFile *cache_file_cow = get_cow_datablock(cache_file);
1744  build_idproperties(cache_file_id->properties);
1745  /* Animation, */
1746  build_animdata(cache_file_id);
1747  build_parameters(cache_file_id);
1748  /* Cache evaluation itself. */
1749  add_operation_node(cache_file_id,
1752  [bmain = bmain_, cache_file_cow](::Depsgraph *depsgraph) {
1753  BKE_cachefile_eval(bmain, depsgraph, cache_file_cow);
1754  });
1755 }
1756 
1758 {
1760  return;
1761  }
1762  ID *mask_id = &mask->id;
1763  Mask *mask_cow = (Mask *)ensure_cow_id(mask_id);
1764  build_idproperties(mask->id.properties);
1765  /* F-Curve based animation. */
1766  build_animdata(mask_id);
1767  build_parameters(mask_id);
1768  /* Animation based on mask's shapes. */
1770  mask_id,
1773  [mask_cow](::Depsgraph *depsgraph) { BKE_mask_eval_animation(depsgraph, mask_cow); });
1774  /* Final mask evaluation. */
1777  BKE_mask_eval_update(depsgraph, mask_cow);
1778  });
1779  /* Build parents. */
1780  LISTBASE_FOREACH (MaskLayer *, mask_layer, &mask->masklayers) {
1781  LISTBASE_FOREACH (MaskSpline *, spline, &mask_layer->splines) {
1782  for (int i = 0; i < spline->tot_point; i++) {
1783  MaskSplinePoint *point = &spline->points[i];
1784  MaskParent *parent = &point->parent;
1785  if (parent == nullptr || parent->id == nullptr) {
1786  continue;
1787  }
1788  build_id(parent->id);
1789  }
1790  }
1791  }
1792 }
1793 
1795 {
1797  return;
1798  }
1799 
1800  ID *linestyle_id = &linestyle->id;
1801  build_parameters(linestyle_id);
1803  build_animdata(linestyle_id);
1805 }
1806 
1808 {
1809  if (built_map_.checkIsBuiltAndTag(clip)) {
1810  return;
1811  }
1812  ID *clip_id = &clip->id;
1813  MovieClip *clip_cow = (MovieClip *)ensure_cow_id(clip_id);
1814  build_idproperties(clip_id->properties);
1815  /* Animation. */
1816  build_animdata(clip_id);
1817  build_parameters(clip_id);
1818  /* Movie clip evaluation. */
1819  add_operation_node(clip_id,
1822  [bmain = bmain_, clip_cow](::Depsgraph *depsgraph) {
1823  BKE_movieclip_eval_update(depsgraph, bmain, clip_cow);
1824  });
1825 
1826  add_operation_node(clip_id,
1829  [clip_cow](::Depsgraph *depsgraph) {
1831  });
1832 }
1833 
1835 {
1836  if (built_map_.checkIsBuiltAndTag(probe)) {
1837  return;
1838  }
1839  /* Placeholder so we can add relations and tag ID node for update. */
1842  build_animdata(&probe->id);
1843  build_parameters(&probe->id);
1844 }
1845 
1847 {
1848  if (built_map_.checkIsBuiltAndTag(speaker)) {
1849  return;
1850  }
1851  /* Placeholder so we can add relations and tag ID node for update. */
1853  build_idproperties(speaker->id.properties);
1854  build_animdata(&speaker->id);
1855  build_parameters(&speaker->id);
1856  if (speaker->sound != nullptr) {
1857  build_sound(speaker->sound);
1858  }
1859 }
1860 
1862 {
1863  if (built_map_.checkIsBuiltAndTag(sound)) {
1864  return;
1865  }
1866  add_id_node(&sound->id);
1867  bSound *sound_cow = get_cow_datablock(sound);
1868  add_operation_node(&sound->id,
1871  [bmain = bmain_, sound_cow](::Depsgraph *depsgraph) {
1872  BKE_sound_evaluate(depsgraph, bmain, sound_cow);
1873  });
1875  build_animdata(&sound->id);
1876  build_parameters(&sound->id);
1877 }
1878 
1880 {
1882  return;
1883  }
1889 
1890  Simulation *simulation_cow = get_cow_datablock(simulation);
1891  Scene *scene_cow = get_cow_datablock(scene_);
1892 
1896  [scene_cow, simulation_cow](::Depsgraph *depsgraph) {
1897  BKE_simulation_data_update(depsgraph, scene_cow, simulation_cow);
1898  });
1899 }
1900 
1902 {
1903  if (scene->ed == nullptr) {
1904  return;
1905  }
1907  return;
1908  }
1910  Scene *scene_cow = get_cow_datablock(scene);
1914  [scene_cow](::Depsgraph *depsgraph) {
1915  BKE_scene_eval_sequencer_sequences(depsgraph, scene_cow);
1916  });
1917  /* Make sure data for sequences is in the graph. */
1918  Sequence *seq;
1919  SEQ_ALL_BEGIN (scene->ed, seq) {
1920  build_idproperties(seq->prop);
1921  if (seq->sound != nullptr) {
1922  build_sound(seq->sound);
1923  }
1924  if (seq->scene != nullptr) {
1926  }
1927  if (seq->type == SEQ_TYPE_SCENE && seq->scene != nullptr) {
1928  if (seq->flag & SEQ_SCENE_STRIPS) {
1930  }
1931  ViewLayer *sequence_view_layer = BKE_view_layer_default_render(seq->scene);
1932  build_scene_speakers(seq->scene, sequence_view_layer);
1933  }
1934  /* TODO(sergey): Movie clip, scene, camera, mask. */
1935  }
1936  SEQ_ALL_END;
1937 }
1938 
1940 {
1942  return;
1943  }
1944 
1945  OperationNode *audio_entry_node = add_operation_node(
1947  audio_entry_node->set_as_entry();
1948 
1950 
1951  Scene *scene_cow = get_cow_datablock(scene);
1955  [scene_cow](::Depsgraph *depsgraph) {
1956  BKE_scene_update_tag_audio_volume(depsgraph, scene_cow);
1957  });
1958 }
1959 
1961 {
1962  LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
1963  Object *object = base->object;
1964  if (object->type != OB_SPEAKER || !need_pull_base_into_graph(base)) {
1965  continue;
1966  }
1967  /* NOTE: Can not use base because it does not belong to a current view layer. */
1968  build_object(-1, base->object, DEG_ID_LINKED_INDIRECTLY, true);
1969  }
1970 }
1971 
1972 /* **** ID traversal callbacks functions **** */
1973 
1975  struct Object * /*object*/,
1976  struct ID **idpoin,
1977  int /*cb_flag*/)
1978 {
1980  ID *id = *idpoin;
1981  if (id == nullptr) {
1982  return;
1983  }
1984  switch (GS(id->name)) {
1985  case ID_OB:
1986  /* Special case for object, so we take owner visibility into
1987  * account. */
1988  data->builder->build_object(
1989  -1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, data->is_parent_visible);
1990  break;
1991  default:
1992  data->builder->build_id(id);
1993  break;
1994  }
1995 }
1996 
1998  ID **idpoin,
1999  bool /*is_reference*/,
2000  void *user_data)
2001 {
2003  ID *id = *idpoin;
2004  if (id == nullptr) {
2005  return;
2006  }
2007  switch (GS(id->name)) {
2008  case ID_OB:
2009  /* Special case for object, so we take owner visibility into
2010  * account. */
2011  data->builder->build_object(
2012  -1, (Object *)id, DEG_ID_LINKED_INDIRECTLY, data->is_parent_visible);
2013  break;
2014  default:
2015  data->builder->build_id(id);
2016  break;
2017  }
2018 }
2019 
2020 } // namespace blender::deg
Blender kernel action and pose functionality.
struct AnimData * BKE_animdata_from_id(struct ID *id)
Definition: anim_data.c:96
void BKE_animsys_eval_animdata(struct Depsgraph *depsgraph, struct ID *id)
Definition: anim_sys.c:3038
void BKE_animsys_eval_driver(struct Depsgraph *depsgraph, struct ID *id, int driver_index, struct FCurve *fcu_orig)
Definition: anim_sys.c:3072
void BKE_cachefile_eval(struct Main *bmain, struct Depsgraph *depsgraph, struct CacheFile *cache_file)
Definition: cachefile.c:272
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
void BKE_constraints_id_loop(struct ListBase *list, ConstraintIDFunc func, void *userdata)
Definition: constraint.c:5680
void BKE_curve_eval_geometry(struct Depsgraph *depsgraph, struct Curve *curve)
Definition: curve.c:5600
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
void BKE_gpencil_frame_active_set(struct Depsgraph *depsgraph, struct bGPdata *gpd)
void void BKE_gpencil_modifiers_foreach_ID_link(struct Object *ob, GreasePencilIDWalkFunc walk, void *userData)
void IDP_foreach_property(struct IDProperty *id_property_root, const int type_filter, IDPForeachPropertyCallback callback, void *user_data)
Definition: idprop.c:1072
void BKE_image_user_id_eval_animation(struct Depsgraph *depsgraph, struct ID *id)
Definition: image.c:5440
bool BKE_image_user_id_has_animation(struct ID *id)
Definition: image.c:5413
struct Key * BKE_key_from_id(struct ID *id)
Definition: key.c:1786
void BKE_lattice_eval_geometry(struct Depsgraph *depsgraph, struct Lattice *latt)
struct ViewLayer * BKE_view_layer_default_render(const struct Scene *scene)
#define MAIN_ID_SESSION_UUID_UNSET
Definition: BKE_lib_id.h:73
General operations, lookup, etc. for blender lights.
void BKE_mask_eval_update(struct Depsgraph *depsgraph, struct Mask *mask)
void BKE_mask_eval_animation(struct Depsgraph *depsgraph, struct Mask *mask)
General operations, lookup, etc. for materials.
struct Material *** BKE_object_material_array_p(struct Object *ob)
Definition: material.c:323
short * BKE_object_material_len_p(struct Object *ob)
Definition: material.c:356
void BKE_mesh_eval_geometry(struct Depsgraph *depsgraph, struct Mesh *mesh)
Definition: mesh.c:2146
void BKE_modifiers_foreach_ID_link(struct Object *ob, IDWalkFunc walk, void *userData)
void BKE_movieclip_eval_update(struct Depsgraph *depsgraph, struct Main *bmain, struct MovieClip *clip)
Definition: movieclip.c:2047
void BKE_movieclip_eval_selection_update(struct Depsgraph *depsgraph, struct MovieClip *clip)
Definition: movieclip.c:2058
#define NODE_CUSTOM_GROUP
Definition: BKE_node.h:876
General operations, lookup, etc. for blender objects.
void BKE_object_data_select_update(struct Depsgraph *depsgraph, struct ID *object_data)
void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, struct Object *object)
bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis)
Definition: pointcache.c:1291
API for Blender-side Rigid Body stuff.
void BKE_shaderfx_foreach_ID_link(struct Object *ob, ShaderFxIDWalkFunc walk, void *userData)
Definition: shader_fx.c:264
Volume datablock.
void BKE_volume_eval_geometry(struct Depsgraph *depsgraph, struct Volume *volume)
Definition: volume.cc:1054
#define BLI_assert(a)
Definition: BLI_assert.h:58
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:124
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
#define ELEM(...)
@ DAG_EVAL_VIEWPORT
Definition: DEG_depsgraph.h:61
@ LIB_TAG_COPIED_ON_WRITE
Definition: DNA_ID.h:565
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:426
@ IDP_ID
Definition: DNA_ID.h:102
@ IDP_TYPE_FILTER_ID
Definition: DNA_ID.h:115
ID_Type
Definition: DNA_ID_enums.h:56
@ ID_WM
Definition: DNA_ID_enums.h:84
@ ID_CA
Definition: DNA_ID_enums.h:68
@ ID_AR
Definition: DNA_ID_enums.h:78
@ ID_MC
Definition: DNA_ID_enums.h:85
@ ID_CF
Definition: DNA_ID_enums.h:90
@ ID_LI
Definition: DNA_ID_enums.h:58
@ ID_TE
Definition: DNA_ID_enums.h:64
@ ID_IM
Definition: DNA_ID_enums.h:65
@ ID_VO
Definition: DNA_ID_enums.h:95
@ ID_WS
Definition: DNA_ID_enums.h:91
@ ID_NT
Definition: DNA_ID_enums.h:80
@ ID_LA
Definition: DNA_ID_enums.h:67
@ ID_KE
Definition: DNA_ID_enums.h:70
@ ID_TXT
Definition: DNA_ID_enums.h:74
@ ID_SO
Definition: DNA_ID_enums.h:76
@ ID_SCE
Definition: DNA_ID_enums.h:57
@ ID_LS
Definition: DNA_ID_enums.h:87
@ ID_MSK
Definition: DNA_ID_enums.h:86
@ ID_GD
Definition: DNA_ID_enums.h:83
@ ID_PAL
Definition: DNA_ID_enums.h:88
@ ID_BR
Definition: DNA_ID_enums.h:81
@ ID_LP
Definition: DNA_ID_enums.h:92
@ ID_HA
Definition: DNA_ID_enums.h:93
@ ID_WO
Definition: DNA_ID_enums.h:71
@ ID_SIM
Definition: DNA_ID_enums.h:96
@ ID_MA
Definition: DNA_ID_enums.h:63
@ ID_AC
Definition: DNA_ID_enums.h:79
@ ID_SCR
Definition: DNA_ID_enums.h:72
@ ID_VF
Definition: DNA_ID_enums.h:73
@ ID_ME
Definition: DNA_ID_enums.h:60
@ ID_IP
Definition: DNA_ID_enums.h:69
@ ID_GR
Definition: DNA_ID_enums.h:77
@ ID_SPK
Definition: DNA_ID_enums.h:75
@ ID_MB
Definition: DNA_ID_enums.h:62
@ ID_LT
Definition: DNA_ID_enums.h:66
@ ID_OB
Definition: DNA_ID_enums.h:59
@ ID_PA
Definition: DNA_ID_enums.h:82
@ ID_PT
Definition: DNA_ID_enums.h:94
@ ID_CU
Definition: DNA_ID_enums.h:61
@ ID_PC
Definition: DNA_ID_enums.h:89
Object groups, one object can be in many groups at once.
@ COLLECTION_RESTRICT_RENDER
@ COLLECTION_RESTRICT_VIEWPORT
@ SOCK_IMAGE
@ SOCK_COLLECTION
@ SOCK_OBJECT
@ PFIELD_TEXTURE
Object is a sort of wrapper for general info.
@ OB_SPEAKER
@ OB_LATTICE
@ OB_MBALL
@ OB_SURF
@ OB_CAMERA
@ OB_FONT
@ OB_ARMATURE
@ OB_LAMP
@ OB_MESH
@ OB_POINTCLOUD
@ OB_HAIR
@ OB_VOLUME
@ OB_CURVE
@ OB_GPENCIL
@ OB_LIGHTPROBE
#define PART_PHYS_KEYED
#define PART_DRAW_OB
#define PART_PHYS_BOIDS
#define PART_DRAW_GR
Types and defines for representing Rigid Body entities.
@ RBO_TYPE_PASSIVE
@ SEQ_SCENE_STRIPS
@ SEQ_TYPE_SCENE
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume TEX_IMAGE
NODE_GROUP
StructRNA RNA_PoseBone
#define SEQ_ALL_END
Definition: SEQ_iterator.h:48
#define SEQ_ALL_BEGIN(ed, _seq)
Definition: SEQ_iterator.h:41
void append(const T &value)
Definition: BLI_vector.hh:438
bool checkIsBuiltAndTag(ID *id, int tag=TAG_COMPLETE)
bool checkIsBuilt(ID *id, int tag=TAG_COMPLETE) const
virtual bool need_pull_base_into_graph(Base *base)
Definition: deg_builder.cc:80
virtual void build_scene_parameters(Scene *scene)
virtual void build_object_data_geometry_datablock(ID *obdata, bool is_object_visible)
virtual void build_scene_sequencer(Scene *scene)
virtual void build_object_data_camera(Object *object)
virtual void build_object_pointcache(Object *object)
static void modifier_walk(void *user_data, struct Object *object, struct ID **idpoin, int cb_flag)
virtual void build_world(World *world)
virtual void build_object(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state, bool is_visible)
virtual void build_object_proxy_group(Object *object, bool is_object_visible)
OperationNode * ensure_operation_node(ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const DepsEvalOperationCb &op=nullptr, const char *name="", int name_tag=-1)
virtual void build_freestyle_linestyle(FreestyleLineStyle *linestyle)
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer)
virtual void build_cachefile(CacheFile *cache_file)
virtual void build_object_instance_collection(Object *object, bool is_object_visible)
virtual void build_object_data_speaker(Object *object)
OperationNode * add_operation_node(ComponentNode *comp_node, OperationCode opcode, const DepsEvalOperationCb &op=nullptr, const char *name="", int name_tag=-1)
virtual void build_particle_settings(ParticleSettings *part)
static void constraint_walk(bConstraint *constraint, ID **idpoin, bool is_reference, void *user_data)
virtual void build_particle_systems(Object *object, bool is_object_visible)
virtual void build_dimensions(Object *object)
virtual void build_armature(bArmature *armature)
virtual void build_scene_audio(Scene *scene)
virtual void build_simulation(Simulation *simulation)
ComponentNode * add_component_node(ID *id, NodeType comp_type, const char *comp_name="")
virtual void build_driver_variables(ID *id, FCurve *fcurve)
virtual void build_action(bAction *action)
virtual void build_animdata_nlastrip_targets(ListBase *strips)
virtual void build_material(Material *ma)
virtual void build_materials(Material **materials, int num_materials)
virtual void build_collection(LayerCollection *from_layer_collection, Collection *collection)
virtual void build_rigidbody(Scene *scene)
virtual void build_object_transform(Object *object)
OperationNode * find_operation_node(ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const char *name="", int name_tag=-1)
virtual void build_movieclip(MovieClip *clip)
Vector< SavedEntryTag > saved_entry_tags_
virtual void build_object_data_light(Object *object)
virtual void build_proxy_rig(Object *object, bool is_object_visible)
virtual void build_rig(Object *object, bool is_object_visible)
virtual void build_image(Image *image)
virtual void build_speaker(Speaker *speaker)
virtual void build_sound(bSound *sound)
DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache)
virtual void build_object_data(Object *object, bool is_object_visible)
virtual void build_object_proxy_from(Object *object, bool is_object_visible)
virtual void build_object_flags(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state)
ID * get_cow_id(const ID *id_orig) const
virtual void build_driver_id_property(ID *id, const char *rna_path)
virtual void build_lightprobe(LightProbe *probe)
virtual void build_nodetree(bNodeTree *ntree)
virtual void build_idproperties(IDProperty *id_property)
virtual void build_camera(Camera *camera)
virtual void build_light(Light *lamp)
virtual void build_armature_bones(ListBase *bones)
virtual void build_driver(ID *id, FCurve *fcurve, int driver_index)
bool has_operation_node(ID *id, NodeType comp_type, const char *comp_name, OperationCode opcode, const char *name="", int name_tag=-1)
virtual void build_object_data_geometry(Object *object, bool is_object_visible)
virtual void build_nodetree_socket(bNodeSocket *socket)
virtual void build_object_data_lightprobe(Object *object)
virtual void build_object_constraints(Object *object)
T * get_cow_datablock(const T *orig) const
virtual void build_object_from_layer(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state)
Depsgraph * graph
const IDNode * id_node
Scene scene
FreestyleLineStyle linestyle
World world
Material material
Simulation simulation
Light lamp
const Depsgraph * depsgraph
void * user_data
bNodeTree * ntree
#define GS(x)
Definition: iris.c:241
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
static void build_idproperties_callback(IDProperty *id_property, void *user_data)
bool deg_copy_on_write_is_needed(const ID *id_orig)
uint64_t IDComponentsMask
Definition: deg_node_id.h:34
eDepsNode_LinkedState_Type
Definition: deg_node_id.h:40
@ DEG_ID_LINKED_INDIRECTLY
Definition: deg_node_id.h:42
@ DEG_ID_LINKED_VIA_SET
Definition: deg_node_id.h:44
bool deg_copy_on_write_is_expanded(const ID *id_cow)
void deg_evaluate_copy_on_write(struct ::Depsgraph *graph, const IDNode *id_node)
void deg_free_copy_on_write_datablock(ID *id_cow)
function< void(struct ::Depsgraph *)> DepsEvalOperationCb
@ DEG_UPDATE_SOURCE_USER_EDIT
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
Definition: rna_access.c:844
bool RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
Definition: rna_access.c:5416
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:122
const char * RNA_property_identifier(const PropertyRNA *prop)
Definition: rna_access.c:1145
bool RNA_property_is_idprop(const PropertyRNA *prop)
Definition: rna_access.c:6706
unsigned int uint32_t
Definition: stdint.h:83
bAction * action
ListBase drivers
ListBase nla_tracks
struct Object * focus_object
struct CameraDOFSettings dof
ListBase variables
struct Object * bevobj
struct Object * textoncurve
struct Object * taperobj
char * rna_path
ChannelDriver * driver
int array_index
struct bNodeTree * nodetree
void * pointer
Definition: DNA_ID.h:63
IDPropertyData data
Definition: DNA_ID.h:80
char type
Definition: DNA_ID.h:71
Definition: DNA_ID.h:273
int tag
Definition: DNA_ID.h:292
IDProperty * properties
Definition: DNA_ID.h:314
unsigned int session_uuid
Definition: DNA_ID.h:312
char name[66]
Definition: DNA_ID.h:283
ID id
Definition: DNA_key_types.h:79
ListBase block
struct bNodeTree * nodetree
void * first
Definition: DNA_listBase.h:47
struct Tex * tex
Definition: BKE_main.h:116
MaskParent parent
struct bNodeTree * nodetree
struct Object * proxy_group
ListBase particlesystem
ListBase constraints
struct Collection * instance_collection
ListBase modifiers
struct Object * proxy_from
ListBase greasepencil_modifiers
struct Material ** mat
struct Object * proxy
struct PartDeflect * pd
ListBase shader_fx
struct Object * parent
void * data
struct Collection * instance_collection
struct MTex * mtex[18]
struct Object * instance_object
struct StructRNA * type
Definition: RNA_types.h:51
void * data
Definition: RNA_types.h:52
struct Object * ob1
struct Object * ob2
struct Collection * constraints
struct Collection * group
struct RigidBodyWorld * rigidbody_world
struct Editing * ed
struct Object * camera
struct Scene * scene
struct bSound * sound
struct IDProperty * prop
struct bNodeTree * nodetree
struct bSound * sound
ListBase object_bases
struct bNodeTree * nodetree
ListBase bonebase
IDProperty * prop
void * default_value
ListBase nodes
ListBase inputs
ListBase outputs
OperationNode * find_operation(OperationIDKey key) const
OperationNode * add_operation(const DepsEvalOperationCb &op, OperationCode opcode, const char *name, int name_tag)
virtual string identifier() const override
ID * get_cow_id(const ID *id_orig) const
Definition: depsgraph.cc:249
IDNode * find_id_node(const ID *id) const
Definition: depsgraph.cc:112
IDNode * add_id_node(ID *id, ID *id_cow_hint=nullptr)
Definition: depsgraph.cc:117
OperationNodes operations
Definition: depsgraph.h:126
eEvaluationMode mode
Definition: depsgraph.h:136
TimeSourceNode * add_time_source()
Definition: depsgraph.cc:93
Set< OperationNode * > entry_tags
Definition: depsgraph.h:120
IDDepsNodes id_nodes
Definition: depsgraph.h:103
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override
virtual string identifier() const override
float max
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
PointerRNA * ptr
Definition: wm_files.c:3157