diff options
Diffstat (limited to 'release/ui/buttons_texture.py')
-rw-r--r-- | release/ui/buttons_texture.py | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 6110d8eaf5e..de166cef796 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -7,19 +7,19 @@ class TextureButtonsPanel(bpy.types.Panel): __context__ = "texture" def poll(self, context): - return (context.texture != None) - + return (context.texture != None and context.texture.type != 'NONE') + class TEXTURE_PT_preview(TextureButtonsPanel): __idname__= "TEXTURE_PT_preview" __label__ = "Preview" def poll(self, context): - return (context.texture or context.material) + return (context.material or context.world or context.lamp or context.texture) def draw(self, context): layout = self.layout - tex = context.texture + layout.template_preview(tex) class TEXTURE_PT_texture(TextureButtonsPanel): @@ -27,10 +27,11 @@ class TEXTURE_PT_texture(TextureButtonsPanel): __label__ = "Texture" def poll(self, context): - return (context.texture or context.material or context.world or context.lamp) + return (context.material or context.world or context.lamp or context.texture) def draw(self, context): layout = self.layout + tex = context.texture ma = context.material la = context.lamp @@ -69,37 +70,45 @@ class TEXTURE_PT_texture(TextureButtonsPanel): class TEXTURE_PT_mapping(TextureButtonsPanel): __idname__= "TEXTURE_PT_mapping" __label__ = "Mapping" + + def poll(self, context): + return (context.texture_slot and context.texture and context.texture.type != 'NONE') def draw(self, context): layout = self.layout tex = context.texture_slot + textype = context.texture split = layout.split(percentage=0.3) col = split.column() col.itemL(text="Coordinates:") col = split.column() col.itemR(tex, "texture_coordinates", text="") - - split = layout.split() - col = split.column() + if tex.texture_coordinates == 'UV': - col.itemR(tex, "uv_layer") + row = layout.row() + row.itemR(tex, "uv_layer") elif tex.texture_coordinates == 'OBJECT': - col.itemR(tex, "object") - + row = layout.row() + row.itemR(tex, "object") + + if textype.type in ('IMAGE', 'ENVIRONMENT_MAP'): + split = layout.split(percentage=0.3) + col = split.column() + col.itemL(text="Projection:") + col = split.column() + col.itemR(tex, "mapping", text="") + + split = layout.split() + col = split.column() col.itemR(tex, "from_dupli") - split = layout.split(percentage=0.3) - col = split.column() - col.itemL(text="Projection:") col = split.column() - col.itemR(tex, "mapping", text="") - - row = layout.row() - row.itemR(tex, "x_mapping", text="X") - row.itemR(tex, "y_mapping", text="Y") - row.itemR(tex, "z_mapping", text="Z") + row = col.row() + row.itemR(tex, "x_mapping", text="") + row.itemR(tex, "y_mapping", text="") + row.itemR(tex, "z_mapping", text="") row = layout.row() row.column().itemR(tex, "offset") @@ -108,16 +117,20 @@ class TEXTURE_PT_mapping(TextureButtonsPanel): class TEXTURE_PT_influence(TextureButtonsPanel): __idname__= "TEXTURE_PT_influence" __label__ = "Influence" + + def poll(self, context): + return (context.texture_slot and context.texture and context.texture.type != 'NONE') def draw(self, context): layout = self.layout + textype = context.texture tex = context.texture_slot split = layout.split() col = split.column() - col.itemR(tex, "map_color") + col.itemR(tex, "map_color", text="Diffuse Color") colsub = col.column() colsub.active = tex.map_color colsub.itemR(tex, "color_factor", text="Opacity", slider=True) @@ -167,6 +180,7 @@ class TEXTURE_PT_influence(TextureButtonsPanel): class TEXTURE_PT_colors(TextureButtonsPanel): __idname__= "TEXTURE_PT_colors" __label__ = "Colors" + __default_closed__ = True def draw(self, context): layout = self.layout @@ -177,7 +191,7 @@ class TEXTURE_PT_colors(TextureButtonsPanel): else: split = layout.split() col = split.column() - col.itemR(tex, "rgb_factor") + col.itemR(tex, "rgb_factor", text="Multiply RGB") col = split.column() col.itemL(text="Adjust:") @@ -491,7 +505,7 @@ class TEXTURE_PT_distortednoise(TextureButtonsPanel): split = layout.split() sub = split.column() - sub.itemR(tex, "distortion_amount", text="Amount") + sub.itemR(tex, "distortion_amount", text="Distortion") sub.itemR(tex, "noise_size", text="Size") sub = split.column() @@ -514,4 +528,5 @@ bpy.types.register(TEXTURE_PT_voronoi) bpy.types.register(TEXTURE_PT_distortednoise) bpy.types.register(TEXTURE_PT_colors) bpy.types.register(TEXTURE_PT_mapping) -bpy.types.register(TEXTURE_PT_influence)
\ No newline at end of file +bpy.types.register(TEXTURE_PT_influence) + |