diff options
Diffstat (limited to 'release/ui/space_view3d_toolbar.py')
-rw-r--r-- | release/ui/space_view3d_toolbar.py | 172 |
1 files changed, 107 insertions, 65 deletions
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 1b4c1e25c34..73f97dec750 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -2,8 +2,8 @@ import bpy class View3DPanel(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "TOOLS" + __space_type__ = 'VIEW_3D' + __region_type__ = 'TOOLS' # ********** default tools for objectmode **************** @@ -107,6 +107,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel): col.itemO("curve.delete") col.itemO("curve.cyclic_toggle") col.itemO("curve.switch_direction") + col.itemO("curve.spline_type_set") layout.itemL(text="Modeling:") @@ -262,8 +263,8 @@ class VIEW3D_PT_tools_posemode(View3DPanel): # ********** default tools for paint modes **************** class PaintPanel(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "TOOLS" + __space_type__ = 'VIEW_3D' + __region_type__ = 'TOOLS' def paint_settings(self, context): ts = context.tool_settings @@ -333,18 +334,15 @@ class VIEW3D_PT_tools_brush(PaintPanel): row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "size_pressure", toggle=True, text="") if brush.sculpt_tool != 'GRAB': row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "strength_pressure", text="") col = layout.column() - if brush.sculpt_tool != 'LAYER': - col.itemR(brush, "anchored") - if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): col.itemR(brush, "flip_direction") @@ -352,8 +350,6 @@ class VIEW3D_PT_tools_brush(PaintPanel): col.itemR(brush, "persistent") col.itemO("sculpt.set_persistent_base") - col.itemR(brush, "rake") - col.itemR(brush, "sculpt_tool") # Texture Paint Mode # @@ -362,38 +358,21 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column(align=True) col.item_enumR(settings, "tool", 'DRAW') col.item_enumR(settings, "tool", 'SOFTEN') - if settings.use_projection: - col.item_enumR(settings, "tool", 'CLONE') - else: - col.item_enumR(settings, "tool", 'SMEAR') + col.item_enumR(settings, "tool", 'CLONE') + col.item_enumR(settings, "tool", 'SMEAR') col = layout.column() col.itemR(brush, "color", text="") - + row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "size_pressure", toggle=True, text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - - row = col.row(align=True) - row.itemR(brush, "falloff", slider=True) - row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "strength_pressure", toggle=True, text="") - row = col.row(align=True) - row.itemR(brush, "space", text="") - rowsub = row.row(align=True) - rowsub.active = brush.space - rowsub.itemR(brush, "spacing", text="Spacing", slider=True) - rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - - col = layout.column() - col.itemR(brush, "airbrush") - sub = col.column() - sub.active = brush.airbrush - sub.itemR(brush, "rate") + col.itemR(brush, "blend") # Weight Paint Mode # @@ -403,11 +382,11 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column() row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "size_pressure", toggle=True, text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "strength_pressure", toggle=True, text="") # Vertex Paint Mode # @@ -417,11 +396,11 @@ class VIEW3D_PT_tools_brush(PaintPanel): row = col.row(align=True) row.itemR(brush, "size", slider=True) - row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "size_pressure", toggle=True, text="") row = col.row(align=True) row.itemR(brush, "strength", slider=True) - row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") + row.itemR(brush, "strength_pressure", toggle=True, text="") class VIEW3D_PT_tools_brush_stroke(PaintPanel): __label__ = "Stroke" @@ -429,24 +408,41 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): def poll(self, context): settings = self.paint_settings(context) - return (settings and settings.brush and context.sculpt_object) + return (settings and settings.brush and (context.sculpt_object or + context.vertex_paint_object or + context.weight_paint_object or + context.texture_paint_object)) def draw(self, context): + layout = self.layout + settings = self.paint_settings(context) brush = settings.brush - layout = self.layout + texture_paint = context.texture_paint_object - layout.itemR(brush, "smooth_stroke") - col = layout.column() - col.active = brush.smooth_stroke - col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) - col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + if context.sculpt_object: + if brush.sculpt_tool != 'LAYER': + layout.itemR(brush, "anchored") + layout.itemR(brush, "rake") - layout.itemR(brush, "space") + layout.itemR(brush, "airbrush") col = layout.column() - col.active = brush.space - col.itemR(brush, "spacing", text="Distance", slider=True) + col.active = brush.airbrush + col.itemR(brush, "rate", slider=True) + + if not texture_paint: + layout.itemR(brush, "smooth_stroke") + col = layout.column() + col.active = brush.smooth_stroke + col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) + col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + layout.itemR(brush, "space") + row = layout.row(align=True) + row.active = brush.space + row.itemR(brush, "spacing", text="Distance", slider=True) + if texture_paint: + row.itemR(brush, "spacing_pressure", toggle=True, text="") class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" @@ -457,9 +453,10 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel): return (settings and settings.brush and settings.brush.curve) def draw(self, context): + layout = self.layout + settings = self.paint_settings(context) brush = settings.brush - layout = self.layout layout.template_curve_mapping(brush.curve) layout.item_menu_enumO("brush.curve_preset", property="shape") @@ -472,6 +469,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel): def draw(self, context): layout = self.layout + sculpt = context.tool_settings.sculpt col = layout.column() @@ -500,6 +498,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel): def draw(self, context): layout = self.layout + wpaint = context.tool_settings.weight_paint col = layout.column() @@ -527,6 +526,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): def draw(self, context): layout = self.layout + vpaint = context.tool_settings.vertex_paint col = layout.column() @@ -545,9 +545,17 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): # ********** default tools for texturepaint **************** -class VIEW3D_PT_tools_texturepaint(View3DPanel): - __context__ = "texturepaint" - __label__ = "Options" +class VIEW3D_PT_tools_projectpaint(View3DPanel): + __context__ = "projectpaint" + __label__ = "Project Paint" + + def poll(self, context): + return context.tool_settings.image_paint.tool != 'SMEAR' + + def draw_header(self, context): + layout = self.layout + ipaint = context.tool_settings.image_paint + layout.itemR(ipaint, "use_projection", text="") def draw(self, context): layout = self.layout @@ -557,7 +565,6 @@ class VIEW3D_PT_tools_texturepaint(View3DPanel): use_projection= ipaint.use_projection col = layout.column() - col.itemR(ipaint, "use_projection") sub = col.column() sub.active = use_projection sub.itemR(ipaint, "use_occlude") @@ -572,8 +579,7 @@ class VIEW3D_PT_tools_texturepaint(View3DPanel): col = split.column() col.active = (ipaint.use_normal_falloff and use_projection) col.itemR(ipaint, "normal_angle", text="") - - + split = layout.split(percentage=0.7) col = split.column(align=False) @@ -583,8 +589,7 @@ class VIEW3D_PT_tools_texturepaint(View3DPanel): col = split.column(align=False) col.active = (use_projection and ipaint.use_stencil_layer) col.itemR(ipaint, "invert_stencil", text="Inv") - - + col = layout.column() sub = col.column() sub.active = (settings.tool == 'CLONE') @@ -601,23 +606,60 @@ class VIEW3D_PT_tools_particlemode(View3DPanel): def draw(self, context): layout = self.layout + pe = context.tool_settings.particle_edit + ob = pe.object + row = layout.row() + row.itemL(text="Edit:") + row.itemR(pe, "type", text="") + + if pe.type == 'PARTICLES': + if ob.particle_systems: + if len(ob.particle_systems) > 1: + layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS') + + ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache + else: + for md in ob.modifiers: + if md.type==pe.type: + ptcache = md.point_cache + + if ptcache and len(ptcache.point_cache_list) > 1: + layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS') + + + if not pe.editable: + layout.itemL(text="Point cache must be baked") + layout.itemL(text="to enable editing!") + col = layout.column(align=True) - col.itemR(pe, "emitter_deflect", text="Deflect") - sub = col.row() - sub.active = pe.emitter_deflect - sub.itemR(pe, "emitter_distance", text="Distance") + if pe.hair: + col.active = pe.editable + col.itemR(pe, "emitter_deflect", text="Deflect emitter") + sub = col.row() + sub.active = pe.emitter_deflect + sub.itemR(pe, "emitter_distance", text="Distance") col = layout.column(align=True) + col.active = pe.editable col.itemL(text="Keep:") col.itemR(pe, "keep_lengths", text="Lenghts") col.itemR(pe, "keep_root", text="Root") + if not pe.hair: + col.itemL(text="Correct:") + col.itemR(pe, "auto_velocity", text="Velocity") col = layout.column(align=True) - col.itemL(text="Display:") - col.itemR(pe, "show_time", text="Time") - col.itemR(pe, "show_children", text="Children") + col.active = pe.editable + col.itemL(text="Draw:") + col.itemR(pe, "draw_step", text="Path Steps") + if pe.type == 'PARTICLES': + col.itemR(pe, "draw_particles", text="Particles") + col.itemR(pe, "fade_time") + sub = col.row() + sub.active = pe.fade_time + sub.itemR(pe, "fade_frames", slider=True) bpy.types.register(VIEW3D_PT_tools_objectmode) bpy.types.register(VIEW3D_PT_tools_meshedit) @@ -634,5 +676,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve) bpy.types.register(VIEW3D_PT_sculpt_options) bpy.types.register(VIEW3D_PT_tools_vertexpaint) bpy.types.register(VIEW3D_PT_tools_weightpaint) -bpy.types.register(VIEW3D_PT_tools_texturepaint) +bpy.types.register(VIEW3D_PT_tools_projectpaint) bpy.types.register(VIEW3D_PT_tools_particlemode) |