py style change only - make property definitions consistent

This commit is contained in:
Campbell Barton 2011-08-19 19:25:20 +00:00
parent 3a81f23e09
commit 90d19ad883
19 changed files with 363 additions and 171 deletions

@ -88,36 +88,62 @@ class AddTorus(Operator):
bl_label = "Add Torus"
bl_options = {'REGISTER', 'UNDO'}
major_radius = FloatProperty(name="Major Radius",
major_radius = FloatProperty(
name="Major Radius",
description=("Radius from the origin to the "
"center of the cross sections"),
default=1.0, min=0.01, max=100.0)
minor_radius = FloatProperty(name="Minor Radius",
min=0.01, max=100.0,
default=1.0,
)
minor_radius = FloatProperty(
name="Minor Radius",
description="Radius of the torus' cross section",
default=0.25, min=0.01, max=100.0)
major_segments = IntProperty(name="Major Segments",
min=0.01, max=100.0,
default=0.25,
)
major_segments = IntProperty(
name="Major Segments",
description="Number of segments for the main ring of the torus",
default=48, min=3, max=256)
minor_segments = IntProperty(name="Minor Segments",
min=3, max=256,
default=48,
)
minor_segments = IntProperty(
name="Minor Segments",
description="Number of segments for the minor ring of the torus",
default=12, min=3, max=256)
use_abso = BoolProperty(name="Use Int+Ext Controls",
min=3, max=256,
default=12,
)
use_abso = BoolProperty(
name="Use Int+Ext Controls",
description="Use the Int / Ext controls for torus dimensions",
default=False)
abso_major_rad = FloatProperty(name="Exterior Radius",
default=False,
)
abso_major_rad = FloatProperty(
name="Exterior Radius",
description="Total Exterior Radius of the torus",
default=1.0, min=0.01, max=100.0)
abso_minor_rad = FloatProperty(name="Inside Radius",
min=0.01, max=100.0,
default=1.0,
)
abso_minor_rad = FloatProperty(
name="Inside Radius",
description="Total Interior Radius of the torus",
default=0.5, min=0.01, max=100.0)
min=0.01, max=100.0,
default=0.5,
)
# generic transform props
view_align = BoolProperty(name="Align to View",
default=False)
location = FloatVectorProperty(name="Location",
subtype='TRANSLATION')
rotation = FloatVectorProperty(name="Rotation",
subtype='EULER')
view_align = BoolProperty(
name="Align to View",
default=False,
)
location = FloatVectorProperty(
name="Location",
subtype='TRANSLATION',
)
rotation = FloatVectorProperty(
name="Rotation",
subtype='EULER',
)
def execute(self, context):

@ -74,11 +74,11 @@ class MeshMirrorUV(Operator):
bl_label = "Copy Mirrored UV coords"
bl_options = {'REGISTER', 'UNDO'}
direction = EnumProperty(items=(
('POSITIVE', "Positive", ""),
('NEGATIVE', "Negative", "")),
name="Axis Direction",
description="")
direction = EnumProperty(
name="Axis Direction",
items=(('POSITIVE', "Positive", ""),
('NEGATIVE', "Negative", "")),
)
@classmethod
def poll(cls, context):

@ -195,8 +195,12 @@ class SubdivisionSet(Operator):
bl_label = "Subdivision Set"
bl_options = {'REGISTER', 'UNDO'}
level = IntProperty(name="Level",
default=1, min=-100, max=100, soft_min=-6, soft_max=6)
level = IntProperty(
name="Level",
min=-100, max=100,
soft_min=-6, soft_max=6,
default=1,
)
relative = BoolProperty(
name="Relative",

@ -351,33 +351,34 @@ class AlignObjects(Operator):
description=("Enables high quality calculation of the "
"bounding box for perfect results on complex "
"shape meshes with rotation/scale (Slow)"),
default=True)
align_mode = EnumProperty(items=(
('OPT_1', "Negative Sides", ""),
('OPT_2', "Centers", ""),
('OPT_3', "Positive Sides", "")),
name="Align Mode:",
description="",
default='OPT_2')
relative_to = EnumProperty(items=(
('OPT_1', "Scene Origin", ""),
('OPT_2', "3D Cursor", ""),
('OPT_3', "Selection", ""),
('OPT_4', "Active", "")),
name="Relative To:",
description="",
default='OPT_4')
align_axis = EnumProperty(items=(
('X', "X", ""),
('Y', "Y", ""),
('Z', "Z", ""),
),
name="Align",
description="Align to axis",
options={'ENUM_FLAG'})
default=True,
)
align_mode = EnumProperty(
name="Align Mode:",
items=(('OPT_1', "Negative Sides", ""),
('OPT_2', "Centers", ""),
('OPT_3', "Positive Sides", ""),
),
default='OPT_2',
)
relative_to = EnumProperty(
name="Relative To:",
items=(('OPT_1', "Scene Origin", ""),
('OPT_2', "3D Cursor", ""),
('OPT_3', "Selection", ""),
('OPT_4', "Active", ""),
),
default='OPT_4',
)
align_axis = EnumProperty(
name="Align",
description="Align to axis",
items=(('X', "X", ""),
('Y', "Y", ""),
('Z', "Z", ""),
),
options={'ENUM_FLAG'},
)
@classmethod
def poll(cls, context):

