e275b8881566c38c9c4b0931e75e72630a7d30c9
[blender.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_extensions")                
48                 col.itemR(rd, "fields", text="Fields")
49                 colsub = col.column()
50                 colsub.active = rd.fields
51                 colsub.itemR(rd, "fields_still", text="Still")
52                 colsub.row().itemR(rd, "field_order", expand=True)
53                 
54                 col = split.column()
55                 col.itemR(rd, "color_mode")
56                 col.itemR(rd, "alpha_mode")
57                 col.itemL(text="Distributed Rendering:")
58                 col.itemR(rd, "placeholders")
59                 col.itemR(rd, "no_overwrite")
60                 
61                 
62                 layout.itemR(rd, "file_format", text="Format")
63                 
64                 split = layout.split()
65                 
66                 col = split.column()
67                 
68                 if rd.file_format in ("AVIJPEG", "JPEG"):
69                         col.itemR(rd, "quality", slider=True)
70                         
71                 elif rd.file_format in ("OPENEXR"):
72                         col.itemR(rd, "exr_codec")
73                         col.itemR(rd, "exr_half")
74                         col = split.column()
75                         col.itemR(rd, "exr_zbuf")
76                         col.itemR(rd, "exr_preview")
77                 
78                 elif rd.file_format in ("JPEG2000"):
79                         row = layout.row()
80                         row.itemR(rd, "jpeg_preset")
81                         split = layout.split()
82                         col = split.column()
83                         col.itemL(text="Depth:")
84                         col.row().itemR(rd, "jpeg_depth", expand=True)
85                         col = split.column()
86                         col.itemR(rd, "jpeg_ycc")
87                         col.itemR(rd, "exr_preview")
88                         
89                 elif rd.file_format in ("CINEON", "DPX"):
90                         col.itemR(rd, "cineon_log", text="Convert to Log")
91                         colsub = col.column()
92                         colsub.active = rd.cineon_log
93                         colsub.itemR(rd, "cineon_black", text="Black")
94                         colsub.itemR(rd, "cineon_white", text="White")
95                         colsub.itemR(rd, "cineon_gamma", text="Gamma")
96                         
97                 elif rd.file_format in ("TIFF"):
98                         col.itemR(rd, "tiff_bit")
99
100 class RENDER_PT_antialiasing(RenderButtonsPanel):
101         __label__ = "Anti-Aliasing"
102
103         def draw_header(self, context):
104                 rd = context.scene.render_data
105
106                 layout = self.layout
107                 layout.itemR(rd, "antialiasing", text="")
108
109         def draw(self, context):
110                 scene = context.scene
111                 rd = scene.render_data
112
113                 layout = self.layout
114                 layout.active = rd.antialiasing
115
116                 split = layout.split()
117                 
118                 sub = split.column()
119                 sub.itemL(text="Samples:")
120                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
121                 sub.itemR(rd, "pixel_filter")
122
123                 col = split.column()
124                 col.itemR(rd, "filter_size", text="Size", slider=True)
125                 col.itemR(rd, "save_buffers")
126                 colsub = col.column()
127                 colsub.active = rd.save_buffers
128                 colsub.itemR(rd, "full_sample")
129
130 class RENDER_PT_render(RenderButtonsPanel):
131         __label__ = "Render"
132
133         def draw(self, context):
134                 scene = context.scene
135                 layout = self.layout
136
137                 rd = scene.render_data
138
139                 row = layout.row()
140                 row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
141                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
142                 
143                 row = layout.row()
144                 row.itemR(rd, "do_composite")
145                 row.itemR(rd, "do_sequence")
146                 rowsub = layout.row()
147                 rowsub.active = rd.do_composite
148                 rowsub.itemR(rd, "free_image_textures")
149
150                 split = layout.split()
151                 
152                 col = split.column(align=True)
153                 col.itemL(text="Threads:")
154                 col.row().itemR(rd, "threads_mode", expand=True)
155                 colsub = col.column()
156                 colsub.active = rd.threads_mode == 'THREADS_FIXED'
157                 colsub.itemR(rd, "threads")
158                 
159                 sub = split.column(align=True)
160                 sub.itemL(text="Tiles:")
161                 sub.itemR(rd, "parts_x", text="X")
162                 sub.itemR(rd, "parts_y", text="Y")
163                 
164                 split = layout.split()
165                 sub = split.column()
166                 sub = split.column()
167                 sub.itemR(rd, "panorama")
168                 
169                 #       row.itemR(rd, "backbuf")
170                         
171 class RENDER_PT_dimensions(RenderButtonsPanel):
172         __label__ = "Dimensions"
173
174         def draw(self, context):
175                 scene = context.scene
176                 layout = self.layout
177
178                 rd = scene.render_data
179                 
180                 split = layout.split()
181                 
182                 col = split.column()
183                 sub = col.column(align=True)
184                 sub.itemL(text="Resolution:")
185                 sub.itemR(rd, "resolution_x", text="X")
186                 sub.itemR(rd, "resolution_y", text="Y")
187                 sub.itemR(rd, "resolution_percentage", text="")
188                 
189                 sub.itemL(text="Aspect Ratio:")
190                 sub.itemR(rd, "pixel_aspect_x", text="X")
191                 sub.itemR(rd, "pixel_aspect_y", text="Y")
192                 
193                 col = col.column(align=False)
194                 col.itemR(rd, "border", text="Border")
195                 colsub = col.column()
196                 colsub.active = rd.border
197                 colsub.itemR(rd, "crop_to_border")
198
199                 col = split.column(align=True)
200                 col.itemL(text="Frame Range:")
201                 col.itemR(scene, "start_frame", text="Start")
202                 col.itemR(scene, "end_frame", text="End")
203                 col.itemR(scene, "frame_step", text="Step")
204                 
205                 col.itemL(text="Frame Rate:")
206                 col.itemR(rd, "fps")
207                 col.itemR(rd, "fps_base",text="/")
208
209 class RENDER_PT_stamp(RenderButtonsPanel):
210         __label__ = "Stamp"
211
212         def draw_header(self, context):
213                 rd = context.scene.render_data
214
215                 layout = self.layout
216                 layout.itemR(rd, "stamp", text="")
217
218         def draw(self, context):
219                 scene = context.scene
220                 rd = scene.render_data
221
222                 layout = self.layout
223                 layout.active = rd.stamp
224
225                 split = layout.split()
226                 
227                 col = split.column()
228                 col.itemR(rd, "stamp_time", text="Time")
229                 col.itemR(rd, "stamp_date", text="Date")
230                 col.itemR(rd, "stamp_frame", text="Frame")
231                 col.itemR(rd, "stamp_camera", text="Scene")
232                 col.itemR(rd, "stamp_marker", text="Marker")
233                 col.itemR(rd, "stamp_filename", text="Filename")
234                 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
235                 col.itemR(rd, "stamp_note", text="Note")
236                 colsub = col.column()
237                 colsub.active = rd.stamp_note
238                 colsub.itemR(rd, "stamp_note_text", text="")
239                 
240                 sub = split.column()
241                 sub.itemR(rd, "render_stamp")
242                 colsub = sub.column()
243                 colsub.active = rd.render_stamp
244                 colsub.itemR(rd, "stamp_foreground")
245                 colsub.itemR(rd, "stamp_background")
246                 colsub.itemR(rd, "stamp_font_size", text="Font Size")
247
248 bpy.types.register(RENDER_PT_render)
249 bpy.types.register(RENDER_PT_dimensions)
250 bpy.types.register(RENDER_PT_antialiasing)
251 bpy.types.register(RENDER_PT_shading)
252 bpy.types.register(RENDER_PT_output)
253 bpy.types.register(RENDER_PT_stamp)