[Bf-blender-cvs] [23919d2275f] master: Fix T75845: some dependencies update missing when painting textures.

Luc Revardel noreply at git.blender.org
Tue Apr 21 15:27:46 CEST 2020


Commit: 23919d2275f22b44e1da6bc3860a66db03579f2f
Author: Luc Revardel
Date:   Tue Apr 21 15:07:13 2020 +0200
Branches: master
https://developer.blender.org/rB23919d2275f22b44e1da6bc3860a66db03579f2f

Fix T75845: some dependencies update missing when painting textures.

issue: Painting a texture that is set as a particle system influencer, doesn't
update particles. An external trigger (such as changing influence slider)
is required to update particles.

fix: The root cause is a missing relationship from image to texture in the
dependency graph.

test: Once fixed, image texture painting updates expected dependencies
such as particle system influence or displacement modifier.

Reviewed By: sergey

Maniphest Tasks: T75845

Differential Revision: https://developer.blender.org/D7472

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 1adf7c09c28..d5a3d5ee121 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2349,21 +2349,27 @@ void DepsgraphRelationBuilder::build_texture(Tex *texture)
     return;
   }
   /* texture itself */
+  ComponentKey texture_key(&texture->id, NodeType::GENERIC_DATABLOCK);
   build_animdata(&texture->id);
   build_parameters(&texture->id);
+
   /* texture's nodetree */
   build_nodetree(texture->nodetree);
+  build_nested_nodetree(&texture->id, texture->nodetree);
+
   /* Special cases for different IDs which texture uses. */
   if (texture->type == TEX_IMAGE) {
     if (texture->ima != nullptr) {
       build_image(texture->ima);
+
+      ComponentKey image_key(&texture->ima->id, NodeType::GENERIC_DATABLOCK);
+      add_relation(image_key, texture_key, "Texture Image");
     }
   }
-  build_nested_nodetree(&texture->id, texture->nodetree);
+
   if (check_id_has_anim_component(&texture->id)) {
     ComponentKey animation_key(&texture->id, NodeType::ANIMATION);
-    ComponentKey datablock_key(&texture->id, NodeType::GENERIC_DATABLOCK);
-    add_relation(animation_key, datablock_key, "Datablock Animation");
+    add_relation(animation_key, texture_key, "Datablock Animation");
   }
 }



More information about the Bf-blender-cvs mailing list