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:
authorJacques Lucke <jacques@blender.org>2022-03-22 18:33:55 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-03-24 10:49:43 +0300
commit97de02247a614d7b8b74cc648bf8db95fff15058 (patch)
tree4acff86163e55a4fdd1ac9ab88f2a5b48a9eca7c
parentedb15b84583e594241bc63636cb279725da70bbd (diff)
Fix T96361: missing update when changing texture mapping properties
-rw-r--r--source/blender/makesrna/intern/rna_texture.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index f66fb2653b5..5373f739c5f 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -35,6 +35,7 @@
#include "BLI_utildefines.h"
#include "BKE_node.h"
+#include "BKE_node_tree_update.h"
#include "BKE_paint.h"
#include "RNA_define.h"
@@ -205,8 +206,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);
}