360122fb8051cd60c60b9cdc6a859bc20bb5e1d4
[blender.git] / release / ui / buttons_scene.py
1
2 import bpy
3
4 class RenderButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "scene"
8
9 class RENDER_PT_shading(RenderButtonsPanel):
10         __label__ = "Shading"
11
12         def draw(self, context):
13                 scene = context.scene
14                 layout = self.layout
15
16                 rd = scene.render_data
17                 
18                 split = layout.split()
19                 
20                 sub = split.column()
21                 sub.itemR(rd, "render_shadows", text="Shadows")
22                 sub.itemR(rd, "render_sss", text="SSS")
23                 sub.itemR(rd, "render_envmaps", text="EnvMap")
24                 #       sub.itemR(rd, "render_radiosity", text="Radio")
25                 
26                 sub = split.column()
27                 sub.itemR(rd, "render_raytracing", text="Ray Tracing")
28                 if (rd.render_raytracing):
29                         sub.itemR(rd, "octree_resolution", text="Octree")
30                 
31 class RENDER_PT_output(RenderButtonsPanel):
32         __label__ = "Output"
33
34         def draw(self, context):
35                 scene = context.scene
36                 layout = self.layout
37
38                 rd = scene.render_data
39                 
40                 col = layout.column()
41                 col.itemR(rd, "output_path")
42                 
43                 split = layout.split()
44                 
45                 sub = split.column()
46                 sub.itemR(rd, "image_type")
47                 if rd.image_type in ("AVIJPEG", "JPEG"):
48                         sub.itemR(rd, "quality")
49                 
50                 sub = split.column()
51                 sub.itemR(rd, "color_mode")
52                 sub.itemR(rd, "alpha_mode")
53                 
54                 split = layout.split()
55                 
56                 sub = split.column()
57                 sub.itemL(text="Distributed Rendering:")
58                 sub.itemR(rd, "placeholders")
59                 sub.itemR(rd, "no_overwrite")
60                 
61                 sub = split.column()
62                 sub.itemL(text="Settings:")
63                 sub.itemR(rd, "file_extensions")
64                 sub.itemR(rd, "fields", text="Fields")
65                 if rd.fields:
66                         sub.itemR(rd, "fields_still", text="Still")
67                         sub.row().itemR(rd, "field_order", expand=True)
68                 
69         
70 class RENDER_PT_antialiasing(RenderButtonsPanel):
71         __label__ = "Anti-Aliasing"
72
73         def draw_header(self, context):
74                 rd = context.scene.render_data
75
76                 layout = self.layout
77                 layout.itemR(rd, "antialiasing", text="")
78
79         def draw(self, context):
80                 scene = context.scene
81                 layout = self.layout
82
83                 rd = scene.render_data
84
85                 split = layout.split()
86                 
87                 sub = split.column()
88                 sub.itemL(text="Samples:")
89                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
90
91                 sub = split.column()
92                 sub.itemR(rd, "pixel_filter")
93                 sub.itemR(rd, "filter_size", text="Size")
94                 sub.itemR(rd, "save_buffers")
95                 if rd.save_buffers:
96                         sub.itemR(rd, "full_sample")
97
98 class RENDER_PT_render(RenderButtonsPanel):
99         __label__ = "Render"
100
101         def draw(self, context):
102                 scene = context.scene
103                 layout = self.layout
104
105                 rd = scene.render_data
106
107                 row = layout.row()
108                 row.itemO("SCREEN_OT_render", text="Render Still")
109                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation")
110                 
111                 row = layout.row()
112                 row.itemR(rd, "do_composite")
113                 row.itemR(rd, "do_sequence")
114                 if rd.do_composite:
115                         row = layout.row()
116                         row.itemR(rd, "free_image_textures")
117                 
118                 row = layout.row()
119                 row.itemL(text="Threads:")
120                 row.itemL(text="Tiles:")
121                 
122                 split = layout.split()
123                 
124                 sub = split.column(align=True)
125                 sub.row().itemR(rd, "threads_mode", expand=True)
126                 if rd.threads_mode == 'THREADS_FIXED':
127                         sub.itemR(rd, "threads")
128                 
129                 sub = split.column(align=True)
130                 sub.itemR(rd, "parts_x", text="X")
131                 sub.itemR(rd, "parts_y", text="Y")
132                 
133                 row = layout.row()
134                 row.itemR(rd, "panorama")
135                 row.itemR(rd, "dither_intensity", text="Dither")
136                 #       row.itemR(rd, "backbuf")
137                         
138 class RENDER_PT_dimensions(RenderButtonsPanel):
139         __label__ = "Dimensions"
140
141         def draw(self, context):
142                 scene = context.scene
143                 layout = self.layout
144
145                 rd = scene.render_data
146                 
147                 split = layout.split()
148                 
149                 col = split.column(align=True)
150                 col.itemL(text="Resolution:")
151                 col.itemR(rd, "resolution_x", text="X")
152                 col.itemR(rd, "resolution_y", text="Y")
153                 col.itemR(rd, "resolution_percentage", text="")
154                 
155                 col.itemL(text="Aspect Ratio:")
156                 col.itemR(rd, "pixel_aspect_x", text="X")
157                 col.itemR(rd, "pixel_aspect_y", text="Y")
158                 
159                 col.itemR(rd, "border", text="Border")
160                 if rd.border:
161                         col.itemR(rd, "crop_to_border")
162
163                 col = split.column(align=True)
164                 col.itemL(text="Frame Range:")
165                 col.itemR(scene, "start_frame", text="Start")
166                 col.itemR(scene, "end_frame", text="End")
167                 col.itemR(scene, "frame_step", text="Step")
168                 
169                 col.itemL(text="Frame Rate:")
170                 col.itemR(rd, "fps")
171                 col.itemR(rd, "fps_base",text="/")
172                 
173 bpy.types.register(RENDER_PT_render)
174 bpy.types.register(RENDER_PT_dimensions)
175 bpy.types.register(RENDER_PT_antialiasing)
176 bpy.types.register(RENDER_PT_shading)
177 bpy.types.register(RENDER_PT_output)