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


Python StreamWriter.chars方法代码示例

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


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

示例1: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import chars [as 别名]
        def write(self, stream, resource=None):
            """
            """
            s = StreamWriter(stream)
            s.chars(self.MAGIC)
            s.u32(self.major_version)
            s.u32(self.minor_version)
            s.u32(self.unknown1)
            s.u32(self.unknown2)
            s.u32(self.unknown3)
            s.u32(self.date_created)
            s.u32(self.date_modified)

            s.u32(self.index_major_version)
            s.u32(self.index_entry_count)
            s.u32(self.index_entry_offset)
            s.u32(self.index_size)
            s.u32(self.hole_count)
            s.u32(self.hole_offset)
            s.u32(self.hole_size)
            s.u32(self.index_minor_version)

            s.u32(self.index_offset)
            s.u32(self.unknown4)
            for i in range(24): s.u32(self.reserved[i])
开发者ID:markmanching,项目名称:s3py,代码行数:27,代码来源:package.py

示例2: write

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

示例3: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import chars [as 别名]
    def write(self, stream, resources=None):
        s = StreamWriter(stream)
        indexedFloats = []
        curves = []
        curveMap = {}
        for t in self.tracks:
            assert isinstance(t,Track)
            for curve in t:
                assert isinstance(curve,Curve)
                if len(curve.frames) > self.max_frame_count: self.max_frame_count = len(curve.frames) + 1
                cdi = CurveDataInfo()
                curve.flags.static = len(curve.frames) == 0
                cdi.frame_count = len(curve.frames)
                cdi.process_frames(curve.frames)
                cdi.flags = curve.flags
                cdi.type = curve.type
                cdi.track_key = t.track_key
                curveMap[cdi] = curve.frames
                curves.append(cdi)

        cCurves = len(curves)
        cFloats = len(indexedFloats)

        #Begin writing...
        s.chars('_pilC3S_')
        s.u32(self.version)
        s.u32(self.unknown1)
        s.f32(self.frame_duration)
        s.u16(self.max_frame_count)
        s.u16(self.unknown2)

        s.u32(cCurves)
        s.u32(cFloats)
        curveOffset = StreamPtr.begin_write(s)
        frameOffset = StreamPtr.begin_write(s)
        nameOffset = StreamPtr.begin_write(s)
        srcNameOffset = StreamPtr.begin_write(s)

        curveOffset.end()
        for curve in curves:
            curve.write(stream)
        nameOffset.end()
        s.zs(self.name)
        srcNameOffset.end()
        s.zs(self.source_file_name)

        frameOffset.end()
        for curve in curves:
            curve.frame_data_ptr.end()
            frames = curveMap[curve]
            for f in frames: f.write(stream, curve, indexedFloats)
        return self
开发者ID:markmanching,项目名称:s3py,代码行数:54,代码来源:__init__.py

示例4: write

# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import chars [as 别名]
    def write(self, stream, keys):
        items = []
        for key in self.__parameters.keys():
            val = self.__parameters[key]
            item = self.Item(key, val)
            items.append(item)

        s = StreamWriter(stream)
        s.chars(self.TAG_TEXTURES)
        s.u32(0)
        data_len_ptr = stream.tell()
        s.u32(0)
        s.u32(len(items))

        for item in items: item.write_pointer(stream)
        start = stream.tell()
        for item in items: item.write_data(stream, keys)
        end = stream.tell()
        stream.seek(data_len_ptr, SEEK_SET)
        s.u32(end - start)
        stream.seek(end, SEEK_SET)
开发者ID:markmanching,项目名称:s3py,代码行数:23,代码来源:material.py


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