Page MenuHome

Fix T67597: Texture painting: Texture slots that correspond to nodes inside node_groups don't remain active
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Jul 25 2019, 12:16 AM.

Details

Summary

Apparently, ma->paint_active_slot is always in sync with the current active texture node in nodetree.
So for the value set in ma->paint_active_slot to remain unchanged, the texture node it represents in nodetree must also become active.
To this, rna_Material_active_paint_texture_index_update searchs the node corresponding to ma->paint_active_slot and activates it.
The problem was that rna_Material_active_paint_texture_index_update did not search for texture nodes that are inside node groups (unlike fill_texpaint_slots_recursive).

The solution was to do a recursive function similar to fill_texpaint_slots_recursive and not ignore nodes inside groups.

Ref T67597

Related commits: rBf745564e, rB86aa621

Diff Detail

Repository
rB Blender
Branch
arcpatch-D5338 (branched from master)
Build Status
Buildable 4151
Build 4151: arc lint + arc unit

Event Timeline

source/blender/blenkernel/intern/material.c
1124

Instead of requesting to keep two function in sync, is it possible to make function itself more generic and public and re-use for this two cases?

Germano Cavalcante (mano-wii) marked an inline comment as done.
  • Deduplicate code using a generic recursive function
Brecht Van Lommel (brecht) requested changes to this revision.Jul 31 2019, 12:18 PM

Fine generally, just minor comments.

source/blender/blenkernel/BKE_material.h
98

Since this is the inverse of BKE_object_material_slot_find_index, they should be next to each other and the naming should be consistent: find_index and find_node.

source/blender/makesrna/intern/rna_material.c
150–151

rna_material.c:150:9: warning: unused variable 'index'

This revision now requires changes to proceed.Jul 31 2019, 12:18 PM
Germano Cavalcante (mano-wii) marked 2 inline comments as done.
  • Rename node_find to find_node
  • rna_material.c:150:9: warning: unused variable 'index'
source/blender/blenkernel/BKE_material.h
98

BKE_object_material_slot_find_index is not the inverse of` BKE_texpaint_slot_material_node_find`.
Currently most similar to her inverse would be fill_texpaint_slots_recursive.
But I renamed it anyway.

This revision is now accepted and ready to land.Jul 31 2019, 4:00 PM