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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-12-30 16:44:17 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-01-18 15:51:28 +0300
commitdfdf79fb03a8eec6e6cd2a098405ae13b00a05ae (patch)
tree8f65b3979c1d7dae1d4a895d8ca3fdeb922b942c /source/blender/depsgraph
parent9f2271d354b96f19f887c1b0e6f0a569073f2636 (diff)
Fix T84250: Eevee world/material parameter animation not updating the viewport
The WORLD_UPDATE operation (needed to free the gpu material) was already defined in DepsgraphNodeBuilder::build_world, but corresponding relation was only set up for changes in the nodetree, not for changes in the world/material itself in DepsgraphRelationBuilder::build_world. Direct changes to these surface properties in the UI were updating properly through RNA property update callbacks, but these are not called from the animation system. So now add these relations in the depsgraph. Not 100% sure this is the right place for this (since e.g. eevee engine seems to handle e.g. animated light paramters just fine through EEVEE_cache_populate / eevee_light_setup, but properly freeing gpu materials wont happen for worlds in e.g eevee_id_world_update and also not for materials) Maniphest Tasks: T84250 Differential Revision: https://developer.blender.org/D9959
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 0eeef1840b6..a6eb40cc6b8 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1712,12 +1712,17 @@ void DepsgraphRelationBuilder::build_world(World *world)
/* animation */
build_animdata(&world->id);
build_parameters(&world->id);
+
+ /* Animated / driven parameters (without nodetree). */
+ OperationKey world_key(&world->id, NodeType::SHADING, OperationCode::WORLD_UPDATE);
+ ComponentKey parameters_key(&world->id, NodeType::PARAMETERS);
+ add_relation(parameters_key, world_key, "World's parameters");
+
/* world's nodetree */
if (world->nodetree != nullptr) {
build_nodetree(world->nodetree);
OperationKey ntree_key(
&world->nodetree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
- OperationKey world_key(&world->id, NodeType::SHADING, OperationCode::WORLD_UPDATE);
add_relation(ntree_key, world_key, "World's NTree");
build_nested_nodetree(&world->id, world->nodetree);
}
@@ -2470,12 +2475,17 @@ void DepsgraphRelationBuilder::build_material(Material *material)
/* animation */
build_animdata(&material->id);
build_parameters(&material->id);
+
+ /* Animated / driven parameters (without nodetree). */
+ OperationKey material_key(&material->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
+ ComponentKey parameters_key(&material->id, NodeType::PARAMETERS);
+ add_relation(parameters_key, material_key, "Material's paramters");
+
/* material's nodetree */
if (material->nodetree != nullptr) {
build_nodetree(material->nodetree);
OperationKey ntree_key(
&material->nodetree->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
- OperationKey material_key(&material->id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE);
add_relation(ntree_key, material_key, "Material's NTree");
build_nested_nodetree(&material->id, material->nodetree);
}