[Bf-blender-cvs] [3b57927651f] master: Fix T82242: creating particle influence textures does not set up DEG relation immediately

Philipp Oeser noreply at git.blender.org
Wed Dec 9 22:01:49 CET 2020


Commit: 3b57927651fe31ea5576cdc69f3ce134bc56a285
Author: Philipp Oeser
Date:   Fri Oct 30 12:12:25 2020 +0100
Branches: master
https://developer.blender.org/rB3b57927651fe31ea5576cdc69f3ce134bc56a285

Fix T82242: creating particle influence textures does not set up DEG
relation immediately

Texture and ParticleSettings have a DEG relation, but
`DEG_relations_tag_update` was not called when the texture changed.
This lead to no updates when e.g. texture size changes, relation only
went into full effect after save/reload or adding/removing keyframes.

Two places were additional relation tagging is needed:
- ParticleSettings `active_texture` changes
- ParticleSettingsTextureSlot (basically any TextureSlots') texture
changes

Maniphest Tasks: T82242

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

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

M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_texture.c

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

diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 5987f52328d..be9bff00b52 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -2484,7 +2484,7 @@ static void rna_def_particle_settings(BlenderRNA *brna)
                       NULL,
                       "ParticleSettingsTextureSlot",
                       "ParticleSettingsTextureSlots",
-                      "rna_Particle_reset",
+                      "rna_Particle_reset_dependency",
                       NULL);
 
   /* Fluid particle type can't be checked from the type value in RNA
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index fb6d40b3a55..4eb11879517 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -148,6 +148,7 @@ static const EnumPropertyItem blend_type_items[] = {
 #  include "BKE_texture.h"
 
 #  include "DEG_depsgraph.h"
+#  include "DEG_depsgraph_build.h"
 
 #  include "ED_node.h"
 #  include "ED_render.h"
@@ -233,6 +234,12 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value)
   BKE_texture_type_set(tex, value);
 }
 
+void rna_TextureSlotTexture_update(bContext *C, PointerRNA *ptr)
+{
+  DEG_relations_tag_update(CTX_data_main(C));
+  rna_TextureSlot_update(C, ptr);
+}
+
 void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
 {
   ID *id = ptr->owner_id;
@@ -623,7 +630,7 @@ static void rna_def_mtex(BlenderRNA *brna)
   RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
   RNA_def_property_ui_text(prop, "Texture", "Texture data-block used by this texture slot");
-  RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, "rna_TextureSlot_update");
+  RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, "rna_TextureSlotTexture_update");
 
   prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
   RNA_def_property_string_funcs(



More information about the Bf-blender-cvs mailing list