Changeset View
Changeset View
Standalone View
Standalone View
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
| Show First 20 Lines • Show All 580 Lines • ▼ Show 20 Lines | case ID_WS: | ||||
| BLI_assert(!deg_copy_on_write_is_needed(id_type)); | BLI_assert(!deg_copy_on_write_is_needed(id_type)); | ||||
| build_generic_id(id); | build_generic_id(id); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_generic_id(ID *id) | void DepsgraphRelationBuilder::build_generic_id(ID *id) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(id)) { | if (built_map_.checkIsBuiltAndTag(id)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*id); | |||||
| build_idproperties(id->properties); | build_idproperties(id->properties); | ||||
| build_animdata(id); | build_animdata(id); | ||||
| build_parameters(id); | build_parameters(id); | ||||
| } | } | ||||
| static void build_idproperties_callback(IDProperty *id_property, void *user_data) | static void build_idproperties_callback(IDProperty *id_property, void *user_data) | ||||
| { | { | ||||
| DepsgraphRelationBuilder *builder = reinterpret_cast<DepsgraphRelationBuilder *>(user_data); | DepsgraphRelationBuilder *builder = reinterpret_cast<DepsgraphRelationBuilder *>(user_data); | ||||
| Show All 14 Lines | if (from_layer_collection != nullptr) { | ||||
| /* If we came from layer collection we don't go deeper, view layer | /* If we came from layer collection we don't go deeper, view layer | ||||
| * builder takes care of going deeper. | * builder takes care of going deeper. | ||||
| * | * | ||||
| * NOTE: Do early output before tagging build as done, so possible | * NOTE: Do early output before tagging build as done, so possible | ||||
| * subsequent builds from outside of the layer collection properly | * subsequent builds from outside of the layer collection properly | ||||
| * recurses into all the nested objects and collections. */ | * recurses into all the nested objects and collections. */ | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(collection->id); | |||||
| const bool group_done = built_map_.checkIsBuiltAndTag(collection); | const bool group_done = built_map_.checkIsBuiltAndTag(collection); | ||||
| OperationKey object_transform_final_key(object != nullptr ? &object->id : nullptr, | 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{ | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_collection, | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_object(Object *object) | void DepsgraphRelationBuilder::build_object(Object *object) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(object)) { | if (built_map_.checkIsBuiltAndTag(object)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(object->id); | |||||
| /* 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( | ||||
| ▲ Show 20 Lines • Show All 433 Lines • ▼ Show 20 Lines | OperationKey constraint_op_key(id, | ||||
| OperationCode::TRANSFORM_CONSTRAINTS); | OperationCode::TRANSFORM_CONSTRAINTS); | ||||
| /* Add dependencies for each constraint in turn. */ | /* Add dependencies for each constraint in turn. */ | ||||
| for (bConstraint *con = (bConstraint *)constraints->first; con; con = con->next) { | for (bConstraint *con = (bConstraint *)constraints->first; con; con = con->next) { | ||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | ||||
| /* Invalid constraint type. */ | /* Invalid constraint type. */ | ||||
| if (cti == nullptr) { | if (cti == nullptr) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*con); | |||||
| /* Special case for camera tracking -- it doesn't use targets to | /* Special case for camera tracking -- it doesn't use targets to | ||||
| * define relations. */ | * define relations. */ | ||||
| /* TODO: we can now represent dependencies in a much richer manner, | /* TODO: we can now represent dependencies in a much richer manner, | ||||
| * so review how this is done. */ | * so review how this is done. */ | ||||
| if (ELEM(cti->type, | if (ELEM(cti->type, | ||||
| CONSTRAINT_TYPE_FOLLOWTRACK, | CONSTRAINT_TYPE_FOLLOWTRACK, | ||||
| CONSTRAINT_TYPE_CAMERASOLVER, | CONSTRAINT_TYPE_CAMERASOLVER, | ||||
| CONSTRAINT_TYPE_OBJECTSOLVER)) { | CONSTRAINT_TYPE_OBJECTSOLVER)) { | ||||
| ▲ Show 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_animdata_force(ID *id) | ||||
| add_relation(animation_key, rigidbody_key, "Animation -> Rigid Body"); | add_relation(animation_key, rigidbody_key, "Animation -> Rigid Body"); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_action(bAction *action) | void DepsgraphRelationBuilder::build_action(bAction *action) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(action)) { | if (built_map_.checkIsBuiltAndTag(action)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(action->id); | |||||
| build_idproperties(action->id.properties); | build_idproperties(action->id.properties); | ||||
| if (!BLI_listbase_is_empty(&action->curves)) { | if (!BLI_listbase_is_empty(&action->curves)) { | ||||
| TimeSourceKey time_src_key; | TimeSourceKey time_src_key; | ||||
| ComponentKey animation_key(&action->id, NodeType::ANIMATION); | ComponentKey animation_key(&action->id, NodeType::ANIMATION); | ||||
| add_relation(time_src_key, animation_key, "TimeSrc -> Animation"); | add_relation(time_src_key, animation_key, "TimeSrc -> Animation"); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_dimensions(Object *object) | ||||
| add_relation(transform_key, dimensions_key, "Transform -> Dimensions"); | add_relation(transform_key, dimensions_key, "Transform -> Dimensions"); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_world(World *world) | void DepsgraphRelationBuilder::build_world(World *world) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(world)) { | if (built_map_.checkIsBuiltAndTag(world)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(world->id); | |||||
| build_idproperties(world->id.properties); | build_idproperties(world->id.properties); | ||||
| /* animation */ | /* animation */ | ||||
| build_animdata(&world->id); | build_animdata(&world->id); | ||||
| build_parameters(&world->id); | build_parameters(&world->id); | ||||
| /* Animated / driven parameters (without nodetree). */ | /* Animated / driven parameters (without nodetree). */ | ||||
| OperationKey world_key(&world->id, NodeType::SHADING, OperationCode::WORLD_UPDATE); | OperationKey world_key(&world->id, NodeType::SHADING, OperationCode::WORLD_UPDATE); | ||||
| ComponentKey parameters_key(&world->id, NodeType::PARAMETERS); | ComponentKey parameters_key(&world->id, NodeType::PARAMETERS); | ||||
| ▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_particle_systems(Object *object) | ||||
| add_depends_on_transform_relation(&object->id, obdata_ubereval_key, "Particle Eval"); | add_depends_on_transform_relation(&object->id, obdata_ubereval_key, "Particle Eval"); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part) | void DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(part)) { | if (built_map_.checkIsBuiltAndTag(part)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(part->id); | |||||
| /* Animation data relations. */ | /* Animation data relations. */ | ||||
| build_animdata(&part->id); | build_animdata(&part->id); | ||||
| build_parameters(&part->id); | build_parameters(&part->id); | ||||
| OperationKey particle_settings_init_key( | OperationKey particle_settings_init_key( | ||||
| &part->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_INIT); | &part->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_INIT); | ||||
| OperationKey particle_settings_eval_key( | OperationKey particle_settings_eval_key( | ||||
| &part->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_EVAL); | &part->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_EVAL); | ||||
| OperationKey particle_settings_reset_key( | OperationKey particle_settings_reset_key( | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Shapekeys */ | /* Shapekeys */ | ||||
| void DepsgraphRelationBuilder::build_shapekeys(Key *key) | void DepsgraphRelationBuilder::build_shapekeys(Key *key) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(key)) { | if (built_map_.checkIsBuiltAndTag(key)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(key->id); | |||||
| build_idproperties(key->id.properties); | build_idproperties(key->id.properties); | ||||
| /* Attach animdata to geometry. */ | /* Attach animdata to geometry. */ | ||||
| build_animdata(&key->id); | build_animdata(&key->id); | ||||
| build_parameters(&key->id); | build_parameters(&key->id); | ||||
| /* Connect all blocks properties to the final result evaluation. */ | /* Connect all blocks properties to the final result evaluation. */ | ||||
| ComponentKey geometry_key(&key->id, NodeType::GEOMETRY); | ComponentKey geometry_key(&key->id, NodeType::GEOMETRY); | ||||
| OperationKey parameters_eval_key(&key->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL); | OperationKey parameters_eval_key(&key->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EVAL); | ||||
| LISTBASE_FOREACH (KeyBlock *, key_block, &key->block) { | LISTBASE_FOREACH (KeyBlock *, key_block, &key->block) { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_object_data_geometry(Object *object) | ||||
| /* Modifiers */ | /* Modifiers */ | ||||
| if (object->modifiers.first != nullptr) { | if (object->modifiers.first != nullptr) { | ||||
| ModifierUpdateDepsgraphContext ctx = {}; | ModifierUpdateDepsgraphContext ctx = {}; | ||||
| ctx.scene = scene_; | ctx.scene = scene_; | ||||
| ctx.object = object; | ctx.object = object; | ||||
| LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { | LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { | ||||
| const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); | const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); | ||||
| if (mti->updateDepsgraph) { | if (mti->updateDepsgraph) { | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*md); | |||||
| DepsNodeHandle handle = create_node_handle(obdata_ubereval_key); | DepsNodeHandle handle = create_node_handle(obdata_ubereval_key); | ||||
| ctx.node = reinterpret_cast<::DepsNodeHandle *>(&handle); | ctx.node = reinterpret_cast<::DepsNodeHandle *>(&handle); | ||||
| mti->updateDepsgraph(md, &ctx); | mti->updateDepsgraph(md, &ctx); | ||||
| } | } | ||||
| if (BKE_object_modifier_use_time(scene_, object, md)) { | if (BKE_object_modifier_use_time(scene_, object, md)) { | ||||
| TimeSourceKey time_src_key; | TimeSourceKey time_src_key; | ||||
| add_relation(time_src_key, obdata_ubereval_key, "Time Source"); | add_relation(time_src_key, obdata_ubereval_key, "Time Source"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | add_relation( | ||||
| geom_key, object_select_key, "Object Geometry -> Select Update", RELATION_FLAG_NO_FLUSH); | geom_key, object_select_key, "Object Geometry -> Select Update", RELATION_FLAG_NO_FLUSH); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) | void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(obdata)) { | if (built_map_.checkIsBuiltAndTag(obdata)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(*obdata); | |||||
| build_idproperties(obdata->properties); | build_idproperties(obdata->properties); | ||||
| /* Animation. */ | /* Animation. */ | ||||
| build_animdata(obdata); | build_animdata(obdata); | ||||
| build_parameters(obdata); | build_parameters(obdata); | ||||
| /* ShapeKeys. */ | /* ShapeKeys. */ | ||||
| Key *key = BKE_key_from_id(obdata); | Key *key = BKE_key_from_id(obdata); | ||||
| if (key != nullptr) { | if (key != nullptr) { | ||||
| build_shapekeys(key); | build_shapekeys(key); | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_armature(bArmature *armature) | void DepsgraphRelationBuilder::build_armature(bArmature *armature) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(armature)) { | if (built_map_.checkIsBuiltAndTag(armature)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(armature->id); | |||||
| build_idproperties(armature->id.properties); | build_idproperties(armature->id.properties); | ||||
| build_animdata(&armature->id); | build_animdata(&armature->id); | ||||
| build_parameters(&armature->id); | build_parameters(&armature->id); | ||||
| build_armature_bones(&armature->bonebase); | build_armature_bones(&armature->bonebase); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_armature_bones(ListBase *bones) | void DepsgraphRelationBuilder::build_armature_bones(ListBase *bones) | ||||
| { | { | ||||
| LISTBASE_FOREACH (Bone *, bone, bones) { | LISTBASE_FOREACH (Bone *, bone, bones) { | ||||
| build_idproperties(bone->prop); | build_idproperties(bone->prop); | ||||
| build_armature_bones(&bone->childbase); | build_armature_bones(&bone->childbase); | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_camera(Camera *camera) | void DepsgraphRelationBuilder::build_camera(Camera *camera) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(camera)) { | if (built_map_.checkIsBuiltAndTag(camera)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(camera->id); | |||||
| 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); | ||||
| 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) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(lamp)) { | if (built_map_.checkIsBuiltAndTag(lamp)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(lamp->id); | |||||
| build_idproperties(lamp->id.properties); | build_idproperties(lamp->id.properties); | ||||
| build_animdata(&lamp->id); | build_animdata(&lamp->id); | ||||
| build_parameters(&lamp->id); | build_parameters(&lamp->id); | ||||
| ComponentKey lamp_parameters_key(&lamp->id, NodeType::PARAMETERS); | ComponentKey lamp_parameters_key(&lamp->id, NodeType::PARAMETERS); | ||||
| /* For allowing drivers on lamp properties. */ | /* For allowing drivers on lamp properties. */ | ||||
| ComponentKey shading_key(&lamp->id, NodeType::SHADING); | ComponentKey shading_key(&lamp->id, NodeType::SHADING); | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) | void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) | ||||
| { | { | ||||
| if (ntree == nullptr) { | if (ntree == nullptr) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (built_map_.checkIsBuiltAndTag(ntree)) { | if (built_map_.checkIsBuiltAndTag(ntree)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(ntree->id); | |||||
| build_idproperties(ntree->id.properties); | build_idproperties(ntree->id.properties); | ||||
| build_animdata(&ntree->id); | build_animdata(&ntree->id); | ||||
| build_parameters(&ntree->id); | build_parameters(&ntree->id); | ||||
| OperationKey ntree_output_key(&ntree->id, NodeType::NTREE_OUTPUT, OperationCode::NTREE_OUTPUT); | OperationKey ntree_output_key(&ntree->id, NodeType::NTREE_OUTPUT, OperationCode::NTREE_OUTPUT); | ||||
| /* nodetree's nodes... */ | /* nodetree's nodes... */ | ||||
| LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { | ||||
| build_idproperties(bnode->prop); | build_idproperties(bnode->prop); | ||||
| LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) { | LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) { | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Recursively build graph for material */ | /* Recursively build graph for material */ | ||||
| void DepsgraphRelationBuilder::build_material(Material *material) | void DepsgraphRelationBuilder::build_material(Material *material) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(material)) { | if (built_map_.checkIsBuiltAndTag(material)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(material->id); | |||||
| build_idproperties(material->id.properties); | build_idproperties(material->id.properties); | ||||
| /* animation */ | /* animation */ | ||||
| build_animdata(&material->id); | build_animdata(&material->id); | ||||
| build_parameters(&material->id); | build_parameters(&material->id); | ||||
| /* Animated / driven parameters (without nodetree). */ | /* Animated / driven parameters (without nodetree). */ | ||||
| OperationKey material_key(&material->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE); | OperationKey material_key(&material->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE); | ||||
| ComponentKey parameters_key(&material->id, NodeType::PARAMETERS); | ComponentKey parameters_key(&material->id, NodeType::PARAMETERS); | ||||
| Show All 20 Lines | |||||
| } | } | ||||
| /* Recursively build graph for texture */ | /* Recursively build graph for texture */ | ||||
| void DepsgraphRelationBuilder::build_texture(Tex *texture) | void DepsgraphRelationBuilder::build_texture(Tex *texture) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(texture)) { | if (built_map_.checkIsBuiltAndTag(texture)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(texture->id); | |||||
| /* texture itself */ | /* texture itself */ | ||||
| ComponentKey texture_key(&texture->id, NodeType::GENERIC_DATABLOCK); | ComponentKey texture_key(&texture->id, NodeType::GENERIC_DATABLOCK); | ||||
| build_idproperties(texture->id.properties); | build_idproperties(texture->id.properties); | ||||
| build_animdata(&texture->id); | build_animdata(&texture->id); | ||||
| build_parameters(&texture->id); | build_parameters(&texture->id); | ||||
| /* texture's nodetree */ | /* texture's nodetree */ | ||||
| if (texture->nodetree) { | if (texture->nodetree) { | ||||
| Show All 25 Lines | void DepsgraphRelationBuilder::build_texture(Tex *texture) | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_image(Image *image) | void DepsgraphRelationBuilder::build_image(Image *image) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(image)) { | if (built_map_.checkIsBuiltAndTag(image)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(image->id); | |||||
| build_idproperties(image->id.properties); | build_idproperties(image->id.properties); | ||||
| build_parameters(&image->id); | build_parameters(&image->id); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) | void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(cache_file)) { | if (built_map_.checkIsBuiltAndTag(cache_file)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(cache_file->id); | |||||
| build_idproperties(cache_file->id.properties); | build_idproperties(cache_file->id.properties); | ||||
| /* Animation. */ | /* Animation. */ | ||||
| build_animdata(&cache_file->id); | build_animdata(&cache_file->id); | ||||
| build_parameters(&cache_file->id); | build_parameters(&cache_file->id); | ||||
| if (check_id_has_anim_component(&cache_file->id)) { | if (check_id_has_anim_component(&cache_file->id)) { | ||||
| ComponentKey animation_key(&cache_file->id, NodeType::ANIMATION); | ComponentKey animation_key(&cache_file->id, NodeType::ANIMATION); | ||||
| ComponentKey datablock_key(&cache_file->id, NodeType::CACHE); | ComponentKey datablock_key(&cache_file->id, NodeType::CACHE); | ||||
| add_relation(animation_key, datablock_key, "Datablock Animation"); | add_relation(animation_key, datablock_key, "Datablock Animation"); | ||||
| Show All 13 Lines | void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_mask(Mask *mask) | void DepsgraphRelationBuilder::build_mask(Mask *mask) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(mask)) { | if (built_map_.checkIsBuiltAndTag(mask)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(mask->id); | |||||
| ID *mask_id = &mask->id; | ID *mask_id = &mask->id; | ||||
| build_idproperties(mask_id->properties); | build_idproperties(mask_id->properties); | ||||
| /* F-Curve animation. */ | /* F-Curve animation. */ | ||||
| build_animdata(mask_id); | build_animdata(mask_id); | ||||
| build_parameters(mask_id); | build_parameters(mask_id); | ||||
| /* Own mask animation. */ | /* Own mask animation. */ | ||||
| OperationKey mask_animation_key(mask_id, NodeType::ANIMATION, OperationCode::MASK_ANIMATION); | OperationKey mask_animation_key(mask_id, NodeType::ANIMATION, OperationCode::MASK_ANIMATION); | ||||
| TimeSourceKey time_src_key; | TimeSourceKey time_src_key; | ||||
| Show All 22 Lines | |||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_freestyle_linestyle(FreestyleLineStyle *linestyle) | void DepsgraphRelationBuilder::build_freestyle_linestyle(FreestyleLineStyle *linestyle) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(linestyle)) { | if (built_map_.checkIsBuiltAndTag(linestyle)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(linestyle->id); | |||||
| ID *linestyle_id = &linestyle->id; | ID *linestyle_id = &linestyle->id; | ||||
| build_parameters(linestyle_id); | build_parameters(linestyle_id); | ||||
| build_idproperties(linestyle_id->properties); | build_idproperties(linestyle_id->properties); | ||||
| build_animdata(linestyle_id); | build_animdata(linestyle_id); | ||||
| build_nodetree(linestyle->nodetree); | build_nodetree(linestyle->nodetree); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip) | void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(clip)) { | if (built_map_.checkIsBuiltAndTag(clip)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(clip->id); | |||||
| /* Animation. */ | /* Animation. */ | ||||
| build_idproperties(clip->id.properties); | build_idproperties(clip->id.properties); | ||||
| build_animdata(&clip->id); | build_animdata(&clip->id); | ||||
| build_parameters(&clip->id); | build_parameters(&clip->id); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_lightprobe(LightProbe *probe) | void DepsgraphRelationBuilder::build_lightprobe(LightProbe *probe) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(probe)) { | if (built_map_.checkIsBuiltAndTag(probe)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(probe->id); | |||||
| build_idproperties(probe->id.properties); | build_idproperties(probe->id.properties); | ||||
| build_animdata(&probe->id); | build_animdata(&probe->id); | ||||
| build_parameters(&probe->id); | build_parameters(&probe->id); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_speaker(Speaker *speaker) | void DepsgraphRelationBuilder::build_speaker(Speaker *speaker) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(speaker)) { | if (built_map_.checkIsBuiltAndTag(speaker)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(speaker->id); | |||||
| build_idproperties(speaker->id.properties); | build_idproperties(speaker->id.properties); | ||||
| build_animdata(&speaker->id); | build_animdata(&speaker->id); | ||||
| build_parameters(&speaker->id); | build_parameters(&speaker->id); | ||||
| if (speaker->sound != nullptr) { | if (speaker->sound != nullptr) { | ||||
| build_sound(speaker->sound); | build_sound(speaker->sound); | ||||
| ComponentKey speaker_key(&speaker->id, NodeType::AUDIO); | ComponentKey speaker_key(&speaker->id, NodeType::AUDIO); | ||||
| ComponentKey sound_key(&speaker->sound->id, NodeType::AUDIO); | ComponentKey sound_key(&speaker->sound->id, NodeType::AUDIO); | ||||
| add_relation(sound_key, speaker_key, "Sound -> Speaker"); | add_relation(sound_key, speaker_key, "Sound -> Speaker"); | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_sound(bSound *sound) | void DepsgraphRelationBuilder::build_sound(bSound *sound) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(sound)) { | if (built_map_.checkIsBuiltAndTag(sound)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(sound->id); | |||||
| build_idproperties(sound->id.properties); | build_idproperties(sound->id.properties); | ||||
| build_animdata(&sound->id); | build_animdata(&sound->id); | ||||
| build_parameters(&sound->id); | build_parameters(&sound->id); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_simulation(Simulation *simulation) | void DepsgraphRelationBuilder::build_simulation(Simulation *simulation) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(simulation)) { | if (built_map_.checkIsBuiltAndTag(simulation)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(simulation->id); | |||||
| build_idproperties(simulation->id.properties); | build_idproperties(simulation->id.properties); | ||||
| build_animdata(&simulation->id); | build_animdata(&simulation->id); | ||||
| build_parameters(&simulation->id); | build_parameters(&simulation->id); | ||||
| build_nodetree(simulation->nodetree); | build_nodetree(simulation->nodetree); | ||||
| build_nested_nodetree(&simulation->id, simulation->nodetree); | build_nested_nodetree(&simulation->id, simulation->nodetree); | ||||
| OperationKey simulation_eval_key( | OperationKey simulation_eval_key( | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene) | void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene) | ||||
| { | { | ||||
| if (scene->ed == nullptr) { | if (scene->ed == nullptr) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (built_map_.checkIsBuiltAndTag(scene, BuilderMap::TAG_SCENE_SEQUENCER)) { | if (built_map_.checkIsBuiltAndTag(scene, BuilderMap::TAG_SCENE_SEQUENCER)) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* TODO(sergey): Trace as a scene sequencer. */ | |||||
| build_scene_audio(scene); | build_scene_audio(scene); | ||||
| ComponentKey scene_audio_key(&scene->id, NodeType::AUDIO); | ComponentKey scene_audio_key(&scene->id, NodeType::AUDIO); | ||||
| /* Make sure dependencies from sequences data goes to the sequencer evaluation. */ | /* Make sure dependencies from sequences data goes to the sequencer evaluation. */ | ||||
| ComponentKey sequencer_key(&scene->id, NodeType::SEQUENCER); | ComponentKey sequencer_key(&scene->id, NodeType::SEQUENCER); | ||||
| Seq_build_prop_cb_data cb_data = {this, sequencer_key, false}; | Seq_build_prop_cb_data cb_data = {this, sequencer_key, false}; | ||||
| SEQ_for_each_callback(&scene->ed->seqbase, seq_build_prop_cb, &cb_data); | SEQ_for_each_callback(&scene->ed->seqbase, seq_build_prop_cb, &cb_data); | ||||
| Show All 27 Lines | void DepsgraphRelationBuilder::build_scene_speakers(Scene * /*scene*/, ViewLayer *view_layer) | ||||
| } | } | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_vfont(VFont *vfont) | void DepsgraphRelationBuilder::build_vfont(VFont *vfont) | ||||
| { | { | ||||
| if (built_map_.checkIsBuiltAndTag(vfont)) { | if (built_map_.checkIsBuiltAndTag(vfont)) { | ||||
| return; | return; | ||||
| } | } | ||||
| const BuilderStack::ScopedEntry stack_entry = stack_.trace(vfont->id); | |||||
| build_parameters(&vfont->id); | build_parameters(&vfont->id); | ||||
| build_idproperties(vfont->id.properties); | build_idproperties(vfont->id.properties); | ||||
| } | } | ||||
| void DepsgraphRelationBuilder::build_copy_on_write_relations() | void DepsgraphRelationBuilder::build_copy_on_write_relations() | ||||
| { | { | ||||
| for (IDNode *id_node : graph_->id_nodes) { | for (IDNode *id_node : graph_->id_nodes) { | ||||
| build_copy_on_write_relations(id_node); | build_copy_on_write_relations(id_node); | ||||
| ▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines | |||||