#NEWLINE# @ staticmethod #NEWLINE# def load( collada , localscope , node ) : #NEWLINE# #INDENT# pnode = node . find ( ( '%s/%s' % ( tag ( 'technique_common' ) , tag ( 'spot' ) ) ) ) #NEWLINE# colornode = pnode . find ( tag ( 'color' ) ) #NEWLINE# if ( colornode is None ) : #NEWLINE# #INDENT# raise DaeIncompleteError ( 'Missing color for spot light' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# color = tuple ( [ float ( v ) for v in colornode . text . split ( ) ] ) #NEWLINE# #UNINDENT# except ValueError as ex : #NEWLINE# #INDENT# raise DaeMalformedError ( 'Corrupted color values in spot light definition' ) #NEWLINE# #UNINDENT# constant_att = linear_att = quad_att = falloff_ang = falloff_exp = None #NEWLINE# cattnode = pnode . find ( tag ( 'constant_attenuation' ) ) #NEWLINE# lattnode = pnode . find ( tag ( 'linear_attenuation' ) ) #NEWLINE# qattnode = pnode . find ( tag ( 'quadratic_attenuation' ) ) #NEWLINE# fangnode = pnode . find ( tag ( 'falloff_angle' ) ) #NEWLINE# fexpnode = pnode . find ( tag ( 'falloff_exponent' ) ) #NEWLINE# try : #NEWLINE# #INDENT# if ( cattnode is not None ) : #NEWLINE# #INDENT# constant_att = float ( cattnode . text ) #NEWLINE# #UNINDENT# if ( lattnode is not None ) : #NEWLINE# #INDENT# linear_att = float ( lattnode . text ) #NEWLINE# #UNINDENT# if ( qattnode is not None ) : #NEWLINE# #INDENT# quad_att = float ( qattnode . text ) #NEWLINE# #UNINDENT# if ( fangnode is not None ) : #NEWLINE# #INDENT# falloff_ang = float ( fangnode . text ) #NEWLINE# #UNINDENT# if ( fexpnode is not None ) : #NEWLINE# #INDENT# falloff_exp = float ( fexpnode . text ) #NEWLINE# #UNINDENT# #UNINDENT# except ValueError as ex : #NEWLINE# #INDENT# raise DaeMalformedError ( 'Corrupted values in spot light definition' ) #NEWLINE# #UNINDENT# return SpotLight ( node . get ( 'id' ) , color , constant_att , linear_att , quad_att , falloff_ang , falloff_exp , xmlnode = node )