本文整理汇总了Python中s3py.io.StreamReader.tgi方法的典型用法代码示例。如果您正苦于以下问题:Python StreamReader.tgi方法的具体用法?Python StreamReader.tgi怎么用?Python StreamReader.tgi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s3py.io.StreamReader
的用法示例。
在下文中一共展示了StreamReader.tgi方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import tgi [as 别名]
def read_rcol(self, stream, rcol):
self.read_tag(stream)
s = StreamReader(stream)
self.version = s.u32()
self.rig.key = s.tgi('ITG')
self.unknown = s.f32()
for i in range(self.RESERVED_COUNT): self.reserved[i] = s.u8()
cValues = s.u32()
self.bone_weights = [0.0] * cValues
for i in range(cValues): self.bone_weights[i] = s.f32()
示例2: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import tgi [as 别名]
def read_rcol(self, stream, rcol):
s = StreamReader(stream)
self.read_tag(stream)
self.version = s.u32()
self.actor = rcol.get_block(s.u32(), ActorDefinition)
self.parameter = s.u32()
self.prop = s.tgi('ITG')
for i in range(4):
assert s.u32() == 0
MulticastDecisionGraphNode.read(self, stream, rcol)
示例3: read_data
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import tgi [as 别名]
def read_data(self, stream, keys=None):
s = StreamReader(stream)
if self.type_code == self.TYPE.FLOAT:
return s.f32() if self.size32 == 1 else [s.f32() for i in range(self.size32)]
if self.type_code == self.TYPE.INT:
return s.i32() if self.size32 == 1 else[s.i32() for i in range(self.size32)]
if self.type_code == self.TYPE.TEXTURE:
if self.size32 == 4:
val = keys.get_resource(s.u32())
stream.seek(12, SEEK_CUR)
return val
elif self.size32 == 5:
key = s.tgi('ITG')
stream.seek(4, SEEK_CUR)
return key
示例4: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import tgi [as 别名]
def read(self, stream, resource=None):
s = StreamReader(stream)
self.version = s.u32()
tgi = TGIList(use_length=self.version >= 7, add_eight=True)
tgi.begin_read(stream)
self.part_name = s.s7(16, '>')
self.blend_type = s.u32()
if self.version >= 8:
key = s.tgi()
bgeo = ExternalResource(key=key)
self.blend_geometry = bgeo
cEntries = s.i32()
for i in range(cEntries):
entry = self.RegionEntry()
entry.region_flags = s.u32()
entry.geom_entries = [self.GeomEntry(stream, tgi) for i in range(s.i32())]
entry.bone_entries = [self.BoneEntry(stream, tgi) for i in range(s.i32())]
self.entries.append(entry)
tgi.end_read(stream)