X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=b60b2e02fc8cf14550c3f2ace276c11545c48bec;hb=e61356f70eddb79f05d7b9e329e91963ec74f817;hp=ccad7bfcb04d001d45f56c083d8dc2f8b8d6262e;hpb=409edea2cf6271956137918e4e0b4f1c2addf620;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index ccad7bf..b60b2e0 100644 --- a/blender_export.py +++ b/blender_export.py @@ -807,22 +807,36 @@ class classtype_audio(Structure): # Classtype 200 # -# Purpose: point light +# Purpose: world light # -class classtype_point_light(Structure): +class classtype_world_light( Structure ): #{ _pack_ = 1 - _fields_ = [("colour",c_float*4)] + _fields_ = [("type",c_uint32), + ("colour",c_float*4), + ("angle",c_float)] def encode_obj(_, node, node_def): #{ node.classtype = 200 - data = node_def['obj'].data + obj = node_def['obj'] + data = obj.data _.colour[0] = data.color[0] _.colour[1] = data.color[1] _.colour[2] = data.color[2] _.colour[3] = data.energy + + if obj.data.type == 'POINT': + #{ + _.type = 0 + _.angle = 0.0 + #} + elif obj.data.type == 'SPOT': + #{ + _.type = 1 + _.angle = math.cos(data.spot_size*0.5) + #} #} @staticmethod @@ -1907,8 +1921,7 @@ def encoder_process_definition( node_def ): obj_classtype = 'classtype_skeleton' elif obj_type == 'LIGHT': #{ - if obj.data.type == 'POINT': - obj_classtype = 'classtype_point_light' + obj_classtype = 'classtype_world_light' #} else: #{