4 class DataButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 def poll(self, context):
10 return (context.object and context.object.type == 'CURVE' and context.curve)
13 class DATA_PT_context(DataButtonsPanel):
14 __idname__ = "DATA_PT_context"
17 def poll(self, context):
18 return (context.object and context.object.type == 'CURVE')
20 def draw(self, context):
25 space = context.space_data
27 split = layout.split(percentage=0.65)
30 split.template_ID(ob, "data")
33 split.template_ID(space, "pin_id")
37 class DATA_PT_shape_curve(DataButtonsPanel):
38 __idname__ = "DATA_PT_shape_curve"
41 def poll(self, context):
42 return (context.object and context.object.type == 'CURVE')
44 def draw(self, context):
49 space = context.space_data
54 layout.itemR(curve, "curve_2d")
56 split = layout.split()
60 colsub.active = curve.curve_2d
61 colsub.itemL(text="Caps:")
62 colsub.itemR(curve, "front")
63 colsub.itemR(curve, "back")
65 col.itemL(text="Textures:")
66 # col.itemR(curve, "uv_orco")
67 col.itemR(curve, "auto_texspace")
70 sub.itemL(text="Resolution:")
71 sub.itemR(curve, "resolution_u", text="Preview U")
72 sub.itemR(curve, "resolution_v", text="Preview V")
73 sub.itemR(curve, "render_resolution_u", text="Render U")
74 sub.itemR(curve, "render_resolution_v", text="Render V")
76 # sub.itemL(text="Display:")
77 # sub.itemL(text="HANDLES")
78 # sub.itemL(text="NORMALS")
79 # sub.itemR(curve, "vertex_normal_flip")
81 class DATA_PT_geometry(DataButtonsPanel):
82 __idname__ = "DATA_PT_geometry"
83 __label__ = "Geometry"
85 def draw(self, context):
89 split = layout.split()
92 sub.itemL(text="Modification:")
93 sub.itemR(curve, "width")
94 sub.itemR(curve, "extrude")
95 sub.itemR(curve, "taper_object")
98 sub.itemL(text="Bevel:")
99 sub.itemR(curve, "bevel_depth", text="Depth")
100 sub.itemR(curve, "bevel_resolution", text="Resolution")
101 sub.itemR(curve, "bevel_object")
103 class DATA_PT_pathanim(DataButtonsPanel):
104 __idname__ = "DATA_PT_pathanim"
105 __label__ = "Path Animation"
107 def draw_header(self, context):
109 curve = context.curve
111 layout.itemR(curve, "path", text="")
113 def draw(self, context):
114 curve = context.curve
116 layout.active = curve.path
118 split = layout.split()
121 sub.itemR(curve, "path_length", text="Frames")
122 sub.itemR(curve, "follow")
125 sub.itemR(curve, "stretch")
126 sub.itemR(curve, "offset_path_distance", text="Offset Children")
128 class DATA_PT_current_curve(DataButtonsPanel):
129 __idname__ = "DATA_PT_current_curve"
130 __label__ = "Current Curve"
132 def draw(self, context):
134 currentcurve = context.curve.curves[0] # XXX
136 split = layout.split()
139 sub.itemL(text="Cyclic:")
140 sub.itemR(currentcurve, "cyclic_u", text="U")
141 sub.itemR(currentcurve, "cyclic_v", text="V")
142 sub.itemL(text="Order:")
143 sub.itemR(currentcurve, "order_u", text="U")
144 sub.itemR(currentcurve, "order_v", text="V")
145 sub.itemL(text="Endpoints:")
146 sub.itemR(currentcurve, "endpoint_u", text="U")
147 sub.itemR(currentcurve, "endpoint_v", text="V")
150 sub.itemL(text="Bezier:")
151 sub.itemR(currentcurve, "bezier_u", text="U")
152 sub.itemR(currentcurve, "bezier_v", text="V")
153 sub.itemL(text="Resolution:")
154 sub.itemR(currentcurve, "resolution_u", text="U")
155 sub.itemR(currentcurve, "resolution_v", text="V")
156 sub.itemL(text="Interpolation:")
157 sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
158 sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
159 sub.itemR(currentcurve, "smooth")
161 bpy.types.register(DATA_PT_context)
162 bpy.types.register(DATA_PT_shape_curve)
163 bpy.types.register(DATA_PT_geometry)
164 bpy.types.register(DATA_PT_pathanim)
165 bpy.types.register(DATA_PT_current_curve)