Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/ui/buttons_texture.py')
-rw-r--r--release/ui/buttons_texture.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
index 5b1269c982c..98476530449 100644
--- a/release/ui/buttons_texture.py
+++ b/release/ui/buttons_texture.py
@@ -43,23 +43,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
layout = self.layout
tex = context.texture
- ma = context.material
- la = context.lamp
- wo = context.world
- br = context.brush
+
+ id = context.material
+ if not id: id = context.lamp
+ if not id: id = context.world
+ if not id: id = context.brush
+
space = context.space_data
- if ma:
- id = ma
- elif la:
- id = la
- elif wo:
- id = wo
- elif br:
- id = br
- else:
- id = None
-
if id:
row = layout.row()
row.template_list(id, "textures", id, "active_texture_index", rows=2)
@@ -71,9 +62,11 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
elif tex:
split.template_ID(space, "pin_id")
- if not space.pin_id and \
- (context.sculpt_object or context.vertex_paint_object or \
- context.weight_paint_object or context.texture_paint_object):
+ if (not space.pin_id) and ( 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)
layout.itemS()