more ui api changes.

- remove functions such as operator_int(), operator_enum(), operator_string
  this mixed with keyword arguments in a way that made them hard to read.
  Instead, have operator() always return properties rather then needing an argument.

- rename prop_pointer() --> prop_object(), pointer is more a C thing.

- missed item_enumR(), rename to prop_enum()
This commit is contained in:
2009-11-23 11:43:38 +00:00
parent c6dbbde16b
commit e0fc6d0c33
36 changed files with 284 additions and 290 deletions

View File

@@ -1142,6 +1142,6 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".3ds") default_path = bpy.data.filename.replace(".blend", ".3ds")
self.layout.operator_string(Export3DS.bl_idname, "path", default_path, text="Autodesk 3DS...") self.layout.operator(Export3DS.bl_idname, text="Autodesk 3DS...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -3466,7 +3466,7 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".fbx") default_path = bpy.data.filename.replace(".blend", ".fbx")
self.layout.operator_string(ExportFBX.bl_idname, "path", default_path, text="Autodesk FBX...") self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -191,7 +191,7 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".mdd") default_path = bpy.data.filename.replace(".blend", ".mdd")
self.layout.operator_string(ExportMDD.bl_idname, "path", default_path, text="Vertex Keyframe Animation (.mdd)...") self.layout.operator(ExportMDD.bl_idname, text="Vertex Keyframe Animation (.mdd)...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -1008,7 +1008,7 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".obj") default_path = bpy.data.filename.replace(".blend", ".obj")
self.layout.operator_string(ExportOBJ.bl_idname, "path", default_path, text="Wavefront (.obj)...") self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -298,7 +298,7 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".ply") default_path = bpy.data.filename.replace(".blend", ".ply")
self.layout.operator_string(ExportPLY.bl_idname, "path", default_path, text="Stanford (.ply)...") self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -1244,7 +1244,7 @@ import dynamic_menu
def menu_func(self, context): def menu_func(self, context):
default_path = bpy.data.filename.replace(".blend", ".x3d") default_path = bpy.data.filename.replace(".blend", ".x3d")
self.layout.operator_string(ExportX3D.bl_idname, "path", default_path, text="X3D Extensible 3D (.x3d)...") self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)...").path = default_path
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func) menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)

View File

@@ -145,7 +145,7 @@ class Menu(StructRNA):
if f.startswith("."): if f.startswith("."):
continue continue
layout.operator_string(operator, "path", path, text=path_to_name(f)) layout.operator(operator, text=path_to_name(f)).path = path
def draw_preset(self, context): def draw_preset(self, context):
'''Define these on the subclass '''Define these on the subclass

View File

