From a49e80c48a7dc23ac388d7846ef47680e752d2d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 Jan 2012 13:09:58 +0000 Subject: use `props` all over for operator properties vars --- release/scripts/modules/rna_prop_ui.py | 8 ++--- release/scripts/startup/bl_operators/wm.py | 6 ++-- release/scripts/startup/bl_ui/properties_object.py | 6 ++-- release/scripts/startup/bl_ui/space_image.py | 42 +++++++++++----------- release/scripts/startup/bl_ui/space_view3d.py | 18 +++++----- .../scripts/startup/bl_ui/space_view3d_toolbar.py | 12 +++---- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 388ae2b0e13..32c8ed11bc5 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -145,11 +145,11 @@ def draw(layout, context, context_member, property_type, use_edit=True): if use_edit: row = split.row(align=True) - prop = row.operator("wm.properties_edit", text="edit") - assign_props(prop, val_draw, key) + props = row.operator("wm.properties_edit", text="edit") + assign_props(props, val_draw, key) - prop = row.operator("wm.properties_remove", text="", icon='ZOOMOUT') - assign_props(prop, val_draw, key) + props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT') + assign_props(props, val_draw, key) class PropertyPanel(): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index fa3b84ed8d7..11326377a79 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -502,9 +502,9 @@ class WM_MT_context_menu_enum(Menu): values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items] for name, identifier in values: - prop = self.layout.operator("wm.context_set_enum", text=name) - prop.data_path = data_path - prop.value = identifier + props = self.layout.operator("wm.context_set_enum", text=name) + props.data_path = data_path + props.value = identifier class WM_OT_context_menu_enum(Operator): diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 27b6aa721a4..f01c2ba45e0 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -181,9 +181,9 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel): col = split.column() col.prop(group, "dupli_offset", text="") - prop = col.operator("wm.context_set_value", text="From Cursor") - prop.data_path = "object.users_group[%d].dupli_offset" % index - prop.value = value + props = col.operator("wm.context_set_value", text="From Cursor") + props.data_path = "object.users_group[%d].dupli_offset" % index + props.value = value index += 1 diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 81526797109..4ccdef747ce 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -298,34 +298,34 @@ class IMAGE_MT_uvs_select_mode(Menu): # do smart things depending on whether uv_select_sync is on if toolsettings.use_uv_select_sync: - prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') - prop.value = "(True, False, False)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') + props.value = "(True, False, False)" + props.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') - prop.value = "(False, True, False)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') + props.value = "(False, True, False)" + props.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') - prop.value = "(False, False, True)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') + props.value = "(False, False, True)" + props.data_path = "tool_settings.mesh_select_mode" else: - prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL') - prop.value = 'VERTEX' - prop.data_path = "tool_settings.uv_select_mode" + props = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL') + props.value = 'VERTEX' + props.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL') - prop.value = 'EDGE' - prop.data_path = "tool_settings.uv_select_mode" + props = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL') + props.value = 'EDGE' + props.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL') - prop.value = 'FACE' - prop.data_path = "tool_settings.uv_select_mode" + props = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL') + props.value = 'FACE' + props.data_path = "tool_settings.uv_select_mode" - prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL') - prop.value = 'ISLAND' - prop.data_path = "tool_settings.uv_select_mode" + props = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL') + props.value = 'ISLAND' + props.data_path = "tool_settings.uv_select_mode" class IMAGE_HT_header(Header): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 84d207f4e45..22d0e39a54b 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1523,17 +1523,17 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') - prop.value = "(True, False, False)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') + props.value = "(True, False, False)" + props.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') - prop.value = "(False, True, False)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') + props.value = "(False, True, False)" + props.data_path = "tool_settings.mesh_select_mode" - prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') - prop.value = "(False, False, True)" - prop.data_path = "tool_settings.mesh_select_mode" + props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') + props.value = "(False, False, True)" + props.data_path = "tool_settings.mesh_select_mode" class VIEW3D_MT_edit_mesh_extrude(Menu): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 9644f57d6cd..25f81f2cde1 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1198,9 +1198,9 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu): def draw(self, context): layout = self.layout for i, tex in enumerate(context.active_object.data.uv_textures): - prop = layout.operator("wm.context_set_int", text=tex.name) - prop.data_path = "active_object.data.uv_texture_clone_index" - prop.value = i + props = layout.operator("wm.context_set_int", text=tex.name) + props.data_path = "active_object.data.uv_texture_clone_index" + props.value = i class VIEW3D_MT_tools_projectpaint_stencil(Menu): @@ -1209,9 +1209,9 @@ class VIEW3D_MT_tools_projectpaint_stencil(Menu): def draw(self, context): layout = self.layout for i, tex in enumerate(context.active_object.data.uv_textures): - prop = layout.operator("wm.context_set_int", text=tex.name) - prop.data_path = "active_object.data.uv_texture_stencil_index" - prop.value = i + props = layout.operator("wm.context_set_int", text=tex.name) + props.data_path = "active_object.data.uv_texture_stencil_index" + props.value = i class VIEW3D_PT_tools_particlemode(View3DPanel, Panel): -- cgit v1.2.3