Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-19 10:25:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-19 10:25:05 +0300
commit816817011feeb2980b050301680ccdb31aa2016f (patch)
tree2ec82b1832bedeafa87e2f958692ae824c1a4b2b /release
parent9025841a0aefb47227eb578f42767415166c3a76 (diff)
Cleanup: rename mode -> object.mode in Py UI
Keep 'mode' only for 'context.mode'.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index fe1d23b4225..1a3b0131eb5 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -43,9 +43,9 @@ class VIEW3D_HT_header(Header):
row = layout.row(align=True)
row.template_header()
- mode = 'OBJECT' if obj is None else obj.mode
+ object_mode = 'OBJECT' if obj is None else obj.mode
- act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[mode]
+ act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode]
layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
del act_mode_item
@@ -57,22 +57,22 @@ class VIEW3D_HT_header(Header):
if obj:
# Set above:
- # mode = obj.mode
+ # object_mode = obj.mode
# Particle edit
- if mode == 'PARTICLE_EDIT':
+ if object_mode == 'PARTICLE_EDIT':
row = layout.row()
row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True)
# Occlude geometry
if ((((shading.type not in {'SOLID', 'TEXTURED'}) or not shading.show_xray) and
- (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
- (mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})):
+ (object_mode == 'PARTICLE_EDIT' or (object_mode == 'EDIT' and obj.type == 'MESH'))) or
+ (object_mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})):
row = layout.row()
row.prop(view, "use_occlude_geometry", text="")
# Pose
- if obj and mode == 'POSE':
+ if obj and object_mode == 'POSE':
row = layout.row(align=True)
row.operator("pose.copy", text="", icon='COPYDOWN')
row.operator("pose.paste", text="", icon='PASTEDOWN').flipped = False
@@ -96,7 +96,6 @@ class VIEW3D_HT_header(Header):
layout.separator_spacer()
# Mode & Transform Settings
- object_mode = 'OBJECT' if obj is None else obj.mode
scene = context.scene
# Orientation & Pivot
@@ -4126,10 +4125,10 @@ class VIEW3D_PT_context_properties(Panel):
def _active_context_member(context):
obj = context.object
if obj:
- mode = obj.mode
- if mode == 'POSE':
+ object_mode = obj.mode
+ if object_mode == 'POSE':
return "active_pose_bone"
- elif mode == 'EDIT' and obj.type == 'ARMATURE':
+ elif object_mode == 'EDIT' and obj.type == 'ARMATURE':
return "active_bone"
else:
return "object"