Shader Editor: tweak when the UI for managing the material is enabled
- disable the UI if the currently selected object does not support materials. - add Metaballs and GPencil as types supporting material.
This commit is contained in:
Submodule release/scripts/addons updated: 6c3a46dc11...5f7fba0565
Submodule release/scripts/addons_contrib updated: 15b25a4278...fecc0db560
@@ -63,10 +63,12 @@ class NODE_HT_header(Header):
|
||||
layout.separator_spacer()
|
||||
|
||||
row = layout.row()
|
||||
types_that_support_material = {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'GPENCIL'}
|
||||
# disable material slot buttons when pinned, cannot find correct slot within id_from (#36589)
|
||||
row.enabled = not snode.pin
|
||||
# disable also when the selected object does not support materials
|
||||
row.enabled = not snode.pin and ob.type in types_that_support_material
|
||||
# Show material.new when no active ID/slot exists
|
||||
if not id_from and ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'METABALL'}:
|
||||
if not id_from and ob.type in types_that_support_material:
|
||||
row.template_ID(ob, "active_material", new="material.new")
|
||||
# Material ID, but not for Lights
|
||||
if id_from and ob.type != 'LIGHT':
|
||||
|
Submodule source/tools updated: 870f46b6e3...11656ebaf7
Reference in New Issue
Block a user