Post #2495: Try this code (Custom tab):

📋 Metadata

  • Author: roaoao
  • Date: 2019-07-09 09:50:51
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_02494

🏷️ Tags

popup-dialog custom-scripting advanced solved

  • Custom Tab
  • Python Scripting
  • Popup Dialog Editor
  • Property Editor

💬 Content

Try this code (Custom tab):

from bl_ui.properties_material import active_node_mat; ob = C.object; mss = ob.material_slots if ob else None; idblock = active_node_mat(mss[ob.active_material_index].material) if mss else None; L.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2) if idblock else operator(L, "pme.message_box", text="No Material", message="No material selected")

🔗 View on Blender Artists