diff options
Diffstat (limited to 'release/ui/space_view3d_toolbar.py')
-rw-r--r-- | release/ui/space_view3d_toolbar.py | 285 |
1 files changed, 190 insertions, 95 deletions
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index bbca43279a7..fe0f4ca5a21 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -14,32 +14,35 @@ class VIEW3D_PT_tools_objectmode(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - layout.itemL(text="Object:") - col = layout.column(align=True) + col.itemL(text="Object:") col.itemO("object.duplicate") col.itemO("object.delete") active_object= context.active_object if active_object and active_object.type == 'MESH': - layout.itemL(text="Shading:") - + col = layout.column(align=True) + col.itemL(text="Shading:") col.itemO("object.shade_smooth", text="Smooth") col.itemO("object.shade_flat", text="Flat") - layout.itemL(text="Keyframes:") - col = layout.column(align=True) + col.itemL(text="Keyframes:") col.itemO("anim.insert_keyframe_menu", text="Insert") col.itemO("anim.delete_keyframe_v3d", text="Remove") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_mesh **************** @@ -50,39 +53,40 @@ class VIEW3D_PT_tools_meshedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - layout.itemL(text="Mesh:") - col = layout.column(align=True) + col.itemL(text="Mesh:") col.itemO("mesh.duplicate") col.itemO("mesh.delete") - layout.itemL(text="Modeling:") - col = layout.column(align=True) + col.itemL(text="Modeling:") col.itemO("mesh.extrude") col.itemO("mesh.subdivide") col.itemO("mesh.spin") col.itemO("mesh.screw") - layout.itemL(text="Shading:") - col = layout.column(align=True) + col.itemL(text="Shading:") col.itemO("mesh.faces_shade_smooth", text="Smooth") col.itemO("mesh.faces_shade_flat", text="Flat") - layout.itemL(text="UV Mapping:") - col = layout.column(align=True) + col.itemL(text="UV Mapping:") col.itemO("uv.mapping_menu", text="Unwrap") col.itemO("mesh.uvs_rotate") col.itemO("mesh.uvs_mirror") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_curve **************** @@ -93,26 +97,37 @@ class VIEW3D_PT_tools_curveedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - - layout.itemL(text="Curve:") col = layout.column(align=True) + col.itemL(text="Curve:") col.itemO("curve.duplicate") col.itemO("curve.delete") col.itemO("curve.cyclic_toggle") col.itemO("curve.switch_direction") + col.itemO("curve.spline_type_set") + + col = layout.column(align=True) + col.itemL(text="Handles:") + col.item_enumO("curve.handle_type_set", "type", 'AUTOMATIC') + col.item_enumO("curve.handle_type_set", "type", 'VECTOR') + col.item_enumO("curve.handle_type_set", "type", 'ALIGN') + col.item_enumO("curve.handle_type_set", "type", 'FREE_ALIGN') - layout.itemL(text="Modeling:") - col = layout.column(align=True) + col.itemL(text="Modeling:") col.itemO("curve.extrude") col.itemO("curve.subdivide") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_surface **************** @@ -123,26 +138,29 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - layout.itemL(text="Curve:") - col = layout.column(align=True) + col.itemL(text="Curve:") col.itemO("curve.duplicate") col.itemO("curve.delete") col.itemO("curve.cyclic_toggle") col.itemO("curve.switch_direction") - layout.itemL(text="Modeling:") - col = layout.column(align=True) + col.itemL(text="Modeling:") col.itemO("curve.extrude") col.itemO("curve.subdivide") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_text **************** @@ -152,14 +170,25 @@ class VIEW3D_PT_tools_textedit(View3DPanel): def draw(self, context): layout = self.layout - + + + col = layout.column(align=True) + col.itemL(text="Text Edit:") col.itemO("font.text_copy", text="Copy") + col.itemO("font.text_cut", text="Cut") col.itemO("font.text_paste", text="Paste") - col = layout.column() + col = layout.column(align=True) + col.itemL(text="Style:") col.itemO("font.case_set") col.itemO("font.style_toggle") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_armature **************** @@ -170,22 +199,29 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") + col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - - layout.itemL(text="Bones:") col = layout.column(align=True) + col.itemL(text="Bones:") col.itemO("armature.bone_primitive_add", text="Add") col.itemO("armature.duplicate", text="Duplicate") col.itemO("armature.delete", text="Delete") - layout.itemL(text="Modeling:") - layout.itemO("armature.extrude") + col = layout.column(align=True) + col.itemL(text="Modeling:") + col.itemO("armature.extrude") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_mball **************** @@ -196,12 +232,17 @@ class VIEW3D_PT_tools_mballedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for editmode_lattice **************** @@ -212,12 +253,17 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") - col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for posemode **************** @@ -228,36 +274,39 @@ class VIEW3D_PT_tools_posemode(View3DPanel): def draw(self, context): layout = self.layout - layout.itemL(text="Transform:") + col = layout.column(align=True) + col.itemL(text="Transform:") col.itemO("tfm.translate") col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") - layout.itemL(text="Bones:") - col = layout.column(align=True) + col.itemL(text="Bones:") col.itemO("pose.hide", text="Hide") col.itemO("pose.reveal", text="Reveal") - layout.itemL(text="Keyframes:") - col = layout.column(align=True) + layout.itemL(text="Keyframes:") col.itemO("anim.insert_keyframe_menu", text="Insert") col.itemO("anim.delete_keyframe_v3d", text="Remove") - layout.itemL(text="Pose:") - col = layout.column(align=True) + col.itemL(text="Pose:") col.itemO("pose.copy", text="Copy") col.itemO("pose.paste", text="Paste") - layout.itemL(text="Library:") - col = layout.column(align=True) + col.itemL(text="Library:") col.itemO("poselib.pose_add", text="Add") col.itemO("poselib.pose_remove", text="Remove") + + col = layout.column(align=True) + col.itemL(text="Repeat:") + col.itemO("screen.repeat_last") + col.itemO("screen.repeat_history", text="History...") + col.itemO("screen.redo_last", text="Tweak...") # ********** default tools for paint modes **************** @@ -330,31 +379,28 @@ class VIEW3D_PT_tools_brush(PaintPanel): elif context.sculpt_object and settings.brush: col = layout.column() col.itemS() - + col.itemR(brush, "sculpt_tool", expand=True) + col.itemS() + 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") + col.row().itemR(brush, "direction", expand=True) if brush.sculpt_tool == 'LAYER': col.itemR(brush, "persistent") col.itemO("sculpt.set_persistent_base") - col.itemR(brush, "rake") - - col.itemR(brush, "sculpt_tool") + # Texture Paint Mode # @@ -362,21 +408,19 @@ 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.itemR(brush, "strength_pressure", toggle=True, text="") col.itemR(brush, "blend") @@ -388,11 +432,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 # @@ -402,11 +446,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" @@ -420,10 +464,21 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): context.texture_paint_object)) def draw(self, context): + layout = self.layout + settings = self.paint_settings(context) brush = settings.brush texture_paint = context.texture_paint_object - layout = self.layout + + if context.sculpt_object: + if brush.sculpt_tool != 'LAYER': + layout.itemR(brush, "anchored") + layout.itemR(brush, "rake") + + layout.itemR(brush, "airbrush") + col = layout.column() + col.active = brush.airbrush + col.itemR(brush, "rate", slider=True) if not texture_paint: layout.itemR(brush, "smooth_stroke") @@ -437,13 +492,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): row.active = brush.space row.itemR(brush, "spacing", text="Distance", slider=True) if texture_paint: - row.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - - layout.itemR(brush, "airbrush") - col = layout.column() - col.active = brush.airbrush - col.itemR(brush, "rate", slider=True) - + row.itemR(brush, "spacing_pressure", toggle=True, text="") class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" @@ -454,9 +503,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") @@ -469,6 +519,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel): def draw(self, context): layout = self.layout + sculpt = context.tool_settings.sculpt col = layout.column() @@ -497,6 +548,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel): def draw(self, context): layout = self.layout + wpaint = context.tool_settings.weight_paint col = layout.column() @@ -524,6 +576,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): def draw(self, context): layout = self.layout + vpaint = context.tool_settings.vertex_paint col = layout.column() @@ -542,9 +595,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 @@ -554,7 +615,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") @@ -569,8 +629,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) @@ -580,8 +639,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') @@ -598,23 +656,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) @@ -631,5 +726,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) |