finish handle for properties_XXX scripts

This commit is contained in:
Xiao Xiangquan
2011-08-02 16:51:50 +00:00
parent 66d1707293
commit 79656a65e0
27 changed files with 1262 additions and 1237 deletions

View File

@@ -18,7 +18,7 @@
# <pep8 compliant>
import bpy
from blf import gettext as _
class ModifierButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -27,7 +27,7 @@ class ModifierButtonsPanel():
class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
bl_label = "Modifiers"
bl_label = _("Modifiers")
def draw(self, context):
layout = self.layout
@@ -50,14 +50,14 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Object:")
col.label(text=_("Object:"))
col.prop(md, "object", text="")
col.prop(md, "use_deform_preserve_volume")
col = split.column()
col.label(text="Bind To:")
col.prop(md, "use_vertex_groups", text="Vertex Groups")
col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
col.label(text=_("Bind To:"))
col.prop(md, "use_vertex_groups", text=_("Vertex Groups"))
col.prop(md, "use_bone_envelopes", text=_("Bone Envelopes"))
layout.separator()
@@ -91,11 +91,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.separator()
col.prop(md, "use_merge_vertices", text="Merge")
col.prop(md, "use_merge_vertices", text=_("Merge"))
sub = col.column()
sub.active = md.use_merge_vertices
sub.prop(md, "use_merge_vertices_cap", text="First Last")
sub.prop(md, "merge_threshold", text="Distance")
sub.prop(md, "use_merge_vertices_cap", text=_("First Last"))
sub.prop(md, "merge_threshold", text=_("Distance"))
col = split.column()
col.prop(md, "use_relative_offset")
@@ -121,7 +121,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split.prop(md, "width")
split.prop(md, "use_only_vertices")
layout.label(text="Limit Method:")
layout.label(text=_("Limit Method:"))
layout.row().prop(md, "limit_method", expand=True)
if md.limit_method == 'ANGLE':
layout.prop(md, "angle_limit")
@@ -132,11 +132,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Operation:")
col.label(text=_("Operation:"))
col.prop(md, "operation", text="")
col = split.column()
col.label(text="Object:")
col.label(text=_("Object:"))
col.prop(md, "object", text="")
def BUILD(self, layout, ob, md):
@@ -155,7 +155,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
def CAST(self, layout, ob, md):
split = layout.split(percentage=0.25)
split.label(text="Cast Type:")
split.label(text=_("Cast Type:"))
split.prop(md, "cast_type", text="")
split = layout.split(percentage=0.25)
@@ -174,52 +174,52 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.label(text="Control Object:")
col.label(text=_("Control Object:"))
col.prop(md, "object", text="")
if md.object:
col.prop(md, "use_transform")
def CLOTH(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def COLLISION(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def CURVE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Object:")
col.label(text=_("Object:"))
col.prop(md, "object", text="")
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(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)
def DECIMATE(self, layout, ob, md):
layout.prop(md, "ratio")
layout.label(text="Face Count: %s" % str(md.face_count))
layout.label(text=_("Face Count")+": %s" % str(md.face_count))
def DISPLACE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Texture:")
col.label(text=_("Texture:"))
col.template_ID(md, "texture", new="texture.new")
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.label(text="Direction:")
col.label(text=_("Direction:"))
col.prop(md, "direction", text="")
col.label(text="Texture Coordinates:")
col.label(text=_("Texture Coordinates:"))
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coords_object", text="Object")
layout.prop(md, "texture_coords_object", text=_("Object"))
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
@@ -233,23 +233,23 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.prop(md, "use_edge_angle", text="Edge Angle")
col.prop(md, "use_edge_angle", text=_("Edge Angle"))
sub = col.column()
sub.active = md.use_edge_angle
sub.prop(md, "split_angle")
split.prop(md, "use_edge_sharp", text="Sharp Edges")
split.prop(md, "use_edge_sharp", text=_("Sharp Edges"))
def EXPLODE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Vertex group:")
col.label(text=_("Vertex group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
sub.active = bool(md.vertex_group)
sub.prop(md, "protect")
col.label(text="Particle UV")
col.label(text=_("Particle UV"))
col.prop_search(md, "particle_uv", ob.data, "uv_textures", text="")
col = split.column()
@@ -259,22 +259,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "show_dead")
col.prop(md, "use_size")
layout.operator("object.explode_refresh", text="Refresh")
layout.operator("object.explode_refresh", text=_("Refresh"))
def FLUID_SIMULATION(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def HOOK(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Object:")
col.label(text=_("Object:"))
col.prop(md, "object", text="")
if md.object and md.object.type == 'ARMATURE':
col.label(text="Bone:")
col.label(text=_("Bone:"))
col.prop_search(md, "subtarget", md.object.data, "bones", text="")
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
layout.separator()
@@ -286,38 +286,38 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "force", slider=True)
col = split.column()
col.operator("object.hook_reset", text="Reset")
col.operator("object.hook_recenter", text="Recenter")
col.operator("object.hook_reset", text=_("Reset"))
col.operator("object.hook_recenter", text=_("Recenter"))
if ob.mode == 'EDIT':
layout.separator()
row = layout.row()
row.operator("object.hook_select", text="Select")
row.operator("object.hook_assign", text="Assign")
row.operator("object.hook_select", text=_("Select"))
row.operator("object.hook_assign", text=_("Assign"))
def LATTICE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Object:")
col.label(text=_("Object:"))
col.prop(md, "object", text="")
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
def MASK(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Mode:")
col.label(text=_("Mode:"))
col.prop(md, "mode", text="")
col = split.column()
if md.mode == 'ARMATURE':
col.label(text="Armature:")
col.label(text=_("Armature:"))
col.prop(md, "armature", text="")
elif md.mode == 'VERTEX_GROUP':
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
@@ -329,11 +329,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col = split.column()
sub = col.column()
sub.label(text="Object:")
sub.label(text=_("Object:"))
sub.prop(md, "object", text="")
sub.active = not md.is_bound
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
@@ -343,9 +343,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
layout.separator()
if md.is_bound:
layout.operator("object.meshdeform_bind", text="Unbind")
layout.operator("object.meshdeform_bind", text=_("Unbind"))
else:
layout.operator("object.meshdeform_bind", text="Bind")
layout.operator("object.meshdeform_bind", text=_("Bind"))
row = layout.row()
row.prop(md, "precision")
@@ -355,19 +355,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split(percentage=0.25)
col = split.column()
col.label(text="Axis:")
col.label(text=_("Axis:"))
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
col = split.column()
col.label(text="Options:")
col.prop(md, "use_mirror_merge", text="Merge")
col.prop(md, "use_clip", text="Clipping")
col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups")
col.label(text=_("Options:"))
col.prop(md, "use_mirror_merge", text=_("Merge"))
col.prop(md, "use_clip", text=_("Clipping"))
col.prop(md, "use_mirror_vertex_groups", text=_("Vertex Groups"))
col = split.column()
col.label(text="Textures:")
col.label(text=_("Textures:"))
col.prop(md, "use_mirror_u", text="U")
col.prop(md, "use_mirror_v", text="V")
@@ -375,7 +375,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
if md.use_mirror_merge == True:
col.prop(md, "merge_threshold")
col.label(text="Mirror Object:")
col.label(text=_("Mirror Object:"))
col.prop(md, "mirror_object", text="")
def MULTIRES(self, layout, ob, md):
@@ -383,17 +383,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.prop(md, "levels", text="Preview")
col.prop(md, "sculpt_levels", text="Sculpt")
col.prop(md, "render_levels", text="Render")
col.prop(md, "levels", text=_("Preview"))
col.prop(md, "sculpt_levels", text=_("Sculpt"))
col.prop(md, "render_levels", text=_("Render"))
col = split.column()
col.enabled = ob.mode != 'EDIT'
col.operator("object.multires_subdivide", text="Subdivide")
col.operator("object.multires_higher_levels_delete", text="Delete Higher")
col.operator("object.multires_reshape", text="Reshape")
col.operator("object.multires_base_apply", text="Apply Base")
col.operator("object.multires_subdivide", text=_("Subdivide"))
col.operator("object.multires_higher_levels_delete", text=_("Delete Higher"))
col.operator("object.multires_reshape", text=_("Reshape"))
col.operator("object.multires_base_apply", text=_("Apply Base"))
col.prop(md, "use_subsurf_uv")
col.prop(md, "show_only_control_edges")
@@ -402,34 +402,34 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col = layout.column()
row = col.row()
if md.is_external:
row.operator("object.multires_external_pack", text="Pack External")
row.operator("object.multires_external_pack", text=_("Pack External"))
row.label()
row = col.row()
row.prop(md, "filepath", text="")
else:
row.operator("object.multires_external_save", text="Save External...")
row.operator("object.multires_external_save", text=_("Save External..."))
row.label()
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.prop(md, "object")
layout.prop(md, "particle_system_index", text="Particle System")
layout.prop(md, "particle_system_index", text=_("Particle System"))
split = layout.split()
col = split.column()
col.label(text="Create From:")
col.label(text=_("Create From:"))
col.prop(md, "use_normal")
col.prop(md, "use_children")
col.prop(md, "use_size")
col = split.column()
col.label(text="Show Particles When:")
col.label(text=_("Show Particles When:"))
col.prop(md, "show_alive")
col.prop(md, "show_unborn")
col.prop(md, "show_dead")
layout.separator()
layout.prop(md, "use_path", text="Create Along Paths")
layout.prop(md, "use_path", text=_("Create Along Paths"))
split = layout.split()
split.active = md.use_path
@@ -439,17 +439,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(md, "position", slider=True)
col.prop(md, "random_position", text="Random", slider=True)
col.prop(md, "random_position", text=_("Random"), slider=True)
def PARTICLE_SYSTEM(self, layout, ob, md):
layout.label(text="Settings can be found inside the Particle context")
layout.label(text=_("Settings can be found inside the Particle context"))
def SCREW(self, layout, ob, md):
split = layout.split()
col = split.column()
col.prop(md, "axis")
col.prop(md, "object", text="AxisOb")
col.prop(md, "object", text=_("AxisOb"))
col.prop(md, "angle")
col.prop(md, "steps")
col.prop(md, "render_steps")
@@ -468,10 +468,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
def SHRINKWRAP(self, layout, ob, md):
split = layout.split()
col = split.column()
col.label(text="Target:")
col.label(text=_("Target:"))
col.prop(md, "target", text="")
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split()
@@ -481,28 +481,28 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "subsurf_levels")
col = split.column()
col.label(text="Mode:")
col.label(text=_("Mode:"))
col.prop(md, "wrap_method", text="")
if md.wrap_method == 'PROJECT':
split = layout.split(percentage=0.25)
col = split.column()
col.label(text="Axis:")
col.label(text=_("Axis:"))
col.prop(md, "use_project_x")
col.prop(md, "use_project_y")
col.prop(md, "use_project_z")
col = split.column()
col.label(text="Direction:")
col.label(text=_("Direction:"))
col.prop(md, "use_negative_direction")
col.prop(md, "use_positive_direction")
col = split.column()
col.label(text="Cull Faces:")
col.label(text=_("Cull Faces:"))
col.prop(md, "cull_face", expand=True)
layout.label(text="Auxiliary Target:")
layout.label(text=_("Auxiliary Target:"))
layout.prop(md, "auxiliary_target", text="")
elif md.wrap_method == 'NEAREST_SURFACEPOINT':
@@ -512,24 +512,24 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Mode:")
col.label(text=_("Mode:"))
col.prop(md, "deform_method", text="")
col = split.column()
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split()
col = split.column()
col.label(text="Origin:")
col.label(text=_("Origin:"))
col.prop(md, "origin", text="")
sub = col.column()
sub.active = (md.origin is not None)
sub.prop(md, "use_relative")
col = split.column()
col.label(text="Deform:")
col.label(text=_("Deform:"))
col.prop(md, "factor")
col.prop(md, "limits", slider=True)
if md.deform_method in {'TAPER', 'STRETCH'}:
@@ -537,13 +537,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "lock_y")
def SMOKE(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def SMOOTH(self, layout, ob, md):
split = layout.split(percentage=0.25)
col = split.column()
col.label(text="Axis:")
col.label(text=_("Axis:"))
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
@@ -551,11 +551,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col = split.column()
col.prop(md, "factor")
col.prop(md, "iterations")
col.label(text="Vertex Group:")
col.label(text=_("Vertex Group:"))
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
def SOFT_BODY(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def SOLIDIFY(self, layout, ob, md):
split = layout.split()
@@ -564,18 +564,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "thickness")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col.label(text="Crease:")
col.prop(md, "edge_crease_inner", text="Inner")
col.prop(md, "edge_crease_outer", text="Outer")
col.prop(md, "edge_crease_rim", text="Rim")
col.label(text="Material Index Offset:")
col.label(text=_("Crease:"))
col.prop(md, "edge_crease_inner", text=_("Inner"))
col.prop(md, "edge_crease_outer", text=_("Outer"))
col.prop(md, "edge_crease_rim", text=_("Rim"))
col.label(text=_("Material Index Offset:"))
col = split.column()
col.prop(md, "offset")
sub = col.column()
sub.active = bool(md.vertex_group)
sub.prop(md, "invert_vertex_group", text="Invert")
sub.prop(md, "invert_vertex_group", text=_("Invert"))
col.prop(md, "use_even_offset")
col.prop(md, "use_quality_normals")
@@ -587,65 +587,65 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
row.prop(md, "material_offset", text="")
row = row.row()
row.active = md.use_rim
row.prop(md, "material_offset_rim", text="Rim")
row.prop(md, "material_offset_rim", text=_("Rim"))
def SUBSURF(self, layout, ob, md):
layout.row().prop(md, "subdivision_type", expand=True)
split = layout.split()
col = split.column()
col.label(text="Subdivisions:")
col.prop(md, "levels", text="View")
col.prop(md, "render_levels", text="Render")
col.label(text=_("Subdivisions:"))
col.prop(md, "levels", text=_("View"))
col.prop(md, "render_levels", text=_("Render"))
col = split.column()
col.label(text="Options:")
col.label(text=_("Options:"))
col.prop(md, "use_subsurf_uv")
col.prop(md, "show_only_control_edges")
def SURFACE(self, layout, ob, md):
layout.label(text="Settings can be found inside the Physics context")
layout.label(text=_("Settings can be found inside the Physics context"))
def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH':
split = layout.split()
col = split.column()
col.label(text="Image:")
col.label(text=_("Image:"))
col.prop(md, "image", text="")
col = split.column()
col.label(text="UV Layer:")
col.label(text=_("UV Layer:"))
col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
split = layout.split()
col = split.column()
col.prop(md, "use_image_override")
col.prop(md, "projector_count", text="Projectors")
col.prop(md, "projector_count", text=_("Projectors"))
for proj in md.projectors:
col.prop(proj, "object", text="")
col = split.column()
sub = col.column(align=True)
sub.prop(md, "aspect_x", text="Aspect X")
sub.prop(md, "aspect_y", text="Aspect Y")
sub.prop(md, "aspect_x", text=_("Aspect X"))
sub.prop(md, "aspect_y", text=_("Aspect Y"))
sub = col.column(align=True)
sub.prop(md, "scale_x", text="Scale X")
sub.prop(md, "scale_y", text="Scale Y")
sub.prop(md, "scale_x", text=_("Scale X"))
sub.prop(md, "scale_y", text=_("Scale Y"))
def WARP(self, layout, ob, md):
use_falloff = (md.falloff_type != 'NONE')
split = layout.split()
col = split.column()
col.label(text="From:")
col.label(text=_("From:"))
col.prop(md, "object_from", text="")
col.prop(md, "use_volume_preserve")
col = split.column()
col.label(text="To:")
col.label(text=_("To:"))
col.prop(md, "object_to", text="")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
@@ -664,15 +664,15 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
# 2 new columns
split = layout.split()
col = split.column()
col.label(text="Texture:")
col.label(text=_("Texture:"))
col.prop(md, "texture", text="")
col = split.column()
col.label(text="Texture Coordinates:")
col.label(text=_("Texture Coordinates:"))
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coords_object", text="Object")
layout.prop(md, "texture_coords_object", text=_("Object"))
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
@@ -680,7 +680,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Motion:")
col.label(text=_("Motion:"))
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_cyclic")
@@ -696,18 +696,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
split = layout.split()
col = split.column()
col.label(text="Time:")
col.label(text=_("Time:"))
sub = col.column(align=True)
sub.prop(md, "time_offset", text="Offset")
sub.prop(md, "lifetime", text="Life")
col.prop(md, "damping_time", text="Damping")
sub.prop(md, "time_offset", text=_("Offset"))
sub.prop(md, "lifetime", text=_("Life"))
col.prop(md, "damping_time", text=_("Damping"))
col = split.column()
col.label(text="Position:")
col.label(text=_("Position:"))
sub = col.column(align=True)
sub.prop(md, "start_position_x", text="X")
sub.prop(md, "start_position_y", text="Y")
col.prop(md, "falloff_radius", text="Falloff")
col.prop(md, "falloff_radius", text=_("Falloff"))
layout.separator()
@@ -715,7 +715,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
layout.prop_search(md, "vertex_group", ob, "vertex_groups")
split = layout.split(percentage=0.33)
col = split.column()
col.label(text="Texture")
col.label(text=_("Texture"))
col = split.column()
col.template_ID(md, "texture", new="texture.new")
layout.prop(md, "texture_coords")