* projection paint options in the toolbar
[blender.git] / release / ui / buttons_data_curve.py
1
2 import bpy
3
4 class DataButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "data"
8         
9         def poll(self, context):
10                 return (context.object and context.object.type == 'CURVE' and context.curve)
11
12 class DATA_PT_context_curve(DataButtonsPanel):
13         __idname__ = "DATA_PT_context_curve"
14         __show_header__ = False
15         
16         def draw(self, context):
17                 layout = self.layout
18                 
19                 ob = context.object
20                 curve = context.curve
21                 space = context.space_data
22
23                 split = layout.split(percentage=0.65)
24
25                 if ob:
26                         split.template_ID(ob, "data")
27                         split.itemS()
28                 elif curve:
29                         split.template_ID(space, "pin_id")
30                         split.itemS()
31
32
33 class DATA_PT_shape_curve(DataButtonsPanel):
34         __idname__ = "DATA_PT_shape_curve"
35         __label__ = "Shape"
36         
37         def draw(self, context):
38                 layout = self.layout
39                 
40                 ob = context.object
41                 curve = context.curve
42                 space = context.space_data
43
44                 if curve:
45                         layout.itemR(curve, "curve_2d")                 
46                                                         
47                         split = layout.split()
48                 
49                         col = split.column()
50                         colsub = col.column()
51                         colsub.active = curve.curve_2d
52                         colsub.itemL(text="Caps:")
53                         colsub.itemR(curve, "front")
54                         colsub.itemR(curve, "back")
55                         
56                         col.itemL(text="Textures:")
57 #                       col.itemR(curve, "uv_orco")
58                         col.itemR(curve, "auto_texspace")
59                         
60                         sub = split.column()    
61                         sub.itemL(text="Resolution:")
62                         sub.itemR(curve, "resolution_u", text="Preview U")
63                         sub.itemR(curve, "resolution_v", text="Preview V")
64                         sub.itemR(curve, "render_resolution_u", text="Render U")
65                         sub.itemR(curve, "render_resolution_v", text="Render V")
66
67 #                       sub.itemL(text="Display:")
68 #                       sub.itemL(text="HANDLES")
69 #                       sub.itemL(text="NORMALS")
70 #                       sub.itemR(curve, "vertex_normal_flip")
71
72 class DATA_PT_geometry_curve(DataButtonsPanel):
73         __idname__ = "DATA_PT_geometry_curve"
74         __label__ = "Geometry "
75
76         def draw(self, context):
77                 layout = self.layout
78                 curve = context.curve
79
80                 split = layout.split()
81         
82                 sub = split.column()
83                 sub.itemL(text="Modification:")
84                 sub.itemR(curve, "width")
85                 sub.itemR(curve, "extrude")
86                 sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE")
87                 
88                 sub = split.column()
89                 sub.itemL(text="Bevel:")
90                 sub.itemR(curve, "bevel_depth", text="Depth")
91                 sub.itemR(curve, "bevel_resolution", text="Resolution")
92                 sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE")
93         
94 class DATA_PT_pathanim(DataButtonsPanel):
95         __idname__ = "DATA_PT_pathanim"
96         __label__ = "Path Animation"
97         
98         def draw_header(self, context):
99                 layout = self.layout
100                 curve = context.curve
101
102                 layout.itemR(curve, "path", text="")
103
104         def draw(self, context):
105                 curve = context.curve
106                 layout = self.layout
107                 layout.active = curve.path      
108                 
109                 split = layout.split()          
110                 
111                 sub = split.column()
112                 sub.itemR(curve, "path_length", text="Frames")
113                 sub.itemR(curve, "follow")
114
115                 sub = split.column()
116                 sub.itemR(curve, "stretch")
117                 sub.itemR(curve, "offset_path_distance", text="Offset Children")
118         
119 class DATA_PT_current_curve(DataButtonsPanel):
120         __idname__ = "DATA_PT_current_curve"
121         __label__ = "Current Curve"
122
123         def draw(self, context):
124                 layout = self.layout
125                 currentcurve = context.curve.curves[0] # XXX
126
127                 split = layout.split()
128         
129                 sub = split.column()
130                 sub.itemL(text="Cyclic:")
131                 sub.itemR(currentcurve, "cyclic_u", text="U")
132                 sub.itemR(currentcurve, "cyclic_v", text="V")
133                 sub.itemL(text="Order:")
134                 sub.itemR(currentcurve, "order_u", text="U")
135                 sub.itemR(currentcurve, "order_v", text="V")
136                 sub.itemL(text="Endpoints:")
137                 sub.itemR(currentcurve, "endpoint_u", text="U")
138                 sub.itemR(currentcurve, "endpoint_v", text="V")
139                 
140                 sub = split.column()
141                 sub.itemL(text="Bezier:")
142                 sub.itemR(currentcurve, "bezier_u", text="U")
143                 sub.itemR(currentcurve, "bezier_v", text="V")
144                 sub.itemL(text="Resolution:")
145                 sub.itemR(currentcurve, "resolution_u", text="U")
146                 sub.itemR(currentcurve, "resolution_v", text="V")
147                 sub.itemL(text="Interpolation:")
148                 sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
149                 sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
150                 sub.itemR(currentcurve, "smooth")
151                 
152 bpy.types.register(DATA_PT_context_curve)
153 bpy.types.register(DATA_PT_shape_curve)
154 bpy.types.register(DATA_PT_geometry_curve)
155 bpy.types.register(DATA_PT_pathanim)
156 bpy.types.register(DATA_PT_current_curve)
157