X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=d6da9c2864f358c8be0ee5f51dc7473ac9d4c114;hb=56f320d8ce6e8997370ec8e02fe50ca2d07b67f0;hp=538ed6cdd69168bf32316d683daa90cfbd57deca;hpb=33de52d9660ab86caafdd0ae4abb496dbc072778;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 538ed6c..d6da9c2 100644 --- a/blender_export.py +++ b/blender_export.py @@ -2,7 +2,7 @@ # ============================================================================= # # Copyright . . . -----, ,----- ,---. .---. -# 2021-2022 |\ /| | / | | | | /| +# 2021-2023 |\ /| | / | | | | /| # | \ / | +-- / +----- +---' | / | # | \ / | | / | | \ | / | # | \/ | | / | | \ | / | @@ -771,6 +771,61 @@ class classtype_audio(Structure): #} #} +# Classtype 200 +# +# Purpose: point light +# +class classtype_point_light(Structure): +#{ + _pack_ = 1 + _fields_ = [("colour",c_float*4)] + + def encode_obj(_, node, node_def): + #{ + node.classtype = 200 + + data = node_def['obj'].data + _.colour[0] = data.color[0] + _.colour[1] = data.color[1] + _.colour[2] = data.color[2] + _.colour[3] = data.energy + #} + + @staticmethod + def editor_interface( layout, obj ): + #{ + pass + #} +#} + +# Classtype 201 +# +# Purpose: lighting settings for world +# +class classtype_lighting_info(Structure): +#{ + _pack_ = 1 + _fields_ = [("colours",(c_float*3)*3), + ("directions",(c_float*2)*3), + ("states",c_uint32*3), + ("shadow_spread",c_float), + ("shadow_length",c_float), + ("ambient",c_float*3)] + + def encode_obj(_, node, node_def): + #{ + node.classtype = 201 + + # TODO + #} + + @staticmethod + def editor_interface( layout, obj ): + #{ + pass + #} +#} + class classtype_spawn_link(Structure): #{ _pack_ = 1 @@ -1816,6 +1871,11 @@ def encoder_process_definition( node_def ): if obj_type == 'ARMATURE': obj_classtype = 'classtype_skeleton' + elif obj_type == 'LIGHT': + #{ + if obj.data.type == 'POINT': + obj_classtype = 'classtype_point_light' + #} else: #{ obj_classtype = obj.cv_data.classtype