Пример #1
0
 def read_mdl(self, stream: TokenStream):
     for token in super().read_generic_block(stream):
         if token == 'Omnidirectional':
             self.type = 0
         elif token == 'Directional':
             self.type = 1
         elif token == 'Ambient':
             self.type = 2
         elif token == 'static AttenuationStart':
             self.attenuation[0] = stream.read_float()
         elif token == 'AttenuationStart':
             self.read_animation(stream, 'KLAS')
         elif token == 'static AttenuationEnd':
             self.attenuation[1] = stream.read_float()
         elif token == 'AttenuationEnd':
             self.read_animation(stream, 'KLAE')
         elif token == 'static Intensity':
             self.intensity = stream.read_float()
         elif token == 'Intensity':
             self.read_animation(stream, 'KLAI')
         elif token == 'static Color':
             self.color = stream.read_color()
         elif token == 'Color':
             self.read_animation(stream, 'KLAC')
         elif token == 'static AmbIntensity':
             self.ambient_intensity = stream.read_float()
         elif token == 'AmbIntensity':
             self.read_animation(stream, 'KLBI')
         elif token == 'static AmbColor':
             self.ambient_color = stream.read_color()
         elif token == 'AmbColor':
             self.read_animation(stream, 'KLBC')
         elif token == 'Visibility':
             self.read_animation(stream, 'KLAV')
         else:
             raise TokenStreamError('Light', token)
Пример #2
0
 def read_mdl(self, stream: TokenStream, version=None):
     for token in super().read_animated_block(stream):
         if token == 'DropShadow':
             self.flags |= 0x1
         elif token == 'static Alpha':
             self.alpha = stream.read_float()
         elif token == 'Alpha':
             self.read_animation(stream, 'KGAO')
         elif token == 'static Color':
             self.flags |= 0x2
             self.color = stream.read_color()
         elif token == 'Color':
             self.flags |= 0x2
             self.read_animation(stream, 'KGAC')
         elif token == 'GeosetId':
             self.geoset_id = stream.read_int()
         else:
             raise TokenStreamError('GeosetAnimation', token)
Пример #3
0
 def read_mdl(self, stream: TokenStream):
     for token in super().read_generic_block(stream):
         if token == 'static HeightAbove':
             self.height_above = stream.read_float()
         elif token == 'HeightAbove':
             self.read_animation(stream, 'KRHA')
         elif token == 'static HeightBelow':
             self.height_below = stream.read_float()
         elif token == 'HeightBelow':
             self.read_animation(stream, 'KRHB')
         elif token == 'static Alpha':
             self.alpha = stream.read_float()
         elif token == 'Alpha':
             self.read_animation(stream, 'KRAL')
         elif token == 'static Color':
             self.color = stream.read_color()
         elif token == 'Color':
             self.read_animation(stream, 'KRCO')
         elif token == 'static TextureSlot':
             self.texture_slot = stream.read_int()
         elif token == 'TextureSlot':
             self.read_animation(stream, 'KRTX')
         elif token == 'Visibility':
             self.read_animation(stream, 'KRVS')
         elif token == 'EmissionRate':
             self.emission_rate = stream.read_int()
         elif token == 'LifeSpan':
             self.lifespan = stream.read_float()
         elif token == 'Gravity':
             self.gravity = stream.read_float()
         elif token == 'Rows':
             self.rows = stream.read_int()
         elif token == 'Columns':
             self.columns = stream.read_int()
         elif token == 'MaterialID':
             self.material_id = stream.read_int()
         else:
             raise TokenStreamError('RibbonEmitter', token)
Пример #4
0
 def read_mdl(self, stream: TokenStream):
     for token in super().read_generic_block(stream):
         if token == 'SortPrimsFarZ':
             self.flags = self.flags or 0x10000
         elif token == 'Unshaded':
             self.flags = self.flags or 0x8000
         elif token == 'LineEmitter':
             self.flags = self.flags or 0x20000
         elif token == 'Unfogged':
             self.flags = self.flags or 0x40000
         elif token == 'ModelSpace':
             self.flags = self.flags or 0x80000
         elif token == 'XYQuad':
             self.flags = self.flags or 0x100000
         elif token == 'static Speed':
             self.speed = stream.read_float()
         elif token == 'Speed':
             self.read_animation(stream, 'KP2S')
         elif token == 'static Variation':
             self.variation = stream.read_float()
         elif token == 'Variation':
             self.read_animation(stream, 'KP2R')
         elif token == 'static Latitude':
             self.latitude = stream.read_float()
         elif token == 'Latitude':
             self.read_animation(stream, 'KP2L')
         elif token == 'static Gravity':
             self.gravity = stream.read_float()
         elif token == 'Gravity':
             self.read_animation(stream, 'KP2G')
         elif token == 'Visibility':
             self.read_animation(stream, 'KP2V')
         elif token == 'Squirt':
             self.squirt = 1
         elif token == 'LifeSpan':
             self.life_span = stream.read_float()
         elif token == 'static EmissionRate':
             self.emission_rate = stream.read_float()
         elif token == 'EmissionRate':
             self.read_animation(stream, 'KP2E')
         elif token == 'static Width':
             self.width = stream.read_float()
         elif token == 'Width':
             self.read_animation(stream, 'KP2N')
         elif token == 'static Length':
             self.length = stream.read_float()
         elif token == 'Length':
             self.read_animation(stream, 'KP2W')
         elif token == 'Blend':
             self.filter_mode = 0
         elif token == 'Additive':
             self.filter_mode = 1
         elif token == 'Modulate':
             self.filter_mode = 2
         elif token == 'Modulate2x':
             self.filter_mode = 3
         elif token == 'AlphaKey':
             self.filter_mode = 4
         elif token == 'Rows':
             self.rows = stream.read_int()
         elif token == 'Columns':
             self.columns = stream.read_int()
         elif token == 'Head':
             self.head_or_tail = 0
         elif token == 'Tail':
             self.head_or_tail = 1
         elif token == 'Both':
             self.head_or_tail = 2
         elif token == 'TailLength':
             self.tail_length = stream.read_float()
         elif token == 'Time':
             self.time_middle = stream.read_float()
         elif token == 'SegmentColor':
             stream.read()
             for i in range(3):
                 stream.read()
                 self.segment_colors[i] = stream.read_color()
             stream.read()
         elif token == 'Alpha':
             self.segment_alphas = stream.read_vector(3)
         elif token == 'ParticleScaling':
             self.segment_scaling = stream.read_vector(3)
         elif token == 'LifeSpanUVAnim':
             self.head_intervals[0] = stream.read_vector(3)
         elif token == 'DecayUVAnim':
             self.head_intervals[1] = stream.read_vector(3)
         elif token == 'TailUVAnim':
             self.tail_intervals[0] = stream.read_vector(3)
         elif token == 'TailDecayUVAnim':
             self.tail_intervals[1] = stream.read_vector(3)
         elif token == 'TextureID':
             self.texture_id = stream.read_int()
         elif token == 'ReplaceableId':
             self.replaceable_id = stream.read_int()
         elif token == 'PriorityPlane':
             self.priority_plane = stream.read_int()
         else:
             raise TokenStreamError('ParticleEmitter2', token)