@ -51,19 +51,25 @@ class QuickFur(Operator):
bl_label = "Quick Fur"
bl_options = {'REGISTER', 'UNDO'}
density = EnumProperty(items=(
('LIGHT', "Light", ""),
('MEDIUM', "Medium", ""),
('HEAVY', "Heavy", "")),
name="Fur Density",
description="",
default='MEDIUM')
view_percentage = IntProperty(name="View %",
default=10, min=1, max=100, soft_min=1, soft_max=100)
length = FloatProperty(name="Length",
default=0.1, min=0.001, max=100, soft_min=0.01, soft_max=10)
density = EnumProperty(
name="Fur Density",
items=(('LIGHT', "Light", ""),
('MEDIUM', "Medium", ""),
('HEAVY', "Heavy", "")),
default='MEDIUM',
)
view_percentage = IntProperty(
name="View %",
min=1, max=100,
soft_min=1, soft_max=100,
default=10,
)
length = FloatProperty(
name="Length",
min=0.001, max=100,
soft_min=0.01, soft_max=10,
default=0.1,
)
def execute(self, context):
fake_context = bpy.context.copy()
@ -110,31 +116,50 @@ class QuickExplode(Operator):
bl_label = "Quick Explode"
bl_options = {'REGISTER', 'UNDO'}
style = EnumProperty(items=(
('EXPLODE', "Explode", ""),
('BLEND', "Blend", "")),
name="Explode Style",
description="",
default='EXPLODE')
style = EnumProperty(
name="Explode Style",
items=(('EXPLODE', "Explode", ""),
('BLEND', "Blend", "")),
default='EXPLODE',
)
amount = IntProperty(
name="Amount of pieces",
min=2, max=10000,
soft_min=2, soft_max=10000,
default=100,
)
frame_duration = IntProperty(
name="Duration",
min=1, max=300000,
soft_min=1, soft_max=10000,
default=50,
)
amount = IntProperty(name="Amount of pieces",
default=100, min=2, max=10000, soft_min=2, soft_max=10000)
frame_start = IntProperty(
name="Start Frame",
min=1, max=300000,
soft_min=1, soft_max=10000,
default=1,
)
frame_end = IntProperty(
name="End Frame",
min=1, max=300000,
soft_min=1, soft_max=10000,
default=10,
)
frame_duration = IntProperty(name="Duration",
default=50, min=1, max=300000, soft_min=1, soft_max=10000)
velocity = FloatProperty(
name="Outwards Velocity",
min=0, max=300000,
soft_min=0, soft_max=10,
default=1,
)
frame_start = IntProperty(name="Start Frame",
default=1, min=1, max=300000, soft_min=1, soft_max=10000)
frame_end = IntProperty(name="End Frame",
default=10, min=1, max=300000, soft_min=1, soft_max=10000)
velocity = FloatProperty(name="Outwards Velocity",
default=1, min=0, max=300000, soft_min=0, soft_max=10)
fade = BoolProperty(name="Fade",
description="Fade the pieces over time.",
default=True)
fade = BoolProperty(
name="Fade",
description="Fade the pieces over time.",
default=True,
)
def execute(self, context):
fake_context = bpy.context.copy()
@ -272,12 +297,11 @@ class QuickSmoke(Operator):
bl_options = {'REGISTER', 'UNDO'}
style = EnumProperty(
name="Smoke Style",
items=(('STREAM', "Stream", ""),
('PUFF', "Puff", ""),
('FIRE', "Fire", ""),
),
name="Smoke Style",
description="",
default='STREAM',
)
@ -390,19 +414,16 @@ class QuickFluid(Operator):
bl_options = {'REGISTER', 'UNDO'}
style = EnumProperty(
name="Fluid Style",
items=(('INFLOW', "Inflow", ""),
('BASIC', "Basic", ""),
),
name="Fluid Style",
description="",
default='BASIC',
)
('BASIC', "Basic", "")),
default='BASIC',
)
initial_velocity = FloatVectorProperty(
name="Initial Velocity",
description="Initial velocity of the fluid",
min=-100.0, max=100.0,
default=(0.0, 0.0, 0.0),
min=-100.0,
max=100.0,
subtype='VELOCITY',
)
show_flows = BoolProperty(

@ -145,9 +145,12 @@ class RandomizeLocRotSize(Operator):
default=False,
)
'''scale_min = FloatProperty(name="Minimun Scale Factor",
description="Lowest scale percentage possible",
default=0.15, min=-1.0, max=1.0, precision=3)'''
'''scale_min = FloatProperty(
name="Minimun Scale Factor",
description="Lowest scale percentage possible",
min=-1.0, max=1.0, precision=3,
default=0.15,
)'''
scale = FloatVectorProperty(
name="Scale",

@ -82,8 +82,12 @@ class SequencerCutMulticam(Operator):
bl_label = "Cut multicam"
bl_options = {'REGISTER', 'UNDO'}
camera = IntProperty(name="Camera",
default=1, min=1, max=32, soft_min=1, soft_max=32)
camera = IntProperty(
name="Camera",
min=1, max=32,
soft_min=1, soft_max=32,
default=1,
)
@classmethod
def poll(cls, context):

@ -552,7 +552,6 @@ class LightMapPack(Operator):
PREF_CONTEXT = bpy.props.EnumProperty(
name="Selection",
description="",
items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"),
("ALL_FACES", "All Faces", "Average space UVs edge length of each loop"),
("ALL_OBJECTS", "Selected Mesh Object", "Average space UVs edge length of each loop")

@ -1110,17 +1110,24 @@ class SmartProject(Operator):
bl_label = "Smart UV Project"
bl_options = {'REGISTER', 'UNDO'}
angle_limit = FloatProperty(name="Angle Limit",
angle_limit = FloatProperty(
name="Angle Limit",
description="lower for more projection groups, higher for less distortion",
default=66.0, min=1.0, max=89.0)
island_margin = FloatProperty(name="Island Margin",
min=1.0, max=89.0,
default=66.0,
)
island_margin = FloatProperty(
name="Island Margin",
description="Margin to reduce bleed from adjacent islands",
default=0.0, min=0.0, max=1.0)
user_area_weight = FloatProperty(name="Area Weight",
min=0.0, max=1.0,
default=0.0,
)
user_area_weight = FloatProperty(
name="Area Weight",
description="Weight projections vector by faces with larger areas",
default=0.0, min=0.0, max=1.0)
min=0.0, max=1.0,
default=0.0,
)
@classmethod
def poll(cls, context):

@ -151,11 +151,35 @@ class VertexPaintDirt(Operator):
bl_label = "Dirty Vertex Colors"
bl_options = {'REGISTER', 'UNDO'}
blur_strength = FloatProperty(name="Blur Strength", description="Blur strength per iteration", default=1.0, min=0.01, max=1.0)
blur_iterations = IntProperty(name="Blur Iterations", description="Number times to blur the colors. (higher blurs more)", default=1, min=0, max=40)
clean_angle = FloatProperty(name="Highlight Angle", description="Less then 90 limits the angle used in the tonal range", default=180.0, min=0.0, max=180.0)
dirt_angle = FloatProperty(name="Dirt Angle", description="Less then 90 limits the angle used in the tonal range", default=0.0, min=0.0, max=180.0)
dirt_only = BoolProperty(name="Dirt Only", description="Dont calculate cleans for convex areas", default=False)
blur_strength = FloatProperty(
name="Blur Strength",
description="Blur strength per iteration",
min=0.01, max=1.0,
default=1.0,
)
blur_iterations = IntProperty(
name="Blur Iterations",
description="Number times to blur the colors. (higher blurs more)",
min=0, max=40,
default=1,
)
clean_angle = FloatProperty(
name="Highlight Angle",
description="Less then 90 limits the angle used in the tonal range",
min=0.0, max=180.0,
default=180.0,
)
dirt_angle = FloatProperty(
name="Dirt Angle",
description="Less then 90 limits the angle used in the tonal range",
min=0.0, max=180.0,
default=0.0,
)
dirt_only = BoolProperty(
name="Dirt Only",
description="Dont calculate cleans for convex areas",
default=False,
)
def execute(self, context):
import time

@ -557,14 +557,12 @@ class WM_OT_context_set_id(Operator):
doc_id = StringProperty(
name="Doc ID",
description="",
maxlen=1024,
options={'HIDDEN'},
)
doc_new = StringProperty(
name="Edit Description",
description="",
maxlen=1024,
)

@ -102,7 +102,10 @@ def register():
items.extend([(cat, cat, "") for cat in sorted(items_unique)])
return items
WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter")
WindowManager.addon_search = StringProperty(
name="Search",
description="Search within the selected filter",
)
WindowManager.addon_filter = EnumProperty(
items=addon_filter_items,
name="Category",

@ -141,7 +141,11 @@ class ConsoleLanguage(Operator):
'''Set the current language for this console'''
bl_idname = "console.language"
bl_label = "Console Language"
language = StringProperty(name="Language", maxlen=32, default="")
language = StringProperty(
name="Language",
maxlen=32,
)
def execute(self, context):
sc = context.space_data

@ -1106,7 +1106,10 @@ class WM_OT_addon_disable(Operator):
bl_idname = "wm.addon_disable"
bl_label = "Disable Add-On"
module = StringProperty(name="Module", description="Module name of the addon to disable")
module = StringProperty(
name="Module",
description="Module name of the addon to disable",
)
def execute(self, context):
addon_utils.disable(self.module)
@ -1118,16 +1121,35 @@ class WM_OT_addon_install(Operator):
bl_idname = "wm.addon_install"
bl_label = "Install Add-On..."
overwrite = BoolProperty(name="Overwrite", description="Remove existing addons with the same ID", default=True)
overwrite = BoolProperty(
name="Overwrite",
description="Remove existing addons with the same ID",
default=True,
)
target = EnumProperty(
name="Target Path",
items=(('DEFAULT', "Default", ""),
('PREFS', "User Prefs", "")))
('PREFS', "User Prefs", "")),
)
filepath = StringProperty(name="File Path", description="File path to write file to")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
filter_glob = StringProperty(default="*.py;*.zip", options={'HIDDEN'})
filepath = StringProperty(
name="File Path",
description="File path to write file to",
)
filter_folder = BoolProperty(
name="Filter folders",
default=True,
options={'HIDDEN'},
)
filter_python = BoolProperty(
name="Filter python",
default=True,
options={'HIDDEN'},
)
filter_glob = StringProperty(
default="*.py;*.zip",
options={'HIDDEN'},
)
@staticmethod
def _module_remove(path_addons, module):
@ -1264,7 +1286,10 @@ class WM_OT_addon_remove(Operator):
bl_idname = "wm.addon_remove"
bl_label = "Remove Add-On"
module = StringProperty(name="Module", description="Module name of the addon to remove")
module = StringProperty(
name="Module",
description="Module name of the addon to remove",
)
@staticmethod
def path_from_addon(module):
@ -1312,7 +1337,10 @@ class WM_OT_addon_expand(Operator):
bl_idname = "wm.addon_expand"
bl_label = ""
module = StringProperty(name="Module", description="Module name of the addon to expand")
module = StringProperty(
name="Module",
description="Module name of the addon to expand",
)
def execute(self, context):
module_name = self.module

@ -533,12 +533,31 @@ class WM_OT_keyconfig_import(Operator):
bl_idname = "wm.keyconfig_import"
bl_label = "Import Key Configuration..."
filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
filepath = StringProperty(
name="File Path",
description="Filepath to write file to",
default="keymap.py",
)
filter_folder = BoolProperty(
name="Filter folders",
default=True,
options={'HIDDEN'},
)
filter_text = BoolProperty(
name="Filter text",
default=True,
options={'HIDDEN'},
)
filter_python = BoolProperty(
name="Filter python",
default=True,
options={'HIDDEN'},
)
keep_original = BoolProperty(
name="Keep original",
description="Keep original file after copying to configuration folder",
default=True,
)
def execute(self, context):
from os.path import basename
@ -580,10 +599,26 @@ class WM_OT_keyconfig_export(Operator):
bl_idname = "wm.keyconfig_export"
bl_label = "Export Key Configuration..."
filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
filepath = StringProperty(
name="File Path",
description="Filepath to write file to",
default="keymap.py",
)
filter_folder = BoolProperty(
name="Filter folders",
default=True,
options={'HIDDEN'},
)
filter_text = BoolProperty(
name="Filter text",
default=True,
options={'HIDDEN'},
)
filter_python = BoolProperty(
name="Filter python",
default=True,
options={'HIDDEN'},
)
def execute(self, context):
if not self.filepath:
@ -673,7 +708,10 @@ class WM_OT_keymap_restore(Operator):
bl_idname = "wm.keymap_restore"
bl_label = "Restore Key Map(s)"
all = BoolProperty(name="All Keymaps", description="Restore all keymaps to default")
all = BoolProperty(
name="All Keymaps",
description="Restore all keymaps to default",
)
def execute(self, context):
wm = context.window_manager
@ -693,7 +731,10 @@ class WM_OT_keyitem_restore(Operator):
bl_idname = "wm.keyitem_restore"
bl_label = "Restore Key Map Item"
item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
item_id = IntProperty(
name="Item Identifier",
description="Identifier of the item to remove",
)
@classmethod
def poll(cls, context):
@ -737,7 +778,10 @@ class WM_OT_keyitem_remove(Operator):
bl_idname = "wm.keyitem_remove"
bl_label = "Remove Key Map Item"
item_id = IntProperty(name="Item Identifier", description="Identifier of the item to remove")
item_id = IntProperty(
name="Item Identifier",
description="Identifier of the item to remove",
)
@classmethod
def poll(cls, context):

@ -45,10 +45,12 @@ class OBJECT_OT_add_object(bpy.types.Operator, AddObjectHelper):
bl_description = "Create a new Mesh Object"
bl_options = {'REGISTER', 'UNDO'}
scale = FloatVectorProperty(name='scale',
default=(1.0, 1.0, 1.0),
subtype='TRANSLATION',
description='scaling')
scale = FloatVectorProperty(
name='scale',
default=(1.0, 1.0, 1.0),
subtype='TRANSLATION',
description='scaling',
)
def execute(self, context):

@ -24,18 +24,26 @@ class ExportSomeData(bpy.types.Operator, ExportHelper):
# ExportHelper mixin class uses this
filename_ext = ".txt"
filter_glob = StringProperty(default="*.txt", options={'HIDDEN'})
filter_glob = StringProperty(
default="*.txt",
options={'HIDDEN'},
)
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default=True)
use_setting = BoolProperty(
name="Example Boolean",
description="Example Tooltip",
default=True,
)
type = EnumProperty(items=(('OPT_A', "First Option", "Description one"),
('OPT_B', "Second Option", "Description two."),
),
name="Example Enum",
description="Choose between two items",
default='OPT_A')
type = EnumProperty(
name="Example Enum",
description="Choose between two items",
items=(('OPT_A', "First Option", "Description one"),
('OPT_B', "Second Option", "Description two.")),
default='OPT_A',
)
@classmethod
def poll(cls, context):

