2.5 Buttons
[blender-staging.git] / release / ui / buttons_scene.py
1
2 import bpy
3
4 class RenderButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "scene"
8
9 class RENDER_PT_shading(RenderButtonsPanel):
10         __label__ = "Shading"
11
12         def draw(self, context):
13                 scene = context.scene
14                 layout = self.layout
15
16                 rd = scene.render_data
17                 
18                 split = layout.split()
19                 
20                 sub = split.column()
21                 sub.itemR(rd, "render_shadows", text="Shadows")
22                 sub.itemR(rd, "render_sss", text="Subsurface Scattering")
23                 sub.itemR(rd, "render_envmaps", text="Environment Map")
24                 #       sub.itemR(rd, "render_radiosity", text="Radio")
25                 
26                 col = split.column()
27                 col.itemR(rd, "render_raytracing", text="Ray Tracing")
28                 colsub = col.column()
29                 colsub.active = rd.render_raytracing
30                 colsub.itemR(rd, "octree_resolution", text="Octree")
31                 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
32                 
33 class RENDER_PT_output(RenderButtonsPanel):
34         __label__ = "Output"
35
36         def draw(self, context):
37                 scene = context.scene
38                 layout = self.layout
39
40                 rd = scene.render_data
41                 
42                 layout.itemR(rd, "output_path")
43                 
44                 split = layout.split()
45                 
46                 col = split.column()
47                 col.itemR(rd, "file_format", text="Format")
48                 colsub = col.column()
49                 colsub.active = rd.file_format in ("AVIJPEG", "JPEG")
50                 colsub.itemR(rd, "quality", slider=True)
51                 
52                 sub = split.column()
53                 sub.itemR(rd, "color_mode")
54                 sub.itemR(rd, "alpha_mode")
55                 
56                 split = layout.split()
57                 
58                 sub = split.column()
59                 sub.itemR(rd, "file_extensions")
60                 sub.itemL(text="Distributed Rendering:")
61                 sub.itemR(rd, "placeholders")
62                 sub.itemR(rd, "no_overwrite")
63                 
64                 col = split.column()
65                 col.itemR(rd, "fields", text="Fields")
66                 colsub = col.column()
67                 colsub.active = rd.fields
68                 colsub.itemR(rd, "fields_still", text="Still")
69                 colsub.row().itemR(rd, "field_order", expand=True)
70
71 class RENDER_PT_antialiasing(RenderButtonsPanel):
72         __label__ = "Anti-Aliasing"
73
74         def draw_header(self, context):
75                 rd = context.scene.render_data
76
77                 layout = self.layout
78                 layout.itemR(rd, "antialiasing", text="")
79
80         def draw(self, context):
81                 scene = context.scene
82                 rd = scene.render_data
83
84                 layout = self.layout
85                 layout.active = rd.antialiasing
86
87                 split = layout.split()
88                 
89                 sub = split.column()
90                 sub.itemL(text="Samples:")
91                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
92                 sub.itemR(rd, "pixel_filter")
93
94                 col = split.column()
95                 col.itemR(rd, "filter_size", text="Size", slider=True)
96                 col.itemR(rd, "save_buffers")
97                 colsub = col.column()
98                 colsub.active = rd.save_buffers
99                 colsub.itemR(rd, "full_sample")
100
101 class RENDER_PT_render(RenderButtonsPanel):
102         __label__ = "Render"
103
104         def draw(self, context):
105                 scene = context.scene
106                 layout = self.layout
107
108                 rd = scene.render_data
109
110                 row = layout.row()
111                 row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
112                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
113                 
114                 row = layout.row()
115                 row.itemR(rd, "do_composite")
116                 row.itemR(rd, "do_sequence")
117                 rowsub = layout.row()
118                 rowsub.active = rd.do_composite
119                 rowsub.itemR(rd, "free_image_textures")
120
121                 split = layout.split()
122                 
123                 col = split.column(align=True)
124                 col.itemL(text="Threads:")
125                 col.row().itemR(rd, "threads_mode", expand=True)
126                 colsub = col.column()
127                 colsub.active = rd.threads_mode == 'THREADS_FIXED'
128                 colsub.itemR(rd, "threads")
129                 
130                 sub = split.column(align=True)
131                 sub.itemL(text="Tiles:")
132                 sub.itemR(rd, "parts_x", text="X")
133                 sub.itemR(rd, "parts_y", text="Y")
134                 
135                 split = layout.split()
136                 sub = split.column()
137                 sub = split.column()
138                 sub.itemR(rd, "panorama")
139                 
140                 #       row.itemR(rd, "backbuf")
141                         
142 class RENDER_PT_dimensions(RenderButtonsPanel):
143         __label__ = "Dimensions"
144
145         def draw(self, context):
146                 scene = context.scene
147                 layout = self.layout
148
149                 rd = scene.render_data
150                 
151                 split = layout.split()
152                 
153                 col = split.column()
154                 sub = col.column(align=True)
155                 sub.itemL(text="Resolution:")
156                 sub.itemR(rd, "resolution_x", text="X")
157                 sub.itemR(rd, "resolution_y", text="Y")
158                 sub.itemR(rd, "resolution_percentage", text="")
159                 
160                 sub.itemL(text="Aspect Ratio:")
161                 sub.itemR(rd, "pixel_aspect_x", text="X")
162                 sub.itemR(rd, "pixel_aspect_y", text="Y")
163                 
164                 col = col.column(align=False)
165                 col.itemR(rd, "border", text="Border")
166                 colsub = col.column()
167                 colsub.active = rd.border
168                 colsub.itemR(rd, "crop_to_border")
169
170                 col = split.column(align=True)
171                 col.itemL(text="Frame Range:")
172                 col.itemR(scene, "start_frame", text="Start")
173                 col.itemR(scene, "end_frame", text="End")
174                 col.itemR(scene, "frame_step", text="Step")
175                 
176                 col.itemL(text="Frame Rate:")
177                 col.itemR(rd, "fps")
178                 col.itemR(rd, "fps_base",text="/")
179
180 class RENDER_PT_stamp(RenderButtonsPanel):
181         __label__ = "Stamp"
182
183         def draw_header(self, context):
184                 rd = context.scene.render_data
185
186                 layout = self.layout
187                 layout.itemR(rd, "stamp", text="")
188
189         def draw(self, context):
190                 scene = context.scene
191                 rd = scene.render_data
192
193                 layout = self.layout
194                 layout.active = rd.stamp
195
196                 split = layout.split()
197                 
198                 col = split.column()
199                 col.itemR(rd, "stamp_time", text="Time")
200                 col.itemR(rd, "stamp_date", text="Date")
201                 col.itemR(rd, "stamp_frame", text="Frame")
202                 col.itemR(rd, "stamp_camera", text="Scene")
203                 col.itemR(rd, "stamp_marker", text="Marker")
204                 col.itemR(rd, "stamp_filename", text="Filename")
205                 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
206                 col.itemR(rd, "stamp_note", text="Note")
207                 colsub = col.column()
208                 colsub.active = rd.stamp_note
209                 colsub.itemR(rd, "stamp_note_text", text="")
210                 
211                 sub = split.column()
212                 sub.itemR(rd, "render_stamp")
213                 sub.itemR(rd, "stamp_foreground")
214                 sub.itemR(rd, "stamp_background")
215                 sub.itemR(rd, "stamp_font_size", text="Font Size")
216
217 bpy.types.register(RENDER_PT_render)
218 bpy.types.register(RENDER_PT_dimensions)
219 bpy.types.register(RENDER_PT_antialiasing)
220 bpy.types.register(RENDER_PT_shading)
221 bpy.types.register(RENDER_PT_output)
222 bpy.types.register(RENDER_PT_stamp)