X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=b6ca3e7208c71d054a869d3b65eeae01902907af;hb=a1741ec4aed057cbafff2d6bc9e5cf8a15ae322b;hp=81951235c49258de1574e7faa2ec73aebba24fef;hpb=23a1be081ab9e378cba49a23b8ed4d4082b580c1;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 8195123..b6ca3e7 100644 --- a/blender_export.py +++ b/blender_export.py @@ -294,6 +294,8 @@ class classtype_spawn(Structure): cv_view_verts += [(v1[0],v1[1],v1[2])] cv_view_colours += [(0,1,1,1),(0,1,1,1)] #} + + cv_draw_sphere( obj.location, 20.0, [0.1,0,0.9,0.4] ) #} @staticmethod @@ -759,6 +761,49 @@ class classtype_audio(Structure): #} #} +class classtype_spawn_link(Structure): +#{ + _pack_ = 1 + _fields_ = [("connections",c_uint32*4)] + + def encode_obj(_, node,node_def ): + #{ + node.classtype = 0 + #} + + @staticmethod + def editor_interface( layout, obj ): + #{ + pass + #} + + @staticmethod + def draw_scene_helpers( obj ): + #{ + global cv_view_verts, cv_view_colours + + count = 0 + + for obj1 in bpy.context.collection.objects: + #{ + if (obj1.cv_data.classtype != 'classtype_spawn_link') and \ + (obj1.cv_data.classtype != 'classtype_spawn') : + continue + + if (obj1.location - obj.location).length < 40.0: + #{ + cv_draw_line( obj.location, obj1.location, [1,1,1,1] ) + count +=1 + #} + + if count == 4: + break + #} + + cv_draw_sphere( obj.location, 20.0, [0.5,0,0.2,0.4] ) + #} +#} + # ---------------------------------------------------------------------------- # # # # Compiler section # @@ -2348,6 +2393,7 @@ class CV_OBJ_SETTINGS(bpy.types.PropertyGroup): ('classtype_trigger',"classtype_trigger","",100), ('classtype_logic_achievement',"classtype_logic_achievement","",101), ('classtype_logic_relay',"classtype_logic_relay","",102), + ('classtype_spawn_link',"classtype_spawn_link","",150), ]) #}