diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-03 11:37:18 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-03 11:37:18 +0300 |
commit | 251ef0a47f34806b911ab18b59f604dd0ef3ea5b (patch) | |
tree | 23574564a0d36337c8d2338197c1527cc77e76ca /release/scripts | |
parent | ca4a5f309eed9922eb7d5188173942f36a5adc0d (diff) |
Changes to Brush texture workflow
This changes how textures are accessed from Brushes, with the intention of simplifying
the workflow, and reducing the amount of clicking. Rather than the previous texture slots
(which didn't work as a stack anyway), brushes now have a single texture linked. Rather
than taking time having to set up your slots in advance, you can now select and change
textures directly as you sculpt/paint on the fly. For complex brushes, node textures can
be used, or for fast access, it's easy to make a duplicate of your brush with the texture
you like and assign a hotkey.
Brush textures can now be chosen from a new Textures panel in the brush tool
properties - click on the thumbnail to open a texture selector. This is done using a new
variation on the ID template - the number of rows and columns to display in the popup
can be customised in the UI scripts.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/ui/properties_texture.py | 35 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d_toolbar.py | 24 |
2 files changed, 48 insertions, 11 deletions
diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index 4471f6f9644..711ba4f8a02 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -87,13 +87,15 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): def draw(self, context): layout = self.layout + space = context.space_data tex = context.texture wide_ui = context.region.width > narrowui idblock = context_tex_datablock(context) + tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush - space = context.space_data + - if idblock: + if tex_collection: row = layout.row() row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2) @@ -101,24 +103,31 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): col = row.column(align=True) col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP' col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN' - - + if wide_ui: split = layout.split(percentage=0.65) - if idblock: - split.template_ID(idblock, "active_texture", new="texture.new") - elif tex: - split.template_ID(space, "pin_id") + col = split.column() else: - layout.template_ID(idblock, "active_texture", new="texture.new") - + col = layout.column() + + if tex_collection: + col.template_ID(idblock, "active_texture", new="texture.new") + elif idblock: + col.template_ID(idblock, "texture", new="texture.new") + + if space.pin_id: + col.template_ID(space, "pin_id") + + if wide_ui: + col = split.column() + 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.prop(space, "brush_texture", text="Brush", toggle=True) + col.prop(space, "brush_texture", text="Brush", toggle=True) if tex: layout.prop(tex, "use_nodes") @@ -268,6 +277,10 @@ class TEXTURE_PT_influence(TextureSlotPanel): bl_label = "Influence" def poll(self, context): + idblock = context_tex_datablock(context) + if type(idblock) == bpy.types.Brush: + return False + return context.texture_slot def draw(self, context): diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index b2c8c39cb3a..3e745bb4b2d 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -624,6 +624,29 @@ class VIEW3D_PT_tools_brush(PaintPanel): #row.prop(brush, "jitter", slider=True) #row.prop(brush, "use_jitter_pressure", toggle=True, text="") + +class VIEW3D_PT_tools_brush_texture(PaintPanel): + bl_label = "Texture" + bl_default_closed = True + + def poll(self, context): + settings = self.paint_settings(context) + return (settings and settings.brush and (context.sculpt_object or + context.texture_paint_object)) + + def draw(self, context): + layout = self.layout + + settings = self.paint_settings(context) + brush = settings.brush + tex_slot = brush.texture_slot + + col = layout.column() + + col.template_ID_preview(brush, "texture", new="texture.new", rows=2, cols=4) + + col.row().prop(tex_slot, "map_mode", expand=True) + class VIEW3D_PT_tools_brush_tool(PaintPanel): bl_label = "Tool" bl_default_closed = True @@ -975,6 +998,7 @@ bpy.types.register(VIEW3D_PT_tools_latticeedit) bpy.types.register(VIEW3D_PT_tools_posemode) bpy.types.register(VIEW3D_PT_tools_posemode_options) bpy.types.register(VIEW3D_PT_tools_brush) +bpy.types.register(VIEW3D_PT_tools_brush_texture) bpy.types.register(VIEW3D_PT_tools_brush_tool) bpy.types.register(VIEW3D_PT_tools_brush_stroke) bpy.types.register(VIEW3D_PT_tools_brush_curve) |