Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d.py
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,023 Lines • ▼ Show 20 Lines | |||||
| class VIEW3D_MT_transform_base: | class VIEW3D_MT_transform_base: | ||||
| bl_label = "Transform" | bl_label = "Transform" | ||||
| bl_category = "View" | bl_category = "View" | ||||
| # TODO: get rid of the custom text strings? | # TODO: get rid of the custom text strings? | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator("transform.translate") | layout.operator("transform.translate").release_confirm = False | ||||
| layout.operator("transform.rotate") | layout.operator("transform.rotate").release_confirm = False | ||||
| layout.operator("transform.resize", text="Scale") | layout.operator("transform.resize", text="Scale").release_confirm = False | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("transform.tosphere", text="To Sphere") | layout.operator("transform.tosphere", text="To Sphere").release_confirm = False | ||||
| layout.operator("transform.shear", text="Shear") | layout.operator("transform.shear", text="Shear").release_confirm = False | ||||
| layout.operator("transform.bend", text="Bend") | layout.operator("transform.bend", text="Bend").release_confirm = False | ||||
| layout.operator("transform.push_pull", text="Push/Pull") | layout.operator("transform.push_pull", text="Push/Pull").release_confirm = False | ||||
| if context.mode in {'EDIT_MESH', 'EDIT_ARMATURE', 'EDIT_SURFACE', 'EDIT_CURVE', | if context.mode in {'EDIT_MESH', 'EDIT_ARMATURE', 'EDIT_SURFACE', 'EDIT_CURVE', | ||||
| 'EDIT_LATTICE', 'EDIT_METABALL'}: | 'EDIT_LATTICE', 'EDIT_METABALL'}: | ||||
| layout.operator("transform.vertex_warp", text="Warp") | layout.operator("transform.vertex_warp", text="Warp") | ||||
| layout.operator_context = 'EXEC_REGION_WIN' | layout.operator_context = 'EXEC_REGION_WIN' | ||||
| layout.operator("transform.vertex_random", text="Randomize").offset = 0.1 | layout.operator("transform.vertex_random", text="Randomize").offset = 0.1 | ||||
| layout.operator_context = 'INVOKE_REGION_WIN' | layout.operator_context = 'INVOKE_REGION_WIN' | ||||
| # Generic transform menu - geometry types | # Generic transform menu - geometry types | ||||
| class VIEW3D_MT_transform(VIEW3D_MT_transform_base, Menu): | class VIEW3D_MT_transform(VIEW3D_MT_transform_base, Menu): | ||||
| def draw(self, context): | def draw(self, context): | ||||
| # base menu | # base menu | ||||
| VIEW3D_MT_transform_base.draw(self, context) | VIEW3D_MT_transform_base.draw(self, context) | ||||
| # generic... | # generic... | ||||
| layout = self.layout | layout = self.layout | ||||
| if context.mode == 'EDIT_MESH': | if context.mode == 'EDIT_MESH': | ||||
| layout.operator("transform.shrink_fatten", text="Shrink/Fatten") | layout.operator("transform.shrink_fatten", text="Shrink/Fatten").release_confirm = False | ||||
| layout.operator("transform.skin_resize") | layout.operator("transform.skin_resize").release_confirm = False | ||||
| elif context.mode == 'EDIT_CURVE': | elif context.mode == 'EDIT_CURVE': | ||||
| layout.operator("transform.transform", text="Radius").mode = 'CURVE_SHRINKFATTEN' | props = layout.operator("transform.transform", text="Radius") | ||||
| props.mode = 'CURVE_SHRINKFATTEN' | |||||
| props.release_confirm = False | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator("transform.translate", text="Move Texture Space").texture_space = True | props = layout.operator("transform.translate", text="Move Texture Space") | ||||
| layout.operator("transform.resize", text="Scale Texture Space").texture_space = True | props.texture_space = True | ||||
| props.release_confirm = False | |||||
| props = layout.operator("transform.resize", text="Scale Texture Space") | |||||
| props.texture_space = True | |||||
| props.release_confirm = False | |||||
| # Object-specific extensions to Transform menu | # Object-specific extensions to Transform menu | ||||
| class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base, Menu): | class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base, Menu): | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| # base menu | # base menu | ||||
| VIEW3D_MT_transform_base.draw(self, context) | VIEW3D_MT_transform_base.draw(self, context) | ||||
| # object-specific option follow... | # object-specific option follow... | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("transform.translate", text="Move Texture Space").texture_space = True | props = layout.operator("transform.translate", text="Move Texture Space") | ||||
| layout.operator("transform.resize", text="Scale Texture Space").texture_space = True | props.texture_space = True | ||||
| props.release_confirm = False | |||||
| props = layout.operator("transform.resize", text="Scale Texture Space") | |||||
| props.texture_space = True | |||||
| props.release_confirm = False | |||||
| layout.separator() | layout.separator() | ||||
| layout.operator_context = 'EXEC_REGION_WIN' | layout.operator_context = 'EXEC_REGION_WIN' | ||||
| # XXX see alignmenu() in edit.c of b2.4x to get this working | # XXX see alignmenu() in edit.c of b2.4x to get this working | ||||
| layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' | layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' | ||||
| layout.separator() | layout.separator() | ||||
| Show All 21 Lines | def draw(self, context): | ||||
| if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}: | if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}: | ||||
| if obj.data.display_type == 'BBONE': | if obj.data.display_type == 'BBONE': | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE' | layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE' | ||||
| elif obj.data.display_type == 'ENVELOPE': | elif obj.data.display_type == 'ENVELOPE': | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE' | props = layout.operator("transform.transform", text="Scale Envelope Distance") | ||||
| layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE' | props.mode = 'BONE_SIZE' | ||||
| props.release_confirm = False | |||||
| props = layout.operator("transform.transform", text="Scale Radius") | |||||
| props.mode = 'BONE_ENVELOPE' | |||||
| props.release_confirm = False | |||||
| if context.edit_object and context.edit_object.type == 'ARMATURE': | if context.edit_object and context.edit_object.type == 'ARMATURE': | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("armature.align") | layout.operator("armature.align") | ||||
| class VIEW3D_MT_mirror(Menu): | class VIEW3D_MT_mirror(Menu): | ||||
| ▲ Show 20 Lines • Show All 7,098 Lines • Show Last 20 Lines | |||||