本文整理汇总了Python中s3py.io.StreamReader.p32方法的典型用法代码示例。如果您正苦于以下问题:Python StreamReader.p32方法的具体用法?Python StreamReader.p32怎么用?Python StreamReader.p32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s3py.io.StreamReader
的用法示例。
在下文中一共展示了StreamReader.p32方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import p32 [as 别名]
def read(self, stream, resource=None):
s = StreamReader(stream)
self.version = s.u32()
cNames = s.u32()
for i in range(cNames):
iid = s.u64()
name = s.p32()
self.names[iid] = name
示例2: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import p32 [as 别名]
def read_rcol(self, stream, rcol):
s = StreamReader(stream)
self.read_tag(stream)
self.version = s.u32()
self.clip = ExternalResource(s.tgi('ITG'))
self.track_mask = ExternalResource(s.tgi('ITG'))
cActorSlots = s.i32()
assert s.u32() == 0
assert s.u32() == 0
assert s.u32() == 0
self.actor_slots = [self.SlotAssignment(stream) for i in range(cActorSlots)]
self.actor_iks = [self.NamespaceSlotSuffix(stream) for i in range(s.i32())]
assert s.u32() == DEADBEEF
self.additive_clip = ExternalResource(s.tgi('ITG'))
self.clip_pattern = s.p32(size=16)
s.align()
self.additive_clip_pattern = s.p32(size=16)
s.align()
assert s.u32() == DEADBEEF
AnimationNode.read_rcol(self, stream, rcol)
示例3: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import p32 [as 别名]
def read(self, stream, resource=None):
s = StreamReader(stream)
self.version_major = s.u32()
self.version_minor = s.u32()
cBones = s.i32()
self.bones = []
opposites = []
parents = []
self.__hashes = {}
for i in range(cBones):
bone = Bone(self)
bone.position = [s.f32() for i in range(3)]
bone.orientation = [s.f32() for i in range(4)]
bone.scale = [s.f32() for i in range(3)]
bone.name = s.p32()
opposites.append(s.i32())
parents.append(s.i32())
hash_name = s.u32()
if not hash_name == FNV32.hash(bone.name):
print("WARNING: Bone %s should have matching hash 0x%08X, but has 0x%08X",bone.name, FNV32.hash(bone.name),hash_name)
self.__hashes[hash] = bone
bone.flags = s.u32()
self.bones.append(bone)
for bone_index, opposite_index in enumerate(opposites):
if opposite_index >= 0:
self.bones[bone_index].opposite = self.bones[opposite_index]
for bone_index, parent_index in enumerate(parents):
if parent_index >= 0:
self.bones[bone_index].parent = self.bones[parent_index]
if self.version_major >= 4: self.name = s.p32()
self.ik_chains = []
cChains = s.i32()
for i in range(cChains):
chain = IKChain(self)
chain.read(stream)
self.ik_chains.append(chain)