a78a636d070d9c82488d71e8315e212f03b06719
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.cc
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2013 Blender Foundation.
19  * All rights reserved.
20  *
21  * Original Author: Joshua Leung
22  * Contributor(s): Based on original depsgraph.c code - Blender Foundation (2005-2013)
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/depsgraph/intern/builder/deg_builder_nodes.cc
28  *  \ingroup depsgraph
29  *
30  * Methods for constructing depsgraph's nodes
31  */
32
33 #include "intern/builder/deg_builder_nodes.h"
34
35 #include <stdio.h>
36 #include <stdlib.h>
37
38 #include "MEM_guardedalloc.h"
39
40 #include "BLI_blenlib.h"
41 #include "BLI_string.h"
42 #include "BLI_utildefines.h"
43
44 extern "C" {
45 #include "DNA_action_types.h"
46 #include "DNA_anim_types.h"
47 #include "DNA_armature_types.h"
48 #include "DNA_cachefile_types.h"
49 #include "DNA_camera_types.h"
50 #include "DNA_constraint_types.h"
51 #include "DNA_curve_types.h"
52 #include "DNA_effect_types.h"
53 #include "DNA_gpencil_types.h"
54 #include "DNA_group_types.h"
55 #include "DNA_key_types.h"
56 #include "DNA_lamp_types.h"
57 #include "DNA_material_types.h"
58 #include "DNA_mask_types.h"
59 #include "DNA_mesh_types.h"
60 #include "DNA_meta_types.h"
61 #include "DNA_movieclip_types.h"
62 #include "DNA_node_types.h"
63 #include "DNA_particle_types.h"
64 #include "DNA_object_types.h"
65 #include "DNA_lightprobe_types.h"
66 #include "DNA_rigidbody_types.h"
67 #include "DNA_scene_types.h"
68 #include "DNA_texture_types.h"
69 #include "DNA_world_types.h"
70
71 #include "BKE_action.h"
72 #include "BKE_armature.h"
73 #include "BKE_animsys.h"
74 #include "BKE_constraint.h"
75 #include "BKE_curve.h"
76 #include "BKE_effect.h"
77 #include "BKE_fcurve.h"
78 #include "BKE_idcode.h"
79 #include "BKE_group.h"
80 #include "BKE_key.h"
81 #include "BKE_lattice.h"
82 #include "BKE_library.h"
83 #include "BKE_main.h"
84 #include "BKE_mask.h"
85 #include "BKE_material.h"
86 #include "BKE_mesh.h"
87 #include "BKE_mball.h"
88 #include "BKE_modifier.h"
89 #include "BKE_movieclip.h"
90 #include "BKE_node.h"
91 #include "BKE_object.h"
92 #include "BKE_particle.h"
93 #include "BKE_rigidbody.h"
94 #include "BKE_sound.h"
95 #include "BKE_texture.h"
96 #include "BKE_tracking.h"
97 #include "BKE_world.h"
98
99 #include "RNA_access.h"
100 #include "RNA_types.h"
101 } /* extern "C" */
102
103 #include "DEG_depsgraph.h"
104 #include "DEG_depsgraph_build.h"
105
106 #include "intern/builder/deg_builder.h"
107 #include "intern/eval/deg_eval_copy_on_write.h"
108 #include "intern/nodes/deg_node.h"
109 #include "intern/nodes/deg_node_component.h"
110 #include "intern/nodes/deg_node_operation.h"
111 #include "intern/depsgraph_types.h"
112 #include "intern/depsgraph_intern.h"
113 #include "util/deg_util_foreach.h"
114
115 namespace DEG {
116
117 namespace {
118
119 struct BuilderWalkUserData {
120         DepsgraphNodeBuilder *builder;
121 };
122
123 static void modifier_walk(void *user_data,
124                           struct Object * /*ob*/,
125                           struct Object **obpoin,
126                           int /*cb_flag*/)
127 {
128         BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
129         if (*obpoin) {
130                 data->builder->build_object(*obpoin, DEG_ID_LINKED_INDIRECTLY);
131         }
132 }
133
134 void constraint_walk(bConstraint * /*con*/,
135                      ID **idpoin,
136                      bool /*is_reference*/,
137                      void *user_data)
138 {
139         BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
140         if (*idpoin) {
141                 ID *id = *idpoin;
142                 if (GS(id->name) == ID_OB) {
143                         data->builder->build_object((Object *)id, DEG_ID_LINKED_INDIRECTLY);
144                 }
145         }
146 }
147
148 void free_copy_on_write_datablock(void *id_v)
149 {
150         ID *id = (ID *)id_v;
151         deg_free_copy_on_write_datablock(id);
152 }
153
154 }  /* namespace */
155
156 /* ************ */
157 /* Node Builder */
158
159 /* **** General purpose functions **** */
160
161 DepsgraphNodeBuilder::DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph)
162     : bmain_(bmain),
163       graph_(graph),
164       scene_(NULL),
165       cow_id_hash_(NULL)
166 {
167 }
168
169 DepsgraphNodeBuilder::~DepsgraphNodeBuilder()
170 {
171         if (cow_id_hash_ != NULL) {
172                 BLI_ghash_free(cow_id_hash_, NULL, free_copy_on_write_datablock);
173         }
174 }
175
176 IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id, bool do_tag)
177 {
178         if (!DEG_depsgraph_use_copy_on_write()) {
179                 return graph_->add_id_node(id);
180         }
181         IDDepsNode *id_node = NULL;
182         ID *id_cow = (ID *)BLI_ghash_lookup(cow_id_hash_, id);
183         if (id_cow != NULL) {
184                 /* TODO(sergey): Is it possible to lookup and pop element from GHash
185                  * at the same time?
186                  */
187                 BLI_ghash_remove(cow_id_hash_, id, NULL, NULL);
188         }
189         id_node = graph_->add_id_node(id, do_tag, id_cow);
190         /* Currently all ID nodes are supposed to have copy-on-write logic.
191          *
192          * NOTE: Zero number of components indicates that ID node was just created.
193          */
194         if (BLI_ghash_size(id_node->components) == 0) {
195                 ComponentDepsNode *comp_cow =
196                         id_node->add_component(DEG_NODE_TYPE_COPY_ON_WRITE);
197                 OperationDepsNode *op_cow = comp_cow->add_operation(
198                         function_bind(deg_evaluate_copy_on_write, _1, graph_, id_node),
199                         DEG_OPCODE_COPY_ON_WRITE,
200                         "", -1);
201                 graph_->operations.push_back(op_cow);
202         }
203         return id_node;
204 }
205
206 IDDepsNode *DepsgraphNodeBuilder::find_id_node(ID *id)
207 {
208         return graph_->find_id_node(id);
209 }
210
211 TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source()
212 {
213         return graph_->add_time_source();
214 }
215
216 ComponentDepsNode *DepsgraphNodeBuilder::add_component_node(
217         ID *id,
218         eDepsNode_Type comp_type,
219         const char *comp_name)
220 {
221         IDDepsNode *id_node = add_id_node(id);
222         ComponentDepsNode *comp_node = id_node->add_component(comp_type, comp_name);
223         comp_node->owner = id_node;
224         return comp_node;
225 }
226
227 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
228         ComponentDepsNode *comp_node,
229         const DepsEvalOperationCb& op,
230         eDepsOperation_Code opcode,
231         const char *name,
232         int name_tag)
233 {
234         OperationDepsNode *op_node = comp_node->has_operation(opcode,
235                                                               name,
236                                                               name_tag);
237         if (op_node == NULL) {
238                 op_node = comp_node->add_operation(op, opcode, name, name_tag);
239                 graph_->operations.push_back(op_node);
240         }
241         else {
242                 fprintf(stderr,
243                         "add_operation: Operation already exists - %s has %s at %p\n",
244                         comp_node->identifier().c_str(),
245                         op_node->identifier().c_str(),
246                         op_node);
247                 BLI_assert(!"Should not happen!");
248         }
249         return op_node;
250 }
251
252 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
253         ID *id,
254         eDepsNode_Type comp_type,
255         const char *comp_name,
256         const DepsEvalOperationCb& op,
257         eDepsOperation_Code opcode,
258         const char *name,
259         int name_tag)
260 {
261         ComponentDepsNode *comp_node = add_component_node(id, comp_type, comp_name);
262         return add_operation_node(comp_node, op, opcode, name, name_tag);
263 }
264
265 OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(
266         ID *id,
267         eDepsNode_Type comp_type,
268         const DepsEvalOperationCb& op,
269         eDepsOperation_Code opcode,
270         const char *name,
271         int name_tag)
272 {
273         return add_operation_node(id,
274                                   comp_type,
275                                   "",
276                                   op,
277                                   opcode,
278                                   name,
279                                   name_tag);
280 }
281
282 bool DepsgraphNodeBuilder::has_operation_node(ID *id,
283                                               eDepsNode_Type comp_type,
284                                               const char *comp_name,
285                                               eDepsOperation_Code opcode,
286                                               const char *name,
287                                               int name_tag)
288 {
289         return find_operation_node(id,
290                                    comp_type,
291                                    comp_name,
292                                    opcode,
293                                    name,
294                                    name_tag) != NULL;
295 }
296
297 OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
298         ID *id,
299         eDepsNode_Type comp_type,
300         const char *comp_name,
301         eDepsOperation_Code opcode,
302         const char *name,
303         int name_tag)
304 {
305         ComponentDepsNode *comp_node = add_component_node(id, comp_type, comp_name);
306         return comp_node->has_operation(opcode, name, name_tag);
307 }
308
309 OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
310         ID *id,
311         eDepsNode_Type comp_type,
312         eDepsOperation_Code opcode,
313         const char *name,
314         int name_tag)
315 {
316         return find_operation_node(id, comp_type, "", opcode, name, name_tag);
317 }
318
319 ID *DepsgraphNodeBuilder::get_cow_id(const ID *id_orig) const
320 {
321         return graph_->get_cow_id(id_orig);
322 }
323
324 ID *DepsgraphNodeBuilder::ensure_cow_id(ID *id_orig)
325 {
326         if (id_orig->tag & LIB_TAG_COPY_ON_WRITE) {
327                 /* ID is already remapped to copy-on-write. */
328                 return id_orig;
329         }
330         IDDepsNode *id_node = add_id_node(id_orig, false);
331         return id_node->id_cow;
332 }
333
334 ID *DepsgraphNodeBuilder::expand_cow_id(IDDepsNode *id_node)
335 {
336         return deg_expand_copy_on_write_datablock(graph_, id_node, this, true);
337 }
338
339 ID *DepsgraphNodeBuilder::expand_cow_id(ID *id_orig)
340 {
341         IDDepsNode *id_node = add_id_node(id_orig);
342         return expand_cow_id(id_node);
343 }
344
345 /* **** Build functions for entity nodes **** */
346
347 void DepsgraphNodeBuilder::begin_build() {
348         /* LIB_TAG_DOIT is used to indicate whether node for given ID was already
349          * created or not. This flag is being set in add_id_node(), so functions
350          * shouldn't bother with setting it, they only might query this flag when
351          * needed.
352          */
353         BKE_main_id_tag_all(bmain_, LIB_TAG_DOIT, false);
354         /* XXX nested node trees are not included in tag-clearing above,
355          * so we need to do this manually.
356          */
357         FOREACH_NODETREE(bmain_, nodetree, id)
358         {
359                 if (id != (ID *)nodetree) {
360                         nodetree->id.tag &= ~LIB_TAG_DOIT;
361                 }
362         }
363         FOREACH_NODETREE_END;
364
365         if (DEG_depsgraph_use_copy_on_write()) {
366                 /* Store existing copy-on-write versions of datablock, so we can re-use
367                  * them for new ID nodes.
368                  */
369                 cow_id_hash_ = BLI_ghash_ptr_new("Depsgraph id hash");
370                 foreach (IDDepsNode *id_node, graph_->id_nodes) {
371                         if (GS(id_node->id_orig->name) != ID_SCE) {
372                                 continue;
373                         }
374                         if (deg_copy_on_write_is_expanded(id_node->id_cow)) {
375                                 BLI_ghash_insert(cow_id_hash_,
376                                                  id_node->id_orig,
377                                                  id_node->id_cow);
378                                 id_node->id_cow = NULL;
379                         }
380                 }
381         }
382
383         /* Make sure graph has no nodes left from previous state. */
384         graph_->clear_all_nodes();
385         graph_->operations.clear();
386         BLI_gset_clear(graph_->entry_tags, NULL);
387 }
388
389 void DepsgraphNodeBuilder::build_group(Group *group)
390 {
391         ID *group_id = &group->id;
392         if (group_id->tag & LIB_TAG_DOIT) {
393                 return;
394         }
395         group_id->tag |= LIB_TAG_DOIT;
396
397         LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
398                 build_object(go->ob, DEG_ID_LINKED_INDIRECTLY);
399         }
400 }
401
402 void DepsgraphNodeBuilder::build_object(Object *ob,
403                                         eDepsNode_LinkedState_Type linked_state)
404 {
405         /* Skip rest of components if the ID node was already there. */
406         if (ob->id.tag & LIB_TAG_DOIT) {
407                 IDDepsNode *id_node = find_id_node(&ob->id);
408                 id_node->linked_state = max(id_node->linked_state, linked_state);
409                 return;
410         }
411         ob->id.tag |= LIB_TAG_DOIT;
412
413         /* Create ID node for object and begin init. */
414         IDDepsNode *id_node = add_id_node(&ob->id);
415         id_node->linked_state = linked_state;
416
417         ob->customdata_mask = 0;
418
419         /* Standard components. */
420         build_object_transform(ob);
421
422         if (ob->parent != NULL) {
423                 build_object(ob->parent, linked_state);
424         }
425         if (ob->modifiers.first != NULL) {
426                 BuilderWalkUserData data;
427                 data.builder = this;
428                 modifiers_foreachObjectLink(ob, modifier_walk, &data);
429         }
430         if (ob->constraints.first != NULL) {
431                 BuilderWalkUserData data;
432                 data.builder = this;
433                 BKE_constraints_id_loop(&ob->constraints, constraint_walk, &data);
434         }
435
436         /* Object data. */
437         if (ob->data != NULL) {
438                 /* type-specific data... */
439                 switch (ob->type) {
440                         case OB_MESH:     /* Geometry */
441                         case OB_CURVE:
442                         case OB_FONT:
443                         case OB_SURF:
444                         case OB_MBALL:
445                         case OB_LATTICE:
446                                 build_obdata_geom(ob);
447                                 /* TODO(sergey): Only for until we support granular
448                                  * update of curves.
449                                  */
450                                 if (ob->type == OB_FONT) {
451                                         Curve *curve = (Curve *)ob->data;
452                                         if (curve->textoncurve) {
453                                                 id_node->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
454                                         }
455                                 }
456                                 break;
457
458                         case OB_ARMATURE: /* Pose */
459                                 if (ID_IS_LINKED(ob) && ob->proxy_from != NULL) {
460                                         build_proxy_rig(ob);
461                                 }
462                                 else {
463                                         build_rig(ob);
464                                 }
465                                 break;
466
467                         case OB_LAMP:   /* Lamp */
468                                 build_lamp(ob);
469                                 break;
470
471                         case OB_CAMERA: /* Camera */
472                                 build_camera(ob);
473                                 break;
474
475                         case OB_LIGHTPROBE:
476                                 build_lightprobe(ob);
477                                 break;
478
479                         default:
480                         {
481                                 ID *obdata = (ID *)ob->data;
482                                 if ((obdata->tag & LIB_TAG_DOIT) == 0) {
483                                         build_animdata(obdata);
484                                 }
485                                 break;
486                         }
487                 }
488         }
489
490         /* Build animation data,
491          *
492          * Do it now because it's possible object data will affect
493          * on object's level animation, for example in case of rebuilding
494          * pose for proxy.
495          */
496         build_animdata(&ob->id);
497
498         /* particle systems */
499         if (ob->particlesystem.first != NULL) {
500                 build_particles(ob);
501         }
502
503         /* Grease pencil. */
504         if (ob->gpd != NULL) {
505                 build_gpencil(ob->gpd);
506         }
507
508         /* Object that this is a proxy for. */
509         if (ob->proxy) {
510                 ob->proxy->proxy_from = ob;
511                 build_object(ob->proxy, DEG_ID_LINKED_INDIRECTLY);
512         }
513
514         /* Object dupligroup. */
515         if (ob->dup_group != NULL) {
516                 build_group(ob->dup_group);
517         }
518 }
519
520 void DepsgraphNodeBuilder::build_object_transform(Object *ob)
521 {
522         OperationDepsNode *op_node;
523         Scene *scene_cow = get_cow_datablock(scene_);
524         Object *ob_cow = get_cow_datablock(ob);
525
526         /* local transforms (from transform channels - loc/rot/scale + deltas) */
527         op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
528                                      function_bind(BKE_object_eval_local_transform,
529                                                    _1,
530                                                    scene_cow,
531                                                    ob_cow),
532                                      DEG_OPCODE_TRANSFORM_LOCAL);
533         op_node->set_as_entry();
534
535         /* object parent */
536         if (ob->parent != NULL) {
537                 add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
538                                    function_bind(BKE_object_eval_parent,
539                                                  _1,
540                                                  scene_cow,
541                                                  ob_cow),
542                                    DEG_OPCODE_TRANSFORM_PARENT);
543         }
544
545         /* object constraints */
546         if (ob->constraints.first != NULL) {
547                 build_object_constraints(ob);
548         }
549
550         /* Rest of transformation update. */
551         add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
552                            function_bind(BKE_object_eval_uber_transform,
553                                          _1,
554                                          scene_cow,
555                                          ob_cow),
556                            DEG_OPCODE_TRANSFORM_OBJECT_UBEREVAL);
557
558         /* object transform is done */
559         op_node = add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
560                                      function_bind(BKE_object_eval_done,
561                                                    _1,
562                                                    ob_cow),
563                                      DEG_OPCODE_TRANSFORM_FINAL);
564         op_node->set_as_exit();
565 }
566
567 /**
568  * Constraints Graph Notes
569  *
570  * For constraints, we currently only add a operation node to the Transform
571  * or Bone components (depending on whichever type of owner we have).
572  * This represents the entire constraints stack, which is for now just
573  * executed as a single monolithic block. At least initially, this should
574  * be sufficient for ensuring that the porting/refactoring process remains
575  * manageable.
576  *
577  * However, when the time comes for developing "node-based" constraints,
578  * we'll need to split this up into pre/post nodes for "constraint stack
579  * evaluation" + operation nodes for each constraint (i.e. the contents
580  * of the loop body used in the current "solve_constraints()" operation).
581  *
582  * -- Aligorith, August 2013
583  */
584 void DepsgraphNodeBuilder::build_object_constraints(Object *ob)
585 {
586         /* create node for constraint stack */
587         add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
588                            function_bind(BKE_object_eval_constraints,
589                                          _1,
590                                          get_cow_datablock(scene_),
591                                          get_cow_datablock(ob)),
592                            DEG_OPCODE_TRANSFORM_CONSTRAINTS);
593 }
594
595 /**
596  * Build graph nodes for AnimData block
597  * \param id: ID-Block which hosts the AnimData
598  */
599 void DepsgraphNodeBuilder::build_animdata(ID *id)
600 {
601         AnimData *adt = BKE_animdata_from_id(id);
602         if (adt == NULL) {
603                 return;
604         }
605
606         /* animation */
607         if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
608                 (void) add_id_node(id);
609                 ID *id_cow = get_cow_id(id);
610
611                 // XXX: Hook up specific update callbacks for special properties which
612                 // may need it...
613
614                 /* actions and NLA - as a single unit for now, as it gets complicated to
615                  * schedule otherwise.
616                  */
617                 if ((adt->action) || (adt->nla_tracks.first)) {
618                         /* create the node */
619                         add_operation_node(id, DEG_NODE_TYPE_ANIMATION,
620                                            function_bind(BKE_animsys_eval_animdata,
621                                                          _1,
622                                                          id_cow),
623                                            DEG_OPCODE_ANIMATION,
624                                            id->name);
625
626                         /* TODO: for each channel affected, we might also want to add some
627                          * support for running RNA update callbacks on them
628                          * (which will be needed for proper handling of drivers later)
629                          */
630                 }
631
632                 /* drivers */
633                 LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) {
634                         /* create driver */
635                         build_driver(id, fcu);
636                 }
637         }
638 }
639
640 /**
641  * Build graph node(s) for Driver
642  * \param id: ID-Block that driver is attached to
643  * \param fcu: Driver-FCurve
644  */
645 OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu)
646 {
647         ID *id_cow = get_cow_id(id);
648
649         /* Create data node for this driver */
650         /* TODO(sergey): Avoid creating same operation multiple times,
651          * in the future we need to avoid lookup of the operation as well
652          * and use some tagging magic instead.
653          */
654         OperationDepsNode *driver_op = find_operation_node(
655                 id,
656                 DEG_NODE_TYPE_PARAMETERS,
657                 DEG_OPCODE_DRIVER,
658                 fcu->rna_path ? fcu->rna_path : "",
659                 fcu->array_index);
660
661         if (driver_op == NULL) {
662                 /* TODO(sergey): Shall we use COW of fcu itself here? */
663                 driver_op = add_operation_node(id,
664                                                DEG_NODE_TYPE_PARAMETERS,
665                                                function_bind(BKE_animsys_eval_driver,
666                                                              _1,
667                                                              id_cow,
668                                                              fcu),
669                                                DEG_OPCODE_DRIVER,
670                                                fcu->rna_path ? fcu->rna_path : "",
671                                                fcu->array_index);
672         }
673
674         /* return driver node created */
675         return driver_op;
676 }
677
678 /* Recursively build graph for world */
679 void DepsgraphNodeBuilder::build_world(World *world)
680 {
681         ID *world_id = &world->id;
682         if (world_id->tag & LIB_TAG_DOIT) {
683                 return;
684         }
685         /* Animation. */
686         build_animdata(world_id);
687         /* world itself */
688         add_operation_node(world_id,
689                            DEG_NODE_TYPE_SHADING,
690                            function_bind(BKE_world_eval,
691                                          _1,
692                                          get_cow_datablock(world)),
693                            DEG_OPCODE_WORLD_UPDATE);
694         /* textures */
695         build_texture_stack(world->mtex);
696         /* world's nodetree */
697         if (world->nodetree != NULL) {
698                 build_nodetree(world->nodetree);
699         }
700 }
701
702 /* Rigidbody Simulation - Scene Level */
703 void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
704 {
705         RigidBodyWorld *rbw = scene->rigidbody_world;
706         Scene *scene_cow = get_cow_datablock(scene);
707
708         /**
709          * Rigidbody Simulation Nodes
710          * ==========================
711          *
712          * There are 3 nodes related to Rigidbody Simulation:
713          * 1) "Initialize/Rebuild World" - this is called sparingly, only when the
714          *    simulation needs to be rebuilt (mainly after file reload, or moving
715          *    back to start frame)
716          * 2) "Do Simulation" - perform a simulation step - interleaved between the
717          *    evaluation steps for clusters of objects (i.e. between those affected
718          *    and/or not affected by the sim for instance).
719          *
720          * 3) "Pull Results" - grab the specific transforms applied for a specific
721          *    object - performed as part of object's transform-stack building.
722          */
723
724         /* Create nodes --------------------------------------------------------- */
725
726         /* XXX: is this the right component, or do we want to use another one
727          * instead?
728          */
729
730         /* init/rebuild operation */
731         /*OperationDepsNode *init_node =*/ add_operation_node(
732                 &scene->id, DEG_NODE_TYPE_TRANSFORM,
733                 function_bind(BKE_rigidbody_rebuild_sim, _1, scene_cow),
734                 DEG_OPCODE_RIGIDBODY_REBUILD);
735
736         /* do-sim operation */
737         // XXX: what happens if we need to split into several groups?
738         OperationDepsNode *sim_node = add_operation_node(
739                 &scene->id, DEG_NODE_TYPE_TRANSFORM,
740                 function_bind(BKE_rigidbody_eval_simulation, _1, scene_cow),
741                 DEG_OPCODE_RIGIDBODY_SIM);
742
743         /* XXX: For now, the sim node is the only one that really matters here.
744          * If any other sims get added later, we may have to remove these hacks...
745          */
746         sim_node->owner->entry_operation = sim_node;
747         sim_node->owner->exit_operation  = sim_node;
748
749         /* objects - simulation participants */
750         if (rbw->group) {
751                 LINKLIST_FOREACH (GroupObject *, go, &rbw->group->gobject) {
752                         Object *ob = go->ob;
753
754                         if (!ob || (ob->type != OB_MESH))
755                                 continue;
756
757                         /* 2) create operation for flushing results */
758                         /* object's transform component - where the rigidbody operation
759                          * lives. */
760                         add_operation_node(&ob->id, DEG_NODE_TYPE_TRANSFORM,
761                                            function_bind(
762                                                    BKE_rigidbody_object_sync_transforms,
763                                                    _1,
764                                                    scene_cow,
765                                                    get_cow_datablock(ob)),
766                                            DEG_OPCODE_RIGIDBODY_TRANSFORM_COPY);
767                 }
768         }
769 }
770
771 void DepsgraphNodeBuilder::build_particles(Object *ob)
772 {
773         /**
774          * Particle Systems Nodes
775          * ======================
776          *
777          * There are two types of nodes associated with representing
778          * particle systems:
779          *  1) Component (EVAL_PARTICLES) - This is the particle-system
780          *     evaluation context for an object. It acts as the container
781          *     for all the nodes associated with a particular set of particle
782          *     systems.
783          *  2) Particle System Eval Operation - This operation node acts as a
784          *     blackbox evaluation step for one particle system referenced by
785          *     the particle systems stack. All dependencies link to this operation.
786          */
787
788         /* component for all particle systems */
789         ComponentDepsNode *psys_comp =
790                 add_component_node(&ob->id, DEG_NODE_TYPE_EVAL_PARTICLES);
791
792         /* TODO(sergey): Need to get COW of PSYS. */
793         Scene *scene_cow = get_cow_datablock(scene_);
794         Object *ob_cow = get_cow_datablock(ob);
795
796         add_operation_node(psys_comp,
797                            function_bind(BKE_particle_system_eval_init,
798                                          _1,
799                                          scene_cow,
800                                          ob_cow),
801                            DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
802
803         /* particle systems */
804         LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
805                 ParticleSettings *part = psys->part;
806
807                 /* Build particle settings operations.
808                  *
809                  * NOTE: The call itself ensures settings are only build once.
810                  */
811                 build_particle_settings(part);
812
813                 /* Update on particle settings change. */
814                 add_operation_node(psys_comp,
815                                    function_bind(BKE_particle_system_settings_eval,
816                                                  _1,
817                                                  psys),
818                                    DEG_OPCODE_PARTICLE_SETTINGS_EVAL,
819                                    psys->name);
820
821                 /* Particle system evaluation. */
822                 add_operation_node(psys_comp,
823                                    NULL,
824                                    DEG_OPCODE_PARTICLE_SYSTEM_EVAL,
825                                    psys->name);
826         }
827
828         /* TODO(sergey): Do we need a point cache operations here? */
829 }
830
831 void DepsgraphNodeBuilder::build_particle_settings(ParticleSettings *part) {
832         ID *part_id = &part->id;
833         if (part_id->tag & LIB_TAG_DOIT) {
834                 return;
835         }
836         part_id->tag |= LIB_TAG_DOIT;
837         /* Animation data. */
838         build_animdata(part_id);
839         /* Parameters change. */
840         add_operation_node(part_id,
841                            DEG_NODE_TYPE_PARAMETERS,
842                            NULL,
843                            DEG_OPCODE_PARTICLE_SETTINGS_EVAL);
844         add_operation_node(part_id,
845                            DEG_NODE_TYPE_PARAMETERS,
846                            function_bind(BKE_particle_system_settings_recalc_clear,
847                                          _1,
848                                          part),
849                            DEG_OPCODE_PARTICLE_SETTINGS_RECALC_CLEAR);
850 }
851
852 void DepsgraphNodeBuilder::build_cloth(Object *object)
853 {
854         Scene *scene_cow = get_cow_datablock(scene_);
855         Object *object_cow = get_cow_datablock(object);
856         add_operation_node(&object->id,
857                            DEG_NODE_TYPE_CACHE,
858                            function_bind(BKE_object_eval_cloth,
859                                          _1,
860                                          scene_cow,
861                                          object_cow),
862                            DEG_OPCODE_GEOMETRY_CLOTH_MODIFIER);
863 }
864
865 /* Shapekeys */
866 void DepsgraphNodeBuilder::build_shapekeys(Key *key)
867 {
868         build_animdata(&key->id);
869         add_operation_node(&key->id,
870                            DEG_NODE_TYPE_GEOMETRY,
871                            NULL,
872                            DEG_OPCODE_GEOMETRY_SHAPEKEY);
873 }
874
875 /* ObData Geometry Evaluation */
876 // XXX: what happens if the datablock is shared!
877 void DepsgraphNodeBuilder::build_obdata_geom(Object *ob)
878 {
879         OperationDepsNode *op_node;
880         Scene *scene_cow = get_cow_datablock(scene_);
881         Object *object_cow = get_cow_datablock(ob);
882
883         /* TODO(sergey): This way using this object's properties as driver target
884          * works fine.
885          *
886          * Does this depend on other nodes?
887          */
888         op_node = add_operation_node(&ob->id,
889                                      DEG_NODE_TYPE_PARAMETERS,
890                                      NULL,
891                                      DEG_OPCODE_PARAMETERS_EVAL);
892         op_node->set_as_exit();
893
894         /* Temporary uber-update node, which does everything.
895          * It is for the being we're porting old dependencies into the new system.
896          * We'll get rid of this node as soon as all the granular update functions
897          * are filled in.
898          *
899          * TODO(sergey): Get rid of this node.
900          */
901         op_node = add_operation_node(&ob->id,
902                                      DEG_NODE_TYPE_GEOMETRY,
903                                      function_bind(BKE_object_eval_uber_data,
904                                                    _1,
905                                                    scene_cow,
906                                                    object_cow),
907                                      DEG_OPCODE_GEOMETRY_UBEREVAL);
908         op_node->set_as_exit();
909
910         op_node = add_operation_node(&ob->id,
911                                      DEG_NODE_TYPE_GEOMETRY,
912                                      NULL,
913                                      DEG_OPCODE_PLACEHOLDER,
914                                      "Eval Init");
915         op_node->set_as_entry();
916
917         // TODO: "Done" operation
918
919         /* Cloyth modifier. */
920         LINKLIST_FOREACH (ModifierData *, md, &ob->modifiers) {
921                 if (md->type == eModifierType_Cloth) {
922                         build_cloth(ob);
923                 }
924         }
925
926         /* materials */
927         if (ob->totcol != 0) {
928                 if (ob->type == OB_MESH) {
929                         add_operation_node(&ob->id,
930                                            DEG_NODE_TYPE_SHADING,
931                                            function_bind(BKE_object_eval_update_shading,
932                                                          _1,
933                                                          object_cow),
934                                            DEG_OPCODE_SHADING);
935                 }
936
937                 for (int a = 1; a <= ob->totcol; a++) {
938                         Material *ma = give_current_material(ob, a);
939                         if (ma != NULL) {
940                                 build_material(ma);
941                         }
942                 }
943         }
944
945         /* geometry collision */
946         if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_LATTICE)) {
947                 // add geometry collider relations
948         }
949
950         ID *obdata = (ID *)ob->data;
951         if (obdata->tag & LIB_TAG_DOIT) {
952                 return;
953         }
954         obdata->tag |= LIB_TAG_DOIT;
955         /* Make sure we've got an ID node before requesting CoW pointer. */
956         (void) add_id_node((ID *)obdata);
957         ID *obdata_cow = get_cow_id(obdata);
958
959         /* ShapeKeys */
960         Key *key = BKE_key_from_object(ob);
961         if (key) {
962                 build_shapekeys(key);
963         }
964
965         build_animdata(obdata);
966
967         /* Nodes for result of obdata's evaluation, and geometry
968          * evaluation on object.
969          */
970         switch (ob->type) {
971                 case OB_MESH:
972                 {
973                         //Mesh *me = (Mesh *)ob->data;
974
975                         /* evaluation operations */
976                         op_node = add_operation_node(obdata,
977                                                      DEG_NODE_TYPE_GEOMETRY,
978                                                      function_bind(BKE_mesh_eval_geometry,
979                                                                    _1,
980                                                                    (Mesh *)obdata_cow),
981                                                      DEG_OPCODE_PLACEHOLDER,
982                                                      "Geometry Eval");
983                         op_node->set_as_entry();
984                         break;
985                 }
986
987                 case OB_MBALL:
988                 {
989                         Object *mom = BKE_mball_basis_find(scene_, ob);
990                         /* NOTE: Only the motherball gets evaluated, it's children are
991                          * having empty placeholders for the correct relations being built.
992                          */
993                         if (mom == ob) {
994                                 /* metaball evaluation operations */
995                                 op_node = add_operation_node(obdata,
996                                                              DEG_NODE_TYPE_GEOMETRY,
997                                                              function_bind(
998                                                                      BKE_mball_eval_geometry,
999                                                                      _1,
1000                                                                      (MetaBall *)obdata_cow),
1001                                                              DEG_OPCODE_PLACEHOLDER,
1002                                                              "Geometry Eval");
1003                         }
1004                         else {
1005                                 op_node = add_operation_node(obdata,
1006                                                              DEG_NODE_TYPE_GEOMETRY,
1007                                                              NULL,
1008                                                              DEG_OPCODE_PLACEHOLDER,
1009                                                              "Geometry Eval");
1010                                 op_node->set_as_entry();
1011                         }
1012                         break;
1013                 }
1014
1015                 case OB_CURVE:
1016                 case OB_SURF:
1017                 case OB_FONT:
1018                 {
1019                         /* Curve/nurms evaluation operations. */
1020                         /* - calculate curve geometry (including path) */
1021                         op_node = add_operation_node(obdata,
1022                                                      DEG_NODE_TYPE_GEOMETRY,
1023                                                      function_bind(BKE_curve_eval_geometry,
1024                                                                    _1,
1025                                                                    (Curve *)obdata_cow),
1026                                                                    DEG_OPCODE_PLACEHOLDER,
1027                                                                    "Geometry Eval");
1028                         op_node->set_as_entry();
1029                         /* Make sure objects used for bevel.taper are in the graph.
1030                          * NOTE: This objects might be not linked to the scene.
1031                          */
1032                         Curve *cu = (Curve *)obdata;
1033                         if (cu->bevobj != NULL) {
1034                                 build_object(cu->bevobj, DEG_ID_LINKED_INDIRECTLY);
1035                         }
1036                         if (cu->taperobj != NULL) {
1037                                 build_object(cu->taperobj, DEG_ID_LINKED_INDIRECTLY);
1038                         }
1039                         if (ob->type == OB_FONT && cu->textoncurve != NULL) {
1040                                 build_object(cu->textoncurve, DEG_ID_LINKED_INDIRECTLY);
1041                         }
1042                         break;
1043                 }
1044
1045                 case OB_LATTICE:
1046                 {
1047                         /* Lattice evaluation operations. */
1048                         op_node = add_operation_node(obdata,
1049                                                      DEG_NODE_TYPE_GEOMETRY,
1050                                                      function_bind(BKE_lattice_eval_geometry,
1051                                                                    _1,
1052                                                                    (Lattice *)obdata_cow),
1053                                                                    DEG_OPCODE_PLACEHOLDER,
1054                                                                    "Geometry Eval");
1055                         op_node->set_as_entry();
1056                         break;
1057                 }
1058         }
1059
1060         op_node = add_operation_node(obdata, DEG_NODE_TYPE_GEOMETRY, NULL,
1061                                      DEG_OPCODE_PLACEHOLDER, "Eval Done");
1062         op_node->set_as_exit();
1063
1064         /* Parameters for driver sources. */
1065         add_operation_node(obdata,
1066                            DEG_NODE_TYPE_PARAMETERS,
1067                            NULL,
1068                            DEG_OPCODE_PARAMETERS_EVAL);
1069 }
1070
1071 /* Cameras */
1072 void DepsgraphNodeBuilder::build_camera(Object *ob)
1073 {
1074         /* Object itself. */
1075         add_operation_node(&ob->id,
1076                            DEG_NODE_TYPE_PARAMETERS,
1077                            NULL,
1078                            DEG_OPCODE_PARAMETERS_EVAL,
1079                            "Camera Parameters");
1080
1081         /* Object data. */
1082         /* TODO: Link scene-camera links in somehow. */
1083         Camera *cam = (Camera *)ob->data;
1084         ID *camera_id = &cam->id;
1085         if (camera_id->tag & LIB_TAG_DOIT) {
1086                 return;
1087         }
1088
1089         build_animdata(&cam->id);
1090
1091         add_operation_node(camera_id,
1092                            DEG_NODE_TYPE_PARAMETERS,
1093                            NULL,
1094                            DEG_OPCODE_PARAMETERS_EVAL);
1095 }
1096
1097 /* Lamps */
1098 void DepsgraphNodeBuilder::build_lamp(Object *ob)
1099 {
1100         /* Object itself. */
1101         add_operation_node(&ob->id,
1102                            DEG_NODE_TYPE_PARAMETERS,
1103                            NULL,
1104                            DEG_OPCODE_PARAMETERS_EVAL,
1105                            "Lamp Parameters");
1106
1107         /* Object data. */
1108         Lamp *la = (Lamp *)ob->data;
1109         ID *lamp_id = &la->id;
1110         if (lamp_id->tag & LIB_TAG_DOIT) {
1111                 return;
1112         }
1113
1114         build_animdata(&la->id);
1115
1116         add_operation_node(lamp_id,
1117                            DEG_NODE_TYPE_PARAMETERS,
1118                            NULL,
1119                            DEG_OPCODE_PARAMETERS_EVAL);
1120
1121         /* lamp's nodetree */
1122         if (la->nodetree) {
1123                 build_nodetree(la->nodetree);
1124         }
1125
1126         /* textures */
1127         build_texture_stack(la->mtex);
1128 }
1129
1130 void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
1131 {
1132         if (ntree == NULL) {
1133                 return;
1134         }
1135         /* nodetree itself */
1136         ID *ntree_id = &ntree->id;
1137         add_id_node(ntree_id);
1138         bNodeTree *ntree_cow = get_cow_datablock(ntree);
1139         /* Animation, */
1140         build_animdata(ntree_id);
1141         /* Shading update. */
1142         add_operation_node(ntree_id,
1143                            DEG_NODE_TYPE_SHADING,
1144                            NULL,
1145                            DEG_OPCODE_MATERIAL_UPDATE);
1146         /* NOTE: We really pass original and CoW node trees here, this is how the
1147          * callback works. Ideally we need to find a better way for that.
1148          */
1149         add_operation_node(ntree_id,
1150                            DEG_NODE_TYPE_SHADING_PARAMETERS,
1151                            function_bind(BKE_nodetree_shading_params_eval,
1152                                          _1,
1153                                          ntree_cow,
1154                                          ntree),
1155                            DEG_OPCODE_MATERIAL_UPDATE);
1156         /* nodetree's nodes... */
1157         LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) {
1158                 ID *id = bnode->id;
1159                 if (id == NULL) {
1160                         continue;
1161                 }
1162                 ID_Type id_type = GS(id->name);
1163                 if (id_type == ID_MA) {
1164                         build_material((Material *)id);
1165                 }
1166                 else if (id_type == ID_TE) {
1167                         build_texture((Tex *)id);
1168                 }
1169                 else if (id_type == ID_IM) {
1170                         build_image((Image *)id);
1171                 }
1172                 else if (id_type == ID_OB) {
1173                         build_object((Object *)id, DEG_ID_LINKED_INDIRECTLY);
1174                 }
1175                 else if (id_type == ID_SCE) {
1176                         /* Scenes are used by compositor trees, and handled by render
1177                          * pipeline. No need to build dependencies for them here.
1178                          */
1179                 }
1180                 else if (bnode->type == NODE_GROUP) {
1181                         bNodeTree *group_ntree = (bNodeTree *)id;
1182                         if ((group_ntree->id.tag & LIB_TAG_DOIT) == 0) {
1183                                 build_nodetree(group_ntree);
1184                         }
1185                 }
1186                 else {
1187                         BLI_assert(!"Unknown ID type used for node");
1188                 }
1189         }
1190
1191         // TODO: link from nodetree to owner_component?
1192 }
1193
1194 /* Recursively build graph for material */
1195 void DepsgraphNodeBuilder::build_material(Material *material)
1196 {
1197         ID *material_id = &material->id;
1198         if (material_id->tag & LIB_TAG_DOIT) {
1199                 return;
1200         }
1201         material_id->tag |= LIB_TAG_DOIT;
1202         /* Material itself. */
1203         add_id_node(material_id);
1204         Material *material_cow = get_cow_datablock(material);
1205         /* Shading update. */
1206         add_operation_node(material_id,
1207                            DEG_NODE_TYPE_SHADING,
1208                            function_bind(BKE_material_eval,
1209                                          _1,
1210                                          material_cow),
1211                            DEG_OPCODE_MATERIAL_UPDATE);
1212         /* Material animation. */
1213         build_animdata(material_id);
1214         /* Textures. */
1215         build_texture_stack(material->mtex);
1216         /* Material's nodetree. */
1217         build_nodetree(material->nodetree);
1218 }
1219
1220 /* Texture-stack attached to some shading datablock */
1221 void DepsgraphNodeBuilder::build_texture_stack(MTex **texture_stack)
1222 {
1223         /* for now assume that all texture-stacks have same number of max items */
1224         for (int i = 0; i < MAX_MTEX; i++) {
1225                 MTex *mtex = texture_stack[i];
1226                 if (mtex && mtex->tex) {
1227                         build_texture(mtex->tex);
1228                 }
1229         }
1230 }
1231
1232 /* Recursively build graph for texture */
1233 void DepsgraphNodeBuilder::build_texture(Tex *tex)
1234 {
1235         ID *tex_id = &tex->id;
1236         if (tex_id->tag & LIB_TAG_DOIT) {
1237                 return;
1238         }
1239         tex_id->tag |= LIB_TAG_DOIT;
1240         /* Texture itself. */
1241         build_animdata(tex_id);
1242         /* Texture's nodetree. */
1243         build_nodetree(tex->nodetree);
1244         /* Special cases for different IDs which texture uses. */
1245         if (tex->type == TEX_IMAGE) {
1246                 if (tex->ima != NULL) {
1247                         build_image(tex->ima);
1248                 }
1249         }
1250 }
1251
1252 void DepsgraphNodeBuilder::build_image(Image *image) {
1253         ID *image_id = &image->id;
1254         if (image_id->tag & LIB_TAG_DOIT) {
1255                 return;
1256         }
1257         image_id->tag |= LIB_TAG_DOIT;
1258         /* Placeholder so we can add relations and tag ID node for update. */
1259         add_operation_node(image_id,
1260                            DEG_NODE_TYPE_PARAMETERS,
1261                            NULL,
1262                            DEG_OPCODE_PLACEHOLDER,
1263                            "Image Eval");
1264 }
1265
1266 void DepsgraphNodeBuilder::build_compositor(Scene *scene)
1267 {
1268         /* For now, just a plain wrapper? */
1269         // TODO: create compositing component?
1270         // XXX: component type undefined!
1271         //graph->get_node(&scene->id, NULL, DEG_NODE_TYPE_COMPOSITING, NULL);
1272
1273         /* for now, nodetrees are just parameters; compositing occurs in internals
1274          * of renderer...
1275          */
1276         add_component_node(&scene->id, DEG_NODE_TYPE_PARAMETERS);
1277         build_nodetree(scene->nodetree);
1278 }
1279
1280 void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
1281 {
1282         ID *gpd_id = &gpd->id;
1283
1284         /* TODO(sergey): what about multiple users of same datablock? This should
1285          * only get added once.
1286          */
1287
1288         /* The main reason Grease Pencil is included here is because the animation
1289          * (and drivers) need to be hosted somewhere.
1290          */
1291         build_animdata(gpd_id);
1292 }
1293
1294 void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
1295 {
1296         ID *cache_file_id = &cache_file->id;
1297         /* Animation, */
1298         build_animdata(cache_file_id);
1299         /* Cache evaluation itself. */
1300         add_operation_node(cache_file_id, DEG_NODE_TYPE_CACHE, NULL,
1301                            DEG_OPCODE_PLACEHOLDER, "Cache File Update");
1302 }
1303
1304 void DepsgraphNodeBuilder::build_mask(Mask *mask)
1305 {
1306         ID *mask_id = &mask->id;
1307         Mask *mask_cow = get_cow_datablock(mask);
1308         /* F-Curve based animation. */
1309         build_animdata(mask_id);
1310         /* Animation based on mask's shapes. */
1311         add_operation_node(mask_id,
1312                            DEG_NODE_TYPE_ANIMATION,
1313                            function_bind(BKE_mask_eval_animation, _1, mask_cow),
1314                            DEG_OPCODE_MASK_ANIMATION);
1315         /* Final mask evaluation. */
1316         add_operation_node(mask_id,
1317                            DEG_NODE_TYPE_PARAMETERS,
1318                            function_bind(BKE_mask_eval_update, _1, mask_cow),
1319                            DEG_OPCODE_MASK_EVAL);
1320 }
1321
1322 void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip)
1323 {
1324         ID *clip_id = &clip->id;
1325         MovieClip *clip_cow = get_cow_datablock(clip);
1326         /* Animation. */
1327         build_animdata(clip_id);
1328         /* Movie clip evaluation. */
1329         add_operation_node(clip_id,
1330                            DEG_NODE_TYPE_PARAMETERS,
1331                            function_bind(BKE_movieclip_eval_update, _1, clip_cow),
1332                            DEG_OPCODE_MOVIECLIP_EVAL);
1333 }
1334
1335 void DepsgraphNodeBuilder::build_lightprobe(Object *object)
1336 {
1337         LightProbe *probe = (LightProbe *)object->data;
1338         ID *probe_id = &probe->id;
1339         if (probe_id->tag & LIB_TAG_DOIT) {
1340                 return;
1341         }
1342         probe_id->tag |= LIB_TAG_DOIT;
1343         /* Placeholder so we can add relations and tag ID node for update. */
1344         add_operation_node(probe_id,
1345                            DEG_NODE_TYPE_PARAMETERS,
1346                            NULL,
1347                            DEG_OPCODE_PLACEHOLDER,
1348                            "LightProbe Eval");
1349         add_operation_node(&object->id,
1350                            DEG_NODE_TYPE_PARAMETERS,
1351                            NULL,
1352                            DEG_OPCODE_PLACEHOLDER,
1353                            "LightProbe Eval");
1354
1355         build_animdata(probe_id);
1356 }
1357
1358 }  // namespace DEG