Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | def draw_gpencil_tools(context, layout): | ||||
| col.separator() | col.separator() | ||||
| col.label(text="Measure:") | col.label(text="Measure:") | ||||
| col.operator("view3d.ruler") | col.operator("view3d.ruler") | ||||
| # ********** default tools for object-mode **************** | # ********** default tools for object-mode **************** | ||||
| class VIEW3D_PT_tools_transform(View3DPanel, Panel): | |||||
| bl_category = "Tools" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "Transform" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| col.operator("transform.translate") | |||||
| col.operator("transform.rotate") | |||||
| col.operator("transform.resize", text="Scale") | |||||
| active_object = context.active_object | |||||
| if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | |||||
| col = layout.column(align=True) | |||||
| col.operator("transform.mirror", text="Mirror") | |||||
| class VIEW3D_PT_tools_object(View3DPanel, Panel): | |||||
| bl_category = "Tools" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "Edit" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| col.operator("object.duplicate_move", text="Duplicate") | |||||
| col.operator("object.duplicate_move_linked", text="Duplicate Linked") | |||||
| active_object = context.active_object | |||||
| if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | |||||
| col = layout.column(align=True) | |||||
| col.operator("object.join") | |||||
| col.operator("object.delete") | |||||
| col = layout.column(align=True) | |||||
| if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | |||||
| col = layout.column(align=True) | |||||
| col.operator("object.origin_set", text="Set Origin") | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Shading:") | |||||
| row = col.row(align=True) | |||||
| row.operator("object.shade_smooth", text="Smooth") | |||||
| row.operator("object.shade_flat", text="Flat") | |||||
| class VIEW3D_PT_tools_objectmode(View3DPanel, Panel): | |||||
| bl_category = "Tools" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "History" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| row = col.row(align=True) | |||||
| row.operator("ed.undo") | |||||
| row.operator("ed.redo") | |||||
| col.operator("ed.undo_history") | |||||
| draw_repeat_tools(context, layout) | |||||
| class VIEW3D_PT_tools_add_mesh(View3DPanel, Panel): | class VIEW3D_PT_tools_add_mesh(View3DPanel, Panel): | ||||
| bl_category = "Create" | bl_category = "Create" | ||||
| bl_context = "objectmode" | bl_context = "objectmode" | ||||
| bl_label = "Add Primitive" | bl_label = "Add Primitive" | ||||
| def draw (self, context): | def draw (self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 23 Lines | def draw (self, context): | ||||
| col.operator("object.lamp_add", text="Area", icon="LAMP_AREA").type='AREA' | col.operator("object.lamp_add", text="Area", icon="LAMP_AREA").type='AREA' | ||||
| col.label(text="Other:") | col.label(text="Other:") | ||||
| col.operator("object.text_add", text="Text", icon ="OUTLINER_OB_FONT") | col.operator("object.text_add", text="Text", icon ="OUTLINER_OB_FONT") | ||||
| col.operator("object.armature_add",text="Armature", icon="OUTLINER_OB_ARMATURE") | col.operator("object.armature_add",text="Armature", icon="OUTLINER_OB_ARMATURE") | ||||
| col.operator("object.add", text="Lattice", icon="OUTLINER_OB_LATTICE").type='LATTICE' | col.operator("object.add", text="Lattice", icon="OUTLINER_OB_LATTICE").type='LATTICE' | ||||
| col.operator("object.empty_add", text="Empty", icon="OUTLINER_OB_EMPTY").type='PLAIN_AXES' | col.operator("object.empty_add", text="Empty", icon="OUTLINER_OB_EMPTY").type='PLAIN_AXES' | ||||
| col.operator("object.camera_add", text="Camera", icon="OUTLINER_OB_CAMERA") | col.operator("object.camera_add", text="Camera", icon="OUTLINER_OB_CAMERA") | ||||
| class VIEW3D_PT_tools_basic(View3DPanel, Panel): | |||||
| bl_category = "Basic" | |||||
| bl_context = "objectmode" | |||||
| bl_label = "Object Operations" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Transform:") | |||||
| col.operator("transform.translate") | |||||
| col.operator("transform.rotate") | |||||
| col.operator("transform.resize", text="Scale") | |||||
| active_object = context.active_object | |||||
| if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}: | |||||
| col = layout.column(align=True) | |||||
| col.operator("transform.mirror", text="Mirror") | |||||
| col = layout.column(align=True) | |||||
| col.operator("object.origin_set", text="Set Origin") | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Operations:") | |||||
| col.operator("object.duplicate_move", text="Duplicate") | |||||
| col.operator("object.duplicate_move_linked", text="Duplicate Linked") | |||||
| col = layout.column(align=True) | |||||
| col.operator("object.join") | |||||
| col.operator("object.delete") | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Shading:") | |||||
| row = col.row(align=True) | |||||
| row.operator("object.shade_smooth", text="Smooth") | |||||
| row.operator("object.shade_flat", text="Flat") | |||||
| class VIEW3D_PT_tools_relations(View3DPanel, Panel): | class VIEW3D_PT_tools_relations(View3DPanel, Panel): | ||||
| bl_category = "Relations" | bl_category = "Relations" | ||||
| bl_context = "objectmode" | bl_context = "objectmode" | ||||
| bl_label = "Relations" | bl_label = "Relations" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 17 Lines | def draw(self, context): | ||||
| col.operator("object.make_links_data") | col.operator("object.make_links_data") | ||||
| col.operator("object.make_single_user") | col.operator("object.make_single_user") | ||||
| col.separator() | col.separator() | ||||
| col.label(text="Linked Objects:") | col.label(text="Linked Objects:") | ||||
| col.operator("object.make_local") | col.operator("object.make_local") | ||||
| col.operator("object.proxy_make") | col.operator("object.proxy_make") | ||||
| class VIEW3D_PT_tools_animation(View3DPanel, Panel): | class VIEW3D_PT_tools_animation(View3DPanel, Panel): | ||||
| bl_category = "Animation" | bl_category = "Animation" | ||||
| bl_context = "objectmode" | bl_context = "objectmode" | ||||
| bl_label = "Animation" | bl_label = "Animation" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 35 Lines | def draw(self, context): | ||||
| 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 **************** | # ********** default tools for editmode_mesh **************** | ||||
| class VIEW3D_PT_tools_transform_mesh(View3DPanel, Panel): | class VIEW3D_PT_tools_transform_mesh(View3DPanel, Panel): | ||||
| bl_category = "Mesh Tools" | bl_category = "Tools" | ||||
| bl_context = "mesh_edit" | bl_context = "mesh_edit" | ||||
| bl_label = "Transform" | bl_label = "Transform" | ||||
| 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.operator("transform.shrink_fatten", text="Shrink/Fatten") | col.operator("transform.shrink_fatten", text="Shrink/Fatten") | ||||
| col.operator("transform.push_pull", text="Push/Pull") | col.operator("transform.push_pull", text="Push/Pull") | ||||
| class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): | class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): | ||||
| bl_category = "Mesh Tools" | bl_category = "Tools" | ||||
| 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 | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Deform:") | col.label(text="Deform:") | ||||
| Show All 29 Lines | def draw(self, context): | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.label(text="Remove:") | col.label(text="Remove:") | ||||
| col.menu("VIEW3D_MT_edit_mesh_delete") | col.menu("VIEW3D_MT_edit_mesh_delete") | ||||
| col.operator_menu_enum("mesh.merge", "type") | col.operator_menu_enum("mesh.merge", "type") | ||||
| col.operator("mesh.remove_doubles") | col.operator("mesh.remove_doubles") | ||||
| draw_repeat_tools(context, layout) | draw_repeat_tools(context, layout) | ||||
| class VIEW3D_PT_tools_add_mesh_edit(View3DPanel, Panel): | |||||
| bl_category = "Create" | |||||
| bl_context = "mesh_edit" | |||||
| bl_label = "Add Meshes" | |||||
| def draw (self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Primitives:") | |||||
| col.operator("mesh.primitive_plane_add", text="Plane", icon="MESH_PLANE") | |||||
| col.operator("mesh.primitive_cube_add", text="Cube", icon="MESH_CUBE") | |||||
| col.operator("mesh.primitive_circle_add", text="Circle", icon="MESH_CIRCLE") | |||||
| col.operator("mesh.primitive_uv_sphere_add", text="UV Sphere", icon="MESH_UVSPHERE") | |||||
| col.operator("mesh.primitive_ico_sphere_add", text="Ico Sphere", icon="MESH_ICOSPHERE") | |||||
| col.operator("mesh.primitive_cylinder_add", text="Cylinder", icon="MESH_CYLINDER") | |||||
| col.operator("mesh.primitive_cone_add", text="Cone", icon="MESH_CONE") | |||||
| col.operator("mesh.primitive_torus_add", text="Torus", icon="MESH_TORUS") | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Special:") | |||||
| col.operator("mesh.primitive_grid_add", text="Grid", icon="MESH_GRID") | |||||
| col.operator("mesh.primitive_monkey_add", text="Monkey", icon="MESH_MONKEY") | |||||
| class VIEW3D_PT_tools_shading(View3DPanel, Panel): | class VIEW3D_PT_tools_shading(View3DPanel, Panel): | ||||
| bl_category = "Shading / UVs" | bl_category = "Shading / UVs" | ||||
| bl_context = "mesh_edit" | bl_context = "mesh_edit" | ||||
| bl_label = "Shading" | bl_label = "Shading" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 16 Lines | class VIEW3D_PT_tools_uvs(View3DPanel, Panel): | ||||
| 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="UV Mapping:") | col.label(text="UV Mapping:") | ||||
| col.menu("VIEW3D_MT_uv_map", text="Unwrap") | col.menu("VIEW3D_MT_uv_map", text="Unwrap") | ||||
| col.operator("mesh.mark_seam").clear = False | col.operator("mesh.mark_seam").clear = False | ||||
| col.operator("mesh.mark_seam", text="Clear Seam").clear = True | col.operator("mesh.mark_seam", text="Clear Seam").clear = True | ||||
| class VIEW3D_PT_tools_add_mesh_edit(View3DPanel, Panel): | |||||
| bl_category = "Create" | |||||
| bl_context = "mesh_edit" | |||||
| bl_label = "Add Meshes" | |||||
| def draw (self, context): | |||||
| layout = self.layout | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Primitives:") | |||||
| col.operator("mesh.primitive_plane_add", text="Plane", icon="MESH_PLANE") | |||||
| col.operator("mesh.primitive_cube_add", text="Cube", icon="MESH_CUBE") | |||||
| col.operator("mesh.primitive_circle_add", text="Circle", icon="MESH_CIRCLE") | |||||
| col.operator("mesh.primitive_uv_sphere_add", text="UV Sphere", icon="MESH_UVSPHERE") | |||||
| col.operator("mesh.primitive_ico_sphere_add", text="Ico Sphere", icon="MESH_ICOSPHERE") | |||||
| col.operator("mesh.primitive_cylinder_add", text="Cylinder", icon="MESH_CYLINDER") | |||||
| col.operator("mesh.primitive_cone_add", text="Cone", icon="MESH_CONE") | |||||
| col.operator("mesh.primitive_torus_add", text="Torus", icon="MESH_TORUS") | |||||
| col = layout.column(align=True) | |||||
| col.label(text="Special:") | |||||
| col.operator("mesh.primitive_grid_add", text="Grid", icon="MESH_GRID") | |||||
| col.operator("mesh.primitive_monkey_add", text="Monkey", icon="MESH_MONKEY") | |||||
| class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): | class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): | ||||
| bl_category = "Options" | bl_category = "Options" | ||||
| bl_context = "mesh_edit" | bl_context = "mesh_edit" | ||||
| bl_label = "Mesh Options" | bl_label = "Mesh Options" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.active_object | return context.active_object | ||||
| ▲ Show 20 Lines • Show All 1,150 Lines • ▼ Show 20 Lines | |||||
| class VIEW3D_PT_tools_greasepencil(View3DPanel, Panel): | class VIEW3D_PT_tools_greasepencil(View3DPanel, Panel): | ||||
| bl_category = "Grease Pencil" | bl_category = "Grease Pencil" | ||||
| bl_label = "Grease Pencil" | bl_label = "Grease Pencil" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| draw_gpencil_tools(context, 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 | |||||
| col = layout.column(align=True) | |||||
| row = col.row(align=True) | |||||
| row.operator("ed.undo") | |||||
| row.operator("ed.redo") | |||||
| col.operator("ed.undo_history") | |||||
| draw_repeat_tools(context, layout) | |||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_module(__name__) | ||||