本文整理汇总了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])
示例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)
示例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
示例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)