Fix build error in release builds after recent changes
[blender.git] / intern / cycles / blender / addon / presets.py
1 #
2 # Copyright 2011-2013 Blender Foundation
3 #
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
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16
17 # <pep8 compliant>
18 from __future__ import annotations
19
20 from bl_operators.presets import AddPresetBase
21 from bpy.types import Operator
22
23
24 class AddPresetIntegrator(AddPresetBase, Operator):
25     '''Add an Integrator Preset'''
26     bl_idname = "render.cycles_integrator_preset_add"
27     bl_label = "Add Integrator Preset"
28     preset_menu = "CYCLES_PT_integrator_presets"
29
30     preset_defines = [
31         "cycles = bpy.context.scene.cycles"
32     ]
33
34     preset_values = [
35         "cycles.max_bounces",
36         "cycles.diffuse_bounces",
37         "cycles.glossy_bounces",
38         "cycles.transmission_bounces",
39         "cycles.volume_bounces",
40         "cycles.transparent_max_bounces",
41         "cycles.caustics_reflective",
42         "cycles.caustics_refractive",
43         "cycles.blur_glossy"
44         "cycles.use_fast_gi"
45         "cycles.ao_bounces"
46         "cycles.ao_bounces_render"
47     ]
48
49     preset_subdir = "cycles/integrator"
50
51
52 class AddPresetSampling(AddPresetBase, Operator):
53     '''Add a Sampling Preset'''
54     bl_idname = "render.cycles_sampling_preset_add"
55     bl_label = "Add Sampling Preset"
56     preset_menu = "CYCLES_PT_sampling_presets"
57
58     preset_defines = [
59         "cycles = bpy.context.scene.cycles"
60     ]
61
62     preset_values = [
63         "cycles.samples",
64         "cycles.preview_samples",
65         "cycles.aa_samples",
66         "cycles.preview_aa_samples",
67         "cycles.diffuse_samples",
68         "cycles.glossy_samples",
69         "cycles.transmission_samples",
70         "cycles.ao_samples",
71         "cycles.mesh_light_samples",
72         "cycles.subsurface_samples",
73         "cycles.volume_samples",
74         "cycles.use_square_samples",
75         "cycles.progressive",
76         "cycles.seed",
77         "cycles.sample_clamp_direct",
78         "cycles.sample_clamp_indirect",
79         "cycles.sample_all_lights_direct",
80         "cycles.sample_all_lights_indirect",
81     ]
82
83     preset_subdir = "cycles/sampling"
84
85
86 classes = (
87     AddPresetIntegrator,
88     AddPresetSampling,
89 )
90
91
92 def register():
93     from bpy.utils import register_class
94     for cls in classes:
95         register_class(cls)
96
97
98 def unregister():
99     from bpy.utils import unregister_class
100     for cls in classes:
101         unregister_class(cls)
102
103
104 if __name__ == "__main__":
105     register()