Newer
Older
box.prop(props, 'cyclo_d')
col = layout.column()
col.label(text="Output Curve Type")
row = layout.row()
row.prop(props, 'outputType', expand=True)
col = layout.column()
col.label(text="Curve Options")
# output options
box = layout.box()
if props.outputType == 'NURBS':
box.row().prop(props, 'shape', expand=True)
box.prop(props, 'cyclic_u')
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
box.prop(props, 'order_u')
if props.outputType == 'POLY':
box.row().prop(props, 'shape', expand=True)
box.prop(props, 'cyclic_u')
if props.outputType == 'BEZIER':
box.row().prop(props, 'shape', expand=True)
box.row().prop(props, 'handleType', expand=True)
box.prop(props, 'cyclic_u')
##### POLL #####
def poll(self, context):
return context.scene != None
##### EXECUTE #####
def execute(self, context):
# turn off undo
undo = bpy.context.user_preferences.edit.global_undo
bpy.context.user_preferences.edit.global_undo = False
props = self.properties
if props.GalloreType in ['Helix', 'Cycloid']:
props.shape = '3D'
if props.GalloreType in ['Helix']:
props.cyclic_u = False
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
# Options
options = [
# general properties
props.outputType, #0
props.GalloreType, #1
# ProfileCurve properties
props.ProfileCurveType, #2
props.ProfileCurvevar1, #3
props.ProfileCurvevar2, #4
# MiscCurve properties
props.MiscCurveType, #5
props.MiscCurvevar1, #6
props.MiscCurvevar2, #7
props.MiscCurvevar3, #8
# Common properties
props.innerRadius, #9
props.middleRadius, #10
props.outerRadius, #11
# Flower properties
props.petals, #12
props.petalWidth, #13
# Star properties
props.starPoints, #14
props.starTwist, #15
# Arc properties
props.arcSides, #16
props.startAngle, #17
props.endAngle, #18
props.arcType, #19
# Cogwheel properties
props.teeth, #20
props.bevel, #21
# Nsided property
props.Nsides, #22
# Splat properties
props.splatSides, #23
props.splatScale, #24
props.seed, #25
props.basis, #26
# Helix properties
props.helixPoints, #27
props.helixHeight, #28
props.helixStart, #29
props.helixEnd, #30
props.helixWidth, #31
props.helix_a, #32
props.helix_b, #33
# Cycloid properties
props.cycloPoints, #34
props.cyclo_d, #35
props.cycloType, #36
props.cyclo_a, #37
props.cyclo_b, #38
props.cycloStart, #39
props.cycloEnd #40
]
# Curve options
curveOptions = [
props.shape, #0
props.cyclic_u, #1
props.endp_u, #2
props.order_u, #4
props.handleType #5
]
# main function
main(context, options, curveOptions, self.align_matrix)
# restore pre operator undo state
bpy.context.user_preferences.edit.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 #####
Curveaceous_galore_button = (lambda self, context: self.layout.operator
(Curveaceous_galore.bl_idname, text="curvatures gallore", icon="PLUGIN"))
classes = [
Curveaceous_galore
]
def register():
register = bpy.types.register
for cls in classes:
register(cls)
bpy.types.INFO_MT_curve_add.append(Curveaceous_galore_button)
def unregister():
unregister = bpy.types.unregister
for cls in classes:
unregister(cls)
bpy.types.INFO_MT_curve_add.remove(Curveaceous_galore_button)
if __name__ == "__main__":