diff options
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 12 |
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); } |