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:
|
if use_edit:
|
||||||
row = split.row(align=True)
|
row = split.row(align=True)
|
||||||
prop = row.operator("wm.properties_edit", text="edit")
|
props = row.operator("wm.properties_edit", text="edit")
|
||||||
assign_props(prop, val_draw, key)
|
assign_props(props, val_draw, key)
|
||||||
|
|
||||||
prop = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
|
props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
|
||||||
assign_props(prop, val_draw, key)
|
assign_props(props, val_draw, key)
|
||||||
|
|
||||||
|
|
||||||
class PropertyPanel():
|
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]
|
values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items]
|
||||||
|
|
||||||
for name, identifier in values:
|
for name, identifier in values:
|
||||||
prop = self.layout.operator("wm.context_set_enum", text=name)
|
props = self.layout.operator("wm.context_set_enum", text=name)
|
||||||
prop.data_path = data_path
|
props.data_path = data_path
|
||||||
prop.value = identifier
|
props.value = identifier
|
||||||
|
|
||||||
|
|
||||||
class WM_OT_context_menu_enum(Operator):
|
class WM_OT_context_menu_enum(Operator):
|
||||||
|
@ -181,9 +181,9 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.prop(group, "dupli_offset", text="")
|
col.prop(group, "dupli_offset", text="")
|
||||||
|
|
||||||
prop = col.operator("wm.context_set_value", text="From Cursor")
|
props = col.operator("wm.context_set_value", text="From Cursor")
|
||||||
prop.data_path = "object.users_group[%d].dupli_offset" % index
|
props.data_path = "object.users_group[%d].dupli_offset" % index
|
||||||
prop.value = value
|
props.value = value
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
|
|
||||||
|
@ -298,34 +298,34 @@ class IMAGE_MT_uvs_select_mode(Menu):
|
|||||||
# do smart things depending on whether uv_select_sync is on
|
# do smart things depending on whether uv_select_sync is on
|
||||||
|
|
||||||
if toolsettings.use_uv_select_sync:
|
if toolsettings.use_uv_select_sync:
|
||||||
prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
|
props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
|
||||||
prop.value = "(True, False, False)"
|
props.value = "(True, False, False)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
|
props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
|
||||||
prop.value = "(False, True, False)"
|
props.value = "(False, True, False)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
|
props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
|
||||||
prop.value = "(False, False, True)"
|
props.value = "(False, False, True)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
|
props = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
|
||||||
prop.value = 'VERTEX'
|
props.value = 'VERTEX'
|
||||||
prop.data_path = "tool_settings.uv_select_mode"
|
props.data_path = "tool_settings.uv_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
|
props = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
|
||||||
prop.value = 'EDGE'
|
props.value = 'EDGE'
|
||||||
prop.data_path = "tool_settings.uv_select_mode"
|
props.data_path = "tool_settings.uv_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
|
props = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
|
||||||
prop.value = 'FACE'
|
props.value = 'FACE'
|
||||||
prop.data_path = "tool_settings.uv_select_mode"
|
props.data_path = "tool_settings.uv_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
|
props = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
|
||||||
prop.value = 'ISLAND'
|
props.value = 'ISLAND'
|
||||||
prop.data_path = "tool_settings.uv_select_mode"
|
props.data_path = "tool_settings.uv_select_mode"
|
||||||
|
|
||||||
|
|
||||||
class IMAGE_HT_header(Header):
|
class IMAGE_HT_header(Header):
|
||||||
|
@ -1523,17 +1523,17 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
|
|||||||
|
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
|
props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
|
||||||
prop.value = "(True, False, False)"
|
props.value = "(True, False, False)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
|
props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
|
||||||
prop.value = "(False, True, False)"
|
props.value = "(False, True, False)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
|
props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
|
||||||
prop.value = "(False, False, True)"
|
props.value = "(False, False, True)"
|
||||||
prop.data_path = "tool_settings.mesh_select_mode"
|
props.data_path = "tool_settings.mesh_select_mode"
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_edit_mesh_extrude(Menu):
|
class VIEW3D_MT_edit_mesh_extrude(Menu):
|
||||||
|
@ -1198,9 +1198,9 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
for i, tex in enumerate(context.active_object.data.uv_textures):
|
for i, tex in enumerate(context.active_object.data.uv_textures):
|
||||||
prop = layout.operator("wm.context_set_int", text=tex.name)
|
props = layout.operator("wm.context_set_int", text=tex.name)
|
||||||
prop.data_path = "active_object.data.uv_texture_clone_index"
|
props.data_path = "active_object.data.uv_texture_clone_index"
|
||||||
prop.value = i
|
props.value = i
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
|
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
|
||||||
@ -1209,9 +1209,9 @@ class VIEW3D_MT_tools_projectpaint_stencil(Menu):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
for i, tex in enumerate(context.active_object.data.uv_textures):
|
for i, tex in enumerate(context.active_object.data.uv_textures):
|
||||||
prop = layout.operator("wm.context_set_int", text=tex.name)
|
props = layout.operator("wm.context_set_int", text=tex.name)
|
||||||
prop.data_path = "active_object.data.uv_texture_stencil_index"
|
props.data_path = "active_object.data.uv_texture_stencil_index"
|
||||||
prop.value = i
|
props.value = i
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
|
||||||
|
Loading…
Reference in New Issue
Block a user