Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show All 34 Lines | |||||
| # History/Repeat tools | # History/Repeat tools | ||||
| def draw_repeat_tools(context, layout): | def draw_repeat_tools(context, layout): | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Repeat:") | col.label(text="Repeat:") | ||||
| col.operator("screen.repeat_last") | col.operator("screen.repeat_last") | ||||
| col.operator("screen.repeat_history", text="History...") | col.operator("screen.repeat_history", text="History...") | ||||
| # Keyframing tools | # Keyframing tools | ||||
| def draw_keyframing_tools(context, layout): | def draw_keyframing_tools(context, layout): | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Keyframes:") | col.label(text="Keyframes:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("anim.keyframe_insert_menu", text="Insert") | row.operator("anim.keyframe_insert_menu", text="Insert") | ||||
| row.operator("anim.keyframe_delete_v3d", text="Remove") | row.operator("anim.keyframe_delete_v3d", text="Remove") | ||||
| # Grease Pencil tools | # Grease Pencil tools | ||||
| def draw_gpencil_tools(context, layout): | def draw_gpencil_tools(context, layout): | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Grease Pencil:") | col.label(text="Grease Pencil:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("gpencil.draw", text="Draw").mode = 'DRAW' | row.operator("gpencil.draw", text="Draw").mode = 'DRAW' | ||||
| row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' | row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' | row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' | ||||
| row.operator("gpencil.draw", text="Erase").mode = 'ERASER' | row.operator("gpencil.draw", text="Erase").mode = 'ERASER' | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(context.tool_settings, "use_grease_pencil_sessions") | row.prop(context.tool_settings, "use_grease_pencil_sessions") | ||||
| col.operator("view3d.ruler") | col.operator("view3d.ruler") | ||||
| # ********** default tools for object-mode **************** | # ********** default tools for object-mode **************** | ||||
| class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): | class VIEW3D_PT_tools_basic(View3DPanel, Panel): | ||||
| bl_category = "Basic" | |||||
| bl_context = "objectmode" | bl_context = "objectmode" | ||||
| bl_label = "Object Tools" | bl_label = "Basic" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Transform:") | col.label(text="Transform:") | ||||
| col.operator("transform.translate") | col.operator("transform.translate") | ||||
| col.operator("transform.rotate") | col.operator("transform.rotate") | ||||
| col.operator("transform.resize", text="Scale") | col.operator("transform.resize", text="Scale") | ||||
| col = layout.column(align=True) | active_object = context.active_object | ||||
| col.operator("object.origin_set", text="Origin") | if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Object:") | col.label(text="Object:") | ||||
| col.operator("object.join") | |||||
| col.operator("object.duplicate_move", text="Duplicate") | col.operator("object.duplicate_move", text="Duplicate") | ||||
| col.operator("object.duplicate_move_linked", text="Duplicate Linked") | |||||
| col.operator("object.delete") | col.operator("object.delete") | ||||
| col.operator("object.join") | |||||
| active_object = context.active_object | col = layout.column(align=True) | ||||
| if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | col.operator("object.origin_set", text="Origin") | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Shading:") | col.label(text="Shading:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("object.shade_smooth", text="Smooth") | row.operator("object.shade_smooth", text="Smooth") | ||||
| row.operator("object.shade_flat", text="Flat") | row.operator("object.shade_flat", text="Flat") | ||||
| class VIEW3D_PT_tools_animation(View3DPanel, Panel): | |||||
| bl_category = "Animation" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "Animation" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| draw_keyframing_tools(context, layout) | draw_keyframing_tools(context, layout) | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Motion Paths:") | col.label(text="Motion Paths:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("object.paths_calculate", text="Calculate") | row.operator("object.paths_calculate", text="Calculate") | ||||
| row.operator("object.paths_clear", text="Clear") | row.operator("object.paths_clear", text="Clear") | ||||
| draw_repeat_tools(context, layout) | |||||
| draw_gpencil_tools(context, layout) | |||||
| class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel): | class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel): | ||||
| bl_category = "Physics" | |||||
| bl_context = "objectmode" | bl_context = "objectmode" | ||||
| bl_label = "Rigid Body Tools" | bl_label = "Rigid Body Tools" | ||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Add/Remove:") | col.label(text="Add/Remove:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE' | row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE' | ||||
| row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE' | row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE' | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator("rigidbody.objects_remove", text="Remove") | row.operator("rigidbody.objects_remove", text="Remove") | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Object Tools:") | col.label(text="Object Tools:") | ||||
| col.operator("rigidbody.shape_change", text="Change Shape") | col.operator("rigidbody.shape_change", text="Change Shape") | ||||
| col.operator("rigidbody.mass_calculate", text="Calculate Mass") | col.operator("rigidbody.mass_calculate", text="Calculate Mass") | ||||
| col.operator("rigidbody.object_settings_copy", text="Copy from Active") | col.operator("rigidbody.object_settings_copy", text="Copy from Active") | ||||
| col.operator("object.visual_transform_apply", text="Apply Transformation") | col.operator("object.visual_transform_apply", text="Apply Transformation") | ||||
| col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes") | col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes") | ||||
| col.label(text="Constraints:") | col.label(text="Constraints:") | ||||
| col.operator("rigidbody.connect", text="Connect") | col.operator("rigidbody.connect", text="Connect") | ||||
| # ********** default tools for editmode_mesh **************** | # Grease Pencil tools | ||||
| class VIEW3D_PT_tools_greasepencil(View3DPanel, Panel): | |||||
| bl_category = "Grease Pencil" | |||||
| bl_label = "Grease Pencil" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| draw_gpencil_tools(context, layout) | |||||
| class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): | |||||
| bl_category = "History" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "History" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| draw_repeat_tools(context, layout) | |||||
| # ********** default tools for editmode_mesh **************** | |||||
| class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): | class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): | ||||
| bl_context = "mesh_edit" | bl_context = "mesh_edit" | ||||
| bl_label = "Mesh Tools" | bl_label = "Mesh Tools" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 1,221 Lines • Show Last 20 Lines | |||||