partial bugfix: [#36501] Blenderplayer can not change video resolution in Mac OSX
[blender.git] / release / scripts / startup / bl_ui / properties_game.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 from bpy.types import Panel
22
23
24 class PhysicsButtonsPanel():
25     bl_space_type = 'PROPERTIES'
26     bl_region_type = 'WINDOW'
27     bl_context = "physics"
28
29
30 class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
31     bl_label = "Physics"
32     COMPAT_ENGINES = {'BLENDER_GAME'}
33
34     @classmethod
35     def poll(cls, context):
36         ob = context.active_object
37         rd = context.scene.render
38         return ob and ob.game and (rd.engine in cls.COMPAT_ENGINES)
39
40     def draw(self, context):
41         layout = self.layout
42
43         ob = context.active_object
44         game = ob.game
45         soft = ob.game.soft_body
46
47         layout.prop(game, "physics_type")
48         layout.separator()
49
50         physics_type = game.physics_type
51
52         if physics_type == 'CHARACTER':
53             layout.prop(game, "use_actor")
54             layout.prop(ob, "hide_render", text="Invisible")  # out of place but useful
55             layout.prop(game, "step_height", slider=True)
56             layout.prop(game, "jump_speed")
57             layout.prop(game, "fall_speed")
58
59         elif physics_type in {'DYNAMIC', 'RIGID_BODY'}:
60             split = layout.split()
61
62             col = split.column()
63             col.prop(game, "use_actor")
64             col.prop(game, "use_ghost")
65             col.prop(ob, "hide_render", text="Invisible")  # out of place but useful
66
67             col = split.column()
68             col.prop(game, "use_material_physics_fh")
69             col.prop(game, "use_rotate_from_normal")
70             col.prop(game, "use_sleep")
71
72             layout.separator()
73
74             split = layout.split()
75
76             col = split.column()
77             col.label(text="Attributes:")
78             col.prop(game, "mass")
79             col.prop(game, "radius")
80             col.prop(game, "form_factor")
81
82             col = split.column()
83             sub = col.column()
84             sub.prop(game, "use_anisotropic_friction")
85             subsub = sub.column()
86             subsub.active = game.use_anisotropic_friction
87             subsub.prop(game, "friction_coefficients", text="", slider=True)
88
89             split = layout.split()
90
91             col = split.column()
92             col.label(text="Velocity:")
93             sub = col.column(align=True)
94             sub.prop(game, "velocity_min", text="Minimum")
95             sub.prop(game, "velocity_max", text="Maximum")
96
97             col = split.column()
98             col.label(text="Damping:")
99             sub = col.column(align=True)
100             sub.prop(game, "damping", text="Translation", slider=True)
101             sub.prop(game, "rotation_damping", text="Rotation", slider=True)
102
103             layout.separator()
104
105             split = layout.split()
106
107             col = split.column()
108             col.label(text="Lock Translation:")
109             col.prop(game, "lock_location_x", text="X")
110             col.prop(game, "lock_location_y", text="Y")
111             col.prop(game, "lock_location_z", text="Z")
112
113             col = split.column()
114             col.label(text="Lock Rotation:")
115             col.prop(game, "lock_rotation_x", text="X")
116             col.prop(game, "lock_rotation_y", text="Y")
117             col.prop(game, "lock_rotation_z", text="Z")
118
119         elif physics_type == 'SOFT_BODY':
120             col = layout.column()
121             col.prop(game, "use_actor")
122             col.prop(game, "use_ghost")
123             col.prop(ob, "hide_render", text="Invisible")
124
125             layout.separator()
126
127             split = layout.split()
128
129             col = split.column()
130             col.label(text="Attributes:")
131             col.prop(game, "mass")
132             # disabled in the code
133             # col.prop(soft, "weld_threshold")
134             col.prop(soft, "location_iterations")
135             col.prop(soft, "linear_stiffness", slider=True)
136             col.prop(soft, "dynamic_friction", slider=True)
137             col.prop(soft, "collision_margin", slider=True)
138             col.prop(soft, "use_bending_constraints", text="Bending Constraints")
139
140             col = split.column()
141             col.prop(soft, "use_shape_match")
142             sub = col.column()
143             sub.active = soft.use_shape_match
144             sub.prop(soft, "shape_threshold", slider=True)
145
146             col.separator()
147
148             col.label(text="Cluster Collision:")
149             col.prop(soft, "use_cluster_rigid_to_softbody")
150             col.prop(soft, "use_cluster_soft_to_softbody")
151             sub = col.column()
152             sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody)
153             sub.prop(soft, "cluster_iterations", text="Iterations")
154
155         elif physics_type == 'STATIC':
156             col = layout.column()
157             col.prop(game, "use_actor")
158             col.prop(game, "use_ghost")
159             col.prop(ob, "hide_render", text="Invisible")
160
161             layout.separator()
162
163             split = layout.split()
164
165             col = split.column()
166             col.label(text="Attributes:")
167             col.prop(game, "radius")
168
169             col = split.column()
170             sub = col.column()
171             sub.prop(game, "use_anisotropic_friction")
172             subsub = sub.column()
173             subsub.active = game.use_anisotropic_friction
174             subsub.prop(game, "friction_coefficients", text="", slider=True)
175
176         elif physics_type == 'SENSOR':
177             col = layout.column()
178             col.prop(game, "use_actor", text="Detect Actors")
179             col.prop(ob, "hide_render", text="Invisible")
180
181         elif physics_type in {'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
182             layout.prop(ob, "hide_render", text="Invisible")
183
184         elif physics_type == 'NAVMESH':
185             layout.operator("mesh.navmesh_face_copy")
186             layout.operator("mesh.navmesh_face_add")
187
188             layout.separator()
189
190             layout.operator("mesh.navmesh_reset")
191             layout.operator("mesh.navmesh_clear")
192
193         if physics_type not in {'NO_COLLISION', 'OCCLUDE'}:
194             layout.separator()
195             split = layout.split()
196
197             col = split.column()
198             col.prop(game, "collision_group")
199             col = split.column()
200             col.prop(game, "collision_mask")
201
202
203 class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
204     bl_label = "Collision Bounds"
205     COMPAT_ENGINES = {'BLENDER_GAME'}
206
207     @classmethod
208     def poll(cls, context):
209         game = context.object.game
210         rd = context.scene.render
211         return (game.physics_type in {'DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC', 'CHARACTER'}) and (rd.engine in cls.COMPAT_ENGINES)
212
213     def draw_header(self, context):
214         game = context.active_object.game
215
216         self.layout.prop(game, "use_collision_bounds", text="")
217
218     def draw(self, context):
219         layout = self.layout
220
221         game = context.active_object.game
222
223         layout.active = game.use_collision_bounds
224         layout.prop(game, "collision_bounds_type", text="Bounds")
225
226         row = layout.row()
227         row.prop(game, "collision_margin", text="Margin", slider=True)
228         row.prop(game, "use_collision_compound", text="Compound")
229
230
231 class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
232     bl_label = "Create Obstacle"
233     COMPAT_ENGINES = {'BLENDER_GAME'}
234
235     @classmethod
236     def poll(cls, context):
237         game = context.object.game
238         rd = context.scene.render
239         return (game.physics_type in {'DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC'}) and (rd.engine in cls.COMPAT_ENGINES)
240
241     def draw_header(self, context):
242         game = context.active_object.game
243
244         self.layout.prop(game, "use_obstacle_create", text="")
245
246     def draw(self, context):
247         layout = self.layout
248
249         game = context.active_object.game
250
251         layout.active = game.use_obstacle_create
252
253         row = layout.row()
254         row.prop(game, "obstacle_radius", text="Radius")
255         row.label()
256
257
258 class RenderButtonsPanel():
259     bl_space_type = 'PROPERTIES'
260     bl_region_type = 'WINDOW'
261     bl_context = "render"
262
263     @classmethod
264     def poll(cls, context):
265         rd = context.scene.render
266         return (rd.engine in cls.COMPAT_ENGINES)
267
268
269 class RENDER_PT_embedded(RenderButtonsPanel, Panel):
270     bl_label = "Embedded Player"
271     COMPAT_ENGINES = {'BLENDER_GAME'}
272
273     def draw(self, context):
274         layout = self.layout
275
276         rd = context.scene.render
277
278         row = layout.row()
279         row.operator("view3d.game_start", text="Start")
280         row.label()
281         row = layout.row()
282         row.label(text="Resolution:")
283         row = layout.row(align=True)
284         row.prop(rd, "resolution_x", slider=False, text="X")
285         row.prop(rd, "resolution_y", slider=False, text="Y")
286
287
288 class RENDER_PT_game_player(RenderButtonsPanel, Panel):
289     bl_label = "Standalone Player"
290     COMPAT_ENGINES = {'BLENDER_GAME'}
291
292     def draw(self, context):
293         import sys
294         layout = self.layout
295         not_osx = sys.platform != "darwin"
296
297         gs = context.scene.game_settings
298
299         row = layout.row()
300         row.operator("wm.blenderplayer_start", text="Start")
301         row.label()
302
303         row = layout.row()
304         row.label(text="Resolution:")
305         row = layout.row(align=True)
306         row.active = not_osx or not gs.show_fullscreen
307         row.prop(gs, "resolution_x", slider=False, text="X")
308         row.prop(gs, "resolution_y", slider=False, text="Y")
309         row = layout.row()
310         col = row.column()
311         col.prop(gs, "show_fullscreen")
312
313         if not_osx:
314             col = row.column()
315             col.prop(gs, "use_desktop")
316             col.active = gs.show_fullscreen
317
318         col = layout.column()
319         col.label(text="Quality:")
320         col.prop(gs, "samples")
321         col = layout.column(align=True)
322         col.prop(gs, "depth", text="Bit Depth", slider=False)
323         col.prop(gs, "frequency", text="Refresh Rate", slider=False)
324
325
326 class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
327     bl_label = "Stereo"
328     COMPAT_ENGINES = {'BLENDER_GAME'}
329
330     def draw(self, context):
331         layout = self.layout
332
333         gs = context.scene.game_settings
334         stereo_mode = gs.stereo
335
336         # stereo options:
337         layout.prop(gs, "stereo", expand=True)
338
339         # stereo:
340         if stereo_mode == 'STEREO':
341             layout.prop(gs, "stereo_mode")
342             layout.prop(gs, "stereo_eye_separation")
343
344         # dome:
345         elif stereo_mode == 'DOME':
346             layout.prop(gs, "dome_mode", text="Dome Type")
347
348             dome_type = gs.dome_mode
349
350             split = layout.split()
351
352             if dome_type in {'FISHEYE', 'TRUNCATED_REAR', 'TRUNCATED_FRONT'}:
353                 col = split.column()
354                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
355                 col.prop(gs, "dome_angle", slider=True)
356
357                 col = split.column()
358                 col.prop(gs, "dome_tessellation", text="Tessellation")
359                 col.prop(gs, "dome_tilt")
360
361             elif dome_type == 'PANORAM_SPH':
362                 col = split.column()
363                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
364
365                 col = split.column()
366                 col.prop(gs, "dome_tessellation", text="Tessellation")
367
368             else:  # cube map
369                 col = split.column()
370                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
371
372                 col = split.column()
373
374             layout.prop(gs, "dome_text")
375
376
377 class RENDER_PT_game_shading(RenderButtonsPanel, Panel):
378     bl_label = "Shading"
379     COMPAT_ENGINES = {'BLENDER_GAME'}
380
381     def draw(self, context):
382         layout = self.layout
383
384         gs = context.scene.game_settings
385
386         layout.prop(gs, "material_mode", expand=True)
387
388         if gs.material_mode == 'GLSL':
389             split = layout.split()
390
391             col = split.column()
392             col.prop(gs, "use_glsl_lights", text="Lights")
393             col.prop(gs, "use_glsl_shaders", text="Shaders")
394             col.prop(gs, "use_glsl_shadows", text="Shadows")
395             col.prop(gs, "use_glsl_color_management", text="Color Management")
396
397             col = split.column()
398             col.prop(gs, "use_glsl_ramps", text="Ramps")
399             col.prop(gs, "use_glsl_nodes", text="Nodes")
400             col.prop(gs, "use_glsl_extra_textures", text="Extra Textures")
401
402
403 class RENDER_PT_game_system(RenderButtonsPanel, Panel):
404     bl_label = "System"
405     COMPAT_ENGINES = {'BLENDER_GAME'}
406
407     def draw(self, context):
408         layout = self.layout
409
410         gs = context.scene.game_settings
411         col = layout.column()
412         row = col.row()
413         col = row.column()
414         col.prop(gs, "use_frame_rate")
415         col.prop(gs, "use_restrict_animation_updates")
416         col.prop(gs, "use_material_caching")
417         col = row.column()
418         col.prop(gs, "use_display_lists")
419         col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
420
421         row = layout.row()
422         row.prop(gs, "vsync")
423
424         row = layout.row()
425         row.prop(gs, "raster_storage")
426
427         row = layout.row()
428         row.label("Exit Key")
429         row.prop(gs, "exit_key", text="", event=True)
430
431
432 class RENDER_PT_game_display(RenderButtonsPanel, Panel):
433     bl_label = "Display"
434     COMPAT_ENGINES = {'BLENDER_GAME'}
435
436     def draw(self, context):
437         layout = self.layout
438
439         gs = context.scene.game_settings
440
441         layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False)
442
443         flow = layout.column_flow()
444         flow.prop(gs, "show_debug_properties", text="Debug Properties")
445         flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
446         flow.prop(gs, "show_physics_visualization", text="Physics Visualization")
447         flow.prop(gs, "use_deprecation_warnings")
448         flow.prop(gs, "show_mouse", text="Mouse Cursor")
449
450         col = layout.column()
451         col.label(text="Framing:")
452         col.row().prop(gs, "frame_type", expand=True)
453         if gs.frame_type == 'LETTERBOX':
454             col.prop(gs, "frame_color", text="")
455
456
457 class SceneButtonsPanel():
458     bl_space_type = 'PROPERTIES'
459     bl_region_type = 'WINDOW'
460     bl_context = "scene"
461
462
463 class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
464     bl_label = "Navigation mesh"
465     bl_options = {'DEFAULT_CLOSED'}
466     COMPAT_ENGINES = {'BLENDER_GAME'}
467
468     @classmethod
469     def poll(cls, context):
470         scene = context.scene
471         return (scene and scene.render.engine in cls.COMPAT_ENGINES)
472
473     def draw(self, context):
474         layout = self.layout
475
476         rd = context.scene.game_settings.recast_data
477
478         layout.operator("mesh.navmesh_make", text="Build navigation mesh")
479
480         col = layout.column()
481         col.label(text="Rasterization:")
482         row = col.row()
483         row.prop(rd, "cell_size")
484         row.prop(rd, "cell_height")
485
486         col = layout.column()
487         col.label(text="Agent:")
488         split = col.split()
489
490         col = split.column()
491         col.prop(rd, "agent_height", text="Height")
492         col.prop(rd, "agent_radius", text="Radius")
493
494         col = split.column()
495         col.prop(rd, "slope_max")
496         col.prop(rd, "climb_max")
497
498         col = layout.column()
499         col.label(text="Region:")
500         row = col.row()
501         row.prop(rd, "region_min_size")
502         row.prop(rd, "region_merge_size")
503
504         col = layout.column()
505         col.label(text="Polygonization:")
506         split = col.split()
507
508         col = split.column()
509         col.prop(rd, "edge_max_len")
510         col.prop(rd, "edge_max_error")
511
512         split.prop(rd, "verts_per_poly")
513
514         col = layout.column()
515         col.label(text="Detail Mesh:")
516         row = col.row()
517         row.prop(rd, "sample_dist")
518         row.prop(rd, "sample_max_error")
519
520
521 class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
522     bl_label = "Sound"
523     COMPAT_ENGINES = {'BLENDER_GAME'}
524
525     def draw(self, context):
526         layout = self.layout
527
528         scene = context.scene
529
530         layout.prop(scene, "audio_distance_model")
531
532         col = layout.column(align=True)
533         col.prop(scene, "audio_doppler_speed", text="Speed")
534         col.prop(scene, "audio_doppler_factor")
535
536
537 class WorldButtonsPanel():
538     bl_space_type = 'PROPERTIES'
539     bl_region_type = 'WINDOW'
540     bl_context = "world"
541
542
543 class WORLD_PT_game_context_world(WorldButtonsPanel, Panel):
544     bl_label = ""
545     bl_options = {'HIDE_HEADER'}
546     COMPAT_ENGINES = {'BLENDER_GAME'}
547
548     @classmethod
549     def poll(cls, context):
550         rd = context.scene.render
551         return (context.scene) and (rd.use_game_engine)
552
553     def draw(self, context):
554         layout = self.layout
555
556         scene = context.scene
557         world = context.world
558         space = context.space_data
559
560         split = layout.split(percentage=0.65)
561         if scene:
562             split.template_ID(scene, "world", new="world.new")
563         elif world:
564             split.template_ID(space, "pin_id")
565
566
567 class WORLD_PT_game_world(WorldButtonsPanel, Panel):
568     bl_label = "World"
569     COMPAT_ENGINES = {'BLENDER_GAME'}
570
571     @classmethod
572     def poll(cls, context):
573         scene = context.scene
574         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
575
576     def draw(self, context):
577         layout = self.layout
578
579         world = context.world
580
581         row = layout.row()
582         row.column().prop(world, "horizon_color")
583         row.column().prop(world, "ambient_color")
584
585
586 class WORLD_PT_game_mist(WorldButtonsPanel, Panel):
587     bl_label = "Mist"
588     COMPAT_ENGINES = {'BLENDER_GAME'}
589
590     @classmethod
591     def poll(cls, context):
592         scene = context.scene
593         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
594
595     def draw_header(self, context):
596         world = context.world
597
598         self.layout.prop(world.mist_settings, "use_mist", text="")
599
600     def draw(self, context):
601         layout = self.layout
602
603         world = context.world
604
605         layout.active = world.mist_settings.use_mist
606
607         layout.prop(world.mist_settings, "falloff")
608
609         row = layout.row(align=True)
610         row.prop(world.mist_settings, "start")
611         row.prop(world.mist_settings, "depth")
612
613         layout.prop(world.mist_settings, "intensity", text="Minimum Intensity")
614
615
616 class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
617     bl_label = "Physics"
618     COMPAT_ENGINES = {'BLENDER_GAME'}
619
620     @classmethod
621     def poll(cls, context):
622         scene = context.scene
623         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
624
625     def draw(self, context):
626         layout = self.layout
627
628         gs = context.scene.game_settings
629
630         layout.prop(gs, "physics_engine", text="Engine")
631         if gs.physics_engine != 'NONE':
632             layout.prop(gs, "physics_gravity", text="Gravity")
633
634             split = layout.split()
635
636             col = split.column()
637             col.label(text="Physics Steps:")
638             sub = col.column(align=True)
639             sub.prop(gs, "physics_step_max", text="Max")
640             sub.prop(gs, "physics_step_sub", text="Substeps")
641             col.prop(gs, "fps", text="FPS")
642
643             col = split.column()
644             col.label(text="Logic Steps:")
645             col.prop(gs, "logic_step_max", text="Max")
646
647             col = layout.column()
648             col.label(text="Physics Deactivation:")
649             sub = col.row(align=True)
650             sub.prop(gs, "deactivation_linear_threshold", text="Linear Threshold")
651             sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold")
652             sub = col.row()
653             sub.prop(gs, "deactivation_time", text="Time")
654
655             col = layout.column()
656             col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
657             sub = col.column()
658             sub.active = gs.use_occlusion_culling
659             sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
660
661         else:
662             split = layout.split()
663
664             col = split.column()
665             col.label(text="Physics Steps:")
666             col.prop(gs, "fps", text="FPS")
667
668             col = split.column()
669             col.label(text="Logic Steps:")
670             col.prop(gs, "logic_step_max", text="Max")
671
672
673 class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel):
674     bl_label = "Obstacle simulation"
675     COMPAT_ENGINES = {'BLENDER_GAME'}
676
677     @classmethod
678     def poll(cls, context):
679         scene = context.scene
680         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
681
682     def draw(self, context):
683         layout = self.layout
684
685         gs = context.scene.game_settings
686
687         layout.prop(gs, "obstacle_simulation", text="Type")
688         if gs.obstacle_simulation != 'NONE':
689             layout.prop(gs, "level_height")
690             layout.prop(gs, "show_obstacle_simulation")
691
692
693 class DataButtonsPanel():
694     bl_space_type = 'PROPERTIES'
695     bl_region_type = 'WINDOW'
696     bl_context = "data"
697
698
699 class DATA_PT_shadow_game(DataButtonsPanel, Panel):
700     bl_label = "Shadow"
701     COMPAT_ENGINES = {'BLENDER_GAME'}
702
703     @classmethod
704     def poll(cls, context):
705         COMPAT_LIGHTS = {'SPOT', 'SUN'}
706         lamp = context.lamp
707         engine = context.scene.render.engine
708         return (lamp and lamp.type in COMPAT_LIGHTS) and (engine in cls.COMPAT_ENGINES)
709
710     def draw_header(self, context):
711         lamp = context.lamp
712
713         self.layout.prop(lamp, "use_shadow", text="")
714
715     def draw(self, context):
716         layout = self.layout
717
718         lamp = context.lamp
719
720         layout.active = lamp.use_shadow
721
722         split = layout.split()
723
724         col = split.column()
725         col.prop(lamp, "shadow_color", text="")
726
727         col = split.column()
728         col.prop(lamp, "use_shadow_layer", text="This Layer Only")
729         col.prop(lamp, "use_only_shadow")
730
731         col = layout.column()
732         col.label("Buffer Type:")
733         col.prop(lamp, "ge_shadow_buffer_type", text="", toggle=True)
734         col.label("Quality:")
735         col = layout.column(align=True)
736         col.prop(lamp, "shadow_buffer_size", text="Size")
737         col.prop(lamp, "shadow_buffer_bias", text="Bias")
738         col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
739
740         row = layout.row()
741         row.label("Clipping:")
742         row = layout.row(align=True)
743         row.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
744         row.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
745
746         if lamp.type == 'SUN':
747             row = layout.row()
748             row.prop(lamp, "shadow_frustum_size", text="Frustum Size")
749
750
751 if __name__ == "__main__":  # only for live edit.
752     bpy.utils.register_module(__name__)