Fix T96361: missing update when changing texture mapping properties
This commit is contained in:
parent
edb15b8458
commit
97de02247a
Notes:
blender-bot
2023-04-04 07:45:26 +02:00
Referenced by issue #96361, Regression: Texture Mapping properties of texture nodes are not updated in 3D Viewport Referenced by issue #96241, 3.1: Potential candidates for corrective releases
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue