diff options
author | Ines Almeida <britalmeida@gmail.com> | 2018-09-12 20:26:28 +0300 |
---|---|---|
committer | Ines Almeida <britalmeida@gmail.com> | 2018-09-12 21:07:03 +0300 |
commit | 32a461adf2cd02bb808eb8be34b036abdd751c76 (patch) | |
tree | b64fc9733f56c48d7a67328f99bb349b39317861 /release/scripts/startup/bl_ui/space_node.py | |
parent | 2e07af36fd35c97d382300962bcb9695584a23f4 (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_node.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index c106c197ecf..4dff94019ab 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -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': |