diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 41dfd360ff4..7f898cd065e 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -48,7 +48,7 @@ class VIEW3D_HT_header(Header): layout.template_header_3D() if obj: - mode = context.workspace.object_mode + mode = obj.mode # Particle edit if mode == 'PARTICLE_EDIT': row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True) @@ -317,9 +317,8 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): VIEW3D_MT_transform_base.draw(self, context) # armature specific extensions follow... - workspace = context.workspace obj = context.object - if obj.type == 'ARMATURE' and workspace.object_mode in {'EDIT', 'POSE'}: + if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}: if obj.data.draw_type == 'BBONE': layout.separator() @@ -1956,10 +1955,7 @@ class VIEW3D_MT_vertex_group(Menu): layout.operator("object.vertex_group_assign_new") ob = context.active_object - workspace = context.workspace - if ((workspace.object_mode == 'EDIT') or - (workspace.object_mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex) - ): + if ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex): if ob.vertex_groups.active: layout.separator() @@ -3405,7 +3401,7 @@ class VIEW3D_PT_view3d_properties(Panel): if lock_object: if lock_object.type == 'ARMATURE': col.prop_search(view, "lock_bone", lock_object.data, - "edit_bones" if context.mode == 'EDIT_ARMATURE' + "edit_bones" if lock_object.mode == 'EDIT' else "bones", text="") else: @@ -3458,13 +3454,12 @@ class VIEW3D_PT_view3d_name(Panel): def draw(self, context): layout = self.layout - workspace = context.workspace ob = context.active_object row = layout.row() row.label(text="", icon='OBJECT_DATA') row.prop(ob, "name", text="") - if ob.type == 'ARMATURE' and workspace.object_mode in {'EDIT', 'POSE'}: + if ob.type == 'ARMATURE' and ob.mode in {'EDIT', 'POSE'}: bone = context.active_bone if bone: row = layout.row() @@ -3782,8 +3777,7 @@ class VIEW3D_PT_etch_a_ton(Panel): def poll(cls, context): scene = context.space_data ob = context.active_object - workspace = context.workspace - return scene and ob and (ob.type == 'ARMATURE') and (workspace.object_mode == 'EDIT') + return scene and ob and ob.type == 'ARMATURE' and ob.mode == 'EDIT' def draw_header(self, context): layout = self.layout @@ -3839,8 +3833,7 @@ class VIEW3D_PT_context_properties(Panel): def _active_context_member(context): obj = context.object if obj: - workspace = context.workspace - mode = workspace.object_mode + mode = obj.mode if mode == 'POSE': return "active_pose_bone" elif mode == 'EDIT' and obj.type == 'ARMATURE': |