diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 22:54:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 22:54:02 +0400 |
commit | 801d44a09efd98a2345dd8b5938b4d811bbf68fc (patch) | |
tree | c2b1330c44c790df0147ee73275bf818cec4930a /release | |
parent | 9a874da36c2e9eb5a4d48c8c7bbce3db48f882a9 (diff) |
2.5: Materials and textures can now be assigned again
even if not slot for them is available.
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_material.py | 9 | ||||
-rw-r--r-- | release/ui/buttons_texture.py | 32 |
2 files changed, 21 insertions, 20 deletions
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 30f7f7122dc..66eca1a14b8 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -52,10 +52,13 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): split = layout.split(percentage=0.65) - if ob and slot: - split.template_ID(slot, "material", new="material.new") + if ob: + split.template_ID(ob, "active_material", new="material.new") row = split.row() - row.itemR(slot, "link", expand=True) + if slot: + row.itemR(slot, "link", expand=True) + else: + row.itemL() elif mat: split.template_ID(space, "pin_id") split.itemS() diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index df409d3c524..d638d1356f9 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -48,26 +48,26 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): wo = context.world br = context.brush space = context.space_data - slot = context.texture_slot - if ma or la or wo or br: + if ma: + id = ma + elif la: + id = la + elif wo: + id = wo + elif br: + id = br + else: + id = None + + if id: row = layout.row() - if ma: - row.template_list(ma, "textures", ma, "active_texture_index", type="ICONS") - elif la: - row.template_list(la, "textures", la, "active_texture_index", type="ICONS") - elif wo: - row.template_list(wo, "textures", wo, "active_texture_index", type="ICONS") - elif br: - row.template_list(br, "textures", br, "active_texture_index", type="ICONS") + row.template_list(id, "textures", id, "active_texture_index", type="ICONS") split = layout.split(percentage=0.65) - if ma or la or wo or br: - if slot: - split.template_ID(slot, "texture", new="texture.new") - else: - split.itemS() + if id: + split.template_ID(id, "active_texture", new="texture.new") elif tex: split.template_ID(space, "pin_id") @@ -75,8 +75,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): (context.sculpt_object or context.vertex_paint_object or \ context.weight_paint_object or context.texture_paint_object): split.itemR(space, "brush_texture", text="Brush", toggle=True) - else: - split.itemS() layout.itemS() |