2.5 Buttons:
[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                 ob = context.active_object
11                 return (ob and ob.type == 'CURVE')
12
13 class DATA_PT_shape_curve(DataButtonsPanel):
14                 __idname__ = "DATA_PT_shape_curve"
15                 __label__ = "Shape"
16
17                 def draw(self, context):
18                         curve = context.active_object.data
19                         layout = self.layout
20
21                         layout.itemR(curve, "curve_2d")                 
22                                                         
23                         split = layout.split()
24                 
25                         sub = split.column()
26                         sub.itemL(text="Caps:")
27                         sub.itemR(curve, "front")
28                         sub.itemR(curve, "back")
29                         
30                         sub.itemL(text="Textures:")
31                         sub.itemR(curve, "uv_orco")
32                         sub.itemR(curve, "auto_texspace")
33                         
34                         sub = split.column()    
35                         sub.itemL(text="Resolution:")
36                         sub.itemR(curve, "resolution_u", text="Preview U")
37                         sub.itemR(curve, "resolution_v", text="Preview V")
38                         sub.itemR(curve, "render_resolution_u", text="Render U")
39                         sub.itemR(curve, "render_resolution_v", text="Render V")
40
41                         sub.itemL(text="Display:")
42                         sub.itemL(text="HANDLES")
43                         sub.itemL(text="NORMALS")
44                         sub.itemR(curve, "vertex_normal_flip")
45
46 class DATA_PT_geometry(DataButtonsPanel):
47                 __idname__ = "DATA_PT_geometry"
48                 __label__ = "Geometry"
49
50                 def draw(self, context):
51                         curve = context.active_object.data
52                         layout = self.layout
53
54                         split = layout.split()
55                 
56                         sub = split.column()
57                         sub.itemL(text="Modification:")
58                         sub.itemR(curve, "width")
59                         sub.itemR(curve, "extrude")
60                         sub.itemR(curve, "taper_object")
61                         
62                         sub = split.column()
63                         sub.itemL(text="Bevel:")
64                         sub.itemR(curve, "bevel_depth", text="Depth")
65                         sub.itemR(curve, "bevel_resolution", text="Resolution")
66                         sub.itemR(curve, "bevel_object")
67         
68 class DATA_PT_pathanim(DataButtonsPanel):
69                 __idname__ = "DATA_PT_pathanim"
70                 __label__ = "Path Animation"
71
72                 def draw(self, context):
73                         curve = context.active_object.data
74                         layout = self.layout
75
76                         layout.itemR(curve, "path", text="Enable")
77                         
78                         split = layout.split()          
79                         
80                         sub = split.column()
81                         sub.itemR(curve, "path_length", text="Frames")
82                         sub.itemR(curve, "follow")
83
84                         sub = split.column()
85                         sub.itemR(curve, "stretch")
86                         sub.itemR(curve, "offset_path_distance", text="Offset Children")
87         
88 class DATA_PT_current_curve(DataButtonsPanel):
89                 __idname__ = "DATA_PT_current_curve"
90                 __label__ = "Current Curve"
91
92                 def draw(self, context):
93                         currentcurve = context.active_object.data.curves[0]
94                         layout = self.layout
95
96                         split = layout.split()
97                 
98                         sub = split.column()
99                         sub.itemL(text="Cyclic:")
100                         sub.itemR(currentcurve, "cyclic_u", text="U")
101                         sub.itemR(currentcurve, "cyclic_v", text="V")
102                         sub.itemL(text="Order:")
103                         sub.itemR(currentcurve, "order_u", text="U")
104                         sub.itemR(currentcurve, "order_v", text="V")
105                         sub.itemL(text="Point Count:")                  
106                         sub.itemR(currentcurve, "point_count_u", text="U")
107                         sub.itemR(currentcurve, "point_count_v", text="V")
108                         sub.itemL(text="Endpoints:")
109                         sub.itemR(currentcurve, "endpoint_u", text="U")
110                         sub.itemR(currentcurve, "endpoint_v", text="V")
111                         
112                         sub = split.column()
113                         sub.itemL(text="Bezier:")
114                         sub.itemR(currentcurve, "bezier_u", text="U")
115                         sub.itemR(currentcurve, "bezier_v", text="V")
116                         sub.itemL(text="Resolution:")
117                         sub.itemR(currentcurve, "resolution_u", text="U")
118                         sub.itemR(currentcurve, "resolution_v", text="V")
119                         sub.itemL(text="Interpolation:")
120                         sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
121                         sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
122                         sub.itemR(currentcurve, "smooth")
123                         
124 bpy.types.register(DATA_PT_shape_curve)
125 bpy.types.register(DATA_PT_geometry)
126 bpy.types.register(DATA_PT_pathanim)
127 bpy.types.register(DATA_PT_current_curve)