Newer
Older
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
Campbell Barton
committed
# <pep8 compliant>
William Reynish
committed
import bpy
William Reynish
committed
class RenderButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
William Reynish
committed
class RENDER_PT_render(RenderButtonsPanel):
bl_label = "Render"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
William Reynish
committed
rd = context.scene.render_data
William Reynish
committed
row = layout.row()
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
layout.itemR(rd, "display_mode", text="Display")
William Reynish
committed
William Reynish
committed
class RENDER_PT_layers(RenderButtonsPanel):
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
bl_label = "Layers"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
rl = rd.layers[rd.active_layer_index]
if rl:
layout.itemR(rl, "name")
split = layout.split()
col = split.column()
col.itemR(scene, "visible_layers", text="Scene")
col = split.column()
col.itemR(rl, "visible_layers", text="Layer")
layout.itemR(rl, "light_override", text="Light")
layout.itemR(rl, "material_override", text="Material")
layout.itemS()
layout.itemL(text="Include:")
split = layout.split()
col = split.column()
col.itemR(rl, "zmask")
row = col.row()
row.itemR(rl, "zmask_negate", text="Negate")
row.active = rl.zmask
col.itemR(rl, "all_z")
col = split.column()
col.itemR(rl, "solid")
col.itemR(rl, "halo")
col.itemR(rl, "ztransp")
col.itemR(rl, "sky")
col = split.column()
col.itemR(rl, "edge")
col.itemR(rl, "strand")
col.itemR(rl, "freestyle")
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
if rl.zmask:
split = layout.split()
split.itemL(text="Zmask Layers:")
split.column().itemR(rl, "zmask_layers", text="")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Passes:")
col.itemR(rl, "pass_combined")
col.itemR(rl, "pass_z")
col.itemR(rl, "pass_vector")
col.itemR(rl, "pass_normal")
col.itemR(rl, "pass_uv")
col.itemR(rl, "pass_mist")
col.itemR(rl, "pass_object_index")
col = split.column()
col.itemL()
col.itemR(rl, "pass_color")
col.itemR(rl, "pass_diffuse")
row = col.row()
row.itemR(rl, "pass_specular")
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_shadow")
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_ao")
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_reflection")
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_refraction")
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
William Reynish
committed
if rl.freestyle:
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Freestyle:")
freestyle = rl.freestyle_settings
col.itemR(freestyle, "sphere_radius", text="Sphere Radius")
col.itemR(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
col.itemR(freestyle, "suggestive_contours", text="Suggestive Contours")
col.itemR(freestyle, "dkr_epsilon", text="Dkr Epsilon")
col.itemO("scene.freestyle_module_add", text="Add Style Module")
for i, module in enumerate(freestyle.modules):
box = layout.box()
box.set_context_pointer("freestyle_module", module)
row = box.row(align=True)
row.itemR(module, "is_displayed", text="")
row.itemR(module, "module_path", text="")
row.itemO("scene.freestyle_module_remove", icon='ICON_X', text="")
props = row.itemO("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="", properties=True)
props.active = (i > 0)
props = row.itemO("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="", properties=True)
props.active = (i < len(freestyle.modules) - 1)
William Reynish
committed
class RENDER_PT_shading(RenderButtonsPanel):
bl_label = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "render_textures", text="Textures")
col.itemR(rd, "render_shadows", text="Shadows")
col.itemR(rd, "render_sss", text="Subsurface Scattering")
col.itemR(rd, "render_envmaps", text="Environment Map")
col = split.column()
col.itemR(rd, "render_raytracing", text="Ray Tracing")
col.itemR(rd, "color_management")
col.itemR(rd, "alpha_mode", text="Alpha")
William Reynish
committed
William Reynish
committed
class RENDER_PT_performance(RenderButtonsPanel):
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
bl_label = "Performance"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column(align=True)
col.itemL(text="Threads:")
col.row().itemR(rd, "threads_mode", expand=True)
sub = col.column()
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
sub.itemR(rd, "threads")
col.itemL(text="Tiles:")
col.itemR(rd, "parts_x", text="X")
col.itemR(rd, "parts_y", text="Y")
col = split.column()
col.itemL(text="Memory:")
sub = col.column()
sub.itemR(rd, "save_buffers")
sub.enabled = not rd.full_sample
sub = col.column()
sub.active = rd.use_compositing
sub.itemR(rd, "free_image_textures")
sub = col.column()
sub.active = rd.render_raytracing
sub.itemL(text="Acceleration structure:")
sub.itemR(rd, "raytrace_structure", text="")
if rd.raytrace_structure == 'OCTREE':
sub.itemR(rd, "octree_resolution", text="Resolution")
else:
sub.itemR(rd, "use_instances", text="Instances")
sub.itemR(rd, "use_local_coords", text="Local Coordinates")
William Reynish
committed
William Reynish
committed
class RENDER_PT_post_processing(RenderButtonsPanel):
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
bl_label = "Post Processing"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "use_compositing")
col.itemR(rd, "use_sequencer")
col = split.column()
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(rd, "fields", text="Fields")
sub = col.column()
sub.active = rd.fields
sub.row().itemR(rd, "field_order", expand=True)
sub.itemR(rd, "fields_still", text="Still")
col = split.column()
col.itemR(rd, "edge")
sub = col.column()
sub.active = rd.edge
sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
sub.itemR(rd, "edge_color", text="")
split = layout.split()
col = split.column()
col.itemR(rd, "freestyle", text="Freestyle")
William Reynish
committed
class RENDER_PT_output(RenderButtonsPanel):
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
bl_label = "Output"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.itemR(rd, "output_path", text="")
split = layout.split()
col = split.column()
col.itemR(rd, "file_format", text="")
col.row().itemR(rd, "color_mode", text="Color", expand=True)
col = split.column()
col.itemR(rd, "file_extensions")
col.itemR(rd, "use_overwrite")
col.itemR(rd, "use_placeholder")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
split.itemR(rd, "quality", slider=True)
elif rd.file_format == 'OPENEXR':
split = layout.split()
col = split.column()
col.itemL(text="Codec:")
col.itemR(rd, "exr_codec", text="")
subsplit = split.split()
col = subsplit.column()
col.itemR(rd, "exr_half")
col.itemR(rd, "exr_zbuf")
col = subsplit.column()
col.itemR(rd, "exr_preview")
elif rd.file_format == 'JPEG2000':
split = layout.split()
col = split.column()
col.itemL(text="Depth:")
col.row().itemR(rd, "jpeg2k_depth", expand=True)
col = split.column()
col.itemR(rd, "jpeg2k_preset", text="")
col.itemR(rd, "jpeg2k_ycc")
elif rd.file_format in ('CINEON', 'DPX'):
split = layout.split()
col = split.column()
col.itemR(rd, "cineon_log", text="Convert to Log")
col = split.column(align=True)
col.active = rd.cineon_log
col.itemR(rd, "cineon_black", text="Black")
col.itemR(rd, "cineon_white", text="White")
col.itemR(rd, "cineon_gamma", text="Gamma")
elif rd.file_format == 'TIFF':
split = layout.split()
split.itemR(rd, "tiff_bit")
William Reynish
committed
William Reynish
committed
class RENDER_PT_encoding(RenderButtonsPanel):
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
bl_label = "Encoding"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
split.itemR(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
split.itemR(rd, "ffmpeg_codec")
else:
split.itemL()
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_video_bitrate")
col.itemL(text="Rate:")
col.itemR(rd, "ffmpeg_minrate", text="Minimum")
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
col = split.column()
col.itemR(rd, "ffmpeg_gopsize")
col.itemR(rd, "ffmpeg_autosplit")
col.itemL(text="Mux:")
col.itemR(rd, "ffmpeg_muxrate", text="Rate")
col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
row = layout.row()
row.itemL(text="Audio:")
row = layout.row()
row.itemR(rd, "ffmpeg_audio_codec")
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_audio_bitrate")
col.itemR(rd, "ffmpeg_audio_mixrate")
col = split.column()
col.itemR(rd, "ffmpeg_multiplex_audio")
col.itemR(rd, "ffmpeg_audio_volume")
William Reynish
committed
William Reynish
committed
class RENDER_PT_antialiasing(RenderButtonsPanel):
bl_label = "Anti-Aliasing"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "antialiasing", text="")
William Reynish
committed
def draw(self, context):
layout = self.layout
William Reynish
committed
rd = context.scene.render_data
William Reynish
committed
layout.active = rd.antialiasing
William Reynish
committed
split = layout.split()
William Reynish
committed
col = split.column()
col.row().itemR(rd, "antialiasing_samples", expand=True)
col.itemR(rd, "full_sample")
col = split.column()
col.itemR(rd, "pixel_filter", text="")
col.itemR(rd, "filter_size", text="Size", slider=True)
William Reynish
committed
William Reynish
committed
class RENDER_PT_dimensions(RenderButtonsPanel):
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
bl_label = "Dimensions"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Resolution:")
sub.itemR(rd, "resolution_x", text="X")
sub.itemR(rd, "resolution_y", text="Y")
sub.itemR(rd, "resolution_percentage", text="")
sub.itemL(text="Aspect Ratio:")
sub.itemR(rd, "pixel_aspect_x", text="X")
sub.itemR(rd, "pixel_aspect_y", text="Y")
row = col.row()
row.itemR(rd, "use_border", text="Border")
rowsub = row.row()
rowsub.active = rd.use_border
rowsub.itemR(rd, "crop_to_border", text="Crop")
col = split.column(align=True)
col.itemL(text="Frame Range:")
col.itemR(scene, "start_frame", text="Start")
col.itemR(scene, "end_frame", text="End")
col.itemR(scene, "frame_step", text="Step")
col.itemL(text="Frame Rate:")
col.itemR(rd, "fps")
col.itemR(rd, "fps_base", text="/")
William Reynish
committed
class RENDER_PT_stamp(RenderButtonsPanel):
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
bl_label = "Stamp"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.active = rd.render_stamp
split = layout.split()
col = split.column()
col.itemR(rd, "stamp_time", text="Time")
col.itemR(rd, "stamp_date", text="Date")
col.itemR(rd, "stamp_render_time", text="RenderTime")
col.itemR(rd, "stamp_frame", text="Frame")
col.itemR(rd, "stamp_scene", text="Scene")
col.itemR(rd, "stamp_camera", text="Camera")
col.itemR(rd, "stamp_filename", text="Filename")
col.itemR(rd, "stamp_marker", text="Marker")
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
col = split.column()
col.active = rd.render_stamp
col.itemR(rd, "stamp_foreground", slider=True)
col.itemR(rd, "stamp_background", slider=True)
col.itemR(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
row.itemR(rd, "stamp_note", text="Note")
sub = row.row()
sub.active = rd.stamp_note
sub.itemR(rd, "stamp_note_text", text="")
William Reynish
committed
bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_layers)
bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
bpy.types.register(RENDER_PT_output)
bpy.types.register(RENDER_PT_encoding)
bpy.types.register(RENDER_PT_performance)
bpy.types.register(RENDER_PT_post_processing)
bpy.types.register(RENDER_PT_stamp)