本文整理汇总了Python中s3py.io.StreamWriter.u8方法的典型用法代码示例。如果您正苦于以下问题:Python StreamWriter.u8方法的具体用法?Python StreamWriter.u8怎么用?Python StreamWriter.u8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s3py.io.StreamWriter
的用法示例。
在下文中一共展示了StreamWriter.u8方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write(self, stream, resource=None):
s = StreamWriter(stream)
s.u32(self.ID)
s.u32(0)
clip_stream = BytesIO()
self.clip.write(clip_stream)
s.u32(clip_stream.tell())
clip_stream.seek(0, SEEK_SET)
clip_ptr = StreamPtr.begin_write(s, True)
ik_ptr = StreamPtr.begin_write(s, True)
actor_ptr = StreamPtr.begin_write(s, True)
event_ptr = StreamPtr.begin_write(s, True)
s.u32(self.unknown1)
s.u32(self.unknown2)
vector_ptr = StreamPtr.begin_write(s, True)
for i in range(16): s.u8(self.unknown3[i])
clip_ptr.end()
stream.write(clip_stream.read())
s.align(char=self.PADDING_CHAR)
if self.ik_info is not None:
ik_ptr.end()
self.ik_info.write(stream)
s.align(char=self.PADDING_CHAR)
actor_ptr.end()
s.zs(self.actor_name)
s.align(char=self.PADDING_CHAR)
event_ptr.end()
self.event_table.write(stream)
s.align(char=self.PADDING_CHAR)
vector_ptr.end()
for i in range(4): s.f32(self.vector[i])
示例2: write
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [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)
示例3: write_rcol
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write_rcol(self, stream, rcol):
self.write_tag(stream)
s = StreamWriter(stream)
s.u32(self.version)
s.tgi(self.rig.key, 'ITG')
s.f32(self.unknown)
for i in range(self.RESERVED_COUNT): s.u8(self.reserved[i])
s.u32(len(self.bone_weights))
for val in self.bone_weights: s.f32(val)
示例4: write
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write(self, stream, resources=None):
s = StreamWriter(stream)
s.u32(self.version)
tgi = TGIList()
tgi.begin_write(stream)
for shader_key in self.shader_keys: shader_key.write(stream, tgi)
s.u32(tgi.get_resource_index(self.sub_skin_ramp))
s.u32(tgi.get_resource_index(self.tone_ramp))
for texture_key in self.texture_keys: texture_key.write(stream, tgi)
s.u8(self.is_dominant)
示例5: write_property
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [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
示例6: write_rcol
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write_rcol(self, stream, rcol):
self.write_tag(stream)
s = StreamWriter(stream)
s.u32(self.version)
cLights = len(self.lights)
cOccluders = len(self.occluders)
s.u32(4 + (cLights * 128) + (cOccluders * 14))
s.u8(cLights)
s.u8(cOccluders)
s.u16(cOccluders * 14)
for light in self.lights:
start = stream.tell()
light.write_rcol(stream)
end = stream.tell()
size = end - start
blank = 128 - size
dwords = int(blank / 4)
for i in range(int(dwords)): s.u32(0)
for occluder in self.occluders:
occluder.write_rcol(stream)
示例7: write_rcol
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write_rcol(self, stream, rcol):
self.write_tag(stream)
s = StreamWriter(stream)
s.u32(self.version)
s.i32(self.stride)
s.i32(len(self.declarations))
s.u32(1 if self.is_extended_format else 0)
for declaration in self.declarations:
if self.is_extended_format:
s.u32(declaration.usage)
s.u32(declaration.usage_index)
s.u32(declaration.format)
s.u32(declaration.offset)
else:
s.u8(declaration.usage)
s.u8(declaration.usage_index)
s.u8(declaration.format)
s.u8(declaration.offset)
示例8: write
# 需要导入模块: from s3py.io import StreamWriter [as 别名]
# 或者: from s3py.io.StreamWriter import u8 [as 别名]
def write(self, stream, resource=None):
s = StreamWriter(stream)
s.u32(self.usage)
s.u32(self.type)
s.u8(self.size)