2.5 Buttons:
[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="Subsurface Scattering")
23                 sub.itemR(rd, "render_envmaps", text="Environment Map")
24                 #       sub.itemR(rd, "render_radiosity", text="Radio")
25                 
26                 col = split.column()
27                 colsub = col.column()
28                 colsub.active = rd.render_raytracing
29                 colsub.itemR(rd, "render_raytracing", text="Ray Tracing")
30                 colsub.itemR(rd, "octree_resolution", text="Octree")
31                 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
32                 
33 class RENDER_PT_output(RenderButtonsPanel):
34         __label__ = "Output"
35
36         def draw(self, context):
37                 scene = context.scene
38                 layout = self.layout
39
40                 rd = scene.render_data
41                 
42                 layout.itemR(rd, "output_path")
43                 
44                 split = layout.split()
45                 
46                 sub = split.column()
47                 sub.itemR(rd, "file_format", text="Format")
48                 if rd.file_format in ("AVIJPEG", "JPEG"):
49                         sub.itemR(rd, "quality", slider=True)
50                 
51                 sub = split.column()
52                 sub.itemR(rd, "color_mode")
53                 sub.itemR(rd, "alpha_mode")
54                 
55                 split = layout.split()
56                 
57                 sub = split.column()
58                 sub.itemL(text="Distributed Rendering:")
59                 sub.itemR(rd, "placeholders")
60                 sub.itemR(rd, "no_overwrite")
61                 
62                 sub = split.column()
63                 sub.itemL(text="Settings:")
64                 sub.itemR(rd, "file_extensions")
65                 sub.itemR(rd, "fields", text="Fields")
66                 if rd.fields:
67                         sub.itemR(rd, "fields_still", text="Still")
68                         sub.row().itemR(rd, "field_order", expand=True)
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                 rd = scene.render_data
82
83                 layout = self.layout
84                 layout.active = rd.antialiasing
85
86                 split = layout.split()
87                 
88                 sub = split.column()
89                 sub.itemL(text="Samples:")
90                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
91
92                 sub = split.column()
93                 sub.itemR(rd, "pixel_filter")
94                 sub.itemR(rd, "filter_size", text="Size", slider=True)
95                 sub.itemR(rd, "save_buffers")
96                 if rd.save_buffers:
97                         sub.itemR(rd, "full_sample")
98
99 class RENDER_PT_render(RenderButtonsPanel):
100         __label__ = "Render"
101
102         def draw(self, context):
103                 scene = context.scene
104                 layout = self.layout
105
106                 rd = scene.render_data
107
108                 row = layout.row()
109                 row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
110                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
111                 
112                 row = layout.row()
113                 row.itemR(rd, "do_composite")
114                 row.itemR(rd, "do_sequence")
115                 if rd.do_composite:
116                         row = layout.row()
117                         row.itemR(rd, "free_image_textures")
118
119                 split = layout.split()
120                 
121                 sub = split.column(align=True)
122                 sub.itemL(text="Threads:")
123                 sub.row().itemR(rd, "threads_mode", expand=True)
124                 if rd.threads_mode == 'THREADS_FIXED':
125                         sub.itemR(rd, "threads")
126                 
127                 sub = split.column(align=True)
128                 sub.itemL(text="Tiles:")
129                 sub.itemR(rd, "parts_x", text="X")
130                 sub.itemR(rd, "parts_y", text="Y")
131                 
132                 split = layout.split()
133                 sub = split.column()
134                 sub = split.column()
135                 sub.itemR(rd, "panorama")
136                 
137                 #       row.itemR(rd, "backbuf")
138                         
139 class RENDER_PT_dimensions(RenderButtonsPanel):
140         __label__ = "Dimensions"
141
142         def draw(self, context):
143                 scene = context.scene
144                 layout = self.layout
145
146                 rd = scene.render_data
147                 
148                 split = layout.split()
149                 
150                 col = split.column()
151                 sub = col.column(align=True)
152                 sub.itemL(text="Resolution:")
153                 sub.itemR(rd, "resolution_x", text="X")
154                 sub.itemR(rd, "resolution_y", text="Y")
155                 sub.itemR(rd, "resolution_percentage", text="")
156                 
157                 sub.itemL(text="Aspect Ratio:")
158                 sub.itemR(rd, "pixel_aspect_x", text="X")
159                 sub.itemR(rd, "pixel_aspect_y", text="Y")
160                 
161                 sub = col.column(align=False)
162                 sub.itemR(rd, "border", text="Border")
163                 if rd.border:
164                         sub.itemR(rd, "crop_to_border")
165
166                 col = split.column(align=True)
167                 col.itemL(text="Frame Range:")
168                 col.itemR(scene, "start_frame", text="Start")
169                 col.itemR(scene, "end_frame", text="End")
170                 col.itemR(scene, "frame_step", text="Step")
171                 
172                 col.itemL(text="Frame Rate:")
173                 col.itemR(rd, "fps")
174                 col.itemR(rd, "fps_base",text="/")
175
176 class RENDER_PT_stamp(RenderButtonsPanel):
177         __label__ = "Stamp"
178
179         def draw_header(self, context):
180                 rd = context.scene.render_data
181
182                 layout = self.layout
183                 layout.itemR(rd, "stamp", text="")
184
185         def draw(self, context):
186                 scene = context.scene
187                 rd = scene.render_data
188
189                 layout = self.layout
190                 layout.active = rd.stamp
191
192                 split = layout.split()
193                 
194                 sub = split.column()
195                 sub.itemR(rd, "stamp_time", text="Time")
196                 sub.itemR(rd, "stamp_date", text="Date")
197                 sub.itemR(rd, "stamp_frame", text="Frame")
198                 sub.itemR(rd, "stamp_camera", text="Scene")
199                 sub.itemR(rd, "stamp_marker", text="Marker")
200                 sub.itemR(rd, "stamp_filename", text="Filename")
201                 sub.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
202                 sub.itemR(rd, "stamp_note", text="Note")
203                 if (rd.stamp_note):
204                         sub.itemR(rd, "stamp_note_text", text="")
205                 
206                 sub = split.column()
207                 sub.itemR(rd, "render_stamp")
208                 sub.itemR(rd, "stamp_foreground")
209                 sub.itemR(rd, "stamp_background")
210                 sub.itemR(rd, "stamp_font_size", text="Font Size")
211
212 bpy.types.register(RENDER_PT_render)
213 bpy.types.register(RENDER_PT_dimensions)
214 bpy.types.register(RENDER_PT_antialiasing)
215 bpy.types.register(RENDER_PT_shading)
216 bpy.types.register(RENDER_PT_output)
217 bpy.types.register(RENDER_PT_stamp)
218