forked from bartvdbraak/blender
use props
all over for operator properties vars
This commit is contained in:
parent
9b45d8acad
commit
a49e80c48a
@ -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():
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user