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)
12 class DATA_PT_shape_curve(DataButtonsPanel):
13 __idname__ = "DATA_PT_shape_curve"
16 def poll(self, context):
17 return (context.object and context.object.type == 'CURVE')
19 def draw(self, context):
24 space = context.space_data
26 split = layout.split(percentage=0.65)
29 split.template_ID(context, ob, "data")
32 split.template_ID(context, space, "pin_id")
37 layout.itemR(curve, "curve_2d")
39 split = layout.split()
43 colsub.active = curve.curve_2d
44 colsub.itemL(text="Caps:")
45 colsub.itemR(curve, "front")
46 colsub.itemR(curve, "back")
48 col.itemL(text="Textures:")
49 col.itemR(curve, "uv_orco")
50 col.itemR(curve, "auto_texspace")
53 sub.itemL(text="Resolution:")
54 sub.itemR(curve, "resolution_u", text="Preview U")
55 sub.itemR(curve, "resolution_v", text="Preview V")
56 sub.itemR(curve, "render_resolution_u", text="Render U")
57 sub.itemR(curve, "render_resolution_v", text="Render V")
59 sub.itemL(text="Display:")
60 sub.itemL(text="HANDLES")
61 sub.itemL(text="NORMALS")
62 sub.itemR(curve, "vertex_normal_flip")
64 class DATA_PT_geometry(DataButtonsPanel):
65 __idname__ = "DATA_PT_geometry"
66 __label__ = "Geometry"
68 def draw(self, context):
72 split = layout.split()
75 sub.itemL(text="Modification:")
76 sub.itemR(curve, "width")
77 sub.itemR(curve, "extrude")
78 sub.itemR(curve, "taper_object")
81 sub.itemL(text="Bevel:")
82 sub.itemR(curve, "bevel_depth", text="Depth")
83 sub.itemR(curve, "bevel_resolution", text="Resolution")
84 sub.itemR(curve, "bevel_object")
86 class DATA_PT_pathanim(DataButtonsPanel):
87 __idname__ = "DATA_PT_pathanim"
88 __label__ = "Path Animation"
90 def draw_header(self, context):
94 layout.itemR(curve, "path", text="")
96 def draw(self, context):
99 layout.active = curve.path
101 split = layout.split()
104 sub.itemR(curve, "path_length", text="Frames")
105 sub.itemR(curve, "follow")
108 sub.itemR(curve, "stretch")
109 sub.itemR(curve, "offset_path_distance", text="Offset Children")
111 class DATA_PT_current_curve(DataButtonsPanel):
112 __idname__ = "DATA_PT_current_curve"
113 __label__ = "Current Curve"
115 def draw(self, context):
117 currentcurve = context.curve.curves[0] # XXX
119 split = layout.split()
122 sub.itemL(text="Cyclic:")
123 sub.itemR(currentcurve, "cyclic_u", text="U")
124 sub.itemR(currentcurve, "cyclic_v", text="V")
125 sub.itemL(text="Order:")
126 sub.itemR(currentcurve, "order_u", text="U")
127 sub.itemR(currentcurve, "order_v", text="V")
128 sub.itemL(text="Endpoints:")
129 sub.itemR(currentcurve, "endpoint_u", text="U")
130 sub.itemR(currentcurve, "endpoint_v", text="V")
133 sub.itemL(text="Bezier:")
134 sub.itemR(currentcurve, "bezier_u", text="U")
135 sub.itemR(currentcurve, "bezier_v", text="V")
136 sub.itemL(text="Resolution:")
137 sub.itemR(currentcurve, "resolution_u", text="U")
138 sub.itemR(currentcurve, "resolution_v", text="V")
139 sub.itemL(text="Interpolation:")
140 sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
141 sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
142 sub.itemR(currentcurve, "smooth")
144 bpy.types.register(DATA_PT_shape_curve)
145 bpy.types.register(DATA_PT_geometry)
146 bpy.types.register(DATA_PT_pathanim)
147 bpy.types.register(DATA_PT_current_curve)