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


Python StreamWriter.u32方法代码示例

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


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

示例1: write

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

        tgi = resources
        use_tgi = not isinstance(tgi, TGIList)
        if use_tgi:
            tgi = TGIList(order='IGT', use_length=False, package=resources, count_size=8)
            tgi.begin_write(self, stream)
        if self.version >= 7:
            s.i8(len(self.fabrics))
            for fabric in self.fabrics:
                s.i8(tgi.get_resource_index(fabric))
                fabric_len = 0
                with BytesIO() as fabric_stream:
                    fabric.write(fabric_stream, tgi)
                    s.u32(fabric_stream.tell())
                    fabric_stream.seek(0, SEEK_SET)
                    stream.write(fabric_stream.read(-1))
            s.u32(self.target_size)
            s.u32(self.part_type)
            s.u8(0)
            s.i32(len(self.steps))
            if self.version >= 0x08:
                s.u8(0)
            for step in self.steps:
                self.write_step(stream, tgi, step)
        if use_tgi:
            tgi.end_read(stream)
        else:
            s.u32(0)
开发者ID:markmanching,项目名称:s3py,代码行数:33,代码来源:material.py

示例2: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
    def write(self, stream, resources=None):
        s = StreamWriter(stream)
        s.u32(self.version)
        tgi = TGIList()
        tgi.begin_write(stream)
        if self.version >= 0x00000007:
            ProductBase.write_presets(stream,self.presets,tgi)
        self.product_info.write(stream,tgi)

        s.i32(tgi.get_resource_index(self.model))
        s.i32(tgi.get_resource_index(self.diagonal_model))
        s.i32(tgi.get_resource_index(self.post_model))
        s.i32(self.post_tile_spacing)
        s.i8(1 if self.can_walk_over else 0)

        if self.version >= 0x00000008:
            if self.version >= 0x0000000A:
                s.i8(1 if self.should_not_get_thick_snow else 0)
                s.i8(1 if self.snow_post_shape_is_circle else 0)
                s.f32(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.i8(1 if self.has_wall else 0)
            if self.version < 0x0000000A or self.has_wall:
                s.i8(1 if self.raise_fence_geometry_above_wall else 0)
                s.i32(tgi.get_resource_index(self.wall))
        tgi.end_write(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:30,代码来源:catalog.py

示例3: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     s.u32(self.index)
     s.zs(self.slot_target_namespace)
     for i in range(511 - len(self.slot_target_namespace)): s.u8(0x23)
     s.zs(self.slot_target_bone)
     for i in range(511 - len(self.slot_target_bone)): s.u8(0x23)
开发者ID:markmanching,项目名称:s3py,代码行数:9,代码来源:__init__.py

示例4: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     keys = self.names.keys()
     s.u32(len(keys))
     for key in keys:
         s.u64(key)
         s.p32(self.names[key])
开发者ID:markmanching,项目名称:s3py,代码行数:9,代码来源:package.py

示例5: write_rcol

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

        def write_names(slots):
            for slot in slots: s.hash(slot.name)

        def write_bones(slots):
            for slot in slots: s.hash(slot.bone_name)

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

        def write_offsets(slots):
            if any(slots):
                s.i32(len(list(filter(lambda slot: slot.offset != None, slots))))
                for i, slot in enumerate(slots):
                    if slot.offset != None:
                        s.i32(i)
                        for i in range(3): s.i32(slot.offset.position)
                        for i in range(3): s.i32(slot.offset.rotation)

        self.write_tag(stream)
        s.u32(self.version)
        s.i32(len(self.routing_slots))
        s.i32(len(self.container_slots))
        s.i32(len(self.effect_slots))
        s.i32(len(self.target_slots))
        s.i32(len(self.cone_slots))

        write_names(self.routing_slots)
        write_bones(self.routing_slots)
        write_transforms(self.routing_slots)
        write_offsets(self.routing_slots)

        write_names(self.container_slots)
        write_bones(self.container_slots)
        for slot in self.container_slots:
            s.u32(slot.flags)
        write_transforms(self.container_slots)
        write_offsets(self.container_slots)

        write_names(self.effect_slots)
        write_bones(self.effect_slots)
        write_transforms(self.effect_slots)
        write_offsets(self.effect_slots)

        write_names(self.target_slots)
        write_bones(self.target_slots)
        write_transforms(self.target_slots)
        write_offsets(self.target_slots)

        write_names(self.cone_slots)
        write_bones(self.cone_slots)
        write_transforms(self.cone_slots)
        for slot in self.cone_slots:
            s.f32(slot.radius)
            s.f32(slot.angle)
        write_offsets(self.cone_slots)
开发者ID:markmanching,项目名称:s3py,代码行数:61,代码来源:__init__.py

示例6: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     s.chars(self.TAG)
     s.u32(self.version)
     cBlends = len(self.blends)
     cLods = 0
     if cBlends:
         len(self.blends[0].lods)
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:geometry.py

示例7: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write(self, stream, resource=None):
     s = StreamWriter(stream)
     s.u32(self.type)
     for i in range(3): s.f32(self.origin[i])
     for i in range(3): s.f32(self.normal[i])
     for i in range(3): s.f32(self.x_axis[i])
     for i in range(3): s.f32(self.y_axis[i])
     s.f32(self.pair_offset)
开发者ID:markmanching,项目名称:s3py,代码行数:10,代码来源:lights.py

示例8: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     self.write_tag(stream)
     s.u32(self.version)
     s.u32(rcol.get_block_index(self.target))
     s.u32(self.operation)
     s.u32(self.operand)
     for i in range(3): s.u32(0)
     MulticastDecisionGraphNode.write(self, stream, rcol)
开发者ID:markmanching,项目名称:s3py,代码行数:11,代码来源:jazz.py

示例9: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     s.u32(self.version)
     s.i32(len(self.deltas))
     for delta in self.deltas:
         s.hash(delta.bone_name)
         for i in range(3): s.f32(delta.offset[i])
         for i in range(3): s.f32(delta.scale[i])
         for i in range(4): s.f32(delta.rotation[i])
开发者ID:markmanching,项目名称:s3py,代码行数:11,代码来源:geometry.py

示例10: write_rcol

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

        for hash in self.deltas:
            delta = self.deltas[hash]
            s.u32(hash)
            delta.write(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:11,代码来源:rig.py

示例11: write_rcol

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write_rcol(self, stream, rcol):
     s = StreamWriter(stream)
     self.write_tag(stream)
     s.u32(self.version)
     s.f32(self.framerate)
     cFrames = len(self.frames)
     s.i32(cFrames)
     data_pos = stream.tell() + (cFrames * 4)
     for frame in self.frames:
         s.u32(data_pos)
         data_pos += len(frame)
     for frame in self.frames:
         stream.write(frame)
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:material.py

示例12: write_property

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
    def write_property(self, stream, key, value, tgi):
        s = StreamWriter(stream)
        s.u32(key)
        if value is None:
            s.i8(1)
            return
        else:
            s.i8(0)
            if isinstance(value, bool):
                s.i8(0)
                s.u8(value)

        pass
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:material.py

示例13: write_presets

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u32 [as 别名]
 def write_presets(cls, stream,presets, resources):
     s = StreamWriter(stream)
     s.i32(len(presets))
     ce = ComplateEncoder()
     for preset in presets:
         assert isinstance(preset,cls.BuildBuyPreset)
         s.i8(preset.unk1)
         if preset.unk1 != 1:
             s.i32(preset.unk2)
         preset_ptr = StreamPtr.begin_write(s)
         ce.serialize(preset.complate,stream,resources)
         preset_ptr.end()
         s.u32(preset.id)
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:catalog.py


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