Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations.cc')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc58
1 files changed, 58 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index e968ad1ea5d..4caea4b8aee 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -78,6 +78,7 @@ extern "C" {
#include "BKE_effect.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil_modifier.h"
+#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_layer.h"
@@ -565,6 +566,18 @@ void DepsgraphRelationBuilder::build_id(ID *id)
}
}
+static void build_idproperties_callback(IDProperty *id_property, void *user_data)
+{
+ DepsgraphRelationBuilder *builder = reinterpret_cast<DepsgraphRelationBuilder *>(user_data);
+ BLI_assert(id_property->type == IDP_ID);
+ builder->build_id(reinterpret_cast<ID *>(id_property->data.pointer));
+}
+
+void DepsgraphRelationBuilder::build_idproperties(IDProperty *id_property)
+{
+ IDP_foreach_property(id_property, IDP_TYPE_FILTER_ID, build_idproperties_callback, this);
+}
+
void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_collection,
Object *object,
Collection *collection)
@@ -578,6 +591,7 @@ void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_coll
* recurses into all the nested objects and collections. */
return;
}
+ build_idproperties(collection->id.properties);
const bool group_done = built_map_.checkIsBuiltAndTag(collection);
OperationKey object_transform_final_key(object != nullptr ? &object->id : nullptr,
NodeType::TRANSFORM,
@@ -691,6 +705,7 @@ void DepsgraphRelationBuilder::build_object(Base *base, Object *object)
final_transform_key,
"Simulation -> Final Transform");
}
+ build_idproperties(object->id.properties);
/* Animation data */
build_animdata(&object->id);
/* Object data. */
@@ -1367,6 +1382,7 @@ void DepsgraphRelationBuilder::build_action(bAction *action)
if (built_map_.checkIsBuiltAndTag(action)) {
return;
}
+ build_idproperties(action->id.properties);
if (!BLI_listbase_is_empty(&action->curves)) {
TimeSourceKey time_src_key;
ComponentKey animation_key(&action->id, NodeType::ANIMATION);
@@ -1612,6 +1628,7 @@ void DepsgraphRelationBuilder::build_world(World *world)
if (built_map_.checkIsBuiltAndTag(world)) {
return;
}
+ build_idproperties(world->id.properties);
/* animation */
build_animdata(&world->id);
build_parameters(&world->id);
@@ -1890,6 +1907,7 @@ void DepsgraphRelationBuilder::build_shapekeys(Key *key)
if (built_map_.checkIsBuiltAndTag(key)) {
return;
}
+ build_idproperties(key->id.properties);
/* Attach animdata to geometry. */
build_animdata(&key->id);
build_parameters(&key->id);
@@ -2069,6 +2087,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
if (built_map_.checkIsBuiltAndTag(obdata)) {
return;
}
+ build_idproperties(obdata->properties);
/* Animation. */
build_animdata(obdata);
build_parameters(obdata);
@@ -2181,8 +2200,18 @@ void DepsgraphRelationBuilder::build_armature(bArmature *armature)
if (built_map_.checkIsBuiltAndTag(armature)) {
return;
}
+ build_idproperties(armature->id.properties);
build_animdata(&armature->id);
build_parameters(&armature->id);
+ build_armature_bones(&armature->bonebase);
+}
+
+void DepsgraphRelationBuilder::build_armature_bones(ListBase *bones)
+{
+ LISTBASE_FOREACH (Bone *, bone, bones) {
+ build_idproperties(bone->prop);
+ build_armature_bones(&bone->childbase);
+ }
}
void DepsgraphRelationBuilder::build_camera(Camera *camera)
@@ -2190,6 +2219,7 @@ void DepsgraphRelationBuilder::build_camera(Camera *camera)
if (built_map_.checkIsBuiltAndTag(camera)) {
return;
}
+ build_idproperties(camera->id.properties);
build_animdata(&camera->id);
build_parameters(&camera->id);
if (camera->dof.focus_object != nullptr) {
@@ -2206,6 +2236,7 @@ void DepsgraphRelationBuilder::build_light(Light *lamp)
if (built_map_.checkIsBuiltAndTag(lamp)) {
return;
}
+ build_idproperties(lamp->id.properties);
build_animdata(&lamp->id);
build_parameters(&lamp->id);
/* light's nodetree */
@@ -2226,11 +2257,20 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
if (built_map_.checkIsBuiltAndTag(ntree)) {
return;
}
+ build_idproperties(ntree->id.properties);
build_animdata(&ntree->id);
build_parameters(&ntree->id);
ComponentKey shading_key(&ntree->id, NodeType::SHADING);
/* nodetree's nodes... */
LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
+ build_idproperties(bnode->prop);
+ LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->inputs) {
+ build_idproperties(socket->prop);
+ }
+ LISTBASE_FOREACH (bNodeSocket *, socket, &bnode->outputs) {
+ build_idproperties(socket->prop);
+ }
+
ID *id = bnode->id;
if (id == nullptr) {
continue;
@@ -2295,6 +2335,13 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
}
}
+ LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->inputs) {
+ build_idproperties(socket->prop);
+ }
+ LISTBASE_FOREACH (bNodeSocket *, socket, &ntree->outputs) {
+ build_idproperties(socket->prop);
+ }
+
OperationKey shading_update_key(&ntree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
OperationKey shading_parameters_key(
&ntree->id, NodeType::SHADING_PARAMETERS, OperationCode::MATERIAL_UPDATE);
@@ -2314,6 +2361,7 @@ void DepsgraphRelationBuilder::build_material(Material *material)
if (built_map_.checkIsBuiltAndTag(material)) {
return;
}
+ build_idproperties(material->id.properties);
/* animation */
build_animdata(&material->id);
build_parameters(&material->id);
@@ -2345,6 +2393,7 @@ void DepsgraphRelationBuilder::build_texture(Tex *texture)
return;
}
/* texture itself */
+ build_idproperties(texture->id.properties);
build_animdata(&texture->id);
build_parameters(&texture->id);
/* texture's nodetree */
@@ -2368,6 +2417,7 @@ void DepsgraphRelationBuilder::build_image(Image *image)
if (built_map_.checkIsBuiltAndTag(image)) {
return;
}
+ build_idproperties(image->id.properties);
build_parameters(&image->id);
}
@@ -2388,6 +2438,7 @@ void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file)
if (built_map_.checkIsBuiltAndTag(cache_file)) {
return;
}
+ build_idproperties(cache_file->id.properties);
/* Animation. */
build_animdata(&cache_file->id);
build_parameters(&cache_file->id);
@@ -2417,6 +2468,7 @@ void DepsgraphRelationBuilder::build_mask(Mask *mask)
return;
}
ID *mask_id = &mask->id;
+ build_idproperties(mask_id->properties);
/* F-Curve animation. */
build_animdata(mask_id);
build_parameters(mask_id);
@@ -2455,6 +2507,7 @@ void DepsgraphRelationBuilder::build_freestyle_linestyle(FreestyleLineStyle *lin
ID *linestyle_id = &linestyle->id;
build_parameters(linestyle_id);
+ build_idproperties(linestyle_id->properties);
build_animdata(linestyle_id);
build_nodetree(linestyle->nodetree);
}
@@ -2465,6 +2518,7 @@ void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip)
return;
}
/* Animation. */
+ build_idproperties(clip->id.properties);
build_animdata(&clip->id);
build_parameters(&clip->id);
}
@@ -2474,6 +2528,7 @@ void DepsgraphRelationBuilder::build_lightprobe(LightProbe *probe)
if (built_map_.checkIsBuiltAndTag(probe)) {
return;
}
+ build_idproperties(probe->id.properties);
build_animdata(&probe->id);
build_parameters(&probe->id);
}
@@ -2483,6 +2538,7 @@ void DepsgraphRelationBuilder::build_speaker(Speaker *speaker)
if (built_map_.checkIsBuiltAndTag(speaker)) {
return;
}
+ build_idproperties(speaker->id.properties);
build_animdata(&speaker->id);
build_parameters(&speaker->id);
if (speaker->sound != nullptr) {
@@ -2498,6 +2554,7 @@ void DepsgraphRelationBuilder::build_sound(bSound *sound)
if (built_map_.checkIsBuiltAndTag(sound)) {
return;
}
+ build_idproperties(sound->id.properties);
build_animdata(&sound->id);
build_parameters(&sound->id);
}
@@ -2514,6 +2571,7 @@ void DepsgraphRelationBuilder::build_scene_sequencer(Scene *scene)
Sequence *seq;
bool has_audio_strips = false;
SEQ_BEGIN (scene->ed, seq) {
+ build_idproperties(seq->prop);
if (seq->sound != nullptr) {
build_sound(seq->sound);
ComponentKey sound_key(&seq->sound->id, NodeType::AUDIO);