X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=blender_export.py;h=d0a1c8aa50932b67a7cd4389865dedc983aed23c;hb=26bde92c7084971f13352b37fd4d1ea528b45dcf;hp=1291cff66b4e1158f6597cddd9bff1b2a1606690;hpb=000297f007a08b25f458656bfb8dfe4345f2ec32;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/blender_export.py b/blender_export.py index 1291cff..d0a1c8a 100644 --- a/blender_export.py +++ b/blender_export.py @@ -801,7 +801,10 @@ class classtype_logic_wire(Structure): def get_targeted_methods( scene, context ): #{ obj = context.object - invalid = [('0',"","")] + invalid = [('0',"",""), + ('1',"",""), + ('2',"",""), + ('3',"","")] if obj.cv_data.target: #{ @@ -1117,6 +1120,8 @@ class classtype_audio(Structure): flags |= 0x200 if obj.cv_data.audio_format == 'remain compressed': flags |= 0x400 + if obj.cv_data.audio_format == 'synthetic bird': + flags |= 0x1000 _.flags = flags _.volume = obj.cv_data.fltp @@ -1144,71 +1149,6 @@ class classtype_audio(Structure): #} #} -# Classtype 14 -# -# Purpose: Plays some audio (44100hz .ogg vorbis only) -# NOTE: There is a 32mb limit on the audio buffer, world audio is -# decompressed and stored in signed 16 bit integers (2 bytes) -# per sample. -# -# volume: not used if has 3D flag -# flags: -# AUDIO_FLAG_LOOP 0x1 -# AUDIO_FLAG_SPACIAL_3D 0x4 (Probably what you want) -# AUDIO_FLAG_AUTO_START 0x8 (Play when the world starts) -# ...... -# the rest are just internal flags, only use the above 3. -# -class classtype_audio(Structure): -#{ - _pack_ = 1 - _fields_ = [("pstr_file",c_uint32), - ("flags",c_uint32), - ("volume",c_float)] - - def encode_obj(_, node,node_def ): - #{ - node.classtype = 14 - - obj = node_def['obj'] - - _.pstr_file = encoder_process_pstr( obj.cv_data.strp ) - - flags = 0x00 - if obj.cv_data.bp0: flags |= 0x1 - if obj.cv_data.bp1: flags |= 0x4 - if obj.cv_data.bp2: flags |= 0x8 - - if obj.cv_data.audio_format == 'stereo': - flags |= 0x200 - if obj.cv_data.audio_format == 'remain compressed': - flags |= 0x400 - - _.flags = flags - _.volume = obj.cv_data.fltp - #} - - @staticmethod - def editor_interface( layout, obj ): - #{ - layout.prop( obj.cv_data, "strp", text = "File (.ogg)" ) - - layout.prop( obj.cv_data, "bp0", text = "Looping" ) - layout.prop( obj.cv_data, "bp1", text = "3D Audio" ) - layout.prop( obj.cv_data, "bp2", text = "Auto Start" ) - layout.prop( obj.cv_data, "audio_format" ) - - layout.prop( obj.cv_data, "fltp", text = "Volume (0-1)" ) - #} - - @staticmethod - def draw_scene_helpers( obj ): - #{ - global cv_view_verts, cv_view_colours - - cv_draw_sphere( obj.location, obj.scale[0], [1,1,0,1] ) - #} -#} # Classtype 200 # @@ -3137,7 +3077,8 @@ class CV_OBJ_SETTINGS(bpy.types.PropertyGroup): items = [ ('mono', "mono", "", 0), ('stereo', "stereo", "", 1), - ('remain compressed', "remain compressed", "", 2) + ('remain compressed', "remain compressed", "", 2), + ('synthetic bird',"synthetic bird","",3) ]) #}