Newer
Older
# options per GalloreType
box = layout.box()
Thomas Dinges
committed
if self.GalloreType == 'Profile':
Campbell Barton
committed
box.prop(self, 'ProfileCurveType')
box.prop(self, 'ProfileCurvevar1')
box.prop(self, 'ProfileCurvevar2')
Thomas Dinges
committed
if self.GalloreType == 'Miscellaneous':
Campbell Barton
committed
box.prop(self, 'MiscCurveType')
box.prop(self, 'MiscCurvevar1', text='Width')
box.prop(self, 'MiscCurvevar2', text='Height')
if self.MiscCurveType == 5:
box.prop(self, 'MiscCurvevar3', text='Rounded')
Thomas Dinges
committed
if self.GalloreType == 'Flower':
Campbell Barton
committed
box.prop(self, 'petals')
box.prop(self, 'petalWidth')
box.prop(self, 'innerRadius')
box.prop(self, 'outerRadius')
Thomas Dinges
committed
if self.GalloreType == 'Star':
Campbell Barton
committed
box.prop(self, 'starPoints')
box.prop(self, 'starTwist')
box.prop(self, 'innerRadius')
box.prop(self, 'outerRadius')
Thomas Dinges
committed
if self.GalloreType == 'Arc':
Campbell Barton
committed
box.prop(self, 'arcSides')
box.prop(self, 'arcType') # has only one Type?
box.prop(self, 'startAngle')
box.prop(self, 'endAngle')
box.prop(self, 'innerRadius') # doesn't seem to do anything
box.prop(self, 'outerRadius')
Thomas Dinges
committed
if self.GalloreType == 'Cogwheel':
Campbell Barton
committed
box.prop(self, 'teeth')
box.prop(self, 'bevel')
box.prop(self, 'innerRadius')
box.prop(self, 'middleRadius')
box.prop(self, 'outerRadius')
Thomas Dinges
committed
if self.GalloreType == 'Nsided':
Campbell Barton
committed
box.prop(self, 'Nsides')
box.prop(self, 'outerRadius', text='Radius')
Thomas Dinges
committed
if self.GalloreType == 'Splat':
Campbell Barton
committed
box.prop(self, 'splatSides')
box.prop(self, 'outerRadius')
box.prop(self, 'splatScale')
box.prop(self, 'seed')
box.prop(self, 'basis')
Thomas Dinges
committed
if self.GalloreType == 'Helix':
Campbell Barton
committed
box.prop(self, 'helixPoints')
box.prop(self, 'helixHeight')
box.prop(self, 'helixWidth')
box.prop(self, 'helixStart')
box.prop(self, 'helixEnd')
box.prop(self, 'helix_a')
box.prop(self, 'helix_b')
Thomas Dinges
committed
if self.GalloreType == 'Cycloid':
Campbell Barton
committed
box.prop(self, 'cycloPoints')
#box.prop(self, 'cycloType') # needs the other types first
box.prop(self, 'cycloStart')
box.prop(self, 'cycloEnd')
box.prop(self, 'cyclo_a')
box.prop(self, 'cyclo_b')
box.prop(self, 'cyclo_d')
col = layout.column()
col.label(text="Output Curve Type")
row = layout.row()
Campbell Barton
committed
row.prop(self, 'outputType', expand=True)
col = layout.column()
col.label(text="Curve Options")
# output options
box = layout.box()
Thomas Dinges
committed
if self.outputType == 'NURBS':
Campbell Barton
committed
box.row().prop(self, 'shape', expand=True)
#box.prop(self, 'use_cyclic_u')
#box.prop(self, 'endp_u')
box.prop(self, 'order_u')
Thomas Dinges
committed
if self.outputType == 'POLY':
Campbell Barton
committed
box.row().prop(self, 'shape', expand=True)
#box.prop(self, 'use_cyclic_u')
Thomas Dinges
committed
if self.outputType == 'BEZIER':
Campbell Barton
committed
box.row().prop(self, 'shape', expand=True)
box.row().prop(self, 'handleType', expand=True)
#box.prop(self, 'use_cyclic_u')
@classmethod
def poll(cls, context):
return context.scene != None
##### EXECUTE #####
def execute(self, context):
# turn off undo
undo = bpy.context.user_preferences.edit.use_global_undo
bpy.context.user_preferences.edit.use_global_undo = False
# deal with 2D - 3D curve differences
Thomas Dinges
committed
if self.GalloreType in ['Helix', 'Cycloid']:
self.shape = '3D'
Thomas Dinges
committed
#self.shape = '2D' # someone decide if we want this
Thomas Dinges
committed
if self.GalloreType in ['Helix']:
self.use_cyclic_u = False
Thomas Dinges
committed
self.use_cyclic_u = True
Thomas Dinges
committed
main(context, self, self.align_matrix)
# restore pre operator undo state
bpy.context.user_preferences.edit.use_global_undo = undo
return {'FINISHED'}
##### INVOKE #####
def invoke(self, context, event):
# store creation_matrix
self.align_matrix = align_matrix(context)
self.execute(context)
return {'FINISHED'}
################################################################################
##### REGISTER #####
def Curveaceous_galore_button(self, context):
self.layout.operator(Curveaceous_galore.bl_idname, text="curvatures gallore", icon="PLUGIN")
def register():
bpy.types.INFO_MT_curve_add.append(Curveaceous_galore_button)
def unregister():
bpy.types.INFO_MT_curve_add.remove(Curveaceous_galore_button)
if __name__ == "__main__":