2 # Copyright 2011-2013 Blender Foundation
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
21 from bpy.types import (
28 class CYCLES_MT_sampling_presets(Menu):
29 bl_label = "Sampling Presets"
30 preset_subdir = "cycles/sampling"
31 preset_operator = "script.execute_preset"
32 COMPAT_ENGINES = {'CYCLES'}
33 draw = Menu.draw_preset
36 class CYCLES_MT_integrator_presets(Menu):
37 bl_label = "Integrator Presets"
38 preset_subdir = "cycles/integrator"
39 preset_operator = "script.execute_preset"
40 COMPAT_ENGINES = {'CYCLES'}
41 draw = Menu.draw_preset
44 class CyclesButtonsPanel:
45 bl_space_type = "PROPERTIES"
46 bl_region_type = "WINDOW"
48 COMPAT_ENGINES = {'CYCLES'}
51 def poll(cls, context):
52 rd = context.scene.render
53 return rd.engine in cls.COMPAT_ENGINES
56 def get_device_type(context):
57 return context.user_preferences.addons[__package__].preferences.compute_device_type
61 cscene = context.scene.cycles
63 return (get_device_type(context) == 'NONE' or cscene.device == 'CPU')
66 def use_opencl(context):
67 cscene = context.scene.cycles
69 return (get_device_type(context) == 'OPENCL' and cscene.device == 'GPU')
72 def use_cuda(context):
73 cscene = context.scene.cycles
75 return (get_device_type(context) == 'CUDA' and cscene.device == 'GPU')
78 def use_branched_path(context):
79 cscene = context.scene.cycles
81 return (cscene.progressive == 'BRANCHED_PATH')
84 def use_sample_all_lights(context):
85 cscene = context.scene.cycles
87 return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
89 def show_device_active(context):
90 cscene = context.scene.cycles
91 if cscene.device != 'GPU':
93 return context.user_preferences.addons[__package__].preferences.has_active_device()
96 def draw_samples_info(layout, context):
97 cscene = context.scene.cycles
98 integrator = cscene.progressive
100 # Calculate sample values
101 if integrator == 'PATH':
103 if cscene.use_square_samples:
106 aa = cscene.aa_samples
107 d = cscene.diffuse_samples
108 g = cscene.glossy_samples
109 t = cscene.transmission_samples
110 ao = cscene.ao_samples
111 ml = cscene.mesh_light_samples
112 sss = cscene.subsurface_samples
113 vol = cscene.volume_samples
115 if cscene.use_square_samples:
126 # Do not draw for progressive, when Square Samples are disabled
127 if use_branched_path(context) or (cscene.use_square_samples and integrator == 'PATH'):
128 col = layout.column(align=True)
130 col.label("Total Samples:")
132 if integrator == 'PATH':
133 col.label("%s AA" % aa)
135 col.label("%s AA, %s Diffuse, %s Glossy, %s Transmission" %
136 (aa, d * aa, g * aa, t * aa))
138 col.label("%s AO, %s Mesh Light, %s Subsurface, %s Volume" %
139 (ao * aa, ml * aa, sss * aa, vol * aa))
142 class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel):
143 bl_label = "Sampling"
144 bl_options = {'DEFAULT_CLOSED'}
146 def draw(self, context):
149 scene = context.scene
150 cscene = scene.cycles
152 row = layout.row(align=True)
153 row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label)
154 row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
155 row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
159 sub.prop(cscene, "progressive", text="")
160 row.prop(cscene, "use_square_samples")
162 split = layout.split()
165 sub = col.column(align=True)
166 sub.label("Settings:")
168 seed_sub = sub.row(align=True)
169 seed_sub.prop(cscene, "seed")
170 seed_sub.prop(cscene, "use_animated_seed", text="", icon="TIME")
172 sub.prop(cscene, "sample_clamp_direct")
173 sub.prop(cscene, "sample_clamp_indirect")
174 sub.prop(cscene, "light_sampling_threshold")
176 if cscene.progressive == 'PATH' or use_branched_path(context) is False:
178 sub = col.column(align=True)
179 sub.label(text="Samples:")
180 sub.prop(cscene, "samples", text="Render")
181 sub.prop(cscene, "preview_samples", text="Preview")
183 sub.label(text="AA Samples:")
184 sub.prop(cscene, "aa_samples", text="Render")
185 sub.prop(cscene, "preview_aa_samples", text="Preview")
188 sub = col.column(align=True)
189 sub.label(text="Samples:")
190 sub.prop(cscene, "diffuse_samples", text="Diffuse")
191 sub.prop(cscene, "glossy_samples", text="Glossy")
192 sub.prop(cscene, "transmission_samples", text="Transmission")
193 sub.prop(cscene, "ao_samples", text="AO")
195 subsub = sub.row(align=True)
196 subsub.active = use_sample_all_lights(context)
197 subsub.prop(cscene, "mesh_light_samples", text="Mesh Light")
199 sub.prop(cscene, "subsurface_samples", text="Subsurface")
200 sub.prop(cscene, "volume_samples", text="Volume")
202 col = layout.column(align=True)
203 col.prop(cscene, "sample_all_lights_direct")
204 col.prop(cscene, "sample_all_lights_indirect")
206 layout.row().prop(cscene, "sampling_pattern", text="Pattern")
208 for rl in scene.render.layers:
211 layout.row().prop(cscene, "use_layer_samples")
214 draw_samples_info(layout, context)
217 class CYCLES_RENDER_PT_geometry(CyclesButtonsPanel, Panel):
218 bl_label = "Geometry"
219 bl_options = {'DEFAULT_CLOSED'}
221 def draw(self, context):
224 scene = context.scene
225 cscene = scene.cycles
226 ccscene = scene.cycles_curves
229 row.label("Volume Sampling:")
231 row.prop(cscene, "volume_step_size")
232 row.prop(cscene, "volume_max_steps")
236 if cscene.feature_set == 'EXPERIMENTAL':
237 layout.label("Subdivision Rate:")
238 split = layout.split()
241 sub = col.column(align=True)
242 sub.prop(cscene, "dicing_rate", text="Render")
243 sub.prop(cscene, "preview_dicing_rate", text="Preview")
246 col.prop(cscene, "offscreen_dicing_scale", text="Offscreen Scale")
247 col.prop(cscene, "max_subdivisions")
249 layout.prop(cscene, "dicing_camera")
253 layout.label("Hair:")
254 layout.prop(ccscene, "use_curves", text="Use Hair")
255 col = layout.column()
256 col.active = ccscene.use_curves
258 col.prop(ccscene, "primitive", text="Primitive")
259 col.prop(ccscene, "shape", text="Shape")
261 if not (ccscene.primitive in {'CURVE_SEGMENTS', 'LINE_SEGMENTS'} and ccscene.shape == 'RIBBONS'):
262 col.prop(ccscene, "cull_backfacing", text="Cull back-faces")
264 if ccscene.primitive == 'TRIANGLES' and ccscene.shape == 'THICK':
265 col.prop(ccscene, "resolution", text="Resolution")
266 elif ccscene.primitive == 'CURVE_SEGMENTS':
267 col.prop(ccscene, "subdivisions", text="Curve subdivisions")
270 row.prop(ccscene, "minimum_width", text="Min Pixels")
271 row.prop(ccscene, "maximum_width", text="Max Extension")
274 class CYCLES_RENDER_PT_light_paths(CyclesButtonsPanel, Panel):
275 bl_label = "Light Paths"
276 bl_options = {'DEFAULT_CLOSED'}
278 def draw(self, context):
281 scene = context.scene
282 cscene = scene.cycles
284 row = layout.row(align=True)
285 row.menu("CYCLES_MT_integrator_presets", text=bpy.types.CYCLES_MT_integrator_presets.bl_label)
286 row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMIN")
287 row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMOUT").remove_active = True
289 split = layout.split()
293 sub = col.column(align=True)
294 sub.label("Transparency:")
295 sub.prop(cscene, "transparent_max_bounces", text="Max")
299 col.prop(cscene, "caustics_reflective")
300 col.prop(cscene, "caustics_refractive")
301 col.prop(cscene, "blur_glossy")
305 sub = col.column(align=True)
306 sub.label(text="Bounces:")
307 sub.prop(cscene, "max_bounces", text="Max")
309 sub = col.column(align=True)
310 sub.prop(cscene, "diffuse_bounces", text="Diffuse")
311 sub.prop(cscene, "glossy_bounces", text="Glossy")
312 sub.prop(cscene, "transmission_bounces", text="Transmission")
313 sub.prop(cscene, "volume_bounces", text="Volume")
316 class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel):
317 bl_label = "Motion Blur"
318 bl_options = {'DEFAULT_CLOSED'}
320 def draw_header(self, context):
321 rd = context.scene.render
323 self.layout.prop(rd, "use_motion_blur", text="")
325 def draw(self, context):
328 scene = context.scene
329 cscene = scene.cycles
331 layout.active = rd.use_motion_blur
333 col = layout.column()
334 col.prop(cscene, "motion_blur_position", text="Position")
335 col.prop(rd, "motion_blur_shutter")
337 col = layout.column()
338 col.label("Shutter curve:")
339 col.template_curve_mapping(rd, "motion_blur_shutter_curve")
341 col = layout.column(align=True)
342 row = col.row(align=True)
343 row.operator("render.shutter_curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
344 row.operator("render.shutter_curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
345 row.operator("render.shutter_curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
346 row.operator("render.shutter_curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
347 row.operator("render.shutter_curve_preset", icon='LINCURVE', text="").shape = 'LINE'
348 row.operator("render.shutter_curve_preset", icon='NOCURVE', text="").shape = 'MAX'
350 col = layout.column()
351 col.prop(cscene, "rolling_shutter_type")
353 row.active = cscene.rolling_shutter_type != 'NONE'
354 row.prop(cscene, "rolling_shutter_duration")
357 class CYCLES_RENDER_PT_film(CyclesButtonsPanel, Panel):
360 def draw(self, context):
363 scene = context.scene
364 cscene = scene.cycles
366 split = layout.split()
369 col.prop(cscene, "film_exposure")
371 sub = col.column(align=True)
372 sub.prop(cscene, "pixel_filter_type", text="")
373 if cscene.pixel_filter_type != 'BOX':
374 sub.prop(cscene, "filter_width", text="Width")
377 col.prop(cscene, "film_transparent")
379 sub.prop(cscene, "film_transparent_glass", text="Transparent Glass")
380 sub.active = cscene.film_transparent
382 sub.prop(cscene, "film_transparent_roughness", text="Roughness Threshold")
383 sub.active = cscene.film_transparent and cscene.film_transparent_glass
386 class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
387 bl_label = "Performance"
388 bl_options = {'DEFAULT_CLOSED'}
390 def draw(self, context):
393 scene = context.scene
395 cscene = scene.cycles
397 split = layout.split()
399 col = split.column(align=True)
401 col.label(text="Threads:")
402 col.row(align=True).prop(rd, "threads_mode", expand=True)
403 sub = col.column(align=True)
404 sub.enabled = rd.threads_mode == 'FIXED'
405 sub.prop(rd, "threads")
409 sub = col.column(align=True)
410 sub.label(text="Tiles:")
411 sub.prop(cscene, "tile_order", text="")
413 sub.prop(rd, "tile_x", text="X")
414 sub.prop(rd, "tile_y", text="Y")
416 subsub = sub.column()
417 subsub.active = not rd.use_save_buffers
419 if rl.cycles.use_denoising:
420 subsub.active = False
421 subsub.prop(cscene, "use_progressive_refine")
425 col.label(text="Final Render:")
426 col.prop(rd, "use_save_buffers")
427 col.prop(rd, "use_persistent_data", text="Persistent Images")
431 col.label(text="Acceleration structure:")
432 col.prop(cscene, "debug_use_spatial_splits")
433 col.prop(cscene, "debug_use_hair_bvh")
436 row.active = not cscene.debug_use_spatial_splits
437 row.prop(cscene, "debug_bvh_time_steps")
439 col = layout.column()
440 col.label(text="Viewport Resolution:")
442 split.prop(rd, "preview_pixel_size", text="")
443 split.prop(cscene, "preview_start_resolution")
446 class CYCLES_RENDER_PT_layer_options(CyclesButtonsPanel, Panel):
448 bl_context = "render_layer"
450 def draw(self, context):
453 scene = context.scene
455 rl = rd.layers.active
457 split = layout.split()
460 col.prop(scene, "layers", text="Scene")
461 col.prop(rl, "layers_exclude", text="Exclude")
464 col.prop(rl, "layers", text="Layer")
465 col.prop(rl, "layers_zmask", text="Mask Layer")
467 split = layout.split()
470 col.label(text="Material:")
471 col.prop(rl, "material_override", text="")
473 col.prop(rl, "samples")
476 col.prop(rl, "use_sky", "Use Environment")
477 col.prop(rl, "use_ao", "Use AO")
478 col.prop(rl, "use_solid", "Use Surfaces")
479 col.prop(rl, "use_strand", "Use Hair")
482 class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel):
484 bl_context = "render_layer"
485 bl_options = {'DEFAULT_CLOSED'}
487 def draw(self, context):
492 scene = context.scene
494 rl = rd.layers.active
497 split = layout.split()
500 col.prop(rl, "use_pass_combined")
501 col.prop(rl, "use_pass_z")
502 col.prop(rl, "use_pass_mist")
503 col.prop(rl, "use_pass_normal")
505 row.prop(rl, "use_pass_vector")
506 row.active = not rd.use_motion_blur
507 col.prop(rl, "use_pass_uv")
508 col.prop(rl, "use_pass_object_index")
509 col.prop(rl, "use_pass_material_index")
511 col.prop(rl, "use_pass_shadow")
512 col.prop(rl, "use_pass_ambient_occlusion")
514 col.prop(rl, "pass_alpha_threshold")
517 col.label(text="Diffuse:")
518 row = col.row(align=True)
519 row.prop(rl, "use_pass_diffuse_direct", text="Direct", toggle=True)
520 row.prop(rl, "use_pass_diffuse_indirect", text="Indirect", toggle=True)
521 row.prop(rl, "use_pass_diffuse_color", text="Color", toggle=True)
522 col.label(text="Glossy:")
523 row = col.row(align=True)
524 row.prop(rl, "use_pass_glossy_direct", text="Direct", toggle=True)
525 row.prop(rl, "use_pass_glossy_indirect", text="Indirect", toggle=True)
526 row.prop(rl, "use_pass_glossy_color", text="Color", toggle=True)
527 col.label(text="Transmission:")
528 row = col.row(align=True)
529 row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True)
530 row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
531 row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
532 col.label(text="Subsurface:")
533 row = col.row(align=True)
534 row.prop(rl, "use_pass_subsurface_direct", text="Direct", toggle=True)
535 row.prop(rl, "use_pass_subsurface_indirect", text="Indirect", toggle=True)
536 row.prop(rl, "use_pass_subsurface_color", text="Color", toggle=True)
537 col.label(text="Volume:")
538 row = col.row(align=True)
539 row.prop(crl, "use_pass_volume_direct", text="Direct", toggle=True)
540 row.prop(crl, "use_pass_volume_indirect", text="Indirect", toggle=True)
543 col.prop(rl, "use_pass_emit", text="Emission")
544 col.prop(rl, "use_pass_environment")
546 if context.scene.cycles.feature_set == 'EXPERIMENTAL':
549 sub.active = crl.use_denoising
550 sub.prop(crl, "denoising_store_passes", text="Denoising")
552 col = layout.column()
553 col.prop(crl, "pass_debug_render_time")
554 if _cycles.with_cycles_debug:
555 col.prop(crl, "pass_debug_bvh_traversed_nodes")
556 col.prop(crl, "pass_debug_bvh_traversed_instances")
557 col.prop(crl, "pass_debug_bvh_intersections")
558 col.prop(crl, "pass_debug_ray_bounces")
561 class CYCLES_RENDER_PT_views(CyclesButtonsPanel, Panel):
563 bl_context = "render_layer"
564 bl_options = {'DEFAULT_CLOSED'}
566 def draw_header(self, context):
567 rd = context.scene.render
568 self.layout.prop(rd, "use_multiview", text="")
570 def draw(self, context):
573 scene = context.scene
577 layout.active = rd.use_multiview
578 basic_stereo = (rd.views_format == 'STEREO_3D')
581 row.prop(rd, "views_format", expand=True)
585 row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "stereo_views", rd.views, "active_index", rows=2)
588 row.label(text="File Suffix:")
589 row.prop(rv, "file_suffix", text="")
593 row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "views", rd.views, "active_index", rows=2)
595 col = row.column(align=True)
596 col.operator("scene.render_view_add", icon='ZOOMIN', text="")
597 col.operator("scene.render_view_remove", icon='ZOOMOUT', text="")
600 row.label(text="Camera Suffix:")
601 row.prop(rv, "camera_suffix", text="")
604 class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
605 bl_label = "Denoising"
606 bl_context = "render_layer"
607 bl_options = {'DEFAULT_CLOSED'}
609 def draw_header(self, context):
610 rd = context.scene.render
611 rl = rd.layers.active
613 cscene = context.scene.cycles
616 layout.prop(crl, "use_denoising", text="")
618 def draw(self, context):
621 scene = context.scene
622 cscene = scene.cycles
624 rl = rd.layers.active
627 layout.active = crl.use_denoising
629 split = layout.split()
632 sub = col.column(align=True)
633 sub.prop(crl, "denoising_radius", text="Radius")
634 sub.prop(crl, "denoising_strength", slider=True, text="Strength")
637 sub = col.column(align=True)
638 sub.prop(crl, "denoising_feature_strength", slider=True, text="Feature Strength")
639 sub.prop(crl, "denoising_relative_pca")
644 row.label(text="Diffuse:")
645 sub = row.row(align=True)
646 sub.prop(crl, "denoising_diffuse_direct", text="Direct", toggle=True)
647 sub.prop(crl, "denoising_diffuse_indirect", text="Indirect", toggle=True)
650 row.label(text="Glossy:")
651 sub = row.row(align=True)
652 sub.prop(crl, "denoising_glossy_direct", text="Direct", toggle=True)
653 sub.prop(crl, "denoising_glossy_indirect", text="Indirect", toggle=True)
656 row.label(text="Transmission:")
657 sub = row.row(align=True)
658 sub.prop(crl, "denoising_transmission_direct", text="Direct", toggle=True)
659 sub.prop(crl, "denoising_transmission_indirect", text="Indirect", toggle=True)
662 row.label(text="Subsurface:")
663 sub = row.row(align=True)
664 sub.prop(crl, "denoising_subsurface_direct", text="Direct", toggle=True)
665 sub.prop(crl, "denoising_subsurface_indirect", text="Indirect", toggle=True)
668 class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
669 bl_label = "Post Processing"
670 bl_options = {'DEFAULT_CLOSED'}
672 def draw(self, context):
675 rd = context.scene.render
677 split = layout.split()
680 col.prop(rd, "use_compositing")
681 col.prop(rd, "use_sequencer")
684 col.prop(rd, "dither_intensity", text="Dither", slider=True)
687 class CYCLES_CAMERA_PT_dof(CyclesButtonsPanel, Panel):
688 bl_label = "Depth of Field"
692 def poll(cls, context):
693 return context.camera and CyclesButtonsPanel.poll(context)
695 def draw(self, context):
700 dof_options = cam.gpu_dof
702 split = layout.split()
706 col.prop(cam, "dof_object", text="")
709 sub.active = cam.dof_object is None
710 sub.prop(cam, "dof_distance", text="Distance")
712 hq_support = dof_options.is_hq_supported
713 sub = col.column(align=True)
714 sub.label("Viewport:")
716 subhq.active = hq_support
717 subhq.prop(dof_options, "use_high_quality")
718 sub.prop(dof_options, "fstop")
719 if dof_options.use_high_quality and hq_support:
720 sub.prop(dof_options, "blades")
724 col.label("Aperture:")
725 sub = col.column(align=True)
726 sub.prop(ccam, "aperture_type", text="")
727 if ccam.aperture_type == 'RADIUS':
728 sub.prop(ccam, "aperture_size", text="Size")
729 elif ccam.aperture_type == 'FSTOP':
730 sub.prop(ccam, "aperture_fstop", text="Number")
732 sub = col.column(align=True)
733 sub.prop(ccam, "aperture_blades", text="Blades")
734 sub.prop(ccam, "aperture_rotation", text="Rotation")
735 sub.prop(ccam, "aperture_ratio", text="Ratio")
738 class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
740 bl_context = "material"
741 bl_options = {'HIDE_HEADER'}
744 def poll(cls, context):
745 return (context.material or context.object) and CyclesButtonsPanel.poll(context)
747 def draw(self, context):
750 mat = context.material
752 slot = context.material_slot
753 space = context.space_data
756 is_sortable = len(ob.material_slots) > 1
763 row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows)
765 col = row.column(align=True)
766 col.operator("object.material_slot_add", icon='ZOOMIN', text="")
767 col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
769 col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
774 col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP'
775 col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
777 if ob.mode == 'EDIT':
778 row = layout.row(align=True)
779 row.operator("object.material_slot_assign", text="Assign")
780 row.operator("object.material_slot_select", text="Select")
781 row.operator("object.material_slot_deselect", text="Deselect")
783 split = layout.split(percentage=0.65)
786 split.template_ID(ob, "active_material", new="material.new")
790 row.prop(slot, "link", text="")
794 split.template_ID(space, "pin_id")
798 class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
799 bl_label = "Motion Blur"
800 bl_context = "object"
801 bl_options = {'DEFAULT_CLOSED'}
804 def poll(cls, context):
806 if CyclesButtonsPanel.poll(context) and ob:
807 if ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META'}:
809 if ob.dupli_type == 'GROUP' and ob.dupli_group:
811 # TODO(sergey): More duplicator types here?
814 def draw_header(self, context):
817 rd = context.scene.render
818 # scene = context.scene
820 layout.active = rd.use_motion_blur
825 layout.prop(cob, "use_motion_blur", text="")
827 def draw(self, context):
830 rd = context.scene.render
831 # scene = context.scene
836 layout.active = (rd.use_motion_blur and cob.use_motion_blur)
839 row.prop(cob, "use_deform_motion", text="Deformation")
842 sub.active = cob.use_deform_motion
843 sub.prop(cob, "motion_steps", text="Steps")
846 class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
847 bl_label = "Cycles Settings"
848 bl_context = "object"
849 bl_options = {'DEFAULT_CLOSED'}
852 def poll(cls, context):
854 return (CyclesButtonsPanel.poll(context) and
855 ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LAMP'}) or
856 (ob.dupli_type == 'GROUP' and ob.dupli_group)))
858 def draw(self, context):
861 scene = context.scene
862 cscene = scene.cycles
865 visibility = ob.cycles_visibility
867 layout.label(text="Ray Visibility:")
868 flow = layout.column_flow()
870 flow.prop(visibility, "camera")
871 flow.prop(visibility, "diffuse")
872 flow.prop(visibility, "glossy")
873 flow.prop(visibility, "transmission")
874 flow.prop(visibility, "scatter")
876 if ob.type != 'LAMP':
877 flow.prop(visibility, "shadow")
880 row.prop(cob, "is_shadow_catcher")
881 row.prop(cob, "is_holdout")
883 col = layout.column()
884 col.label(text="Performance:")
887 sub.active = scene.render.use_simplify and cscene.use_camera_cull
888 sub.prop(cob, "use_camera_cull")
891 sub.active = scene.render.use_simplify and cscene.use_distance_cull
892 sub.prop(cob, "use_distance_cull")
895 class CYCLES_OT_use_shading_nodes(Operator):
896 """Enable nodes on a material, world or lamp"""
897 bl_idname = "cycles.use_shading_nodes"
898 bl_label = "Use Nodes"
901 def poll(cls, context):
902 return (getattr(context, "material", False) or getattr(context, "world", False) or
903 getattr(context, "lamp", False))
905 def execute(self, context):
907 context.material.use_nodes = True
909 context.world.use_nodes = True
911 context.lamp.use_nodes = True
916 def find_node(material, nodetype):
917 if material and material.node_tree:
918 ntree = material.node_tree
920 active_output_node = None
921 for node in ntree.nodes:
922 if getattr(node, "type", None) == nodetype:
923 if getattr(node, "is_active_output", True):
925 if not active_output_node:
926 active_output_node = node
927 return active_output_node
932 def find_node_input(node, name):
933 for input in node.inputs:
934 if input.name == name:
940 def panel_node_draw(layout, id_data, output_type, input_name):
941 if not id_data.use_nodes:
942 layout.operator("cycles.use_shading_nodes", icon='NODETREE')
945 ntree = id_data.node_tree
947 node = find_node(id_data, output_type)
949 layout.label(text="No output node")
951 input = find_node_input(node, input_name)
952 layout.template_node_view(ntree, node, input)
957 class CYCLES_LAMP_PT_preview(CyclesButtonsPanel, Panel):
960 bl_options = {'DEFAULT_CLOSED'}
963 def poll(cls, context):
964 return context.lamp and \
965 not (context.lamp.type == 'AREA' and
966 context.lamp.cycles.is_portal) \
967 and CyclesButtonsPanel.poll(context)
969 def draw(self, context):
970 self.layout.template_preview(context.lamp)
973 class CYCLES_LAMP_PT_lamp(CyclesButtonsPanel, Panel):
978 def poll(cls, context):
979 return context.lamp and CyclesButtonsPanel.poll(context)
981 def draw(self, context):
986 # cscene = context.scene.cycles
988 layout.prop(lamp, "type", expand=True)
990 split = layout.split()
991 col = split.column(align=True)
993 if lamp.type in {'POINT', 'SUN', 'SPOT'}:
994 col.prop(lamp, "shadow_soft_size", text="Size")
995 elif lamp.type == 'AREA':
996 col.prop(lamp, "shape", text="")
997 sub = col.column(align=True)
999 if lamp.shape == 'SQUARE':
1000 sub.prop(lamp, "size")
1001 elif lamp.shape == 'RECTANGLE':
1002 sub.prop(lamp, "size", text="Size X")
1003 sub.prop(lamp, "size_y", text="Size Y")
1005 if not (lamp.type == 'AREA' and clamp.is_portal):
1006 sub = col.column(align=True)
1007 if use_branched_path(context):
1008 subsub = sub.row(align=True)
1009 subsub.active = use_sample_all_lights(context)
1010 subsub.prop(clamp, "samples")
1011 sub.prop(clamp, "max_bounces")
1013 col = split.column()
1015 sub = col.column(align=True)
1016 sub.active = not (lamp.type == 'AREA' and clamp.is_portal)
1017 sub.prop(clamp, "cast_shadow")
1018 sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance")
1020 if lamp.type == 'AREA':
1021 col.prop(clamp, "is_portal", text="Portal")
1023 if lamp.type == 'HEMI':
1024 layout.label(text="Not supported, interpreted as sun lamp")
1027 class CYCLES_LAMP_PT_nodes(CyclesButtonsPanel, Panel):
1032 def poll(cls, context):
1033 return context.lamp and not (context.lamp.type == 'AREA' and
1034 context.lamp.cycles.is_portal) and \
1035 CyclesButtonsPanel.poll(context)
1037 def draw(self, context):
1038 layout = self.layout
1041 if not panel_node_draw(layout, lamp, 'OUTPUT_LAMP', 'Surface'):
1042 layout.prop(lamp, "color")
1045 class CYCLES_LAMP_PT_spot(CyclesButtonsPanel, Panel):
1046 bl_label = "Spot Shape"
1050 def poll(cls, context):
1052 return (lamp and lamp.type == 'SPOT') and CyclesButtonsPanel.poll(context)
1054 def draw(self, context):
1055 layout = self.layout
1059 split = layout.split()
1061 col = split.column()
1063 sub.prop(lamp, "spot_size", text="Size")
1064 sub.prop(lamp, "spot_blend", text="Blend", slider=True)
1066 col = split.column()
1067 col.prop(lamp, "show_cone")
1070 class CYCLES_WORLD_PT_preview(CyclesButtonsPanel, Panel):
1071 bl_label = "Preview"
1072 bl_context = "world"
1073 bl_options = {'DEFAULT_CLOSED'}
1076 def poll(cls, context):
1077 return context.world and CyclesButtonsPanel.poll(context)
1079 def draw(self, context):
1080 self.layout.template_preview(context.world)
1083 class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel):
1084 bl_label = "Surface"
1085 bl_context = "world"
1088 def poll(cls, context):
1089 return context.world and CyclesButtonsPanel.poll(context)
1091 def draw(self, context):
1092 layout = self.layout
1094 world = context.world
1096 if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
1097 layout.prop(world, "horizon_color", text="Color")
1100 class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel):
1102 bl_context = "world"
1103 bl_options = {'DEFAULT_CLOSED'}
1106 def poll(cls, context):
1107 world = context.world
1108 return world and world.node_tree and CyclesButtonsPanel.poll(context)
1110 def draw(self, context):
1111 layout = self.layout
1113 world = context.world
1114 panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
1117 class CYCLES_WORLD_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
1118 bl_label = "Ambient Occlusion"
1119 bl_context = "world"
1122 def poll(cls, context):
1123 return context.world and CyclesButtonsPanel.poll(context)
1125 def draw_header(self, context):
1126 light = context.world.light_settings
1127 self.layout.prop(light, "use_ambient_occlusion", text="")
1129 def draw(self, context):
1130 layout = self.layout
1132 light = context.world.light_settings
1133 scene = context.scene
1137 sub.active = light.use_ambient_occlusion or scene.render.use_simplify
1138 sub.prop(light, "ao_factor", text="Factor")
1139 row.prop(light, "distance", text="Distance")
1142 class CYCLES_WORLD_PT_mist(CyclesButtonsPanel, Panel):
1143 bl_label = "Mist Pass"
1144 bl_context = "world"
1145 bl_options = {'DEFAULT_CLOSED'}
1148 def poll(cls, context):
1149 if CyclesButtonsPanel.poll(context):
1151 for rl in context.scene.render.layers:
1152 if rl.use_pass_mist:
1157 def draw(self, context):
1158 layout = self.layout
1160 world = context.world
1162 split = layout.split(align=True)
1163 split.prop(world.mist_settings, "start")
1164 split.prop(world.mist_settings, "depth")
1166 layout.prop(world.mist_settings, "falloff")
1169 class CYCLES_WORLD_PT_ray_visibility(CyclesButtonsPanel, Panel):
1170 bl_label = "Ray Visibility"
1171 bl_context = "world"
1172 bl_options = {'DEFAULT_CLOSED'}
1175 def poll(cls, context):
1176 return CyclesButtonsPanel.poll(context) and context.world
1178 def draw(self, context):
1179 layout = self.layout
1181 world = context.world
1182 visibility = world.cycles_visibility
1184 flow = layout.column_flow()
1186 flow.prop(visibility, "camera")
1187 flow.prop(visibility, "diffuse")
1188 flow.prop(visibility, "glossy")
1189 flow.prop(visibility, "transmission")
1190 flow.prop(visibility, "scatter")
1193 class CYCLES_WORLD_PT_settings(CyclesButtonsPanel, Panel):
1194 bl_label = "Settings"
1195 bl_context = "world"
1196 bl_options = {'DEFAULT_CLOSED'}
1199 def poll(cls, context):
1200 return context.world and CyclesButtonsPanel.poll(context)
1202 def draw(self, context):
1203 layout = self.layout
1205 world = context.world
1206 cworld = world.cycles
1207 # cscene = context.scene.cycles
1209 split = layout.split()
1211 col = split.column()
1213 col.label(text="Surface:")
1214 col.prop(cworld, "sample_as_light", text="Multiple Importance")
1216 sub = col.column(align=True)
1217 sub.active = cworld.sample_as_light
1218 sub.prop(cworld, "sample_map_resolution")
1219 if use_branched_path(context):
1220 subsub = sub.row(align=True)
1221 subsub.active = use_sample_all_lights(context)
1222 subsub.prop(cworld, "samples")
1223 sub.prop(cworld, "max_bounces")
1225 col = split.column()
1226 col.label(text="Volume:")
1228 sub.active = use_cpu(context)
1229 sub.prop(cworld, "volume_sampling", text="")
1230 col.prop(cworld, "volume_interpolation", text="")
1231 col.prop(cworld, "homogeneous_volume", text="Homogeneous")
1234 class CYCLES_MATERIAL_PT_preview(CyclesButtonsPanel, Panel):
1235 bl_label = "Preview"
1236 bl_context = "material"
1237 bl_options = {'DEFAULT_CLOSED'}
1240 def poll(cls, context):
1241 return context.material and CyclesButtonsPanel.poll(context)
1243 def draw(self, context):
1244 self.layout.template_preview(context.material)
1247 class CYCLES_MATERIAL_PT_surface(CyclesButtonsPanel, Panel):
1248 bl_label = "Surface"
1249 bl_context = "material"
1252 def poll(cls, context):
1253 return context.material and CyclesButtonsPanel.poll(context)
1255 def draw(self, context):
1256 layout = self.layout
1258 mat = context.material
1259 if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'):
1260 layout.prop(mat, "diffuse_color")
1263 class CYCLES_MATERIAL_PT_volume(CyclesButtonsPanel, Panel):
1265 bl_context = "material"
1266 bl_options = {'DEFAULT_CLOSED'}
1269 def poll(cls, context):
1270 mat = context.material
1271 return mat and mat.node_tree and CyclesButtonsPanel.poll(context)
1273 def draw(self, context):
1274 layout = self.layout
1276 mat = context.material
1279 panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
1282 class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel):
1283 bl_label = "Displacement"
1284 bl_context = "material"
1287 def poll(cls, context):
1288 mat = context.material
1289 return mat and mat.node_tree and CyclesButtonsPanel.poll(context)
1291 def draw(self, context):
1292 layout = self.layout
1294 mat = context.material
1295 panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement')
1298 class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel):
1299 bl_label = "Settings"
1300 bl_context = "material"
1303 def poll(cls, context):
1304 return context.material and CyclesButtonsPanel.poll(context)
1306 def draw(self, context):
1307 layout = self.layout
1309 mat = context.material
1312 split = layout.split()
1313 col = split.column()
1314 col.label(text="Surface:")
1315 col.prop(cmat, "sample_as_light", text="Multiple Importance")
1316 col.prop(cmat, "use_transparent_shadow")
1318 if context.scene.cycles.feature_set == 'EXPERIMENTAL':
1320 col.label(text="Geometry:")
1321 col.prop(cmat, "displacement_method", text="")
1324 col.prop(mat, "pass_index")
1326 col = split.column()
1327 col.label(text="Volume:")
1329 sub.active = use_cpu(context)
1330 sub.prop(cmat, "volume_sampling", text="")
1331 col.prop(cmat, "volume_interpolation", text="")
1332 col.prop(cmat, "homogeneous_volume", text="Homogeneous")
1334 if context.scene.cycles.feature_set == 'EXPERIMENTAL':
1336 col.prop(mat, "pass_index")
1339 class CYCLES_MATERIAL_PT_viewport(CyclesButtonsPanel, Panel):
1340 bl_label = "Viewport"
1341 bl_context = "material"
1342 bl_options = {'DEFAULT_CLOSED'}
1345 def poll(cls, context):
1346 return context.material and CyclesButtonsPanel.poll(context)
1348 def draw(self, context):
1349 mat = context.material
1351 layout = self.layout
1352 split = layout.split()
1354 col = split.column(align=True)
1356 col.prop(mat, "diffuse_color", text="")
1357 col.prop(mat, "alpha")
1361 col.prop(mat.game_settings, "alpha_blend", text="")
1363 col = split.column(align=True)
1364 col.label("Specular:")
1365 col.prop(mat, "specular_color", text="")
1366 col.prop(mat, "specular_hardness", text="Hardness")
1369 class CYCLES_TEXTURE_PT_context(CyclesButtonsPanel, Panel):
1371 bl_context = "texture"
1372 bl_options = {'HIDE_HEADER'}
1373 COMPAT_ENGINES = {'CYCLES'}
1375 def draw(self, context):
1376 layout = self.layout
1378 tex = context.texture
1379 space = context.space_data
1380 pin_id = space.pin_id
1381 use_pin_id = space.use_pin_id
1382 user = context.texture_user
1384 space.use_limited_texture_context = False
1386 if not (use_pin_id and isinstance(pin_id, bpy.types.Texture)):
1390 layout.template_texture_user()
1395 split = layout.split(percentage=0.65)
1396 col = split.column()
1399 col.template_ID(space, "pin_id")
1401 propname = context.texture_user_property.identifier
1402 col.template_ID(user, propname, new="texture.new")
1405 split = layout.split(percentage=0.2)
1406 split.label(text="Type:")
1407 split.prop(tex, "type", text="")
1410 class CYCLES_TEXTURE_PT_node(CyclesButtonsPanel, Panel):
1412 bl_context = "texture"
1415 def poll(cls, context):
1416 node = context.texture_node
1417 return node and CyclesButtonsPanel.poll(context)
1419 def draw(self, context):
1420 layout = self.layout
1422 node = context.texture_node
1423 ntree = node.id_data
1424 layout.template_node_view(ntree, node, None)
1427 class CYCLES_TEXTURE_PT_mapping(CyclesButtonsPanel, Panel):
1428 bl_label = "Mapping"
1429 bl_context = "texture"
1432 def poll(cls, context):
1433 node = context.texture_node
1434 # TODO(sergey): perform a faster/nicer check?
1435 return node and hasattr(node, 'texture_mapping') and CyclesButtonsPanel.poll(context)
1437 def draw(self, context):
1438 layout = self.layout
1440 node = context.texture_node
1442 mapping = node.texture_mapping
1444 layout.prop(mapping, "vector_type", expand=True)
1448 row.column().prop(mapping, "translation")
1449 row.column().prop(mapping, "rotation")
1450 row.column().prop(mapping, "scale")
1452 layout.label(text="Projection:")
1455 row.prop(mapping, "mapping_x", text="")
1456 row.prop(mapping, "mapping_y", text="")
1457 row.prop(mapping, "mapping_z", text="")
1460 class CYCLES_TEXTURE_PT_colors(CyclesButtonsPanel, Panel):
1462 bl_context = "texture"
1463 bl_options = {'DEFAULT_CLOSED'}
1466 def poll(cls, context):
1467 # node = context.texture_node
1469 # return node and CyclesButtonsPanel.poll(context)
1471 def draw(self, context):
1472 layout = self.layout
1474 node = context.texture_node
1476 mapping = node.color_mapping
1478 split = layout.split()
1480 col = split.column()
1481 col.label(text="Blend:")
1482 col.prop(mapping, "blend_type", text="")
1483 col.prop(mapping, "blend_factor", text="Factor")
1484 col.prop(mapping, "blend_color", text="")
1486 col = split.column()
1487 col.label(text="Adjust:")
1488 col.prop(mapping, "brightness")
1489 col.prop(mapping, "contrast")
1490 col.prop(mapping, "saturation")
1494 layout.prop(mapping, "use_color_ramp", text="Ramp")
1495 if mapping.use_color_ramp:
1496 layout.template_color_ramp(mapping, "color_ramp", expand=True)
1499 class CYCLES_PARTICLE_PT_textures(CyclesButtonsPanel, Panel):
1500 bl_label = "Textures"
1501 bl_context = "particle"
1502 bl_options = {'DEFAULT_CLOSED'}
1505 def poll(cls, context):
1506 psys = context.particle_system
1507 return psys and CyclesButtonsPanel.poll(context)
1509 def draw(self, context):
1510 layout = self.layout
1512 psys = context.particle_system
1513 part = psys.settings
1516 row.template_list("TEXTURE_UL_texslots", "", part, "texture_slots", part, "active_texture_index", rows=2)
1518 col = row.column(align=True)
1519 col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP'
1520 col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
1521 col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="")
1523 if not part.active_texture:
1524 layout.template_ID(part, "active_texture", new="texture.new")
1526 slot = part.texture_slots[part.active_texture_index]
1527 layout.template_ID(slot, "texture", new="texture.new")
1530 class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
1532 bl_context = "render"
1533 bl_options = {'DEFAULT_CLOSED'}
1534 COMPAT_ENGINES = {'CYCLES'}
1536 def draw(self, context):
1537 layout = self.layout
1539 scene = context.scene
1540 cscene = scene.cycles
1541 cbk = scene.render.bake
1543 layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type
1545 col = layout.column()
1546 col.prop(cscene, "bake_type")
1548 col = layout.column()
1550 if cscene.bake_type == 'NORMAL':
1551 col.prop(cbk, "normal_space", text="Space")
1553 row = col.row(align=True)
1554 row.label(text="Swizzle:")
1555 row.prop(cbk, "normal_r", text="")
1556 row.prop(cbk, "normal_g", text="")
1557 row.prop(cbk, "normal_b", text="")
1559 elif cscene.bake_type == 'COMBINED':
1560 row = col.row(align=True)
1561 row.prop(cbk, "use_pass_direct", toggle=True)
1562 row.prop(cbk, "use_pass_indirect", toggle=True)
1565 split.active = cbk.use_pass_direct or cbk.use_pass_indirect
1567 col = split.column()
1568 col.prop(cbk, "use_pass_diffuse")
1569 col.prop(cbk, "use_pass_glossy")
1570 col.prop(cbk, "use_pass_transmission")
1572 col = split.column()
1573 col.prop(cbk, "use_pass_subsurface")
1574 col.prop(cbk, "use_pass_ambient_occlusion")
1575 col.prop(cbk, "use_pass_emit")
1577 elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
1578 row = col.row(align=True)
1579 row.prop(cbk, "use_pass_direct", toggle=True)
1580 row.prop(cbk, "use_pass_indirect", toggle=True)
1581 row.prop(cbk, "use_pass_color", toggle=True)
1585 split = layout.split()
1587 col = split.column()
1588 col.prop(cbk, "margin")
1589 col.prop(cbk, "use_clear")
1591 col = split.column()
1592 col.prop(cbk, "use_selected_to_active")
1594 sub.active = cbk.use_selected_to_active
1595 sub.prop(cbk, "use_cage", text="Cage")
1597 sub.prop(cbk, "cage_extrusion", text="Extrusion")
1598 sub.prop_search(cbk, "cage_object", scene, "objects", text="")
1600 sub.prop(cbk, "cage_extrusion", text="Ray Distance")
1603 class CYCLES_RENDER_PT_debug(CyclesButtonsPanel, Panel):
1605 bl_context = "render"
1606 bl_options = {'DEFAULT_CLOSED'}
1607 COMPAT_ENGINES = {'CYCLES'}
1610 def poll(cls, context):
1611 return CyclesButtonsPanel.poll(context) and bpy.app.debug_value == 256
1613 def draw(self, context):
1614 layout = self.layout
1616 scene = context.scene
1617 cscene = scene.cycles
1619 col = layout.column()
1621 col.label('CPU Flags:')
1622 row = col.row(align=True)
1623 row.prop(cscene, "debug_use_cpu_sse2", toggle=True)
1624 row.prop(cscene, "debug_use_cpu_sse3", toggle=True)
1625 row.prop(cscene, "debug_use_cpu_sse41", toggle=True)
1626 row.prop(cscene, "debug_use_cpu_avx", toggle=True)
1627 row.prop(cscene, "debug_use_cpu_avx2", toggle=True)
1628 col.prop(cscene, "debug_bvh_layout")
1629 col.prop(cscene, "debug_use_cpu_split_kernel")
1633 col = layout.column()
1634 col.label('CUDA Flags:')
1635 col.prop(cscene, "debug_use_cuda_adaptive_compile")
1636 col.prop(cscene, "debug_use_cuda_split_kernel")
1640 col = layout.column()
1641 col.label('OpenCL Flags:')
1642 col.prop(cscene, "debug_opencl_kernel_type", text="Kernel")
1643 col.prop(cscene, "debug_opencl_device_type", text="Device")
1644 col.prop(cscene, "debug_opencl_kernel_single_program", text="Single Program")
1645 col.prop(cscene, "debug_use_opencl_debug", text="Debug")
1646 col.prop(cscene, "debug_opencl_mem_limit")
1650 col = layout.column()
1651 col.prop(cscene, "debug_bvh_type")
1654 class CYCLES_PARTICLE_PT_curve_settings(CyclesButtonsPanel, Panel):
1655 bl_label = "Cycles Hair Settings"
1656 bl_context = "particle"
1659 def poll(cls, context):
1660 scene = context.scene
1661 ccscene = scene.cycles_curves
1662 psys = context.particle_system
1663 use_curves = ccscene.use_curves and psys
1664 return CyclesButtonsPanel.poll(context) and use_curves and psys.settings.type == 'HAIR'
1666 def draw(self, context):
1667 layout = self.layout
1669 psys = context.particle_settings
1673 row.prop(cpsys, "shape", text="Shape")
1675 layout.label(text="Thickness:")
1677 row.prop(cpsys, "root_width", text="Root")
1678 row.prop(cpsys, "tip_width", text="Tip")
1681 row.prop(cpsys, "radius_scale", text="Scaling")
1682 row.prop(cpsys, "use_closetip", text="Close tip")
1685 class CYCLES_SCENE_PT_simplify(CyclesButtonsPanel, Panel):
1686 bl_label = "Simplify"
1687 bl_context = "scene"
1688 COMPAT_ENGINES = {'CYCLES'}
1690 def draw_header(self, context):
1691 rd = context.scene.render
1692 self.layout.prop(rd, "use_simplify", text="")
1694 def draw(self, context):
1695 layout = self.layout
1697 scene = context.scene
1699 cscene = scene.cycles
1701 layout.active = rd.use_simplify
1703 col = layout.column(align=True)
1704 col.label(text="Subdivision")
1705 row = col.row(align=True)
1706 row.prop(rd, "simplify_subdivision", text="Viewport")
1707 row.prop(rd, "simplify_subdivision_render", text="Render")
1709 col = layout.column(align=True)
1710 col.label(text="Child Particles")
1711 row = col.row(align=True)
1712 row.prop(rd, "simplify_child_particles", text="Viewport")
1713 row.prop(rd, "simplify_child_particles_render", text="Render")
1715 col = layout.column(align=True)
1717 sub = split.column()
1718 sub.label(text="Texture Limit Viewport")
1719 sub.prop(cscene, "texture_limit", text="")
1720 sub = split.column()
1721 sub.label(text="Texture Limit Render")
1722 sub.prop(cscene, "texture_limit_render", text="")
1724 split = layout.split()
1725 col = split.column()
1726 col.prop(cscene, "use_camera_cull")
1728 row.active = cscene.use_camera_cull
1729 row.prop(cscene, "camera_cull_margin")
1731 col = split.column()
1732 col.prop(cscene, "use_distance_cull")
1734 row.active = cscene.use_distance_cull
1735 row.prop(cscene, "distance_cull_margin", text="Distance")
1737 split = layout.split()
1738 col = split.column()
1739 col.prop(cscene, "ao_bounces")
1741 col = split.column()
1742 col.prop(cscene, "ao_bounces_render")
1744 def draw_device(self, context):
1745 scene = context.scene
1746 layout = self.layout
1748 if scene.render.engine == 'CYCLES':
1749 from . import engine
1750 cscene = scene.cycles
1752 layout.prop(cscene, "feature_set")
1754 split = layout.split(percentage=1 / 3)
1755 split.label("Device:")
1757 row.active = show_device_active(context)
1758 row.prop(cscene, "device", text="")
1760 if engine.with_osl() and use_cpu(context):
1761 layout.prop(cscene, "shading_system")
1764 def draw_pause(self, context):
1765 layout = self.layout
1766 scene = context.scene
1768 if scene.render.engine == "CYCLES":
1769 view = context.space_data
1771 if view.viewport_shade == 'RENDERED':
1772 cscene = scene.cycles
1773 layername = scene.render.layers.active.name
1774 layout.prop(cscene, "preview_pause", icon="PAUSE", text="")
1775 layout.prop(cscene, "preview_active_layer", icon="RENDERLAYERS", text=layername)
1781 'DATA_PT_camera_dof',
1782 'DATA_PT_falloff_curve',
1788 'MATERIAL_PT_context_material',
1789 'MATERIAL_PT_diffuse',
1790 'MATERIAL_PT_flare',
1792 'MATERIAL_PT_mirror',
1793 'MATERIAL_PT_options',
1794 'MATERIAL_PT_pipeline',
1795 'MATERIAL_PT_preview',
1796 'MATERIAL_PT_shading',
1797 'MATERIAL_PT_shadow',
1798 'MATERIAL_PT_specular',
1800 'MATERIAL_PT_strand',
1801 'MATERIAL_PT_transp',
1802 'MATERIAL_PT_volume_density',
1803 'MATERIAL_PT_volume_integration',
1804 'MATERIAL_PT_volume_lighting',
1805 'MATERIAL_PT_volume_options',
1806 'MATERIAL_PT_volume_shading',
1807 'MATERIAL_PT_volume_transp',
1808 'RENDERLAYER_PT_layer_options',
1809 'RENDERLAYER_PT_layer_passes',
1810 'RENDERLAYER_PT_views',
1811 'RENDER_PT_antialiasing',
1813 'RENDER_PT_motion_blur',
1814 'RENDER_PT_performance',
1815 'RENDER_PT_post_processing',
1816 'RENDER_PT_shading',
1817 'SCENE_PT_simplify',
1818 'TEXTURE_PT_context_texture',
1819 'WORLD_PT_ambient_occlusion',
1820 'WORLD_PT_environment_lighting',
1822 'WORLD_PT_indirect_lighting',
1829 for panel in bpy.types.Panel.__subclasses__():
1830 if hasattr(panel, 'COMPAT_ENGINES') and 'BLENDER_RENDER' in panel.COMPAT_ENGINES:
1831 if panel.__name__ not in exclude_panels:
1832 panels.append(panel)
1838 CYCLES_MT_sampling_presets,
1839 CYCLES_MT_integrator_presets,
1840 CYCLES_RENDER_PT_sampling,
1841 CYCLES_RENDER_PT_geometry,
1842 CYCLES_RENDER_PT_light_paths,
1843 CYCLES_RENDER_PT_motion_blur,
1844 CYCLES_RENDER_PT_film,
1845 CYCLES_RENDER_PT_performance,
1846 CYCLES_RENDER_PT_layer_options,
1847 CYCLES_RENDER_PT_layer_passes,
1848 CYCLES_RENDER_PT_views,
1849 CYCLES_RENDER_PT_denoising,
1850 CYCLES_PT_post_processing,
1851 CYCLES_CAMERA_PT_dof,
1852 CYCLES_PT_context_material,
1853 CYCLES_OBJECT_PT_motion_blur,
1854 CYCLES_OBJECT_PT_cycles_settings,
1855 CYCLES_OT_use_shading_nodes,
1856 CYCLES_LAMP_PT_preview,
1857 CYCLES_LAMP_PT_lamp,
1858 CYCLES_LAMP_PT_nodes,
1859 CYCLES_LAMP_PT_spot,
1860 CYCLES_WORLD_PT_preview,
1861 CYCLES_WORLD_PT_surface,
1862 CYCLES_WORLD_PT_volume,
1863 CYCLES_WORLD_PT_ambient_occlusion,
1864 CYCLES_WORLD_PT_mist,
1865 CYCLES_WORLD_PT_ray_visibility,
1866 CYCLES_WORLD_PT_settings,
1867 CYCLES_MATERIAL_PT_preview,
1868 CYCLES_MATERIAL_PT_surface,
1869 CYCLES_MATERIAL_PT_volume,
1870 CYCLES_MATERIAL_PT_displacement,
1871 CYCLES_MATERIAL_PT_settings,
1872 CYCLES_MATERIAL_PT_viewport,
1873 CYCLES_TEXTURE_PT_context,
1874 CYCLES_TEXTURE_PT_node,
1875 CYCLES_TEXTURE_PT_mapping,
1876 CYCLES_TEXTURE_PT_colors,
1877 CYCLES_PARTICLE_PT_textures,
1878 CYCLES_RENDER_PT_bake,
1879 CYCLES_RENDER_PT_debug,
1880 CYCLES_PARTICLE_PT_curve_settings,
1881 CYCLES_SCENE_PT_simplify,
1886 from bpy.utils import register_class
1888 bpy.types.RENDER_PT_render.append(draw_device)
1889 bpy.types.VIEW3D_HT_header.append(draw_pause)
1891 for panel in get_panels():
1892 panel.COMPAT_ENGINES.add('CYCLES')
1899 from bpy.utils import unregister_class
1901 bpy.types.RENDER_PT_render.remove(draw_device)
1902 bpy.types.VIEW3D_HT_header.remove(draw_pause)
1904 for panel in get_panels():
1905 if 'CYCLES' in panel.COMPAT_ENGINES:
1906 panel.COMPAT_ENGINES.remove('CYCLES')
1909 unregister_class(cls)