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