[Bf-blender-cvs] [87a0770bb96] master: Fix T96361: missing update when changing texture mapping properties
Jacques Lucke
noreply at git.blender.org
Tue Mar 22 16:36:37 CET 2022
Commit: 87a0770bb969ce37d9a41a04c1658ea09c63933a
Author: Jacques Lucke
Date: Tue Mar 22 16:33:55 2022 +0100
Branches: master
https://developer.blender.org/rB87a0770bb969ce37d9a41a04c1658ea09c63933a
Fix T96361: missing update when changing texture mapping properties
===================================================================
M source/blender/makesrna/intern/rna_texture.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 3c8f1ee28c9..56d1b48811a 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -21,6 +21,7 @@
#include "BLI_utildefines.h"
#include "BKE_node.h"
+#include "BKE_node_tree_update.h"
#include "BKE_paint.h"
#include "RNA_define.h"
@@ -191,8 +192,23 @@ static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *pt
static void rna_Texture_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
+ ID *id = ptr->owner_id;
TexMapping *texmap = ptr->data;
BKE_texture_mapping_init(texmap);
+
+ if (GS(id->name) == ID_NT) {
+ bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
+ /* Try to find and tag the node that this #TexMapping belongs to. */
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ /* This assumes that the #TexMapping is stored at the beginning of the node storage. This is
+ * generally true, see #NodeTexBase. If the assumption happens to be false, there might be a
+ * missing update. */
+ if (node->storage == texmap) {
+ BKE_ntree_update_tag_node_property(ntree, node);
+ }
+ }
+ }
+
rna_Texture_update(bmain, scene, ptr);
}
More information about the Bf-blender-cvs
mailing list