def write_mdl(self, stream: TokenStream, version=None): stream.start_object_block('Bone', self.name) self.write_generic_header(stream) if self.geoset_id == -1: stream.write_flag_attrib('GeosetId', 'Multiple') else: stream.write_number_attrib('GeosetId', self.geoset_id) if self.geoset_animation_id == -1: stream.write_flag_attrib('GeosetAnimId', 'None') else: stream.write_number_attrib('GeosetAnimId', self.geoset_animation_id) self.write_generic_animations(stream) stream.end_block()
def write_mdl(self, stream: TokenStream, version=None): stream.start_block('Layer', None) # headers ?? stream.write_flag_attrib('FilterMode', filter_mode_to_mdl(self.filter_mode)) if self.flags & 0x1: stream.write_flag('Unshaded') if self.flags & 0x2: stream.write_flag('SphereEnvMap') if self.flags & 0x10: stream.write_flag('TwoSided') if self.flags & 0x20: stream.write_flag('Unfogged') if self.flags & 0x40: stream.write_flag('NoDepthTest') if self.flags & 0x80: stream.write_flag('NoDepthSet') if version > 800: if self.flags & 0x100: stream.write_flag('Unlit') if not self.write_animation(stream, 'KMTF'): stream.write_number_attrib('static TextureID', self.texture_id) if self.texture_animation_id != -1: stream.write_number_attrib('TVertexAnimId', self.texture_animation_id) if self.coord_id != 0: stream.write_number_attrib('CoordId', self.coord_id) if not self.write_animation(stream, 'KMTA') and self.alpha != 1: stream.write_number_attrib('static Alpha', self.alpha) if version > 800: if not self.write_animation(stream, 'KMTE') and self.emissive_gain != 1: stream.write_number_attrib('static EmissiveGain', self.emissive_gain) if not self.write_animation(stream, 'KFC3') and ( self.fresnel_color[0] != 1 or self.fresnel_color[1] != 1 or self.fresnel_color[2] != 1): stream.write_vector_attrib('static FresnelColor', self.fresnel_color) if not self.write_animation(stream, 'KFCA') and self.fresnel_opacity != 0: stream.write_number_attrib('static FresnelOpacity', self.fresnel_opacity) if not self.write_animation( stream, 'KFTC') and self.fresnel_team_color != 0: stream.write_number_attrib('static FresnelTeamColor', self.fresnel_team_color) stream.end_block()