当前位置: 首页>>代码示例>>Python>>正文


Python StreamReader.i32方法代码示例

本文整理汇总了Python中s3py.io.StreamReader.i32方法的典型用法代码示例。如果您正苦于以下问题:Python StreamReader.i32方法的具体用法?Python StreamReader.i32怎么用?Python StreamReader.i32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在s3py.io.StreamReader的用法示例。


在下文中一共展示了StreamReader.i32方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read(self, stream, resource=None):
     s = StreamReader(stream)
     self.name = s.u32()
     self.start_index = s.i32()
     self.start_vertex = s.i32()
     self.vertex_count = s.i32()
     self.index_count = s.i32()
开发者ID:markmanching,项目名称:s3py,代码行数:9,代码来源:geometry.py

示例2: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
    def read(self, stream, resources=None):
        s = StreamReader(stream)
        self.version = s.u32()
        tgi = TGIList(package=resources)
        tgi.begin_read(stream)
        if self.version >= 0x00000007:
            self.presets = ProductBase.read_presets(stream,tgi)
        self.product_info = ProductInfo()
        self.product_info.read(stream,tgi)
        self.model = tgi.get_resource(s.i32())
        self.diagonal_model = tgi.get_resource(s.i32())
        self.post_model = tgi.get_resource(s.i32())
        self.post_tile_spacing = s.i32()
        self.can_walk_over = s.i8() == 1

        if self.version >= 0x00000008:
            if self.version >= 0x000000A:
                self.should_not_get_thick_snow = s.i8() == 1
                self.snow_post_shape_is_circle = s.i8()==1
                self.snow_thickness_post_scale_factor = s.f32()
                self.snow_thickness_rail_scale_factor = s.f32()
                self.snow_thickness_post_vertical_offset = s.f32()
                self.snow_thickness_rail_vertical_offset = s.f32()
                self.has_wall = s.i8() == 1
            if self.version < 0x000000A or self.has_wall:
                self.raise_fence_geometry_above_wall = s.i8()== 1
                self.wall = tgi.get_resource(s.i32())
        tgi.end_read(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:30,代码来源:catalog.py

示例3: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
    def read_rcol(self, stream, rcol):
        s = StreamReader(stream)
        self.read_tag(stream)
        self.version = s.u32()

        self.routing_slots = [RoutingSlot() for i in range(s.i32())]
        self.container_slots = [ContainerSlot() for i in range(s.i32())]
        self.effect_slots = [EffectSlot() for i in range(s.i32())]
        self.target_slots = [TargetSlot() for i in range(s.i32())]
        self.cone_slots = [ConeSlot() for i in range(s.i32())]

        def read_names(slots):
            for slot in slots: slot.name = s.hash(Slot.NAMES)

        def read_bones(slots):
            for slot in slots: slot.bone_name = s.u32()

        def read_transforms(slots):
            for slot in slots: slot.transform = s.m43()

        def read_offsets(slots):
            if any(slots):
                for i in range(s.i32()):
                    slots[i].offset = SlotOffset([s.f32(), s.f32(), s.f32()], [s.f32(), s.f32(), s.f32()])
                    pass
                pass

        read_names(self.routing_slots)
        read_bones(self.routing_slots)
        read_transforms(self.routing_slots)
        read_offsets(self.routing_slots)

        read_names(self.container_slots)
        read_bones(self.container_slots)
        for slot in self.container_slots:
            slot.flags = s.u32()
        read_transforms(self.container_slots)
        read_offsets(self.container_slots)

        read_names(self.effect_slots)
        read_bones(self.effect_slots)
        read_transforms(self.effect_slots)
        read_offsets(self.effect_slots)

        read_names(self.target_slots)
        read_bones(self.target_slots)
        read_transforms(self.target_slots)
        read_offsets(self.target_slots)

        read_names(self.cone_slots)
        read_bones(self.cone_slots)
        read_transforms(self.cone_slots)
        for cone_slot in self.cone_slots:
            cone_slot.radius = s.f32()
            cone_slot.angle = s.f32()
        read_offsets(self.cone_slots)
        pass
开发者ID:markmanching,项目名称:s3py,代码行数:59,代码来源:__init__.py

示例4: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
        def read(self, stream, resources=None):
            s = StreamReader(stream)
            self.rcol_version = s.u32()

            item_links = [ResourceKey(group=s.u32(), instance=s.u32(), type=s.i32()) for i in range(s.i32())]
            c = s.i32()
            ids = [s.u32() for i in range(c)]
            for i in range(c):
                pass
            pass
开发者ID:markmanching,项目名称:s3py,代码行数:12,代码来源:__init__.py

示例5: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.read_tag(stream)
     self.version = s.u32()
     cLods = s.i32()
     self.bounds.read(stream)
     if self.version >= self.VERSION.EXTENDED:
         self.extra_bounds = [BoundingBox(stream=stream) for i in range(s.i32())]
         self.fade_type = s.u32()
         self.custom_fade_distance = s.f32()
     self.lods = [self.LOD(stream, rcol) for i in range(cLods)]
开发者ID:markmanching,项目名称:s3py,代码行数:13,代码来源:geometry.py

示例6: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.read_tag(stream)
     self.version = s.u32()
     self.parameter_index = s.i32()
     for item_index in range(s.i32()):
         item = self.Item()
         item.value = s.u32()
         for action_index in range(s.i32()):
             item.actions.append(rcol.get_block(s.u32(), DecisionGraphNode.get_node_types()))
         self.items.append(item)
     assert s.u32() == DEADBEEF
     DecisionGraphNode.read(self, stream, rcol)
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:jazz.py

示例7: read_data

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_data(self, stream, keys=None):
     s = StreamReader(stream)
     if self.type_code == self.TYPE.FLOAT:
         return s.f32() if self.size32 == 1 else [s.f32() for i in range(self.size32)]
     if self.type_code == self.TYPE.INT:
         return s.i32() if self.size32 == 1 else[s.i32() for i in range(self.size32)]
     if self.type_code == self.TYPE.TEXTURE:
         if self.size32 == 4:
             val = keys.get_resource(s.u32())
             stream.seek(12, SEEK_CUR)
             return val
         elif self.size32 == 5:
             key = s.tgi('ITG')
             stream.seek(4, SEEK_CUR)
             return key
开发者ID:markmanching,项目名称:s3py,代码行数:17,代码来源:material.py

示例8: read_presets

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_presets(cls,stream,resources=None):
     s = StreamReader(stream)
     c = s.i32()
     ce = ComplateEncoder()
     presets = []
     for i in range(c):
         preset = cls.BuildBuyPreset()
         preset.unk1 = s.i8()
         if preset.unk1 != 1:
             preset.unk2 = s.i32()
         preset_ptr = StreamPtr.begin_read(s,relative=True,offset_start=True)
         preset.complate = ce.deserialize(stream,resources)
         preset_ptr.end()
         preset.id = s.u32()
         presets.append(preset)
     return presets
开发者ID:markmanching,项目名称:s3py,代码行数:18,代码来源:catalog.py

示例9: read_property

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_property(self, stream, hash, tgi):
     s = StreamReader(stream)
     id = s.u32()
     value = None
     if not id:
         return False
     if not s.u8():
         t = s.u8()
         if   t == 0x00: value = bool(s.u8())
         elif t == 0x01: value = s.i8()
         elif t == 0x02: value = s.i16()
         elif t == 0x03: value = s.i32()
         elif t == 0x04: value = s.i64()
         elif t == 0x05: value = s.u8()
         elif t == 0x06: value = s.u16()
         elif t == 0x07: value = s.u32()
         elif t == 0x08: value = s.u64()
         elif t == 0x09: value = s.f32()
         elif t == 0x0A: value = [s.f32() for i in range(4)]
         elif t == 0x0B: value = [s.f32() for i in range(4)]
         elif t == 0x0C: value = tgi.get_resource(s.u8())
         elif t == 0x0D: value = s.p16()
         else: raise Exception("Unknown TXTC parameter type %s" % t)
     hash[id] = value
     return True
开发者ID:markmanching,项目名称:s3py,代码行数:27,代码来源:material.py

示例10: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
    def read(self, stream, resources=None):
        s = StreamReader(stream)
        self.version = s.u32()

        use_tgi = not isinstance(resources, TGIList)
        tgi = resources
        if use_tgi:
            tgi = TGIList(order='IGT', use_length=False, package=resources, count_size=8)
            tgi.begin_read(stream)

        if self.version >= 7:
            cFabrics = s.i8()
            for fabric_index in range(cFabrics):
                key = tgi.get_resource(s.u8())
                fabric = TextureCompositor(key)
                fabric_len = s.u32()
                with BytesIO() as fabric_stream:
                    fabric_stream.write(stream.read(fabric_len))
                    fabric_stream.seek(0, SEEK_SET)
                    fabric.read(fabric_stream, tgi)
                self.fabrics.append(fabric)
        self.target_size = s.u32()
        self.part_type = s.u32()
        assert s.u8() == 0
        cSteps = s.i32()
        if self.version >= 0x08:
            assert s.u8() == 0
        self.steps = []
        for step_index in range(cSteps):
            self.steps.append(self.read_step(stream, tgi))
        if use_tgi:
            tgi.end_read(stream)
        else:
            assert s.u32() == 0
开发者ID:markmanching,项目名称:s3py,代码行数:36,代码来源:material.py

示例11: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.version = s.u32()
     self.deltas = {}
     c = s.i32()
     for i in range(c):
         hsh = s.hash()
         self.deltas[hsh] = self.Delta(stream)
     pass
开发者ID:markmanching,项目名称:s3py,代码行数:11,代码来源:rig.py

示例12: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.read_tag(stream)
     self.version = s.u32()
     self.framerate = s.f32()
     cFrames = s.i32()
     offsets = [s.u32() for i in range(cFrames)]
     offsets.append(-1)
     for frame_index in range(cFrames):
         offset = offsets[frame_index]
         next = offsets[frame_index + 1]
         cBytes = next - offset if next > 0 else -1
         data = stream.read(cBytes)
         self.frames.append(data)
开发者ID:markmanching,项目名称:s3py,代码行数:16,代码来源:material.py

示例13: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import i32 [as 别名]
 def read(self, stream, resource=None):
     s = StreamReader(stream)
     self.version_major = s.u32()
     self.version_minor = s.u32()
     cBones = s.i32()
     self.bones = []
     opposites = []
     parents = []
     self.__hashes = {}
     for i in range(cBones):
         bone = Bone(self)
         bone.position = [s.f32() for i in range(3)]
         bone.orientation = [s.f32() for i in range(4)]
         bone.scale = [s.f32() for i in range(3)]
         bone.name = s.p32()
         opposites.append(s.i32())
         parents.append(s.i32())
         hash_name = s.u32()
         if not hash_name == FNV32.hash(bone.name):
             print("WARNING: Bone %s should have matching hash 0x%08X, but has 0x%08X",bone.name, FNV32.hash(bone.name),hash_name)
         self.__hashes[hash] = bone
         bone.flags = s.u32()
         self.bones.append(bone)
     for bone_index, opposite_index in enumerate(opposites):
         if opposite_index >= 0:
             self.bones[bone_index].opposite = self.bones[opposite_index]
     for bone_index, parent_index in enumerate(parents):
         if parent_index >= 0:
             self.bones[bone_index].parent = self.bones[parent_index]
     if self.version_major >= 4: self.name = s.p32()
     self.ik_chains = []
     cChains = s.i32()
     for i in range(cChains):
         chain = IKChain(self)
         chain.read(stream)
         self.ik_chains.append(chain)
开发者ID:markmanching,项目名称:s3py,代码行数:38,代码来源:rig.py


注:本文中的s3py.io.StreamReader.i32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。