diff options
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
4 files changed, 64 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 3354f85bf27..524933a5f37 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -65,6 +65,7 @@ extern "C" { #include "DNA_lightprobe_types.h" #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" +#include "DNA_speaker_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" @@ -431,6 +432,9 @@ void DepsgraphNodeBuilder::build_id(ID *id) { case ID_LT: build_object_data_geometry_datablock(id); break; + case ID_SPK: + build_speaker((Speaker *)id); + break; default: fprintf(stderr, "Unhandled ID %s\n", id->name); BLI_assert(!"Should never happen"); @@ -615,6 +619,9 @@ void DepsgraphNodeBuilder::build_object_data(Object *object) case OB_LIGHTPROBE: build_object_data_lightprobe(object); break; + case OB_SPEAKER: + build_object_data_speaker(object); + break; default: { ID *obdata = (ID *)object->data; @@ -648,6 +655,16 @@ void DepsgraphNodeBuilder::build_object_data_lightprobe(Object *object) DEG_OPCODE_LIGHT_PROBE_EVAL); } +void DepsgraphNodeBuilder::build_object_data_speaker(Object *object) +{ + Speaker *speaker = (Speaker *)object->data; + build_speaker(speaker); + add_operation_node(&object->id, + DEG_NODE_TYPE_PARAMETERS, + NULL, + DEG_OPCODE_SPEAKER_EVAL); +} + void DepsgraphNodeBuilder::build_object_transform(Object *object) { OperationDepsNode *op_node; @@ -1464,6 +1481,19 @@ void DepsgraphNodeBuilder::build_lightprobe(LightProbe *probe) build_animdata(&probe->id); } +void DepsgraphNodeBuilder::build_speaker(Speaker *speaker) +{ + if (built_map_.checkIsBuiltAndTag(speaker)) { + return; + } + /* Placeholder so we can add relations and tag ID node for update. */ + add_operation_node(&speaker->id, + DEG_NODE_TYPE_PARAMETERS, + NULL, + DEG_OPCODE_SPEAKER_EVAL); + build_animdata(&speaker->id); +} + /* **** ID traversal callbacks functions **** */ void DepsgraphNodeBuilder::modifier_walk(void *user_data, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 72aa5dbe003..487b834bd07 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -62,6 +62,7 @@ struct Probe; struct bPoseChannel; struct bConstraint; struct Scene; +struct Speaker; struct Tex; struct World; @@ -175,6 +176,7 @@ struct DepsgraphNodeBuilder { void build_object_data_geometry_datablock(ID *obdata); void build_object_data_lamp(Object *object); void build_object_data_lightprobe(Object *object); + void build_object_data_speaker(Object *object); void build_object_transform(Object *object); void build_object_constraints(Object *object); void build_pose_constraints(Object *object, bPoseChannel *pchan, int pchan_index); @@ -209,6 +211,7 @@ struct DepsgraphNodeBuilder { void build_mask(Mask *mask); void build_movieclip(MovieClip *clip); void build_lightprobe(LightProbe *probe); + void build_speaker(Speaker *speaker); protected: struct SavedEntryTag { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index c9b9cf38cc5..9714cf9d853 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -65,6 +65,7 @@ extern "C" { #include "DNA_object_types.h" #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" +#include "DNA_speaker_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" #include "DNA_object_force_types.h" @@ -440,6 +441,9 @@ void DepsgraphRelationBuilder::build_id(ID *id) case ID_LT: build_object_data_geometry_datablock(id); break; + case ID_SPK: + build_speaker((Speaker *)id); + break; default: fprintf(stderr, "Unhandled ID %s\n", id->name); BLI_assert(!"Should never happen"); @@ -660,6 +664,9 @@ void DepsgraphRelationBuilder::build_object_data(Object *object) case OB_LIGHTPROBE: build_object_data_lightprobe(object); break; + case OB_SPEAKER: + build_object_data_speaker(object); + break; } Key *key = BKE_key_from_object(object); if (key != NULL) { @@ -701,6 +708,19 @@ void DepsgraphRelationBuilder::build_object_data_lightprobe(Object *object) add_relation(probe_key, object_key, "LightProbe Update"); } +void DepsgraphRelationBuilder::build_object_data_speaker(Object *object) +{ + Speaker *speaker = (Speaker *)object->data; + build_speaker(speaker); + OperationKey probe_key(&speaker->id, + DEG_NODE_TYPE_PARAMETERS, + DEG_OPCODE_SPEAKER_EVAL); + OperationKey object_key(&object->id, + DEG_NODE_TYPE_PARAMETERS, + DEG_OPCODE_SPEAKER_EVAL); + add_relation(probe_key, object_key, "Speaker Update"); +} + void DepsgraphRelationBuilder::build_object_parent(Object *object) { /* XXX: for now, need to use the component key (not just direct to the parent op), @@ -2122,6 +2142,14 @@ void DepsgraphRelationBuilder::build_lightprobe(LightProbe *probe) build_animdata(&probe->id); } +void DepsgraphRelationBuilder::build_speaker(Speaker *speaker) +{ + if (built_map_.checkIsBuiltAndTag(speaker)) { + return; + } + build_animdata(&speaker->id); +} + void DepsgraphRelationBuilder::build_copy_on_write_relations() { foreach (IDDepsNode *id_node, graph_->id_nodes) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 3d3a73b6551..2b9ba3edffb 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -75,6 +75,7 @@ struct bConstraint; struct ParticleSystem; struct ParticleSettings; struct Scene; +struct Speaker; struct ViewLayer; struct Tex; struct World; @@ -212,6 +213,7 @@ struct DepsgraphRelationBuilder void build_object_data_geometry_datablock(ID *obdata); void build_object_data_lamp(Object *object); void build_object_data_lightprobe(Object *object); + void build_object_data_speaker(Object *object); void build_object_parent(Object *object); void build_constraints(ID *id, eDepsNode_Type component_type, @@ -263,6 +265,7 @@ struct DepsgraphRelationBuilder void build_mask(Mask *mask); void build_movieclip(MovieClip *clip); void build_lightprobe(LightProbe *probe); + void build_speaker(Speaker *speaker); void build_nested_datablock(ID *owner, ID *id); void build_nested_nodetree(ID *owner, bNodeTree *ntree); |