1111import math
1212import os
1313
14+ def ToggleShadows (self , context ):
15+ shadow_caster = bpy .data .lamps ['ShadowCasterLamp' ]
16+ if shadow_caster is None :
17+ return False
18+ print (shadow_caster .shadow_method )
19+ if self .cast_shadows :
20+ shadow_caster .shadow_method = "RAY_SHADOW"
21+ shadow_caster .use_diffuse = True
22+ else :
23+ shadow_caster .shadow_method = "NOSHADOW"
24+ shadow_caster .use_diffuse = False
25+ return
26+
1427class GeneralProperties (bpy .types .PropertyGroup ):
1528 script_file = os .path .realpath (__file__ )
1629 directory = os .path .dirname (script_file )
@@ -30,10 +43,16 @@ class GeneralProperties(bpy.types.PropertyGroup):
3043
3144 number_of_animation_frames = bpy .props .IntProperty (
3245 name = "Animation Frames" ,
33- description = "Number of animation frames. For example in use for swinging, rotating or animated ride vehicles, animated rides, and animated scenery. " ,
46+ description = "Number of animation frames. For example in use for swinging, rotating or animated ride vehicles, animated rides, and animated scenery" ,
3447 default = 1 ,
3548 min = 1 )
3649
50+ cast_shadows = bpy .props .BoolProperty (
51+ name = "Cast Shadows" ,
52+ description = "Control wether or not the render contains shadows. Should be disabled for vehicles" ,
53+ default = False ,
54+ update = ToggleShadows )
55+
3756 out_start_index = bpy .props .IntProperty (
3857 name = "Output Starting Index" ,
3958 description = "Number to start counting from for the output file names" ,
@@ -69,6 +88,9 @@ def draw(self, context):
6988 row = layout .row ()
7089 row .prop (properties , "number_of_animation_frames" )
7190
91+ row = layout .row ()
92+ row .prop (properties , "cast_shadows" )
93+
7294 row = layout .row ()
7395 row .prop (properties , "out_start_index" )
7496
0 commit comments