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:
authormano-wii <germano.costa@ig.com.br>2019-07-31 17:37:03 +0300
committermano-wii <germano.costa@ig.com.br>2019-07-31 17:39:30 +0300
commitbc42092a7ddbc888e1bc3ef74caeb0140037c560 (patch)
treec6d3fa685eb355d5b118cb9d9281defa211db2cf /source/blender/makesrna/intern/rna_material.c
parent8dd95abb2ff9160d95808507f70b4233546e9f65 (diff)
Fix T67597: Texture painting: Texture slots that correspond to nodes inside node_groups don't remain active
Unlike `fill_texpaint_slots_recursive`, `rna_Material_active_paint_texture_index_update` did not search for texture nodes that are inside node groups. Reviewers: sergey, psy-fi, zeddb, brecht Subscribers: brecht Differential Revision: https://developer.blender.org/D5338
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r--source/blender/makesrna/intern/rna_material.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 28989d1dd5f..162ba6be834 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -147,16 +147,8 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain,
Material *ma = ptr->id.data;
if (ma->use_nodes && ma->nodetree) {
- struct bNode *node;
- int index = 0;
- for (node = ma->nodetree->nodes.first; node; node = node->next) {
- if (node->typeinfo->nclass == NODE_CLASS_TEXTURE &&
- node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id) {
- if (index++ == ma->paint_active_slot) {
- break;
- }
- }
- }
+ struct bNode *node = BKE_texpaint_slot_material_find_node(ma, ma->paint_active_slot);
+
if (node) {
nodeSetActive(ma->nodetree, node);
}