Assorted UI tweaks/cleanups
[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(self, context):
74                 scene = context.scene
75                 layout = self.layout
76
77                 rd = scene.render_data
78
79                 row = layout.row()
80                 row.itemR(rd, "antialiasing", text="Enable")
81
82                 if rd.antialiasing:
83                         split = layout.split()
84                         
85                         sub = split.column()
86                         sub.itemL(text="Samples:")
87                         sub.row().itemR(rd, "antialiasing_samples", expand=True)
88         
89                         sub = split.column()
90                         sub.itemR(rd, "pixel_filter")
91                         sub.itemR(rd, "filter_size", text="Size")
92                         sub.itemR(rd, "save_buffers")
93                         if rd.save_buffers:
94                                 sub.itemR(rd, "full_sample")
95
96 class RENDER_PT_render(RenderButtonsPanel):
97         __label__ = "Render"
98
99         def draw(self, context):
100                 scene = context.scene
101                 layout = self.layout
102
103                 rd = scene.render_data
104
105                 row = layout.row()
106                 row.itemO("SCREEN_OT_render", text="Render Still")
107                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation")
108                 
109                 row = layout.row()
110                 row.itemR(rd, "do_composite")
111                 row.itemR(rd, "do_sequence")
112                 if rd.do_composite:
113                         row = layout.row()
114                         row.itemR(rd, "free_image_textures")
115                 
116                 row = layout.row()
117                 row.itemL(text="Threads:")
118                 row.itemL(text="Tiles:")
119                 
120                 split = layout.split()
121                 
122                 sub = split.column(align=True)
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.itemR(rd, "parts_x", text="X")
129                 sub.itemR(rd, "parts_y", text="Y")
130                 
131                 row = layout.row()
132                 row.itemR(rd, "panorama")
133                 row.itemR(rd, "dither_intensity", text="Dither")
134                 #       row.itemR(rd, "backbuf")
135                         
136 class RENDER_PT_dimensions(RenderButtonsPanel):
137         __label__ = "Dimensions"
138
139         def draw(self, context):
140                 scene = context.scene
141                 layout = self.layout
142
143                 rd = scene.render_data
144                 
145                 split = layout.split()
146                 
147                 col = split.column(align=True)
148                 col.itemL(text="Resolution:")
149                 col.itemR(rd, "resolution_x", text="X")
150                 col.itemR(rd, "resolution_y", text="Y")
151                 col.itemR(rd, "resolution_percentage", text="")
152                 
153                 col.itemL(text="Aspect Ratio:")
154                 col.itemR(rd, "pixel_aspect_x", text="X")
155                 col.itemR(rd, "pixel_aspect_y", text="Y")
156                 
157                 col.itemR(rd, "border", text="Border")
158                 if rd.border:
159                         col.itemR(rd, "crop_to_border")
160
161                 col = split.column(align=True)
162                 col.itemL(text="Frame Range:")
163                 col.itemR(scene, "start_frame", text="Start")
164                 col.itemR(scene, "end_frame", text="End")
165                 col.itemR(scene, "frame_step", text="Step")
166                 
167                 col.itemL(text="Frame Rate:")
168                 col.itemR(rd, "fps")
169                 col.itemR(rd, "fps_base",text="/")
170                 
171 bpy.types.register(RENDER_PT_render)
172 bpy.types.register(RENDER_PT_dimensions)
173 bpy.types.register(RENDER_PT_antialiasing)
174 bpy.types.register(RENDER_PT_shading)
175 bpy.types.register(RENDER_PT_output)