@ -43,25 +43,38 @@ class AddBox(bpy.types.Operator):
bl_label = "Add Box"
bl_options = {'REGISTER', 'UNDO'}
width = FloatProperty(name="Width",
width = FloatProperty(
name="Width",
description="Box Width",
default=1.0, min=0.01, max=100.0)
height = FloatProperty(name="Height",
min=0.01, max=100.0,
default=1.0,
)
height = FloatProperty(
name="Height",
description="Box Height",
default=1.0, min=0.01, max=100.0)
depth = FloatProperty(name="Depth",
min=0.01, max=100.0,
default=1.0,
)
depth = FloatProperty(
name="Depth",
description="Box Depth",
default=1.0, min=0.01, max=100.0)
min=0.01, max=100.0,
default=1.0,
)
# generic transform props
view_align = BoolProperty(name="Align to View",
default=False)
location = FloatVectorProperty(name="Location",
subtype='TRANSLATION')
rotation = FloatVectorProperty(name="Rotation",
subtype='EULER')
view_align = BoolProperty(
name="Align to View",
default=False,
)
location = FloatVectorProperty(
name="Location",
subtype='TRANSLATION',
)
rotation = FloatVectorProperty(
name="Rotation",
subtype='EULER',
)
def execute(self, context):

@ -8,7 +8,10 @@ class ViewOperator(bpy.types.Operator):
bl_idname = "view3d.modal_operator"
bl_label = "Simple View Operator"
offset = FloatVectorProperty(name="Offset", size=3)
offset = FloatVectorProperty(
name="Offset",
size=3,
)
def execute(self, context):
v3d = context.space_data