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


Python StreamReader.u32方法代码示例

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


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

示例1: read_property

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [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

示例2: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [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

示例3: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read(self, stream, resources):
     s = StreamReader(stream)
     self.age_gender = s.u32()
     self.edge_color = s.u32()
     self.specular_color = s.u32()
     self.specular_power = s.f32()
     self.is_genetic = bool(s.u8())
开发者ID:markmanching,项目名称:s3py,代码行数:9,代码来源:catalog.py

示例4: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read(self, stream, resources):
     s = StreamReader(stream)
     self.model = resources.get_block(s.u32(), ModelLod)
     self.flags = s.u32()
     self.id = s.u16()
     self.is_sunshadow = bool(s.u16())
     self.min_z = s.f32()
     self.max_z = s.f32()
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:geometry.py

示例5: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.read_tag(stream)
     self.version = s.u32()
     assert s.u32() == 0x00000000
     self.children = [rcol.get_block(s.u32(), DecisionGraphNode.get_node_types()) for i in range(s.i32())]
     self.parents = [rcol.get_block(s.u32(), DecisionGraphNode.get_node_types()) for i in range(s.i32())]
     assert s.u32() == DEADBEEF
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:jazz.py

示例6: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read(self, stream, resource=None):
     s = StreamReader(stream)
     self.version = s.u32()
     cNames = s.u32()
     for i in range(cNames):
         iid = s.u64()
         name = s.p32()
         self.names[iid] = name
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:package.py

示例7: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read(self, stream, resource=None):
     Event.read(self, stream)
     s = StreamReader(stream)
     self.prop_actor_name = s.u32()
     self.object_actor_name = s.u32()
     self.slot_name = s.u32()
     self.unknown4 = s.u32()
     self.matrix = [[s.f32() for i in range(4)] for i in range(4)]
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:__init__.py

示例8: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read_rcol(self, stream, rcol):
     self.read_tag(stream)
     s = StreamReader(stream)
     self.version = s.u32()
     cBones = s.i32()
     names = [s.u32() for i in range(cBones)]
     poses = [s.m43() for pose_index in range(cBones)]
     self.bones = [self.Bone(names[i], poses[i]) for i in range(cBones)]
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:geometry.py

示例9: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [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

示例10: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
 def read_rcol(self, stream, rcol):
     self.read_tag(stream)
     s = StreamReader(stream)
     self.version = s.u32()
     name = s.hash(self.NAMES)
     value = rcol.get_block(s.u32(),(MaterialDefinition, MaterialSet))
     self.default_material = self.Element(name, value)
     self.elements = []
     cItems = s.u32()
     for i in range(cItems):
         value = rcol.get_block(s.u32(), (MaterialDefinition, MaterialSet))
         name = s.hash(self.NAMES)
         self.elements.append(self.Element(name, value))
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:material.py


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