@@ -75,7 +75,7 @@ def draw(layout, context, context_member, use_edit = True):
if use_edit: if use_edit:
row = layout.row() row = layout.row()
props = row.operator("wm.properties_add", properties=True, text="Add") props = row.operator("wm.properties_add", text="Add")
props.path = context_member props.path = context_member
del row del row
@@ -112,10 +112,10 @@ def draw(layout, context, context_member, 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", properties=True, text="edit") prop = row.operator("wm.properties_edit", text="edit")
assign_props(prop, val_draw, key) assign_props(prop, val_draw, key)
prop = row.operator("wm.properties_remove", properties=True, text="", icon='ICON_ZOOMOUT') prop = row.operator("wm.properties_remove", text="", icon='ICON_ZOOMOUT')
assign_props(prop, val_draw, key) assign_props(prop, val_draw, key)

View File

@@ -174,7 +174,7 @@ class BONE_PT_relations(BoneButtonsPanel):
if ob and pchan: if ob and pchan:
col.label(text="Bone Group:") col.label(text="Bone Group:")
col.prop_pointer(pchan, "bone_group", ob.pose, "bone_groups", text="") col.prop_object(pchan, "bone_group", ob.pose, "bone_groups", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
@@ -182,7 +182,7 @@ class BONE_PT_relations(BoneButtonsPanel):
if context.bone: if context.bone:
col.prop(bone, "parent", text="") col.prop(bone, "parent", text="")
else: else:
col.prop_pointer(bone, "parent", arm, "edit_bones", text="") col.prop_object(bone, "parent", arm, "edit_bones", text="")
sub = col.column() sub = col.column()
sub.active = (bone.parent is not None) sub.active = (bone.parent is not None)

View File

@@ -177,8 +177,8 @@ class DATA_PT_shape_keys(DataButtonsPanel):
col.separator() col.separator()
sub = col.column(align=True) sub = col.column(align=True)
sub.operator_enum("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="") sub.operator("object.shape_key_move", icon='ICON_TRIA_UP', text="").type = 'UP'
sub.operator_enum("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="") sub.operator("object.shape_key_move", icon='ICON_TRIA_DOWN', text="").type = 'DOWN'
split = layout.split(percentage=0.4) split = layout.split(percentage=0.4)
row = split.row() row = split.row()
@@ -233,8 +233,8 @@ class DATA_PT_shape_keys(DataButtonsPanel):
col = split.column(align=True) col = split.column(align=True)
col.active = enable_edit_value col.active = enable_edit_value
col.label(text="Blend:") col.label(text="Blend:")
col.prop_pointer(kb, "vertex_group", ob, "vertex_groups", text="") col.prop_object(kb, "vertex_group", ob, "vertex_groups", text="")
col.prop_pointer(kb, "relative_key", key, "keys", text="") col.prop_object(kb, "relative_key", key, "keys", text="")
else: else:
row = layout.row() row = layout.row()

View File

@@ -62,7 +62,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group::") col.label(text="Vertex Group::")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column() sub = col.column()
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
sub.prop(md, "invert") sub.prop(md, "invert")
@@ -201,7 +201,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Control Object:") col.label(text="Control Object:")
@@ -224,7 +224,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
layout.label(text="Deformation Axis:") layout.label(text="Deformation Axis:")
layout.row().prop(md, "deform_axis", expand=True) layout.row().prop(md, "deform_axis", expand=True)
@@ -239,7 +239,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.label(text="Texture:") col.label(text="Texture:")
col.prop(md, "texture", text="") col.prop(md, "texture", text="")
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
@@ -250,7 +250,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if md.texture_coordinates == 'OBJECT': if md.texture_coordinates == 'OBJECT':
layout.prop(md, "texture_coordinate_object", text="Object") layout.prop(md, "texture_coordinate_object", text="Object")
elif md.texture_coordinates == 'UV' and ob.type == 'MESH': elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
layout.prop_pointer(md, "uv_layer", ob.data, "uv_textures") layout.prop_object(md, "uv_layer", ob.data, "uv_textures")
layout.separator() layout.separator()
@@ -281,7 +281,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col = split.column() col = split.column()
col.label(text="Vertex group:") col.label(text="Vertex group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column() sub = col.column()
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
sub.prop(md, "protect") sub.prop(md, "protect")
@@ -306,11 +306,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "object", text="") col.prop(md, "object", text="")
if md.object and md.object.type == 'ARMATURE': if md.object and md.object.type == 'ARMATURE':
col.label(text="Bone:") col.label(text="Bone:")
col.prop_pointer(md, "subtarget", md.object.data, "bones", text="") col.prop_object(md, "subtarget", md.object.data, "bones", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
layout.separator() layout.separator()
@@ -342,7 +342,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
def MASK(self, layout, ob, md, wide_ui): def MASK(self, layout, ob, md, wide_ui):
split = layout.split() split = layout.split()
@@ -356,7 +356,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if md.mode == 'ARMATURE': if md.mode == 'ARMATURE':
col.prop(md, "armature", text="") col.prop(md, "armature", text="")
elif md.mode == 'VERTEX_GROUP': elif md.mode == 'VERTEX_GROUP':
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column() sub = col.column()
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
@@ -369,11 +369,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "object", text="") col.prop(md, "object", text="")
if md.object and md.object.type == 'ARMATURE': if md.object and md.object.type == 'ARMATURE':
col.label(text="Bone:") col.label(text="Bone:")
col.prop_pointer(md, "subtarget", md.object.data, "bones", text="") col.prop_object(md, "subtarget", md.object.data, "bones", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column() sub = col.column()
sub.active = bool(md.vertex_group) sub.active = bool(md.vertex_group)
@@ -485,7 +485,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split() split = layout.split()
@@ -540,7 +540,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split() split = layout.split()
@@ -576,7 +576,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "factor") col.prop(md, "factor")
col.prop(md, "repeat") col.prop(md, "repeat")
col.label(text="Vertex Group:") col.label(text="Vertex Group:")
col.prop_pointer(md, "vertex_group", ob, "vertex_groups", text="") col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
def SOFT_BODY(self, layout, ob, md, wide_ui): def SOFT_BODY(self, layout, ob, md, wide_ui):
layout.label(text="See Soft Body panel.") layout.label(text="See Soft Body panel.")
@@ -607,7 +607,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.label(text="UV Layer:") col.label(text="UV Layer:")
col.prop_pointer(md, "uv_layer", ob.data, "uv_textures", text="") col.prop_object(md, "uv_layer", ob.data, "uv_textures", text="")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
@@ -666,11 +666,11 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.separator() layout.separator()
layout.prop(md, "start_position_object") layout.prop(md, "start_position_object")
layout.prop_pointer(md, "vertex_group", ob, "vertex_groups") layout.prop_object(md, "vertex_group", ob, "vertex_groups")
layout.prop(md, "texture") layout.prop(md, "texture")
layout.prop(md, "texture_coordinates") layout.prop(md, "texture_coordinates")
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH': if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
layout.prop_pointer(md, "uv_layer", ob.data, "uv_textures") layout.prop_object(md, "uv_layer", ob.data, "uv_textures")
elif md.texture_coordinates == 'OBJECT': elif md.texture_coordinates == 'OBJECT':
layout.prop(md, "texture_coordinates_object") layout.prop(md, "texture_coordinates_object")

View File

@@ -200,7 +200,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
col.prop(tan, "width_fade") col.prop(tan, "width_fade")
ob = context.object ob = context.object
if ob and ob.type == 'MESH': if ob and ob.type == 'MESH':
col.prop_pointer(tan, "uv_layer", ob.data, "uv_textures", text="") col.prop_object(tan, "uv_layer", ob.data, "uv_textures", text="")
else: else:
col.prop(tan, "uv_layer", text="") col.prop(tan, "uv_layer", text="")
col.separator() col.separator()

View File

@@ -134,7 +134,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
sub.prop(ob, "parent_type", text="") sub.prop(ob, "parent_type", text="")
parent = ob.parent parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE': if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.prop_pointer(ob, "parent_bone", parent.data, "bones", text="") sub.prop_object(ob, "parent_bone", parent.data, "bones", text="")
sub.active = (parent is not None) sub.active = (parent is not None)

View File

@@ -73,23 +73,23 @@ class ConstraintButtonsPanel(bpy.types.Panel):
if con.target and subtargets: if con.target and subtargets:
if con.target.type == 'ARMATURE': if con.target.type == 'ARMATURE':
if wide_ui: if wide_ui:
layout.prop_pointer(con, "subtarget", con.target.data, "bones", text="Bone") layout.prop_object(con, "subtarget", con.target.data, "bones", text="Bone")
else: else:
layout.prop_pointer(con, "subtarget", con.target.data, "bones", text="") layout.prop_object(con, "subtarget", con.target.data, "bones", text="")
if con.type == 'COPY_LOCATION': if con.type == 'COPY_LOCATION':
row = layout.row() row = layout.row()
row.label(text="Head/Tail:") row.label(text="Head/Tail:")
row.prop(con, "head_tail", text="") row.prop(con, "head_tail", text="")
elif con.target.type in ('MESH', 'LATTICE'): elif con.target.type in ('MESH', 'LATTICE'):
layout.prop_pointer(con, "subtarget", con.target, "vertex_groups", text="Vertex Group") layout.prop_object(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def ik_template(self, layout, con, wide_ui): def ik_template(self, layout, con, wide_ui):
# only used for iTaSC # only used for iTaSC
layout.prop(con, "pole_target") layout.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE': if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.prop_pointer(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target: if con.pole_target:
row = layout.row() row = layout.row()
@@ -169,9 +169,9 @@ class ConstraintButtonsPanel(bpy.types.Panel):
layout.prop(con, "pole_target", text="") layout.prop(con, "pole_target", text="")
if con.pole_target and con.pole_target.type == 'ARMATURE': if con.pole_target and con.pole_target.type == 'ARMATURE':
if wide_ui: if wide_ui:
layout.prop_pointer(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone") layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
else: else:
layout.prop_pointer(con, "pole_subtarget", con.pole_target.data, "bones", text="") layout.prop_object(con, "pole_subtarget", con.pole_target.data, "bones", text="")
if con.pole_target: if con.pole_target:
row = layout.row() row = layout.row()

View File

@@ -941,51 +941,51 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_density", ob, "vertex_groups", text="Density") row.prop_object(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
row.prop(psys, "vertex_group_density_negate", text="") row.prop(psys, "vertex_group_density_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity") row.prop_object(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
row.prop(psys, "vertex_group_velocity_negate", text="") row.prop(psys, "vertex_group_velocity_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_length", ob, "vertex_groups", text="Length") row.prop_object(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
row.prop(psys, "vertex_group_length_negate", text="") row.prop(psys, "vertex_group_length_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump") row.prop_object(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
row.prop(psys, "vertex_group_clump_negate", text="") row.prop(psys, "vertex_group_clump_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink") row.prop_object(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
row.prop(psys, "vertex_group_kink_negate", text="") row.prop(psys, "vertex_group_kink_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1") row.prop_object(psys, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1")
row.prop(psys, "vertex_group_roughness1_negate", text="") row.prop(psys, "vertex_group_roughness1_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2") row.prop_object(psys, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2")
row.prop(psys, "vertex_group_roughness2_negate", text="") row.prop(psys, "vertex_group_roughness2_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End") row.prop_object(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
row.prop(psys, "vertex_group_roughness_end_negate", text="") row.prop(psys, "vertex_group_roughness_end_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_size", ob, "vertex_groups", text="Size") row.prop_object(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
row.prop(psys, "vertex_group_size_negate", text="") row.prop(psys, "vertex_group_size_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent") row.prop_object(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
row.prop(psys, "vertex_group_tangent_negate", text="") row.prop(psys, "vertex_group_tangent_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation") row.prop_object(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
row.prop(psys, "vertex_group_rotation_negate", text="") row.prop(psys, "vertex_group_rotation_negate", text="")
row = layout.row() row = layout.row()
row.prop_pointer(psys, "vertex_group_field", ob, "vertex_groups", text="Field") row.prop_object(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
row.prop(psys, "vertex_group_field_negate", text="") row.prop(psys, "vertex_group_field_negate", text="")
bpy.types.register(PARTICLE_PT_particles) bpy.types.register(PARTICLE_PT_particles)

View File

@@ -74,7 +74,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
row.prop(md, "realtime", text="") row.prop(md, "realtime", text="")
else: else:
# add modifier # add modifier
split.operator_enum("object.modifier_add", "type", 'CLOTH', text="Add") split.operator("object.modifier_add", text="Add").type = 'CLOTH'
if wide_ui: if wide_ui:
split.column() split.column()
@@ -112,7 +112,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
col.prop(cloth, "pin_cloth", text="Pinning") col.prop(cloth, "pin_cloth", text="Pinning")
sub = col.column() sub = col.column()
sub.active = cloth.pin_cloth sub.active = cloth.pin_cloth
sub.prop_pointer(cloth, "mass_vertex_group", ob, "vertex_groups", text="") sub.prop_object(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
sub.prop(cloth, "pin_stiffness", text="Stiffness") sub.prop(cloth, "pin_stiffness", text="Stiffness")
col.label(text="Pre roll:") col.label(text="Pre roll:")
@@ -207,13 +207,13 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
col = split.column() col = split.column()
col.label(text="Structural Stiffness:") col.label(text="Structural Stiffness:")
col.prop_pointer(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="") col.prop_object(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col.prop(cloth, "structural_stiffness_max", text="Max") col.prop(cloth, "structural_stiffness_max", text="Max")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.label(text="Bending Stiffness:") col.label(text="Bending Stiffness:")
col.prop_pointer(cloth, "bending_vertex_group", ob, "vertex_groups", text="") col.prop_object(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
col.prop(cloth, "bending_stiffness_max", text="Max") col.prop(cloth, "bending_stiffness_max", text="Max")

View File

@@ -61,7 +61,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
if cache.baked == True: if cache.baked == True:
row.operator("ptcache.free_bake", text="Free Bake") row.operator("ptcache.free_bake", text="Free Bake")
else: else:
row.operator_boolean("ptcache.bake", "bake", True, text="Bake") row.operator("ptcache.bake", text="Bake").bake = True
sub = row.row() sub = row.row()
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
@@ -85,7 +85,7 @@ def point_cache_ui(self, context, cache, enabled, particles, smoke):
layout.separator() layout.separator()
row = layout.row() row = layout.row()
row.operator_boolean("ptcache.bake_all", "bake", True, text="Bake All Dynamics") row.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
row.operator("ptcache.free_bake_all", text="Free All Bakes") row.operator("ptcache.free_bake_all", text="Free All Bakes")
layout.operator("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") layout.operator("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")

View File

@@ -201,7 +201,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
else: else:
# add modifier # add modifier
split.operator_enum("object.modifier_add", "type", 'COLLISION', text="Add") split.operator("object.modifier_add", text="Add").type = 'COLLISION'
if wide_ui: if wide_ui:
split.label() split.label()

View File

@@ -58,7 +58,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
else: else:
# add modifier # add modifier
split.operator_enum("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add") split.operator("object.modifier_add", text="Add").type = 'FLUID_SIMULATION'
if wide_ui: if wide_ui:
split.label() split.label()

View File

@@ -61,7 +61,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
else: else:
# add modifier # add modifier
split.operator_enum("object.modifier_add", "type", 'SMOKE', text="Add") split.operator("object.modifier_add", text="Add").type = 'SMOKE'
if wide_ui: if wide_ui:
split.label() split.label()
@@ -101,7 +101,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
col = split.column() col = split.column()
col.prop(flow, "outflow") col.prop(flow, "outflow")
col.label(text="Particle System:") col.label(text="Particle System:")
col.prop_pointer(flow, "psys", ob, "particle_systems", text="") col.prop_object(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow: if md.flow_settings.outflow:
if wide_ui: if wide_ui:

View File

@@ -64,7 +64,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
row.prop(md, "realtime", text="") row.prop(md, "realtime", text="")
else: else:
# add modifier # add modifier
split.operator_enum("object.modifier_add", "type", 'SOFT_BODY', text="Add") split.operator("object.modifier_add", text="Add").type = 'SOFT_BODY'
if wide_ui: if wide_ui:
split.column() split.column()
@@ -79,7 +79,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel):
col.label(text="Object:") col.label(text="Object:")
col.prop(softbody, "friction") col.prop(softbody, "friction")
col.prop(softbody, "mass") col.prop(softbody, "mass")
col.prop_pointer(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:") col.prop_object(softbody, "mass_vertex_group", ob, "vertex_groups", text="Mass:")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
@@ -140,7 +140,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
col.prop(softbody, "goal_spring", text="Stiffness") col.prop(softbody, "goal_spring", text="Stiffness")
col.prop(softbody, "goal_friction", text="Damping") col.prop(softbody, "goal_friction", text="Damping")
layout.prop_pointer(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group") layout.prop_object(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
@@ -176,7 +176,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
col.prop(softbody, "plastic") col.prop(softbody, "plastic")
col.prop(softbody, "bending") col.prop(softbody, "bending")
col.prop(softbody, "spring_length", text="Length") col.prop(softbody, "spring_length", text="Length")
col.prop_pointer(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:") col.prop_object(softbody, "spring_vertex_group", ob, "vertex_groups", text="Springs:")
if wide_ui: if wide_ui:
col = split.column() col = split.column()

View File

@@ -57,7 +57,7 @@ class RENDER_PT_render(RenderButtonsPanel):
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.operator_boolean("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION') col.operator("screen.render", text="Animation", icon='ICON_RENDER_ANIMATION').animation = True
layout.prop(rd, "display_mode", text="Display") layout.prop(rd, "display_mode", text="Display")

View File

@@ -99,8 +99,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2) row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2)
col = row.column(align=True) col = row.column(align=True)
col.operator_enum("texture.slot_move", "type", 'UP', text="", icon='ICON_TRIA_UP') col.operator("texture.slot_move", text="", icon='ICON_TRIA_UP').type = 'UP'
col.operator_enum("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN') col.operator("texture.slot_move", text="", icon='ICON_TRIA_DOWN').type = 'DOWN'
if wide_ui: if wide_ui:
@@ -211,7 +211,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
split.label(text="Layer:") split.label(text="Layer:")
ob = context.object ob = context.object
if ob and ob.type == 'MESH': if ob and ob.type == 'MESH':
split.prop_pointer(tex, "uv_layer", ob.data, "uv_textures", text="") split.prop_object(tex, "uv_layer", ob.data, "uv_textures", text="")
else: else:
split.prop(tex, "uv_layer", text="") split.prop(tex, "uv_layer", text="")
@@ -873,7 +873,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel):
sub.enabled = bool(pd.object) sub.enabled = bool(pd.object)
if pd.object: if pd.object:
sub.label(text="System:") sub.label(text="System:")
sub.prop_pointer(pd, "particle_system", pd.object, "particle_systems", text="") sub.prop_object(pd, "particle_system", pd.object, "particle_systems", text="")
sub.label(text="Cache:") sub.label(text="Cache:")
sub.prop(pd, "particle_cache", text="") sub.prop(pd, "particle_cache", text="")
else: else:

View File

@@ -101,7 +101,7 @@ class CONSOLE_MT_language(bpy.types.Menu):
languages.sort() languages.sort()
for language in languages: for language in languages:
layout.operator_string("console.language", "language", language, text=language[0].upper() + language[1:]) layout.operator("console.language", text=language[0].upper() + language[1:]).language = language
def add_scrollback(text, text_type): def add_scrollback(text, text_type):

View File

@@ -53,7 +53,7 @@ class IMAGE_MT_view(bpy.types.Menu):
for a, b in ratios: for a, b in ratios:
text = "Zoom %d:%d" % (a, b) text = "Zoom %d:%d" % (a, b)
layout.operator_float("image.view_zoom_ratio", "ratio", a / b, text=text) layout.operator("image.view_zoom_ratio", text=text).ratio = a / b
layout.separator() layout.separator()
@@ -71,7 +71,7 @@ class IMAGE_MT_select(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator("uv.select_border") layout.operator("uv.select_border")
layout.operator_boolean("uv.select_border", "pinned", True) layout.operator("uv.select_border").pinned = True
layout.separator() layout.separator()
@@ -122,7 +122,7 @@ class IMAGE_MT_image(bpy.types.Menu):
# this could be done in operator poll too # this could be done in operator poll too
if ima.dirty: if ima.dirty:
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER': if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
layout.operator_boolean("image.pack", "as_png", True, text="Pack As PNG") layout.operator("image.pack", text="Pack As PNG").as_png = True
layout.separator() layout.separator()
@@ -137,7 +137,7 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu):
layout.operator("uv.reveal") layout.operator("uv.reveal")
layout.operator("uv.hide") layout.operator("uv.hide")
layout.operator_boolean("uv.hide", "unselected", True) layout.operator("uv.hide").unselected = True
class IMAGE_MT_uvs_transform(bpy.types.Menu): class IMAGE_MT_uvs_transform(bpy.types.Menu):
@@ -158,11 +158,8 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN' layout.operator_context = 'EXEC_REGION_WIN'
props = layout.operator("tfm.mirror", text="X Axis", properties=True) layout.operator("tfm.mirror", text="X Axis").constraint_axis[0] = True
props.constraint_axis[0] = True layout.operator("tfm.mirror", text="Y Axis").constraint_axis[1] = True
props = layout.operator("tfm.mirror", text="Y Axis", properties=True)
props.constraint_axis[1] = True
class IMAGE_MT_uvs_weldalign(bpy.types.Menu): class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
@@ -192,7 +189,7 @@ class IMAGE_MT_uvs(bpy.types.Menu):
layout.prop(uv, "live_unwrap") layout.prop(uv, "live_unwrap")
layout.operator("uv.unwrap") layout.operator("uv.unwrap")
layout.operator_boolean("uv.pin", "clear", True, text="Unpin") layout.operator("uv.pin", text="Unpin").clear = True
layout.operator("uv.pin") layout.operator("uv.pin")
layout.separator() layout.separator()
@@ -273,7 +270,7 @@ class IMAGE_HT_header(bpy.types.Header):
row.prop(settings, "snap_mode", text="") row.prop(settings, "snap_mode", text="")
# mesh = context.edit_object.data # mesh = context.edit_object.data
# row.prop_pointer(mesh, "active_uv_layer", mesh, "uv_textures") # row.prop_object(mesh, "active_uv_layer", mesh, "uv_textures")
if ima: if ima:
# layers # layers
@@ -445,10 +442,10 @@ class IMAGE_PT_paint(bpy.types.Panel):
sub = layout.row(align=True) sub = layout.row(align=True)
else: else:
sub = layout.column(align=True) sub = layout.column(align=True)
sub.item_enumR(settings, "tool", 'DRAW') sub.prop_enum(settings, "tool", 'DRAW')
sub.item_enumR(settings, "tool", 'SOFTEN') sub.prop_enum(settings, "tool", 'SOFTEN')
sub.item_enumR(settings, "tool", 'CLONE') sub.prop_enum(settings, "tool", 'CLONE')
sub.item_enumR(settings, "tool", 'SMEAR') sub.prop_enum(settings, "tool", 'SMEAR')
if brush: if brush:
col = layout.column() col = layout.column()

View File

@@ -88,7 +88,7 @@ class INFO_MT_file(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_context = 'INVOKE_AREA' layout.operator_context = 'INVOKE_AREA'
layout.operator("wm.link_append", text="Link") layout.operator("wm.link_append", text="Link")
layout.operator_boolean("wm.link_append", "link", False, text="Append") layout.operator("wm.link_append", text="Append").link = False
layout.separator() layout.separator()
layout.menu("INFO_MT_file_import") layout.menu("INFO_MT_file_import")
@@ -192,12 +192,12 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_context = 'INVOKE_SCREEN' layout.operator_context = 'INVOKE_SCREEN'
layout.operator("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') layout.operator("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
layout.operator_enum("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') layout.operator("object.add", icon='ICON_OUTLINER_OB_LATTICE').type = 'LATTICE'
layout.operator_enum("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') layout.operator("object.add", icon='ICON_OUTLINER_OB_EMPTY').type = 'EMPTY'
layout.separator() layout.separator()
layout.operator_enum("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') layout.operator("object.add", icon='ICON_OUTLINER_OB_CAMERA').type = 'CAMERA'
layout.operator_context = 'EXEC_SCREEN' layout.operator_context = 'EXEC_SCREEN'
@@ -239,12 +239,12 @@ class INFO_MT_render(bpy.types.Menu):
# rd = context.scene.render_data # rd = context.scene.render_data
layout.operator("screen.render", text="Render Image", icon='ICON_RENDER_STILL') layout.operator("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
layout.operator_boolean("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION') layout.operator("screen.render", text="Render Animation", icon='ICON_RENDER_ANIMATION').animation = True
layout.separator() layout.separator()
layout.operator("screen.opengl_render", text="OpenGL Render Image") layout.operator("screen.opengl_render", text="OpenGL Render Image")
layout.operator_boolean("screen.opengl_render", "animation", True, text="OpenGL Render Animation") layout.operator("screen.opengl_render", text="OpenGL Render Animation").animation = True
layout.separator() layout.separator()

View File

@@ -44,6 +44,6 @@ class LOGIC_PT_properties(bpy.types.Panel):
row.prop(prop, "type", text="") row.prop(prop, "type", text="")
row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly row.prop(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly
row.prop(prop, "debug", text="", toggle=True, icon='ICON_INFO') row.prop(prop, "debug", text="", toggle=True, icon='ICON_INFO')
row.operator_int("object.game_property_remove", "index", i, text="", icon='ICON_X') row.operator("object.game_property_remove", text="", icon='ICON_X').index = i
bpy.types.register(LOGIC_PT_properties) bpy.types.register(LOGIC_PT_properties)

View File

@@ -50,7 +50,7 @@ class OUTLINER_HT_header(bpy.types.Header):
if ks: if ks:
row = layout.row(align=False) row = layout.row(align=False)
row.prop_pointer(scene, "active_keying_set", scene, "keying_sets", text="") row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
row = layout.row(align=True) row = layout.row(align=True)
row.operator("anim.insert_keyframe", text="", icon='ICON_KEY_HLT') row.operator("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')

View File

@@ -135,12 +135,12 @@ class SEQUENCER_MT_select(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.column() layout.column()
layout.operator_enum("sequencer.select_active_side", "side", 'LEFT', text="Strips to the Left") layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
layout.operator_enum("sequencer.select_active_side", "side", 'RIGHT', text="Strips to the Right") layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
layout.separator() layout.separator()
layout.operator_enum("sequencer.select_handles", "side", 'BOTH', text="Surrounding Handles") layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
layout.operator_enum("sequencer.select_handles", "side", 'LEFT', text="Left Handle") layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
layout.operator_enum("sequencer.select_handles", "side", 'RIGHT', text="Right Handle") layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
layout.separator() layout.separator()
layout.operator("sequencer.select_linked") layout.operator("sequencer.select_linked")
layout.operator("sequencer.select_all_toggle") layout.operator("sequencer.select_all_toggle")
@@ -188,19 +188,19 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
layout.column() layout.column()
layout.operator_enum("sequencer.effect_strip_add", 'type', 'ADD') layout.operator("sequencer.effect_strip_add").type = 'ADD'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'SUBTRACT') layout.operator("sequencer.effect_strip_add").type = 'SUBTRACT'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'ALPHA_OVER') layout.operator("sequencer.effect_strip_add").type = 'ALPHA_OVER'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'ALPHA_UNDER') layout.operator("sequencer.effect_strip_add").type = 'ALPHA_UNDER'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'GAMMA_CROSS') layout.operator("sequencer.effect_strip_add").type = 'GAMMA_CROSS'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'MULTIPLY') layout.operator("sequencer.effect_strip_add").type = 'MULTIPLY'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'OVER_DROP') layout.operator("sequencer.effect_strip_add").type = 'OVER_DROP'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'PLUGIN') layout.operator("sequencer.effect_strip_add").type = 'PLUGIN'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'WIPE') layout.operator("sequencer.effect_strip_add").type = 'WIPE'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'GLOW') layout.operator("sequencer.effect_strip_add").type = 'GLOW'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'TRANSFORM') layout.operator("sequencer.effect_strip_add").type = 'TRANSFORM'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'COLOR') layout.operator("sequencer.effect_strip_add").type = 'COLOR'
layout.operator_enum("sequencer.effect_strip_add", 'type', 'SPEED') layout.operator("sequencer.effect_strip_add").type = 'SPEED'
class SEQUENCER_MT_strip(bpy.types.Menu): class SEQUENCER_MT_strip(bpy.types.Menu):
@@ -212,13 +212,13 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
layout.column() layout.column()
layout.operator_enum("tfm.transform", "mode", 'TRANSLATION', text="Grab/Move") layout.operator("tfm.transform", text="Grab/Move").mode = TRANSLATION
layout.operator_enum("tfm.transform", "mode", 'TIME_EXTEND', text="Grab/Extend from frame") layout.operator("tfm.transform", text="Grab/Extend from frame").mode = TIME_EXTEND
# uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator # uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
layout.separator() layout.separator()
layout.operator_enum("sequencer.cut", "type", 'HARD', text="Cut (hard) at frame") layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
layout.operator_enum("sequencer.cut", "type", 'SOFT', text="Cut (soft) at frame") layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
layout.operator("sequencer.images_separate") layout.operator("sequencer.images_separate")
layout.separator() layout.separator()
@@ -264,7 +264,7 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
layout.operator("sequencer.mute") layout.operator("sequencer.mute")
layout.operator("sequencer.unmute") layout.operator("sequencer.unmute")
layout.operator_boolean("sequencer.mute", "unselected", 1, text="Mute Deselected Strips") layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
layout.operator("sequencer.snap") layout.operator("sequencer.snap")

View File

@@ -178,8 +178,8 @@ class TEXT_MT_edit_view(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_enum("text.move", "type", 'FILE_TOP', text="Top of File") layout.operator("text.move", text="Top of File").type = 'FILE_TOP'
layout.operator_enum("text.move", "type", 'FILE_BOTTOM', text="Bottom of File") layout.operator("text.move", text="Bottom of File").type = 'FILE_BOTTOM'
class TEXT_MT_edit_select(bpy.types.Menu): class TEXT_MT_edit_select(bpy.types.Menu):
@@ -228,8 +228,8 @@ class TEXT_MT_edit_to3d(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_boolean("text.to_3d_object", "split_lines", False, text="One Object") layout.operator("text.to_3d_object", text="One Object").split_lines = False
layout.operator_boolean("text.to_3d_object", "split_lines", True, text="One Object Per Line") layout.operator("text.to_3d_object", text="One Object Per Line").split_lines = True
class TEXT_MT_edit(bpy.types.Menu): class TEXT_MT_edit(bpy.types.Menu):

View File

@@ -54,17 +54,17 @@ class TIME_HT_header(bpy.types.Header):
layout.separator() layout.separator()
row = layout.row(align=True) row = layout.row(align=True)
row.operator_boolean("screen.frame_jump", "end", False, text="", icon='ICON_REW') row.operator("screen.frame_jump", text="", icon='ICON_REW').end = False
row.operator_boolean("screen.keyframe_jump", "next", False, text="", icon='ICON_PREV_KEYFRAME') row.operator("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME').next = False
if not screen.animation_playing: if not screen.animation_playing:
row.operator_boolean("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE') row.operator("screen.animation_play", text="", icon='ICON_PLAY_REVERSE').reverse = True
row.operator("screen.animation_play", text="", icon='ICON_PLAY') row.operator("screen.animation_play", text="", icon='ICON_PLAY')
else: else:
sub = row.row() sub = row.row()
sub.scale_x = 2.0 sub.scale_x = 2.0
sub.operator("screen.animation_play", text="", icon='ICON_PAUSE') sub.operator("screen.animation_play", text="", icon='ICON_PAUSE')
row.operator_boolean("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME') row.operator("screen.keyframe_jump", text="", icon='ICON_NEXT_KEYFRAME').next = True
row.operator_boolean("screen.frame_jump", "end", True, text="", icon='ICON_FF') row.operator("screen.frame_jump", text="", icon='ICON_FF').end = True
row = layout.row(align=True) row = layout.row(align=True)
row.prop(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC') row.prop(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
@@ -77,7 +77,7 @@ class TIME_HT_header(bpy.types.Header):
layout.separator() layout.separator()
row = layout.row(align=True) row = layout.row(align=True)
row.prop_pointer(scene, "active_keying_set", scene, "keying_sets", text="") row.prop_object(scene, "active_keying_set", scene, "keying_sets", text="")
row.operator("anim.insert_keyframe", text="", icon='ICON_KEY_HLT') row.operator("anim.insert_keyframe", text="", icon='ICON_KEY_HLT')
row.operator("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT') row.operator("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT')
@@ -159,8 +159,8 @@ class TIME_MT_autokey(bpy.types.Menu):
layout.active = tools.enable_auto_key layout.active = tools.enable_auto_key
layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS') layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS') layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
bpy.types.register(TIME_HT_header) bpy.types.register(TIME_HT_header)
bpy.types.register(TIME_MT_view) bpy.types.register(TIME_MT_view)

View File

@@ -34,7 +34,7 @@ class USERPREF_HT_header(bpy.types.Header):
if userpref.active_section == 'INPUT': if userpref.active_section == 'INPUT':
layout.operator_context = 'INVOKE_DEFAULT' layout.operator_context = 'INVOKE_DEFAULT'
layout.operator_string("wm.keyconfig_export", "path", "keymap.py", "Export Key Configuration...") layout.operator("wm.keyconfig_export", "Export Key Configuration...").path = "keymap.py"
class USERPREF_MT_view(bpy.types.Menu): class USERPREF_MT_view(bpy.types.Menu):
@@ -1111,7 +1111,7 @@ class USERPREF_PT_input(bpy.types.Panel):
sub = col.column() sub = col.column()
sub.label(text="Configuration:") sub.label(text="Configuration:")
sub.prop_pointer(wm, "active_keyconfig", wm, "keyconfigs", text="") sub.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="")
col.separator() col.separator()
@@ -1165,11 +1165,11 @@ class USERPREF_PT_input(bpy.types.Panel):
km = wm.active_keymap km = wm.active_keymap
subsplit = col.split() subsplit = col.split()
subsplit.prop_pointer(wm, "active_keymap", defkc, "keymaps", text="Map:") subsplit.prop_object(wm, "active_keymap", defkc, "keymaps", text="Map:")
if km.user_defined: if km.user_defined:
row = subsplit.row() row = subsplit.row()
row.operator("WM_OT_keymap_restore", text="Restore") row.operator("WM_OT_keymap_restore", text="Restore")
row.operator_boolean("WM_OT_keymap_restore", "all", True, text="Restore All") row.operator("WM_OT_keymap_restore", text="Restore All").all = True
else: else:
row = subsplit.row() row = subsplit.row()
row.operator("WM_OT_keymap_edit", text="Edit") row.operator("WM_OT_keymap_edit", text="Edit")

View File

@@ -69,7 +69,7 @@ class VIEW3D_MT_showhide(bpy.types.Menu):
layout.operator("%s.reveal" % self._operator_name, text="Show Hidden") layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
layout.operator("%s.hide" % self._operator_name, text="Hide Selected") layout.operator("%s.hide" % self._operator_name, text="Hide Selected")
layout.operator_boolean("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected") layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
class VIEW3D_MT_transform(bpy.types.Menu): class VIEW3D_MT_transform(bpy.types.Menu):
@@ -91,20 +91,20 @@ class VIEW3D_MT_transform(bpy.types.Menu):
layout.operator("tfm.tosphere", text="To Sphere") layout.operator("tfm.tosphere", text="To Sphere")
layout.operator("tfm.shear", text="Shear") layout.operator("tfm.shear", text="Shear")
layout.operator("tfm.warp", text="Warp") layout.operator("tfm.warp", text="Warp")
layout.operator_enum("tfm.transform", "mode", 'PUSHPULL', text="Push/Pull") layout.operator("tfm.transform", text="Push/Pull").mode = 'PUSHPULL'
if context.edit_object and context.edit_object.type == 'ARMATURE': if context.edit_object and context.edit_object.type == 'ARMATURE':
layout.operator("armature.align") layout.operator("armature.align")
else: else:
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator_enum("tfm.transform", "mode", 'ALIGN', text="Align to Transform Orientation") # XXX see alignmenu() in edit.c of b2.4x to get this working layout.operator("tfm.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
layout.separator() layout.separator()
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator_enum("object.center_set", "type", 'CENTER') layout.operator("object.center_set").type = 'CENTER'
layout.operator_enum("object.center_set", "type", 'CENTERNEW') layout.operator("object.center_set").type = 'CENTER_NEW'
layout.operator_enum("object.center_set", "type", 'CENTERCURSOR') layout.operator("object.center_set").type = 'CENTER_CURSOR'
class VIEW3D_MT_mirror(bpy.types.Menu): class VIEW3D_MT_mirror(bpy.types.Menu):
bl_label = "Mirror" bl_label = "Mirror"
@@ -118,26 +118,26 @@ class VIEW3D_MT_mirror(bpy.types.Menu):
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
props = layout.operator("tfm.mirror", properties=True, text="X Global") props = layout.operator("tfm.mirror", text="X Global")
props.constraint_axis = (True, False, False) props.constraint_axis = (True, False, False)
props.constraint_orientation = 'GLOBAL' props.constraint_orientation = 'GLOBAL'
props = layout.operator("tfm.mirror", properties=True, text="Y Global") props = layout.operator("tfm.mirror", text="Y Global")
props.constraint_axis = (False, True, False) props.constraint_axis = (False, True, False)
props.constraint_orientation = 'GLOBAL' props.constraint_orientation = 'GLOBAL'
props = layout.operator("tfm.mirror", properties=True, text="Z Global") props = layout.operator("tfm.mirror", text="Z Global")
props.constraint_axis = (False, False, True) props.constraint_axis = (False, False, True)
props.constraint_orientation = 'GLOBAL' props.constraint_orientation = 'GLOBAL'
if context.edit_object: if context.edit_object:
layout.separator() layout.separator()
props = layout.operator("tfm.mirror", properties=True, text="X Local") props = layout.operator("tfm.mirror", text="X Local")
props.constraint_axis = (True, False, False) props.constraint_axis = (True, False, False)
props.constraint_orientation = 'LOCAL' props.constraint_orientation = 'LOCAL'
props = layout.operator("tfm.mirror", properties=True, text="Y Local") props = layout.operator("tfm.mirror", text="Y Local")
props.constraint_axis = (False, True, False) props.constraint_axis = (False, True, False)
props.constraint_orientation = 'LOCAL' props.constraint_orientation = 'LOCAL'
props = layout.operator("tfm.mirror", properties=True, text="Z Local") props = layout.operator("tfm.mirror", text="Z Local")
props.constraint_axis = (False, False, True) props.constraint_axis = (False, False, True)
props.constraint_orientation = 'LOCAL' props.constraint_orientation = 'LOCAL'
@@ -188,10 +188,10 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_enum("view3d.viewnumpad", "type", 'CAMERA') layout.operator("view3d.viewnumpad").type = 'CAMERA'
layout.operator_enum("view3d.viewnumpad", "type", 'TOP') layout.operator("view3d.viewnumpad").type = 'TOP'
layout.operator_enum("view3d.viewnumpad", "type", 'FRONT') layout.operator("view3d.viewnumpad").type = 'FRONT'
layout.operator_enum("view3d.viewnumpad", "type", 'RIGHT') layout.operator("view3d.viewnumpad").type = 'RIGHT'
layout.menu("VIEW3D_MT_view_cameras", text="Cameras") layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
@@ -213,7 +213,7 @@ class VIEW3D_MT_view(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_int("view3d.layers", "nr", 0, text="Show All Layers") layout.operator("view3d.layers", text="Show All Layers").nr = 0
layout.separator() layout.separator()
@@ -245,8 +245,8 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_float("view3d.zoom", "delta", 1.0, text="Zoom In") layout.operator("view3d.zoom", text="Zoom In").delta = 1.0
layout.operator_float("view3d.zoom", "delta", -1.0, text="Zoom Out") layout.operator("view3d.zoom", text="Zoom Out").delta = -1.0
layout.separator() layout.separator()
@@ -263,7 +263,7 @@ class VIEW3D_MT_view_align(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_boolean("view3d.view_all", "center", True, text="Center Cursor and View All") layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
layout.operator("view3d.camera_to_view", text="Align Active Camera to View") layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
layout.operator("view3d.view_center") layout.operator("view3d.view_center")
layout.operator("view3d.view_center_cursor") layout.operator("view3d.view_center_cursor")
@@ -275,22 +275,22 @@ class VIEW3D_MT_view_align_selected(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
props = layout.operator("view3d.viewnumpad", properties=True, text="Top") props = layout.operator("view3d.viewnumpad", text="Top")
props.align_active = True props.align_active = True
props.type = 'TOP' props.type = 'TOP'
props = layout.operator("view3d.viewnumpad", properties=True, text="Bottom") props = layout.operator("view3d.viewnumpad", text="Bottom")
props.align_active = True props.align_active = True
props.type = 'BOTTOM' props.type = 'BOTTOM'
props = layout.operator("view3d.viewnumpad", properties=True, text="Front") props = layout.operator("view3d.viewnumpad", text="Front")
props.align_active = True props.align_active = True
props.type = 'FRONT' props.type = 'FRONT'
props = layout.operator("view3d.viewnumpad", properties=True, text="Back") props = layout.operator("view3d.viewnumpad", text="Back")
props.align_active = True props.align_active = True
props.type = 'BACK' props.type = 'BACK'
props = layout.operator("view3d.viewnumpad", properties=True, text="Right") props = layout.operator("view3d.viewnumpad", text="Right")
props.align_active = True props.align_active = True
props.type = 'RIGHT' props.type = 'RIGHT'
props = layout.operator("view3d.viewnumpad", properties=True, text="Left") props = layout.operator("view3d.viewnumpad", text="Left")
props.align_active = True props.align_active = True
props.type = 'LEFT' props.type = 'LEFT'
@@ -302,7 +302,7 @@ class VIEW3D_MT_view_cameras(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator("view3d.object_as_camera") layout.operator("view3d.object_as_camera")
layout.operator_enum("view3d.viewnumpad", "type", 'CAMERA', text="Active Camera") layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
# ********** Select menus, suffix from context.mode ********** # ********** Select menus, suffix from context.mode **********
@@ -349,16 +349,16 @@ class VIEW3D_MT_select_pose(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_enum("pose.select_hierarchy", "direction", 'PARENT') layout.operator("pose.select_hierarchy").direction = 'PARENT'
layout.operator_enum("pose.select_hierarchy", "direction", 'CHILD') layout.operator("pose.select_hierarchy").direction = 'CHILD'
layout.separator() layout.separator()
props = layout.operator("pose.select_hierarchy", properties=True, text="Extend Parent") props = layout.operator("pose.select_hierarchy", text="Extend Parent")
props.extend = True props.extend = True
props.direction = 'PARENT' props.direction = 'PARENT'
props = layout.operator("pose.select_hierarchy", properties=True, text="Extend Child") props = layout.operator("pose.select_hierarchy", text="Extend Child")
props.extend = True props.extend = True
props.direction = 'CHILD' props.direction = 'CHILD'
@@ -412,9 +412,9 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_enum("mesh.select_by_number_vertices", "type", 'TRIANGLES', text="Triangles") layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES'
layout.operator_enum("mesh.select_by_number_vertices", "type", 'QUADS', text="Quads") layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS'
layout.operator_enum("mesh.select_by_number_vertices", "type", 'OTHER', text="Loose Verts/Edges") layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER'
layout.operator("mesh.select_similar", text="Similar...") layout.operator("mesh.select_similar", text="Similar...")
layout.separator() layout.separator()
@@ -429,7 +429,7 @@ class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
layout.operator("mesh.select_linked", text="Linked") layout.operator("mesh.select_linked", text="Linked")
layout.operator("mesh.select_vertex_path", text="Vertex Path") layout.operator("mesh.select_vertex_path", text="Vertex Path")
layout.operator("mesh.loop_multi_select", text="Edge Loop") layout.operator("mesh.loop_multi_select", text="Edge Loop")
layout.operator_boolean("mesh.loop_multi_select", "ring", True, text="Edge Ring") layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
layout.separator() layout.separator()
@@ -539,16 +539,16 @@ class VIEW3D_MT_select_edit_armature(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_enum("armature.select_hierarchy", "direction", 'PARENT', text="Parent") layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
layout.operator_enum("armature.select_hierarchy", "direction", 'CHILD', text="Child") layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
layout.separator() layout.separator()
props = layout.operator("armature.select_hierarchy", properties=True, text="Extend Parent") props = layout.operator("armature.select_hierarchy", text="Extend Parent")
props.extend = True props.extend = True
props.direction = 'PARENT' props.direction = 'PARENT'
props = layout.operator("armature.select_hierarchy", properties=True, text="Extend Child") props = layout.operator("armature.select_hierarchy", text="Extend Child")
props.extend = True props.extend = True
props.direction = 'CHILD' props.direction = 'CHILD'
@@ -586,7 +586,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("object.duplicate_move") layout.operator("object.duplicate_move")
layout.operator_boolean("object.duplicate", "linked", True, text="Duplicate Linked") layout.operator("object.duplicate", text="Duplicate Linked").linked = True
layout.operator("object.delete", text="Delete...") layout.operator("object.delete", text="Delete...")
layout.operator("object.proxy_make", text="Make Proxy...") layout.operator("object.proxy_make", text="Make Proxy...")
layout.menu("VIEW3D_MT_make_links", text="Make Links...") layout.menu("VIEW3D_MT_make_links", text="Make Links...")
@@ -692,7 +692,7 @@ class VIEW3D_MT_object_showhide(bpy.types.Menu):
layout.operator("object.restrictview_clear", text="Show Hidden") layout.operator("object.restrictview_clear", text="Show Hidden")
layout.operator("object.restrictview_set", text="Hide Selected") layout.operator("object.restrictview_set", text="Hide Selected")
layout.operator_boolean("object.restrictview_set", "unselected", True, text="Hide Unselected") layout.operator("object.restrictview_set", text="Hide Unselected").unselected = True
class VIEW3D_MT_make_single_user(bpy.types.Menu): class VIEW3D_MT_make_single_user(bpy.types.Menu):
@@ -701,19 +701,19 @@ class VIEW3D_MT_make_single_user(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
props = layout.operator("object.make_single_user", properties=True, text="Object") props = layout.operator("object.make_single_user", text="Object")
props.object = True props.object = True
props = layout.operator("object.make_single_user", properties=True, text="Object & ObData") props = layout.operator("object.make_single_user", text="Object & ObData")
props.object = props.obdata = True props.object = props.obdata = True
props = layout.operator("object.make_single_user", properties=True, text="Object & ObData & Materials+Tex") props = layout.operator("object.make_single_user", text="Object & ObData & Materials+Tex")
props.object = props.obdata = props.material = props.texture = True props.object = props.obdata = props.material = props.texture = True
props = layout.operator("object.make_single_user", properties=True, text="Materials+Tex") props = layout.operator("object.make_single_user", text="Materials+Tex")
props.material = props.texture = True props.material = props.texture = True
props = layout.operator("object.make_single_user", properties=True, text="Animation") props = layout.operator("object.make_single_user", text="Animation")
props.animation = True props.animation = True
@@ -738,8 +738,7 @@ class VIEW3D_MT_paint_vertex(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator("paint.vertex_color_set") layout.operator("paint.vertex_color_set")
props = layout.operator("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True) layout.operator("paint.vertex_color_set", text="Set Selected Vertex Colors").selected = True
props.selected = True
class VIEW3D_MT_hook(bpy.types.Menu): class VIEW3D_MT_hook(bpy.types.Menu):
@@ -767,7 +766,7 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator_boolean("object.vertex_group_assign", "new", True, text="Assign to New Group") layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
ob = context.active_object ob = context.active_object
if ob.mode == 'EDIT': if ob.mode == 'EDIT':
@@ -775,13 +774,13 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("object.vertex_group_assign", text="Assign to Active Group") layout.operator("object.vertex_group_assign", text="Assign to Active Group")
layout.operator("object.vertex_group_remove_from", text="Remove from Active Group") layout.operator("object.vertex_group_remove_from", text="Remove from Active Group")
layout.operator_boolean("object.vertex_group_remove_from", "all", True, text="Remove from All") layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
layout.separator() layout.separator()
if ob.vertex_groups and ob.active_vertex_group: if ob.vertex_groups and ob.active_vertex_group:
layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group") layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
layout.operator("object.vertex_group_remove", text="Remove Active Group") layout.operator("object.vertex_group_remove", text="Remove Active Group")
layout.operator_boolean("object.vertex_group_remove", "all", True, text="Remove All Groups") layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
# ********** Sculpt menu ********** # ********** Sculpt menu **********
@@ -867,7 +866,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_transform")
layout.menu("VIEW3D_MT_snap") layout.menu("VIEW3D_MT_snap")
if arm.drawtype in ('BBONE', 'ENVELOPE'): if arm.drawtype in ('BBONE', 'ENVELOPE'):
layout.operator_enum("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance") layout.operator("tfm.transform", text="Scale Envelope Distance").mode = 'BONESIZE'
layout.menu("VIEW3D_MT_pose_transform") layout.menu("VIEW3D_MT_pose_transform")
@@ -885,7 +884,7 @@ class VIEW3D_MT_pose(bpy.types.Menu):
layout.operator("pose.copy") layout.operator("pose.copy")
layout.operator("pose.paste") layout.operator("pose.paste")
layout.operator_boolean("pose.paste", "flipped", True, text="Paste X-Flipped Pose") layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
layout.separator() layout.separator()
@@ -901,9 +900,9 @@ class VIEW3D_MT_pose(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator_enum("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
layout.operator_enum("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
layout.operator_enum("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
layout.operator("pose.flip_names") layout.operator("pose.flip_names")
@@ -1053,7 +1052,7 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("mesh.subdivide", text="Subdivide") layout.operator("mesh.subdivide", text="Subdivide")
layout.operator_float("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth") layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
layout.operator("mesh.merge", text="Merge...") layout.operator("mesh.merge", text="Merge...")
layout.operator("mesh.remove_doubles") layout.operator("mesh.remove_doubles")
layout.operator("mesh.hide", text="Hide") layout.operator("mesh.hide", text="Hide")
@@ -1112,17 +1111,17 @@ class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("mesh.mark_seam") layout.operator("mesh.mark_seam")
layout.operator_boolean("mesh.mark_seam", "clear", True, text="Clear Seam") layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
layout.separator() layout.separator()
layout.operator("mesh.mark_sharp") layout.operator("mesh.mark_sharp")
layout.operator_boolean("mesh.mark_sharp", "clear", True, text="Clear Sharp") layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
layout.separator() layout.separator()
layout.operator_enum("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW") layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
layout.operator_enum("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW") layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
layout.separator() layout.separator()
@@ -1132,7 +1131,7 @@ class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
# uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1); # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
# uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0); # uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
layout.operator_boolean("mesh.loop_multi_select", "ring", True, text="Edge Ring") layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
layout.operator("mesh.loop_to_region") layout.operator("mesh.loop_to_region")
layout.operator("mesh.region_to_loop") layout.operator("mesh.region_to_loop")
@@ -1168,7 +1167,7 @@ class VIEW3D_MT_edit_mesh_faces(dynamic_menu.DynMenu):
# uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1); # uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
# uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0); # uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
layout.operator_enum("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW") layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
layout.separator() layout.separator()
@@ -1185,7 +1184,7 @@ class VIEW3D_MT_edit_mesh_normals(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator("mesh.normals_make_consistent", text="Recalculate Outside") layout.operator("mesh.normals_make_consistent", text="Recalculate Outside")
layout.operator_boolean("mesh.normals_make_consistent", "inside", True, text="Recalculate Inside") layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
layout.separator() layout.separator()
@@ -1247,7 +1246,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(bpy.types.Menu):
edit_object = context.edit_object edit_object = context.edit_object
if edit_object.type == 'CURVE': if edit_object.type == 'CURVE':
layout.operator_enum("tfm.transform", "mode", 'TILT') layout.operator("tfm.transform").mode = 'TILT'
layout.operator("curve.tilt_clear") layout.operator("curve.tilt_clear")
layout.operator("curve.separate") layout.operator("curve.separate")
@@ -1299,32 +1298,32 @@ class VIEW3D_MT_edit_text_chars(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_string("font.text_insert", "text", b'\xC2\xA9'.decode(), text="Copyright|Alt C") layout.operator("font.text_insert", text="Copyright|Alt C").text = b'\xC2\xA9'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xAE'.decode(), text="Registered Trademark|Alt R") layout.operator("font.text_insert", text="Registered Trademark|Alt R").text = b'\xC2\xAE'.decode()
layout.separator() layout.separator()
layout.operator_string("font.text_insert", "text", b'\xC2\xB0'.decode(), text="Degree Sign|Alt G") layout.operator("font.text_insert", text="Degree Sign|Alt G").text = b'\xC2\xB0'.decode()
layout.operator_string("font.text_insert", "text", b'\xC3\x97'.decode(), text="Multiplication Sign|Alt x") layout.operator("font.text_insert", text="Multiplication Sign|Alt x").text = b'\xC3\x97'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\x8A'.decode(), text="Circle|Alt .") layout.operator("font.text_insert", text="Circle|Alt .").text = b'\xC2\x8A'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xB9'.decode(), text="Superscript 1|Alt 1") layout.operator("font.text_insert", text="Superscript 1|Alt 1").text = b'\xC2\xB9'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xB2'.decode(), text="Superscript 2|Alt 2") layout.operator("font.text_insert", text="Superscript 2|Alt 2").text = b'\xC2\xB2'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xB3'.decode(), text="Superscript 3|Alt 3") layout.operator("font.text_insert", text="Superscript 3|Alt 3").text = b'\xC2\xB3'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xBB'.decode(), text="Double >>|Alt >") layout.operator("font.text_insert", text="Double >>|Alt >").text = b'\xC2\xBB'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xAB'.decode(), text="Double <<|Alt <") layout.operator("font.text_insert", text="Double <<|Alt <").text = b'\xC2\xAB'.decode()
layout.operator_string("font.text_insert", "text", b'\xE2\x80\xB0'.decode(), text="Promillage|Alt %") layout.operator("font.text_insert", text="Promillage|Alt %").text = b'\xE2\x80\xB0'.decode()
layout.separator() layout.separator()
layout.operator_string("font.text_insert", "text", b'\xC2\xA4'.decode(), text="Dutch Florin|Alt F") layout.operator("font.text_insert", text="Dutch Florin|Alt F").text = b'\xC2\xA4'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xA3'.decode(), text="British Pound|Alt L") layout.operator("font.text_insert", text="British Pound|Alt L").text = b'\xC2\xA3'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xA5'.decode(), text="Japanese Yen|Alt Y") layout.operator("font.text_insert", text="Japanese Yen|Alt Y").text = b'\xC2\xA5'.decode()
layout.separator() layout.separator()
layout.operator_string("font.text_insert", "text", b'\xC3\x9F'.decode(), text="German S|Alt S") layout.operator("font.text_insert", text="German S|Alt S").text = b'\xC3\x9F'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xBF'.decode(), text="Spanish Question Mark|Alt ?") layout.operator("font.text_insert", text="Spanish Question Mark|Alt ?").text = b'\xC2\xBF'.decode()
layout.operator_string("font.text_insert", "text", b'\xC2\xA1'.decode(), text="Spanish Exclamation Mark|Alt !") layout.operator("font.text_insert", text="Spanish Exclamation Mark|Alt !").text = b'\xC2\xA1'.decode()
class VIEW3D_MT_edit_meta(bpy.types.Menu): class VIEW3D_MT_edit_meta(bpy.types.Menu):
@@ -1367,7 +1366,7 @@ class VIEW3D_MT_edit_meta_showhide(bpy.types.Menu):
layout.operator("mball.reveal_metaelems", text="Show Hidden") layout.operator("mball.reveal_metaelems", text="Show Hidden")
layout.operator("mball.hide_metaelems", text="Hide Selected") layout.operator("mball.hide_metaelems", text="Hide Selected")
layout.operator_boolean("mball.hide_metaelems", "unselected", True, text="Hide Unselected") layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
class VIEW3D_MT_edit_lattice(bpy.types.Menu): class VIEW3D_MT_edit_lattice(bpy.types.Menu):
@@ -1407,9 +1406,9 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
layout.menu("VIEW3D_MT_edit_armature_roll") layout.menu("VIEW3D_MT_edit_armature_roll")
if arm.drawtype == 'ENVELOPE': if arm.drawtype == 'ENVELOPE':
layout.operator_enum("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance") layout.operator("tfm.transform", text="Scale Envelope Distance").mode = 'BONESIZE'
else: else:
layout.operator_enum("tfm.transform", "mode", 'BONESIZE', text="Scale B-Bone Width") layout.operator("tfm.transform", text="Scale B-Bone Width").mode = 'BONESIZE'
layout.separator() layout.separator()
@@ -1432,9 +1431,9 @@ class VIEW3D_MT_edit_armature(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_context = 'EXEC_AREA' layout.operator_context = 'EXEC_AREA'
layout.operator_enum("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
layout.operator_enum("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
layout.operator_enum("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
layout.operator("armature.flip_names") layout.operator("armature.flip_names")
layout.separator() layout.separator()
@@ -1466,9 +1465,9 @@ class VIEW3D_MT_armature_specials(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator_context = 'EXEC_REGION_WIN' layout.operator_context = 'EXEC_REGION_WIN'
layout.operator_enum("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
layout.operator_enum("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
layout.operator_enum("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
layout.operator("armature.flip_names", text="Flip Names") layout.operator("armature.flip_names", text="Flip Names")
@@ -1488,12 +1487,12 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_enum("armature.calculate_roll", "type", 'GLOBALUP', text="Clear Roll (Z-Axis Up)") layout.operator("armature.calculate_roll", text="Clear Roll (Z-Axis Up)").type = 'GLOBALUP'
layout.operator_enum("armature.calculate_roll", "type", 'CURSOR', text="Roll to Cursor") layout.operator("armature.calculate_roll", text="Roll to Cursor").type = 'CURSOR'
layout.separator() layout.separator()
layout.operator_enum("tfm.transform", "mode", 'BONE_ROLL', text="Set Roll") layout.operator("tfm.transform", text="Set Roll").mode = 'BONE_ROLL'
# ********** Panel ********** # ********** Panel **********

View File

@@ -68,9 +68,9 @@ class VIEW3D_PT_tools_objectmode(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_mesh **************** # ********** default tools for editmode_mesh ****************
@@ -119,9 +119,9 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="UV Mapping:") col.label(text="UV Mapping:")
col.operator_string("wm.call_menu", "name", "VIEW3D_MT_uv_map", text="Unwrap") col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
col.operator("mesh.mark_seam") col.operator("mesh.mark_seam")
col.operator_boolean("mesh.mark_seam", "clear", True, text="Clear Seam") col.operator("mesh.mark_seam", text="Clear Seam").clear = True
col = layout.column(align=True) col = layout.column(align=True)
@@ -137,9 +137,9 @@ class VIEW3D_PT_tools_meshedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_meshedit_options(View3DPanel): class VIEW3D_PT_tools_meshedit_options(View3DPanel):
@@ -173,8 +173,8 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
col.operator("tfm.resize", text="Scale") col.operator("tfm.resize", text="Scale")
col = layout.column(align=True) col = layout.column(align=True)
col.operator_enum("tfm.transform", "mode", 'TILT') col.operator("tfm.transform").mode = 'TILT'
col.operator_enum("tfm.transform", "mode", 'CURVE_SHRINKFATTEN') col.operator("tfm.transform").mode = 'CURVE_SHRINKFATTEN'
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Curve:") col.label(text="Curve:")
@@ -187,11 +187,11 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Handles:") col.label(text="Handles:")
row = col.row() row = col.row()
row.operator_enum("curve.handle_type_set", "type", 'AUTOMATIC', text="Auto") row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
row.operator_enum("curve.handle_type_set", "type", 'VECTOR') row.operator("curve.handle_type_set").type = 'VECTOR'
row = col.row() row = col.row()
row.operator_enum("curve.handle_type_set", "type", 'ALIGN') row.operator("curve.handle_type_set").type = 'ALIGN'
row.operator_enum("curve.handle_type_set", "type", 'FREE_ALIGN', text="Free") row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Modeling:") col.label(text="Modeling:")
@@ -206,9 +206,9 @@ class VIEW3D_PT_tools_curveedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_surface **************** # ********** default tools for editmode_surface ****************
@@ -246,9 +246,9 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_text **************** # ********** default tools for editmode_text ****************
@@ -268,14 +268,14 @@ class VIEW3D_PT_tools_textedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Set Case:") col.label(text="Set Case:")
col.operator_enum("font.case_set", "case", 'UPPER', text="To Upper") col.operator("font.case_set", text="To Upper").case = 'UPPER'
col.operator_enum("font.case_set", "case", 'LOWER', text="To Lower") col.operator("font.case_set", text="To Lower").case = 'LOWER'
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Style:") col.label(text="Style:")
col.operator_enum("font.style_toggle", "style", 'BOLD') col.operator("font.style_toggle").style = 'BOLD'
col.operator_enum("font.style_toggle", "style", 'ITALIC') col.operator("font.style_toggle").style = 'ITALIC'
col.operator_enum("font.style_toggle", "style", 'UNDERLINE') col.operator("font.style_toggle").style = 'UNDERLINE'
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Repeat:") col.label(text="Repeat:")
@@ -318,9 +318,9 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_armatureedit_options(View3DPanel): class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
@@ -359,9 +359,9 @@ class VIEW3D_PT_tools_mballedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for editmode_lattice **************** # ********** default tools for editmode_lattice ****************
@@ -390,9 +390,9 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
# ********** default tools for posemode **************** # ********** default tools for posemode ****************
@@ -441,9 +441,9 @@ class VIEW3D_PT_tools_posemode(View3DPanel):
col = layout.column(align=True) col = layout.column(align=True)
col.label(text="Grease Pencil:") col.label(text="Grease Pencil:")
row = col.row() row = col.row()
row.operator_enum("gpencil.draw", "mode", 'DRAW', text="Draw") row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator_enum("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Line") row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row.operator_enum("gpencil.draw", "mode", 'ERASER', text="Erase") row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
class VIEW3D_PT_tools_posemode_options(View3DPanel): class VIEW3D_PT_tools_posemode_options(View3DPanel):
@@ -561,10 +561,10 @@ class VIEW3D_PT_tools_brush(PaintPanel):
elif context.texture_paint_object and brush: elif context.texture_paint_object and brush:
col = layout.column(align=True) col = layout.column(align=True)
col.item_enumR(settings, "tool", 'DRAW') col.prop_enum(settings, "tool", 'DRAW')
col.item_enumR(settings, "tool", 'SOFTEN') col.prop_enum(settings, "tool", 'SOFTEN')
col.item_enumR(settings, "tool", 'CLONE') col.prop_enum(settings, "tool", 'CLONE')
col.item_enumR(settings, "tool", 'SMEAR') col.prop_enum(settings, "tool", 'SMEAR')
col = layout.column() col = layout.column()
col.prop(brush, "color", text="") col.prop(brush, "color", text="")

View File

@@ -657,8 +657,8 @@ void texspace_edit(Scene *scene, View3D *v3d)
static EnumPropertyItem prop_set_center_types[] = { static EnumPropertyItem prop_set_center_types[] = {
{0, "CENTER", 0, "ObData to Center", "Move object data around Object center"}, {0, "CENTER", 0, "ObData to Center", "Move object data around Object center"},
{1, "CENTERNEW", 0, "Center New", "Move Object center to center of object data"}, {1, "CENTER_NEW", 0, "Center New", "Move Object center to center of object data"},
{2, "CENTERCURSOR", 0, "Center Cursor", "Move Object Center to position of the 3d cursor"}, {2, "CENTER_CURSOR", 0, "Center Cursor", "Move Object Center to position of the 3d cursor"},
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };

View File

@@ -51,10 +51,9 @@ static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr,
uiItemR(layout, name, icon, ptr, propname, flag); uiItemR(layout, name, icon, ptr, propname, flag);
} }
static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname, int properties) static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname)
{ {
int flag= (properties)? UI_ITEM_O_RETURN_PROPS: 0; return uiItemFullO(layout, name, icon, opname, NULL, uiLayoutGetOperatorContext(layout), UI_ITEM_O_RETURN_PROPS);
return uiItemFullO(layout, name, icon, opname, NULL, uiLayoutGetOperatorContext(layout), flag);
} }
#else #else
@@ -159,13 +158,13 @@ void RNA_api_ui_layout(StructRNA *srna)
api_ui_item_common(func); api_ui_item_common(func);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
func= RNA_def_function(srna, "item_enumR", "uiItemEnumR_string"); func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
api_ui_item_common(func); api_ui_item_common(func);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "prop_pointer", "uiItemPointerR"); func= RNA_def_function(srna, "prop_object", "uiItemPointerR");
api_ui_item_common(func); api_ui_item_common(func);
api_ui_item_rna_common(func); api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in."); parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in.");
@@ -175,17 +174,16 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "operator", "rna_uiItemO"); func= RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_boolean(func, "properties", 0, "Properties", "Return operator properties to fill in manually."); parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true.");
parm= RNA_def_pointer(func, "return_properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "operator_enum", "uiItemEnumO_string"); /* func= RNA_def_function(srna, "operator_enum", "uiItemEnumO_string");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_enums", "uiItemsEnumO"); func= RNA_def_function(srna, "operator_enums", "uiItemsEnumO");
parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
@@ -198,33 +196,33 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO"); /* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with."); parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_int", "uiItemIntO"); /* func= RNA_def_function(srna, "operator_int", "uiItemIntO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX); parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_float", "uiItemFloatO"); /* func= RNA_def_function(srna, "operator_float", "uiItemFloatO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX); parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_string", "uiItemStringO"); /* func= RNA_def_function(srna, "operator_string", "uiItemStringO");
api_ui_item_op_common(func); api_ui_item_op_common(func);
parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with."); parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with.");
RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "label", "uiItemL"); func= RNA_def_function(srna, "label", "uiItemL");
api_ui_item_common(func); api_ui_item_common(func);