First merge with 2.5 branch.
[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                 layout.split(number=2)
19                 
20                 sub = layout.sub(0)
21                 sub.column()
22                 sub.itemR(rd, "render_shadows", text="Shadows")
23                 sub.itemR(rd, "render_sss", text="SSS")
24                 sub.itemR(rd, "render_envmaps", text="EnvMap")
25                 sub.itemR(rd, "render_radiosity", text="Radio")
26                 
27                 sub = layout.sub(1)
28                 subsub = sub.box()
29                 subsub.column()
30                 subsub.itemR(rd, "render_raytracing", text="Ray Tracing")
31                 if (rd.render_raytracing):
32                         subsub.itemR(rd, "octree_resolution", text="Octree")
33                 sub.row()
34                 sub.itemR(rd, "alpha_mode")
35                 
36 class RENDER_PT_image(RenderButtonsPanel):
37         __label__ = "Image"
38
39         def draw(self, context):
40                 scene = context.scene
41                 layout = self.layout
42
43                 rd = scene.render_data
44
45                 layout.column_flow()
46                 layout.itemR(rd, "resolution_x", text="SizeX")
47                 layout.itemR(rd, "resolution_y", text="SizeY")
48                 layout.itemR(rd, "pixel_aspect_x", text="AspX")
49                 layout.itemR(rd, "pixel_aspect_y", text="AspY")
50
51                 sub = layout.box()
52                 sub.row()
53                 sub.itemR(rd, "image_type")
54                 sub.row()
55                 sub.itemR(rd, "file_extensions")
56                 sub.itemR(rd, "color_mode")
57                 if rd.image_type in ("AVIJPEG", "JPEG"):
58                         sub.row()
59                         sub.itemR(rd, "quality")
60         
61 class RENDER_PT_antialiasing(RenderButtonsPanel):
62         __label__ = "Anti-Aliasing"
63
64         def draw(self, context):
65                 scene = context.scene
66                 layout = self.layout
67
68                 rd = scene.render_data
69
70                 layout.row()
71                 layout.itemR(rd, "antialiasing", text="Enable")
72                 if (rd.antialiasing):
73                         layout.row()
74                         layout.itemL(text="Samples:")
75                         layout.itemR(rd, "antialiasing_samples", expand=True)
76                         layout.row()
77                         layout.itemR(rd, "pixel_filter")
78                         layout.itemR(rd, "filter_size")
79
80                         layout.row()
81                         layout.itemR(rd, "save_buffers")
82                         if (rd.save_buffers):
83                                 layout.itemR(rd, "full_sample")
84
85 class RENDER_PT_render(RenderButtonsPanel):
86         __label__ = "Render"
87
88         def draw(self, context):
89                 scene = context.scene
90                 layout = self.layout
91
92                 rd = scene.render_data
93
94                 layout.row()
95                 layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
96                 #layout.itemO("SCREEN_OT_render", text="ANIM", icon=0) # "anim", 1
97
98                 layout.row()
99                 layout.itemR(scene, "start_frame", text="Start")
100                 layout.itemR(rd, "fps")
101                 layout.itemR(scene, "current_frame", text="Frame")
102                 
103                 layout.row()
104                 layout.itemR(scene, "end_frame", text="End")
105                 layout.itemR(rd, "fps_base",text="/")
106                 layout.itemR(scene, "frame_step", text="Step")
107
108                 layout.row()
109                 layout.itemR(rd, "do_composite")
110                 layout.itemR(rd, "do_sequence")
111
112                 layout.row()
113                 layout.itemL(text="General:")
114
115                 layout.column_flow()
116                 layout.itemR(rd, "resolution_percentage", text="Size ")
117                 layout.itemR(rd, "dither_intensity")
118                 layout.itemR(rd, "parts_x")
119                 layout.itemR(rd, "parts_y")
120                 
121                 layout.split(number=2)
122                 
123                 sub = layout.sub(0)
124                 subsub = sub.box()
125                 subsub.column()
126                 subsub.itemL(text="Threads Mode:")
127                 subsub.itemR(rd, "threads_mode", expand=True)
128                 if rd.threads_mode == 'THREADS_FIXED':
129                         subsub.itemR(rd, "threads")
130                 
131                 subsub = sub.box()
132                 subsub.column()
133                 subsub.itemL(text="Distributed Rendering:")
134                 subsub.itemR(rd, "placeholders")
135                 subsub.itemR(rd, "no_overwrite")
136                 subsub = sub.box()
137                 subsub.column()
138                 subsub.itemR(rd, "fields", text="Fields")
139                 if (rd.fields):
140                         subsub.itemR(rd, "fields_still", text="Still")
141                         subsub.itemR(rd, "field_order", text="Order")
142                 
143                 sub = layout.sub(1)
144                 subsub = sub.box()
145                 subsub.column()
146                 subsub.itemL(text="Extra:")
147                 subsub.itemR(rd, "panorama")
148                 subsub.itemR(rd, "backbuf")
149                 subsub.itemR(rd, "free_image_textures")
150                 
151                 subsub = sub.box()
152                 subsub.column()
153                 subsub.itemL(text="Border:")
154                 subsub.itemR(rd, "border", text="Border Render")
155                 if (rd.border):
156                         subsub.itemR(rd, "crop_to_border")
157
158 bpy.types.register(RENDER_PT_render)
159 bpy.types.register(RENDER_PT_antialiasing)
160 bpy.types.register(RENDER_PT_shading)
161 bpy.types.register(RENDER_PT_image)