Cycles: support for mask layers in render layer, this has the same effect as
[blender.git] / intern / cycles / blender / addon / ui.py
1 #
2 # Copyright 2011, Blender Foundation.
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18
19 # <pep8 compliant>
20
21 import bpy
22
23 from bpy.types import Panel, Menu
24
25 from . import enums, engine
26
27
28 class CYCLES_MT_integrator_presets(Menu):
29     bl_label = "Integrator Presets"
30     preset_subdir = "cycles/integrator"
31     preset_operator = "script.execute_preset"
32     COMPAT_ENGINES = {'CYCLES'}
33     draw = Menu.draw_preset
34
35
36 class CyclesButtonsPanel():
37     bl_space_type = "PROPERTIES"
38     bl_region_type = "WINDOW"
39     bl_context = "render"
40
41     @classmethod
42     def poll(cls, context):
43         rd = context.scene.render
44         return rd.engine == 'CYCLES'
45
46
47 class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel):
48     bl_label = "Integrator"
49     bl_options = {'DEFAULT_CLOSED'}
50
51     def draw(self, context):
52         layout = self.layout
53
54         scene = context.scene
55         cscene = scene.cycles
56
57         row = layout.row(align=True)
58         row.menu("CYCLES_MT_integrator_presets", text=bpy.types.CYCLES_MT_integrator_presets.bl_label)
59         row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMIN")
60         row.operator("render.cycles_integrator_preset_add", text="", icon="ZOOMOUT").remove_active = True
61
62         split = layout.split()
63
64         col = split.column()
65         sub = col.column(align=True)
66         sub.label(text="Samples:")
67         sub.prop(cscene, "samples", text="Render")
68         sub.prop(cscene, "preview_samples", text="Preview")
69         sub.prop(cscene, "seed")
70
71         sub = col.column(align=True)
72         sub.label("Transparency:")
73         sub.prop(cscene, "transparent_max_bounces", text="Max")
74         sub.prop(cscene, "transparent_min_bounces", text="Min")
75         sub.prop(cscene, "use_transparent_shadows", text="Shadows")
76
77         col = split.column()
78
79         sub = col.column(align=True)
80         sub.label(text="Bounces:")
81         sub.prop(cscene, "max_bounces", text="Max")
82         sub.prop(cscene, "min_bounces", text="Min")
83
84         sub = col.column(align=True)
85         sub.label(text="Light Paths:")
86         sub.prop(cscene, "diffuse_bounces", text="Diffuse")
87         sub.prop(cscene, "glossy_bounces", text="Glossy")
88         sub.prop(cscene, "transmission_bounces", text="Transmission")
89         sub.prop(cscene, "no_caustics")
90
91         #row = col.row()
92         #row.prop(cscene, "blur_caustics")
93         #row.active = not cscene.no_caustics
94
95
96 class CyclesRender_PT_film(CyclesButtonsPanel, Panel):
97     bl_label = "Film"
98
99     def draw(self, context):
100         layout = self.layout
101
102         scene = context.scene
103         cscene = scene.cycles
104
105         split = layout.split()
106
107         col = split.column()
108         col.prop(cscene, "film_exposure")
109         col.prop(cscene, "film_transparent")
110
111         col = split.column()
112         sub = col.column(align=True)
113         sub.prop(cscene, "filter_type", text="")
114         if cscene.filter_type != 'BOX':
115             sub.prop(cscene, "filter_width", text="Width")
116
117
118 class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
119     bl_label = "Performance"
120     bl_options = {'DEFAULT_CLOSED'}
121
122     def draw(self, context):
123         layout = self.layout
124
125         scene = context.scene
126         rd = scene.render
127         cscene = scene.cycles
128
129         split = layout.split()
130
131         col = split.column(align=True)
132
133         col.label(text="Threads:")
134         col.row().prop(rd, "threads_mode", expand=True)
135         sub = col.column()
136         sub.enabled = rd.threads_mode == 'FIXED'
137         sub.prop(rd, "threads")
138
139         sub = col.column(align=True)
140         sub.label(text="Tiles:")
141         sub.prop(cscene, "debug_tile_size")
142         sub.prop(cscene, "debug_min_size")
143
144         col = split.column()
145
146         sub = col.column(align=True)
147         sub.label(text="Acceleration structure:")
148         sub.prop(cscene, "debug_bvh_type", text="")
149         sub.prop(cscene, "debug_use_spatial_splits")
150         sub.prop(cscene, "use_cache")
151
152
153 class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
154     bl_label = "Layers"
155     bl_options = {'DEFAULT_CLOSED'}
156     COMPAT_ENGINES = {'BLENDER_RENDER'}
157
158     def draw(self, context):
159         layout = self.layout
160
161         scene = context.scene
162         rd = scene.render
163
164         row = layout.row()
165         row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
166
167         col = row.column(align=True)
168         col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
169         col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
170
171         row = layout.row()
172         rl = rd.layers.active
173         row.prop(rl, "name")
174         row.prop(rd, "use_single_layer", text="", icon_only=True)
175
176         split = layout.split()
177
178         col = split.column()
179         col.prop(scene, "layers", text="Scene")
180         col.label(text="Material:")
181         col.prop(rl, "material_override", text="")
182
183         col = split.column()
184         col.prop(rl, "layers", text="Layer")
185         col.label(text="Mask Layers:")
186         col.prop(rl, "layers_zmask", text="")
187
188         split = layout.split()
189
190         col = split.column()
191         col.label(text="Passes:")
192         col.prop(rl, "use_pass_combined")
193         col.prop(rl, "use_pass_z")
194         col.prop(rl, "use_pass_normal")
195         col.prop(rl, "use_pass_object_index")
196         col.prop(rl, "use_pass_material_index")
197         col.prop(rl, "use_pass_emit")
198         col.prop(rl, "use_pass_environment")
199
200         col = split.column()
201         col.label()
202         col.label(text="Diffuse:")
203         row = col.row(align=True)
204         row.prop(rl, "use_pass_diffuse_direct", text="Direct", toggle=True)
205         row.prop(rl, "use_pass_diffuse_indirect", text="Indirect", toggle=True)
206         row.prop(rl, "use_pass_diffuse_color", text="Color", toggle=True)
207         col.label(text="Glossy:")
208         row = col.row(align=True)
209         row.prop(rl, "use_pass_glossy_direct", text="Direct", toggle=True)
210         row.prop(rl, "use_pass_glossy_indirect", text="Indirect", toggle=True)
211         row.prop(rl, "use_pass_glossy_color", text="Color", toggle=True)
212         col.label(text="Transmission:")
213         row = col.row(align=True)
214         row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True)
215         row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
216         row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
217
218
219 class Cycles_PT_post_processing(CyclesButtonsPanel, Panel):
220     bl_label = "Post Processing"
221     bl_options = {'DEFAULT_CLOSED'}
222
223     def draw(self, context):
224         layout = self.layout
225
226         rd = context.scene.render
227
228         split = layout.split()
229
230         col = split.column()
231         col.prop(rd, "use_compositing")
232         col.prop(rd, "use_sequencer")
233
234         col = split.column()
235         col.prop(rd, "dither_intensity", text="Dither", slider=True)
236
237
238 class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
239     bl_label = "Depth of Field"
240     bl_context = "data"
241
242     @classmethod
243     def poll(cls, context):
244         return context.camera and CyclesButtonsPanel.poll(context)
245
246     def draw(self, context):
247         layout = self.layout
248
249         cam = context.camera
250         ccam = cam.cycles
251
252         split = layout.split()
253
254         col = split.column()
255         col.label("Focus:")
256         col.prop(cam, "dof_object", text="")
257
258         sub = col.row()
259         sub.active = cam.dof_object is None
260         sub.prop(cam, "dof_distance", text="Distance")
261
262         col = split.column()
263
264         col.label("Aperture:")
265         col.prop(ccam, "aperture_size", text="Size")
266
267         sub = col.column(align=True)
268         sub.prop(ccam, "aperture_blades", text="Blades")
269         sub.prop(ccam, "aperture_rotation", text="Rotation")
270
271
272 class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
273     bl_label = ""
274     bl_context = "material"
275     bl_options = {'HIDE_HEADER'}
276
277     @classmethod
278     def poll(cls, context):
279         return (context.material or context.object) and CyclesButtonsPanel.poll(context)
280
281     def draw(self, context):
282         layout = self.layout
283
284         mat = context.material
285         ob = context.object
286         slot = context.material_slot
287         space = context.space_data
288
289         if ob:
290             row = layout.row()
291
292             row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)
293
294             col = row.column(align=True)
295             col.operator("object.material_slot_add", icon='ZOOMIN', text="")
296             col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
297
298             col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
299
300             if ob.mode == 'EDIT':
301                 row = layout.row(align=True)
302                 row.operator("object.material_slot_assign", text="Assign")
303                 row.operator("object.material_slot_select", text="Select")
304                 row.operator("object.material_slot_deselect", text="Deselect")
305
306         split = layout.split(percentage=0.65)
307
308         if ob:
309             split.template_ID(ob, "active_material", new="material.new")
310             row = split.row()
311
312             if slot:
313                 row.prop(slot, "link", text="")
314             else:
315                 row.label()
316         elif mat:
317             split.template_ID(space, "pin_id")
318             split.separator()
319
320
321 class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
322     bl_label = "Displacement"
323     bl_context = "data"
324
325     @classmethod
326     def poll(cls, context):
327         if CyclesButtonsPanel.poll(context):
328             if context.mesh or context.curve or context.meta_ball:
329                 if context.scene.cycles.feature_set == 'EXPERIMENTAL':
330                     return True
331
332         return False
333
334     def draw(self, context):
335         layout = self.layout
336
337         mesh = context.mesh
338         curve = context.curve
339         mball = context.meta_ball
340
341         if mesh:
342             cdata = mesh.cycles
343         elif curve:
344             cdata = curve.cycles
345         elif mball:
346             cdata = mball.cycles
347
348         layout.prop(cdata, "displacement_method", text="Method")
349         layout.prop(cdata, "use_subdivision")
350         layout.prop(cdata, "dicing_rate")
351
352
353 class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
354     bl_label = "Ray Visibility"
355     bl_context = "object"
356     bl_options = {'DEFAULT_CLOSED'}
357
358     @classmethod
359     def poll(cls, context):
360         ob = context.object
361         return CyclesButtonsPanel.poll(context) and ob and ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META'}  # todo: 'LAMP'
362
363     def draw(self, context):
364         layout = self.layout
365
366         ob = context.object
367         visibility = ob.cycles_visibility
368
369         flow = layout.column_flow()
370
371         flow.prop(visibility, "camera")
372         flow.prop(visibility, "diffuse")
373         flow.prop(visibility, "glossy")
374         flow.prop(visibility, "transmission")
375         flow.prop(visibility, "shadow")
376
377
378 def find_node(material, nodetype):
379     if material and material.node_tree:
380         ntree = material.node_tree
381
382         for node in ntree.nodes:
383             if getattr(node, "type", None) == nodetype:
384                 return node
385
386     return None
387
388
389 def find_node_input(node, name):
390     for input in node.inputs:
391         if input.name == name:
392             return input
393
394     return None
395
396
397 def panel_node_draw(layout, id_data, output_type, input_name):
398     if not id_data.node_tree:
399         layout.prop(id_data, "use_nodes", icon='NODETREE')
400         return False
401
402     ntree = id_data.node_tree
403
404     node = find_node(id_data, output_type)
405     if not node:
406         layout.label(text="No output node.")
407     else:
408         input = find_node_input(node, input_name)
409         layout.template_node_view(ntree, node, input)
410
411     return True
412
413
414 class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
415     bl_label = "Lamp"
416     bl_context = "data"
417
418     @classmethod
419     def poll(cls, context):
420         return context.lamp and CyclesButtonsPanel.poll(context)
421
422     def draw(self, context):
423         layout = self.layout
424
425         lamp = context.lamp
426         clamp = lamp.cycles
427
428         layout.prop(lamp, "type", expand=True)
429
430         split = layout.split()
431         col = split.column(align=True)
432
433         if lamp.type in {'POINT', 'SUN', 'SPOT'}:
434             col.prop(lamp, "shadow_soft_size", text="Size")
435         elif lamp.type == 'AREA':
436             col.prop(lamp, "shape", text="")
437             sub = col.column(align=True)
438
439             if lamp.shape == 'SQUARE':
440                 sub.prop(lamp, "size")
441             elif lamp.shape == 'RECTANGLE':
442                 sub.prop(lamp, "size", text="Size X")
443                 sub.prop(lamp, "size_y", text="Size Y")
444
445         col = split.column()
446         col.prop(clamp, "cast_shadow")
447
448         if lamp.type == 'SPOT':
449             layout.label(text="Not supported, interpreted as point lamp.")
450         elif lamp.type == 'HEMI':
451             layout.label(text="Not supported, interpreted as sun lamp.")
452
453
454 class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel):
455     bl_label = "Nodes"
456     bl_context = "data"
457
458     @classmethod
459     def poll(cls, context):
460         return context.lamp and CyclesButtonsPanel.poll(context)
461
462     def draw(self, context):
463         layout = self.layout
464
465         lamp = context.lamp
466         if not panel_node_draw(layout, lamp, 'OUTPUT_LAMP', 'Surface'):
467             layout.prop(lamp, "color")
468
469
470 class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
471     bl_label = "Surface"
472     bl_context = "world"
473
474     @classmethod
475     def poll(cls, context):
476         return context.world and CyclesButtonsPanel.poll(context)
477
478     def draw(self, context):
479         layout = self.layout
480
481         world = context.world
482
483         if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
484             layout.prop(world, "horizon_color", text="Color")
485
486
487 class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
488     bl_label = "Settings"
489     bl_context = "world"
490     bl_options = {'DEFAULT_CLOSED'}
491
492     @classmethod
493     def poll(cls, context):
494         return context.world and CyclesButtonsPanel.poll(context)
495
496     def draw(self, context):
497         layout = self.layout
498
499         world = context.world
500         cworld = world.cycles
501
502         col = layout.column()
503
504         col.prop(cworld, "sample_as_light")
505         row = col.row()
506         row.active = cworld.sample_as_light
507         row.prop(cworld, "sample_map_resolution")
508
509
510 class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
511     bl_label = "Volume"
512     bl_context = "world"
513     bl_options = {'DEFAULT_CLOSED'}
514
515     @classmethod
516     def poll(cls, context):
517         # world = context.world
518         # world and world.node_tree and CyclesButtonsPanel.poll(context)
519         return False
520
521     def draw(self, context):
522         layout = self.layout
523         layout.active = False
524
525         world = context.world
526         panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
527
528
529 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
530     bl_label = "Surface"
531     bl_context = "material"
532
533     @classmethod
534     def poll(cls, context):
535         return context.material and CyclesButtonsPanel.poll(context)
536
537     def draw(self, context):
538         layout = self.layout
539
540         mat = context.material
541         if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'):
542             layout.prop(mat, "diffuse_color")
543
544
545 class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
546     bl_label = "Volume"
547     bl_context = "material"
548     bl_options = {'DEFAULT_CLOSED'}
549
550     @classmethod
551     def poll(cls, context):
552         # mat = context.material
553         # mat and mat.node_tree and CyclesButtonsPanel.poll(context)
554         return False
555
556     def draw(self, context):
557         layout = self.layout
558         layout.active = False
559
560         mat = context.material
561         cmat = mat.cycles
562
563         panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
564
565         layout.prop(cmat, "homogeneous_volume")
566
567
568 class CyclesMaterial_PT_displacement(CyclesButtonsPanel, Panel):
569     bl_label = "Displacement"
570     bl_context = "material"
571
572     @classmethod
573     def poll(cls, context):
574         mat = context.material
575         return mat and mat.node_tree and CyclesButtonsPanel.poll(context)
576
577     def draw(self, context):
578         layout = self.layout
579
580         mat = context.material
581         panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement')
582
583
584 class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
585     bl_label = "Settings"
586     bl_context = "material"
587     bl_options = {'DEFAULT_CLOSED'}
588
589     @classmethod
590     def poll(cls, context):
591         return context.material and CyclesButtonsPanel.poll(context)
592
593     def draw(self, context):
594         layout = self.layout
595
596         mat = context.material
597         cmat = mat.cycles
598
599         split = layout.split()
600
601         col = split.column()
602         col.prop(mat, "diffuse_color", text="Viewport Color")
603
604         col = split.column()
605         col.prop(cmat, "sample_as_light")
606         col.prop(mat, "pass_index")
607
608
609 class CyclesTexture_PT_context(CyclesButtonsPanel, Panel):
610     bl_label = ""
611     bl_context = "texture"
612     bl_options = {'HIDE_HEADER'}
613     COMPAT_ENGINES = {'CYCLES'}
614
615     def draw(self, context):
616         layout = self.layout
617
618         tex = context.texture
619         space = context.space_data
620         pin_id = space.pin_id
621         use_pin_id = space.use_pin_id
622         user = context.texture_user
623         # node = context.texture_node
624
625         if not use_pin_id or not isinstance(pin_id, bpy.types.Texture):
626             pin_id = None
627
628         if not pin_id:
629             layout.template_texture_user()
630
631         if user:
632             layout.separator()
633
634             split = layout.split(percentage=0.65)
635             col = split.column()
636
637             if pin_id:
638                 col.template_ID(space, "pin_id")
639             elif user:
640                 col.template_ID(user, "texture", new="texture.new")
641
642             if tex:
643                 split = layout.split(percentage=0.2)
644                 split.label(text="Type:")
645                 split.prop(tex, "type", text="")
646
647
648 class CyclesTexture_PT_nodes(CyclesButtonsPanel, Panel):
649     bl_label = "Nodes"
650     bl_context = "texture"
651
652     @classmethod
653     def poll(cls, context):
654         tex = context.texture
655         return (tex and tex.use_nodes) and CyclesButtonsPanel.poll(context)
656
657     def draw(self, context):
658         layout = self.layout
659
660         tex = context.texture
661         panel_node_draw(layout, tex, 'OUTPUT_TEXTURE', 'Color')
662
663
664 class CyclesTexture_PT_node(CyclesButtonsPanel, Panel):
665     bl_label = "Node"
666     bl_context = "texture"
667
668     @classmethod
669     def poll(cls, context):
670         node = context.texture_node
671         return node and CyclesButtonsPanel.poll(context)
672
673     def draw(self, context):
674         layout = self.layout
675
676         node = context.texture_node
677         ntree = node.id_data
678         layout.template_node_view(ntree, node, None)
679
680
681 class CyclesTexture_PT_mapping(CyclesButtonsPanel, Panel):
682     bl_label = "Mapping"
683     bl_context = "texture"
684
685     @classmethod
686     def poll(cls, context):
687         tex = context.texture
688         node = context.texture_node
689         return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
690
691     def draw(self, context):
692         layout = self.layout
693
694         # tex = context.texture
695         node = context.texture_node
696
697         mapping = node.texture_mapping
698
699         row = layout.row()
700
701         row.column().prop(mapping, "location")
702         row.column().prop(mapping, "rotation")
703         row.column().prop(mapping, "scale")
704
705         layout.label(text="Projection:")
706
707         row = layout.row()
708         row.prop(mapping, "mapping_x", text="")
709         row.prop(mapping, "mapping_y", text="")
710         row.prop(mapping, "mapping_z", text="")
711
712
713 class CyclesTexture_PT_colors(CyclesButtonsPanel, Panel):
714     bl_label = "Color"
715     bl_context = "texture"
716     bl_options = {'DEFAULT_CLOSED'}
717
718     @classmethod
719     def poll(cls, context):
720         # tex = context.texture
721         # node = context.texture_node
722         return False
723         #return (node or (tex and tex.use_nodes)) and CyclesButtonsPanel.poll(context)
724
725     def draw(self, context):
726         layout = self.layout
727
728         # tex = context.texture
729         node = context.texture_node
730
731         mapping = node.color_mapping
732
733         split = layout.split()
734
735         col = split.column()
736         col.label(text="Blend:")
737         col.prop(mapping, "blend_type", text="")
738         col.prop(mapping, "blend_factor", text="Factor")
739         col.prop(mapping, "blend_color", text="")
740
741         col = split.column()
742         col.label(text="Adjust:")
743         col.prop(mapping, "brightness")
744         col.prop(mapping, "contrast")
745         col.prop(mapping, "saturation")
746
747         layout.separator()
748
749         layout.prop(mapping, "use_color_ramp", text="Ramp")
750         if mapping.use_color_ramp:
751             layout.template_color_ramp(mapping, "color_ramp", expand=True)
752
753
754 def draw_device(self, context):
755     scene = context.scene
756     layout = self.layout
757
758     if scene.render.engine == 'CYCLES':
759         cscene = scene.cycles
760
761         layout.prop(cscene, "feature_set")
762
763         device_type = context.user_preferences.system.compute_device_type
764         if device_type == 'CUDA':
765             layout.prop(cscene, "device")
766         elif device_type == 'OPENCL' and cscene.feature_set == 'EXPERIMENTAL':
767             layout.prop(cscene, "device")
768
769
770 def draw_pause(self, context):
771     layout = self.layout
772     scene = context.scene
773
774     if scene.render.engine == "CYCLES":
775         view = context.space_data
776
777         if view.viewport_shade == 'RENDERED':
778             cscene = scene.cycles
779             layout.prop(cscene, "preview_pause", icon="PAUSE", text="")
780
781
782 def get_panels():
783     return (
784         bpy.types.RENDER_PT_render,
785         bpy.types.RENDER_PT_output,
786         bpy.types.RENDER_PT_encoding,
787         bpy.types.RENDER_PT_dimensions,
788         bpy.types.RENDER_PT_stamp,
789         bpy.types.SCENE_PT_scene,
790         bpy.types.SCENE_PT_audio,
791         bpy.types.SCENE_PT_unit,
792         bpy.types.SCENE_PT_keying_sets,
793         bpy.types.SCENE_PT_keying_set_paths,
794         bpy.types.SCENE_PT_physics,
795         bpy.types.WORLD_PT_context_world,
796         bpy.types.DATA_PT_context_mesh,
797         bpy.types.DATA_PT_context_camera,
798         bpy.types.DATA_PT_context_lamp,
799         bpy.types.DATA_PT_texture_space,
800         bpy.types.DATA_PT_curve_texture_space,
801         bpy.types.DATA_PT_mball_texture_space,
802         bpy.types.DATA_PT_vertex_groups,
803         bpy.types.DATA_PT_shape_keys,
804         bpy.types.DATA_PT_uv_texture,
805         bpy.types.DATA_PT_vertex_colors,
806         bpy.types.DATA_PT_camera,
807         bpy.types.DATA_PT_camera_display,
808         bpy.types.DATA_PT_lens,
809         bpy.types.DATA_PT_custom_props_mesh,
810         bpy.types.DATA_PT_custom_props_camera,
811         bpy.types.DATA_PT_custom_props_lamp,
812         bpy.types.TEXTURE_PT_clouds,
813         bpy.types.TEXTURE_PT_wood,
814         bpy.types.TEXTURE_PT_marble,
815         bpy.types.TEXTURE_PT_magic,
816         bpy.types.TEXTURE_PT_blend,
817         bpy.types.TEXTURE_PT_stucci,
818         bpy.types.TEXTURE_PT_image,
819         bpy.types.TEXTURE_PT_image_sampling,
820         bpy.types.TEXTURE_PT_image_mapping,
821         bpy.types.TEXTURE_PT_musgrave,
822         bpy.types.TEXTURE_PT_voronoi,
823         bpy.types.TEXTURE_PT_distortednoise,
824         bpy.types.TEXTURE_PT_voxeldata,
825         bpy.types.TEXTURE_PT_pointdensity,
826         bpy.types.TEXTURE_PT_pointdensity_turbulence,
827         bpy.types.PARTICLE_PT_context_particles,
828         bpy.types.PARTICLE_PT_emission,
829         bpy.types.PARTICLE_PT_hair_dynamics,
830         bpy.types.PARTICLE_PT_cache,
831         bpy.types.PARTICLE_PT_velocity,
832         bpy.types.PARTICLE_PT_rotation,
833         bpy.types.PARTICLE_PT_physics,
834         bpy.types.PARTICLE_PT_boidbrain,
835         bpy.types.PARTICLE_PT_render,
836         bpy.types.PARTICLE_PT_draw,
837         bpy.types.PARTICLE_PT_children,
838         bpy.types.PARTICLE_PT_field_weights,
839         bpy.types.PARTICLE_PT_force_fields,
840         bpy.types.PARTICLE_PT_vertexgroups,
841         bpy.types.PARTICLE_PT_custom_props,
842         )
843
844
845 def register():
846     bpy.types.RENDER_PT_render.append(draw_device)
847     bpy.types.VIEW3D_HT_header.append(draw_pause)
848
849     for panel in get_panels():
850         panel.COMPAT_ENGINES.add('CYCLES')
851
852
853 def unregister():
854     bpy.types.RENDER_PT_render.remove(draw_device)
855     bpy.types.VIEW3D_HT_header.remove(draw_pause)
856
857     for panel in get_panels():
858         panel.COMPAT_ENGINES.remove('CYCLES')