Changeset View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
| Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Lines | case ID_AR: | ||||
| break; | break; | ||||
| case ID_CA: | case ID_CA: | ||||
| build_camera((Camera *)id); | build_camera((Camera *)id); | ||||
| break; | break; | ||||
| case ID_GR: | case ID_GR: | ||||
| build_collection(nullptr, nullptr, (Collection *)id); | build_collection(nullptr, nullptr, (Collection *)id); | ||||
| break; | break; | ||||
| case ID_OB: | case ID_OB: | ||||
| build_object((Object *)id); | build_object((Object *)id, false); | ||||
| break; | break; | ||||
| case ID_KE: | case ID_KE: | ||||
| build_shapekeys((Key *)id); | build_shapekeys((Key *)id); | ||||
| break; | break; | ||||
| case ID_LA: | case ID_LA: | ||||
| build_light((Light *)id); | build_light((Light *)id); | ||||
| break; | break; | ||||
| case ID_LP: | case ID_LP: | ||||
| ▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | OperationKey object_transform_final_key(object != nullptr ? &object->id : nullptr, | ||||
| NodeType::TRANSFORM, | NodeType::TRANSFORM, | ||||
| OperationCode::TRANSFORM_FINAL); | OperationCode::TRANSFORM_FINAL); | ||||
| ComponentKey duplicator_key(object != nullptr ? &object->id : nullptr, NodeType::DUPLI); | ComponentKey duplicator_key(object != nullptr ? &object->id : nullptr, NodeType::DUPLI); | ||||
| if (!group_done) { | if (!group_done) { | ||||
| build_idproperties(collection->id.properties); | build_idproperties(collection->id.properties); | ||||
| OperationKey collection_geometry_key{ | OperationKey collection_geometry_key{ | ||||
| &collection->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DONE}; | &collection->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DONE}; | ||||
| LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) { | LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) { | ||||
| build_object(cob->ob); | build_object(cob->ob, false); | ||||
| /* The geometry of a collection depends on the positions of the elements in it. */ | /* The geometry of a collection depends on the positions of the elements in it. */ | ||||
| OperationKey object_transform_key{ | OperationKey object_transform_key{ | ||||
| &cob->ob->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL}; | &cob->ob->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL}; | ||||
| add_relation(object_transform_key, collection_geometry_key, "Collection Geometry"); | add_relation(object_transform_key, collection_geometry_key, "Collection Geometry"); | ||||
| /* Only create geometry relations to child objects, if they have a geometry component. */ | /* Only create geometry relations to child objects, if they have a geometry component. */ | ||||
| OperationKey object_geometry_key{ | OperationKey object_geometry_key{ | ||||
| Show All 31 Lines | FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (collection, ob, graph_->mode) { | ||||
| ComponentKey dupli_geometry_component_key(&ob->id, dupli_geometry_component_type); | ComponentKey dupli_geometry_component_key(&ob->id, dupli_geometry_component_type); | ||||
| add_relation(dupli_geometry_component_key, duplicator_key, "Dupligroup"); | add_relation(dupli_geometry_component_key, duplicator_key, "Dupligroup"); | ||||
| } | } | ||||
| } | } | ||||
| FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END; | FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END; | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_object(Object *object) | void DepsgraphRelationBuilder::build_object(Object *object, | ||||
| const bool base_known_in_current_view_layer) | |||||
| { | { | ||||
| /* Relations from the view layer which is currently being built to the object. | |||||
| * | |||||
| * NOTE: Do it before the tag-and-check since multiple view layers can directly or indirectly | |||||
| * pull object into the dependency graph, and we need to handle all of those cases. */ | |||||
| build_object_current_layer_relations(object, base_known_in_current_view_layer); | |||||
| if (built_map_.checkIsBuiltAndTag(object)) { | if (built_map_.checkIsBuiltAndTag(object)) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* Object Transforms */ | /* Object Transforms */ | ||||
| OperationCode base_op = (object->parent) ? OperationCode::TRANSFORM_PARENT : | OperationCode base_op = (object->parent) ? OperationCode::TRANSFORM_PARENT : | ||||
| OperationCode::TRANSFORM_LOCAL; | OperationCode::TRANSFORM_LOCAL; | ||||
| OperationKey base_op_key(&object->id, NodeType::TRANSFORM, base_op); | OperationKey base_op_key(&object->id, NodeType::TRANSFORM, base_op); | ||||
| OperationKey init_transform_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_INIT); | OperationKey init_transform_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_INIT); | ||||
| OperationKey local_transform_key( | OperationKey local_transform_key( | ||||
| &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_LOCAL); | &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_LOCAL); | ||||
| OperationKey parent_transform_key( | OperationKey parent_transform_key( | ||||
| &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_PARENT); | &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_PARENT); | ||||
| OperationKey transform_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL); | OperationKey transform_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL); | ||||
| OperationKey final_transform_key( | OperationKey final_transform_key( | ||||
| &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL); | &object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_FINAL); | ||||
| OperationKey ob_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL); | OperationKey ob_eval_key(&object->id, NodeType::TRANSFORM, OperationCode::TRANSFORM_EVAL); | ||||
| add_relation(init_transform_key, local_transform_key, "Transform Init"); | add_relation(init_transform_key, local_transform_key, "Transform Init"); | ||||
| /* Various flags, flushing from bases/collections. */ | /* Various flags, flushing from bases/collections. */ | ||||
| build_object_from_layer_relations(object); | build_object_from_layer_component_relations(object); | ||||
| /* Parenting. */ | /* Parenting. */ | ||||
| if (object->parent != nullptr) { | if (object->parent != nullptr) { | ||||
| /* Make sure parent object's relations are built. */ | /* Make sure parent object's relations are built. */ | ||||
| build_object(object->parent); | build_object(object->parent, false); | ||||
| /* Parent relationship. */ | /* Parent relationship. */ | ||||
| build_object_parent(object); | build_object_parent(object); | ||||
| /* Local -> parent. */ | /* Local -> parent. */ | ||||
| add_relation(local_transform_key, parent_transform_key, "ObLocal -> ObParent"); | add_relation(local_transform_key, parent_transform_key, "ObLocal -> ObParent"); | ||||
| } | } | ||||
| /* Modifiers. */ | /* Modifiers. */ | ||||
| if (object->modifiers.first != nullptr) { | if (object->modifiers.first != nullptr) { | ||||
| BuilderWalkUserData data; | BuilderWalkUserData data; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_object(Object *object, | ||||
| /* Synchronization back to original object. */ | /* Synchronization back to original object. */ | ||||
| OperationKey synchronize_key( | OperationKey synchronize_key( | ||||
| &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); | &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); | ||||
| add_relation(final_transform_key, synchronize_key, "Synchronize to Original"); | add_relation(final_transform_key, synchronize_key, "Synchronize to Original"); | ||||
| /* Parameters. */ | /* Parameters. */ | ||||
| build_parameters(&object->id); | build_parameters(&object->id); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_object_from_layer_relations(Object *object) | void DepsgraphRelationBuilder::build_object_current_layer_relations( | ||||
| Object *object, const bool base_known_in_current_view_layer) | |||||
| { | |||||
| /* It is possible to have situation when object is pulled into the dependency graph in many ways: | |||||
| * indirect driver dependency while building "View Layer A", or via base from "View Layer B". | |||||
| * Only add relation from the current view layer to the object's base flag when it is known that | |||||
| * there is a base in the current view layer. | |||||
| * The view layers which do not have base with this object has no affect on the way how object | |||||
sybren: Minor nag: it's unclear in this comment which view layer this depsgraph is built for. Is that… | |||||
Done Inline ActionsGood point. Feel free to either update comment directly or give suggestions for improvements. I've committed the patch since it is green and since it fixes rather annoying bug. sergey: Good point.
This isn't really important which view layer the depsgraph is built for. Whatever… | |||||
| * flags will be calculated. */ | |||||
| if (!base_known_in_current_view_layer) { | |||||
| return; | |||||
Not Done Inline Actionsa base sybren: a base | |||||
| } | |||||
| OperationKey view_layer_done_key( | |||||
| &scene_->id, NodeType::LAYER_COLLECTIONS, OperationCode::VIEW_LAYER_EVAL); | |||||
Not Done Inline Actionstypos (form, has) JacquesLucke: typos (`form`, `has`) | |||||
| OperationKey object_from_layer_entry_key( | |||||
Not Done Inline Actionstypo (ob) JacquesLucke: typo (`ob`) | |||||
| &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_FROM_LAYER_ENTRY); | |||||
Not Done Inline ActionsThe last thing I don't understand yet is how the from every view layer works here. It seems like view_layer_done_key does not depend on the view layer, just on scene_. So isn't this just adding the same relation for every view layer? JacquesLucke: The last thing I don't understand yet is how the `from every view layer` works here. It seems… | |||||
Done Inline ActionsDepsgraph is per-scene per-view layer, so it is not possible to have multiple view layers of the same scene in the dependency graph. This patch will make it so that if multiple view layers from different scenes shares the same object the the relations to the OperationCode::OBJECT_BASE_FLAGS will be correct: they'll be coming from all view layers which are referencing the object. What I'm noticing now is that OperationCode::OBJECT_BASE_FLAGS operation itself is not really ready to handle this situation, but this can/should be solved separately, as the design behind what is the proper thing to do is not clear. I'll list it as a limitation of this patch. sergey: Depsgraph is per-scene per-view layer, so it is not possible to have multiple view layers of… | |||||
Not Done Inline Actionsa base sybren: a base | |||||
| add_relation(view_layer_done_key, object_from_layer_entry_key, "View Layer flags to Object"); | |||||
| } | |||||
| void DepsgraphRelationBuilder::build_object_from_layer_component_relations(Object *object) | |||||
| { | { | ||||
| OperationKey object_from_layer_entry_key( | OperationKey object_from_layer_entry_key( | ||||
| &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_FROM_LAYER_ENTRY); | &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_FROM_LAYER_ENTRY); | ||||
| OperationKey object_from_layer_exit_key( | OperationKey object_from_layer_exit_key( | ||||
| &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_FROM_LAYER_EXIT); | &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_FROM_LAYER_EXIT); | ||||
| OperationKey object_flags_key( | OperationKey object_flags_key( | ||||
| &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_BASE_FLAGS); | &object->id, NodeType::OBJECT_FROM_LAYER, OperationCode::OBJECT_BASE_FLAGS); | ||||
| if (!has_node(object_flags_key)) { | if (!has_node(object_flags_key)) { | ||||
| /* Just connect Entry -> Exit if there is no OBJECT_BASE_FLAGS node. */ | /* Just connect Entry -> Exit if there is no OBJECT_BASE_FLAGS node. */ | ||||
| add_relation(object_from_layer_entry_key, object_from_layer_exit_key, "Object from Layer"); | add_relation(object_from_layer_entry_key, object_from_layer_exit_key, "Object from Layer"); | ||||
| return; | return; | ||||
| } | } | ||||
| /* Entry -> OBJECT_BASE_FLAGS -> Exit */ | /* Entry -> OBJECT_BASE_FLAGS -> Exit */ | ||||
| add_relation(object_from_layer_entry_key, object_flags_key, "Base flags flush Entry"); | add_relation(object_from_layer_entry_key, object_flags_key, "Base flags flush Entry"); | ||||
| add_relation(object_flags_key, object_from_layer_exit_key, "Base flags flush Exit"); | add_relation(object_flags_key, object_from_layer_exit_key, "Base flags flush Exit"); | ||||
| /* Synchronization back to original object. */ | /* Synchronization back to original object. */ | ||||
| OperationKey synchronize_key( | OperationKey synchronize_key( | ||||
| &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); | &object->id, NodeType::SYNCHRONIZATION, OperationCode::SYNCHRONIZE_TO_ORIGINAL); | ||||
| add_relation(object_from_layer_exit_key, synchronize_key, "Synchronize to Original"); | add_relation(object_from_layer_exit_key, synchronize_key, "Synchronize to Original"); | ||||
| OperationKey view_layer_done_key( | |||||
| &scene_->id, NodeType::LAYER_COLLECTIONS, OperationCode::VIEW_LAYER_EVAL); | |||||
| add_relation(view_layer_done_key, object_from_layer_entry_key, "View Layer flags to Object"); | |||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_object_data(Object *object) | void DepsgraphRelationBuilder::build_object_data(Object *object) | ||||
| { | { | ||||
| if (object->data == nullptr) { | if (object->data == nullptr) { | ||||
| return; | return; | ||||
| } | } | ||||
| ID *obdata_id = (ID *)object->data; | ID *obdata_id = (ID *)object->data; | ||||
| ▲ Show 20 Lines • Show All 1,098 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { | ||||
| } | } | ||||
| /* Keyed particle targets. */ | /* Keyed particle targets. */ | ||||
| if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) { | if (ELEM(part->phystype, PART_PHYS_KEYED, PART_PHYS_BOIDS)) { | ||||
| LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) { | LISTBASE_FOREACH (ParticleTarget *, particle_target, &psys->targets) { | ||||
| if (ELEM(particle_target->ob, nullptr, object)) { | if (ELEM(particle_target->ob, nullptr, object)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Make sure target object is pulled into the graph. */ | /* Make sure target object is pulled into the graph. */ | ||||
| build_object(particle_target->ob); | build_object(particle_target->ob, false); | ||||
| /* Use geometry component, since that's where particles are | /* Use geometry component, since that's where particles are | ||||
| * actually evaluated. */ | * actually evaluated. */ | ||||
| ComponentKey target_key(&particle_target->ob->id, NodeType::GEOMETRY); | ComponentKey target_key(&particle_target->ob->id, NodeType::GEOMETRY); | ||||
| add_relation(target_key, psys_key, "Keyed Target"); | add_relation(target_key, psys_key, "Keyed Target"); | ||||
| } | } | ||||
| } | } | ||||
| /* Visualization. */ | /* Visualization. */ | ||||
| switch (part->ren_as) { | switch (part->ren_as) { | ||||
| case PART_DRAW_OB: | case PART_DRAW_OB: | ||||
| if (part->instance_object != nullptr) { | if (part->instance_object != nullptr) { | ||||
| /* Make sure object's relations are all built. */ | /* Make sure object's relations are all built. */ | ||||
| build_object(part->instance_object); | build_object(part->instance_object, false); | ||||
| /* Build relation for the particle visualization. */ | /* Build relation for the particle visualization. */ | ||||
| build_particle_system_visualization_object(object, psys, part->instance_object); | build_particle_system_visualization_object(object, psys, part->instance_object); | ||||
| } | } | ||||
| break; | break; | ||||
| case PART_DRAW_GR: | case PART_DRAW_GR: | ||||
| if (part->instance_collection != nullptr) { | if (part->instance_collection != nullptr) { | ||||
| build_collection(nullptr, nullptr, part->instance_collection); | build_collection(nullptr, nullptr, part->instance_collection); | ||||
| LISTBASE_FOREACH (CollectionObject *, go, &part->instance_collection->gobject) { | LISTBASE_FOREACH (CollectionObject *, go, &part->instance_collection->gobject) { | ||||
| ▲ Show 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | case ID_MB: | ||||
| break; | break; | ||||
| case ID_CU_LEGACY: { | case ID_CU_LEGACY: { | ||||
| Curve *cu = (Curve *)obdata; | Curve *cu = (Curve *)obdata; | ||||
| if (cu->bevobj != nullptr) { | if (cu->bevobj != nullptr) { | ||||
| ComponentKey bevob_geom_key(&cu->bevobj->id, NodeType::GEOMETRY); | ComponentKey bevob_geom_key(&cu->bevobj->id, NodeType::GEOMETRY); | ||||
| add_relation(bevob_geom_key, obdata_geom_eval_key, "Curve Bevel Geometry"); | add_relation(bevob_geom_key, obdata_geom_eval_key, "Curve Bevel Geometry"); | ||||
| ComponentKey bevob_key(&cu->bevobj->id, NodeType::TRANSFORM); | ComponentKey bevob_key(&cu->bevobj->id, NodeType::TRANSFORM); | ||||
| add_relation(bevob_key, obdata_geom_eval_key, "Curve Bevel Transform"); | add_relation(bevob_key, obdata_geom_eval_key, "Curve Bevel Transform"); | ||||
| build_object(cu->bevobj); | build_object(cu->bevobj, false); | ||||
| } | } | ||||
| if (cu->taperobj != nullptr) { | if (cu->taperobj != nullptr) { | ||||
| ComponentKey taperob_key(&cu->taperobj->id, NodeType::GEOMETRY); | ComponentKey taperob_key(&cu->taperobj->id, NodeType::GEOMETRY); | ||||
| add_relation(taperob_key, obdata_geom_eval_key, "Curve Taper"); | add_relation(taperob_key, obdata_geom_eval_key, "Curve Taper"); | ||||
| build_object(cu->taperobj); | build_object(cu->taperobj, false); | ||||
| } | } | ||||
| if (cu->textoncurve != nullptr) { | if (cu->textoncurve != nullptr) { | ||||
| ComponentKey textoncurve_geom_key(&cu->textoncurve->id, NodeType::GEOMETRY); | ComponentKey textoncurve_geom_key(&cu->textoncurve->id, NodeType::GEOMETRY); | ||||
| add_relation(textoncurve_geom_key, obdata_geom_eval_key, "Text on Curve Geometry"); | add_relation(textoncurve_geom_key, obdata_geom_eval_key, "Text on Curve Geometry"); | ||||
| ComponentKey textoncurve_key(&cu->textoncurve->id, NodeType::TRANSFORM); | ComponentKey textoncurve_key(&cu->textoncurve->id, NodeType::TRANSFORM); | ||||
| add_relation(textoncurve_key, obdata_geom_eval_key, "Text on Curve Transform"); | add_relation(textoncurve_key, obdata_geom_eval_key, "Text on Curve Transform"); | ||||
| build_object(cu->textoncurve); | build_object(cu->textoncurve, false); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case ID_LT: | case ID_LT: | ||||
| break; | break; | ||||
| case ID_GD: /* Grease Pencil */ | case ID_GD: /* Grease Pencil */ | ||||
| { | { | ||||
| bGPdata *gpd = (bGPdata *)obdata; | bGPdata *gpd = (bGPdata *)obdata; | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(camera)) { | if (built_map_.checkIsBuiltAndTag(camera)) { | ||||
| return; | return; | ||||
| } | } | ||||
| build_idproperties(camera->id.properties); | build_idproperties(camera->id.properties); | ||||
| build_animdata(&camera->id); | build_animdata(&camera->id); | ||||
| build_parameters(&camera->id); | build_parameters(&camera->id); | ||||
| if (camera->dof.focus_object != nullptr) { | if (camera->dof.focus_object != nullptr) { | ||||
| build_object(camera->dof.focus_object); | build_object(camera->dof.focus_object, false); | ||||
| ComponentKey camera_parameters_key(&camera->id, NodeType::PARAMETERS); | ComponentKey camera_parameters_key(&camera->id, NodeType::PARAMETERS); | ||||
| ComponentKey dof_ob_key(&camera->dof.focus_object->id, NodeType::TRANSFORM); | ComponentKey dof_ob_key(&camera->dof.focus_object->id, NodeType::TRANSFORM); | ||||
| add_relation(dof_ob_key, camera_parameters_key, "Camera DOF"); | add_relation(dof_ob_key, camera_parameters_key, "Camera DOF"); | ||||
| } | } | ||||
| } | } | ||||
| /* Lights */ | /* Lights */ | ||||
| void DepsgraphRelationBuilder::build_light(Light *lamp) | void DepsgraphRelationBuilder::build_light(Light *lamp) | ||||
| Show All 23 Lines | |||||
| void DepsgraphRelationBuilder::build_nodetree_socket(bNodeSocket *socket) | void DepsgraphRelationBuilder::build_nodetree_socket(bNodeSocket *socket) | ||||
| { | { | ||||
| build_idproperties(socket->prop); | build_idproperties(socket->prop); | ||||
| if (socket->type == SOCK_OBJECT) { | if (socket->type == SOCK_OBJECT) { | ||||
| Object *object = ((bNodeSocketValueObject *)socket->default_value)->value; | Object *object = ((bNodeSocketValueObject *)socket->default_value)->value; | ||||
| if (object != nullptr) { | if (object != nullptr) { | ||||
| build_object(object); | build_object(object, false); | ||||
| } | } | ||||
| } | } | ||||
| else if (socket->type == SOCK_IMAGE) { | else if (socket->type == SOCK_IMAGE) { | ||||
| Image *image = ((bNodeSocketValueImage *)socket->default_value)->value; | Image *image = ((bNodeSocketValueImage *)socket->default_value)->value; | ||||
| if (image != nullptr) { | if (image != nullptr) { | ||||
| build_image(image); | build_image(image); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | else if (id_type == ID_TE) { | ||||
| add_relation(texture_key, ntree_output_key, "Texture -> Node"); | add_relation(texture_key, ntree_output_key, "Texture -> Node"); | ||||
| } | } | ||||
| else if (id_type == ID_IM) { | else if (id_type == ID_IM) { | ||||
| build_image((Image *)bnode->id); | build_image((Image *)bnode->id); | ||||
| ComponentKey image_key(id, NodeType::GENERIC_DATABLOCK); | ComponentKey image_key(id, NodeType::GENERIC_DATABLOCK); | ||||
| add_relation(image_key, ntree_output_key, "Image -> Node"); | add_relation(image_key, ntree_output_key, "Image -> Node"); | ||||
| } | } | ||||
| else if (id_type == ID_OB) { | else if (id_type == ID_OB) { | ||||
| build_object((Object *)id); | build_object((Object *)id, false); | ||||
| ComponentKey object_transform_key(id, NodeType::TRANSFORM); | ComponentKey object_transform_key(id, NodeType::TRANSFORM); | ||||
| add_relation(object_transform_key, ntree_output_key, "Object Transform -> Node"); | add_relation(object_transform_key, ntree_output_key, "Object Transform -> Node"); | ||||
| if (object_have_geometry_component(reinterpret_cast<Object *>(id))) { | if (object_have_geometry_component(reinterpret_cast<Object *>(id))) { | ||||
| ComponentKey object_geometry_key(id, NodeType::GEOMETRY); | ComponentKey object_geometry_key(id, NodeType::GEOMETRY); | ||||
| add_relation(object_geometry_key, ntree_output_key, "Object Geometry -> Node"); | add_relation(object_geometry_key, ntree_output_key, "Object Geometry -> Node"); | ||||
| } | } | ||||
| } | } | ||||
| else if (id_type == ID_SCE) { | else if (id_type == ID_SCE) { | ||||
| Scene *node_scene = (Scene *)id; | Scene *node_scene = (Scene *)id; | ||||
| build_scene_parameters(node_scene); | build_scene_parameters(node_scene); | ||||
| /* Camera is used by defocus node. | /* Camera is used by defocus node. | ||||
| * | * | ||||
| * On the one hand it's annoying to always pull it in, but on another hand it's also annoying | * On the one hand it's annoying to always pull it in, but on another hand it's also annoying | ||||
| * to have hardcoded node-type exception here. */ | * to have hardcoded node-type exception here. */ | ||||
| if (node_scene->camera != nullptr) { | if (node_scene->camera != nullptr) { | ||||
| build_object(node_scene->camera); | build_object(node_scene->camera, false); | ||||
| } | } | ||||
| } | } | ||||
| else if (id_type == ID_TXT) { | else if (id_type == ID_TXT) { | ||||
| /* Ignore script nodes. */ | /* Ignore script nodes. */ | ||||
| } | } | ||||
| else if (id_type == ID_MSK) { | else if (id_type == ID_MSK) { | ||||
| build_mask((Mask *)id); | build_mask((Mask *)id); | ||||
| OperationKey mask_key(id, NodeType::PARAMETERS, OperationCode::MASK_EVAL); | OperationKey mask_key(id, NodeType::PARAMETERS, OperationCode::MASK_EVAL); | ||||
| ▲ Show 20 Lines • Show All 347 Lines • ▼ Show 20 Lines | |||||
| void DepsgraphRelationBuilder::build_scene_speakers(Scene * /*scene*/, ViewLayer *view_layer) | void DepsgraphRelationBuilder::build_scene_speakers(Scene * /*scene*/, ViewLayer *view_layer) | ||||
| { | { | ||||
| LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { | LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { | ||||
| Object *object = base->object; | Object *object = base->object; | ||||
| if (object->type != OB_SPEAKER || !need_pull_base_into_graph(base)) { | if (object->type != OB_SPEAKER || !need_pull_base_into_graph(base)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| build_object(base->object); | build_object(base->object, false); | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_vfont(VFont *vfont) | void DepsgraphRelationBuilder::build_vfont(VFont *vfont) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(vfont)) { | if (built_map_.checkIsBuiltAndTag(vfont)) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||
Minor nag: it's unclear in this comment which view layer this depsgraph is built for. Is that "View Layer C"? Or one of the alread-mentioned ones?