diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-31 19:40:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-31 19:40:14 +0300 |
commit | e4881eef529262ec131ab22688e44fb9af2f0bb9 (patch) | |
tree | 7aa57ef1436870ac6b07d0aa11c713bd0d19400c /release/scripts/io/export_ply.py | |
parent | ea265fc69702566a846be3005d9fd814a10d7d54 (diff) |
define operator properties in the class, similar to django fields
# Before
[
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),
bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
]
# After
path = StringProperty(attr="", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_modifiers = BoolProperty(attr="", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
use_normals = BoolProperty(attr="", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True)
use_uvs = BoolProperty(attr="", name="Export UVs", description="Exort the active UV layer", default= True)
use_colors = BoolProperty(attr="", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
Diffstat (limited to 'release/scripts/io/export_ply.py')
-rw-r--r-- | release/scripts/io/export_ply.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py index 67cd6a85599..fedf50d6a4e 100644 --- a/release/scripts/io/export_ply.py +++ b/release/scripts/io/export_ply.py @@ -231,6 +231,9 @@ def write(filename, scene, ob, \ Blender.Window.EditMode(1, '', 0) """ +from bpy.props import * + + class EXPORT_OT_ply(bpy.types.Operator): '''Export a single object as a stanford PLY with normals, colours and texture coordinates.''' bl_idname = "export.ply" @@ -239,13 +242,13 @@ class EXPORT_OT_ply(bpy.types.Operator): # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. - bl_props = [ - bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""), - bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True), - bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True), - bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True), - bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True) - ] + + path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") + use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True) + use_normals = BoolProperty(name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True) + use_uvs = BoolProperty(name="Export UVs", description="Exort the active UV layer", default= True) + use_colors = BoolProperty(name="Export Vertex Colors", description="Exort the active vertex color layer", default= True) + def poll(self, context): return context.active_object != None |