X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=6117ff871b80bbd0ead49466cec553776ac0176b;hb=791f807111a1f740f745c67db642aa7a8bee56e8;hp=b60b2e02fc8cf14550c3f2ace276c11545c48bec;hpb=e61356f70eddb79f05d7b9e329e91963ec74f817;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index b60b2e0..6117ff8 100644 --- a/blender_export.py +++ b/blender_export.py @@ -837,6 +837,9 @@ class classtype_world_light( Structure ): _.type = 1 _.angle = math.cos(data.spot_size*0.5) #} + + if data.cv_data.bp0: + _.type += 2 #} @staticmethod @@ -1340,7 +1343,7 @@ def encoder_build_scene_graph( collection ): for obj in collection.all_objects: #{ - if obj.parent: continue + #if obj.parent: continue def _extend( p, n, d ): #{ @@ -1915,7 +1918,7 @@ def encoder_process_definition( node_def ): #{ obj = node_def['obj'] obj_type = obj.type - obj_co = obj.location + obj_co = obj.matrix_world @ Vector((0,0,0)) if obj_type == 'ARMATURE': obj_classtype = 'classtype_skeleton' @@ -2642,6 +2645,31 @@ class CV_MESH_SETTINGS(bpy.types.PropertyGroup): v3: bpy.props.FloatVectorProperty(name="v3",size=3) #} +class CV_LIGHT_SETTINGS(bpy.types.PropertyGroup): +#{ + bp0: bpy.props.BoolProperty( name="bp0" ); +#} + +class CV_LIGHT_PANEL(bpy.types.Panel): +#{ + bl_label="[Skate Rift]" + bl_idname="SCENE_PT_cv_light" + bl_space_type='PROPERTIES' + bl_region_type='WINDOW' + bl_context='data' + + def draw(_,context): + #{ + active_object = context.active_object + if active_object == None: return + + if active_object.type != 'LIGHT': return + + data = active_object.data.cv_data + _.layout.prop( data, "bp0", text="Only on during night" ) + #} +#} + class CV_OBJ_SETTINGS(bpy.types.PropertyGroup): #{ uid: bpy.props.IntProperty( name="" ) @@ -2709,7 +2737,7 @@ class CV_BONE_SETTINGS(bpy.types.PropertyGroup): class CV_BONE_PANEL(bpy.types.Panel): #{ - bl_label="Bone Config" + bl_label="[Skate Rift]" bl_idname="SCENE_PT_cv_bone" bl_space_type='PROPERTIES' bl_region_type='WINDOW' @@ -3002,7 +3030,8 @@ class CV_INTERFACE(bpy.types.Panel): classes = [CV_OBJ_SETTINGS,CV_OBJ_PANEL,CV_COMPILE,CV_INTERFACE,\ CV_MESH_SETTINGS, CV_SCENE_SETTINGS, CV_BONE_SETTINGS,\ CV_BONE_PANEL, CV_COLLECTION_SETTINGS, CV_COMPILE_THIS,\ - CV_MATERIAL_SETTINGS, CV_MATERIAL_PANEL ] + CV_MATERIAL_SETTINGS, CV_MATERIAL_PANEL, CV_LIGHT_SETTINGS,\ + CV_LIGHT_PANEL] def register(): #{ @@ -3019,6 +3048,7 @@ def register(): bpy.props.PointerProperty(type=CV_COLLECTION_SETTINGS) bpy.types.Material.cv_data = \ bpy.props.PointerProperty(type=CV_MATERIAL_SETTINGS) + bpy.types.Light.cv_data = bpy.props.PointerProperty(type=CV_LIGHT_SETTINGS) cv_view_draw_handler = bpy.types.SpaceView3D.draw_handler_add(\ cv_draw,(),'WINDOW','POST_VIEW')