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.
This commit is contained in:
2010-01-03 08:37:18 +00:00
parent ca4a5f309e
commit 251ef0a47f
25 changed files with 357 additions and 223 deletions

View File

@@ -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):