#NEWLINE# def on_pre_render_update( self ) : #NEWLINE# #INDENT# sun_vector = self . get_plugin_instance ( 'scattering' ) . sun_vector #NEWLINE# if ( sun_vector . z < 0.0 ) : #NEWLINE# #INDENT# self . shadow_stage . active = False #NEWLINE# self . scene_shadow_stage . active = False #NEWLINE# self . pssm_stage . set_render_shadows ( False ) #NEWLINE# if self . get_setting ( 'use_distant_shadows' ) : #NEWLINE# #INDENT# self . dist_shadow_stage . active = False #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . shadow_stage . active = True #NEWLINE# self . scene_shadow_stage . active = True #NEWLINE# self . pssm_stage . set_render_shadows ( True ) #NEWLINE# if self . get_setting ( 'use_distant_shadows' ) : #NEWLINE# #INDENT# self . dist_shadow_stage . active = True #NEWLINE# #UNINDENT# #UNINDENT# if self . update_enabled : #NEWLINE# #INDENT# self . camera_rig . update ( Globals . base . camera , sun_vector ) #NEWLINE# cache_diff = ( Globals . clock . get_frame_time ( ) - self . last_cache_reset ) #NEWLINE# if ( cache_diff > 5.0 ) : #NEWLINE# #INDENT# self . last_cache_reset = Globals . clock . get_frame_time ( ) #NEWLINE# self . camera_rig . reset_film_size_cache ( ) #NEWLINE# #UNINDENT# self . scene_shadow_stage . sun_vector = sun_vector #NEWLINE# if self . get_setting ( 'use_distant_shadows' ) : #NEWLINE# #INDENT# self . dist_shadow_stage . sun_vector = sun_vector