本文整理汇总了Python中s3py.io.StreamReader.u32方法的典型用法代码示例。如果您正苦于以下问题:Python StreamReader.u32方法的具体用法?Python StreamReader.u32怎么用?Python StreamReader.u32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s3py.io.StreamReader
的用法示例。
在下文中一共展示了StreamReader.u32方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_property
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read_property(self, stream, hash, tgi):
s = StreamReader(stream)
id = s.u32()
value = None
if not id:
return False
if not s.u8():
t = s.u8()
if t == 0x00: value = bool(s.u8())
elif t == 0x01: value = s.i8()
elif t == 0x02: value = s.i16()
elif t == 0x03: value = s.i32()
elif t == 0x04: value = s.i64()
elif t == 0x05: value = s.u8()
elif t == 0x06: value = s.u16()
elif t == 0x07: value = s.u32()
elif t == 0x08: value = s.u64()
elif t == 0x09: value = s.f32()
elif t == 0x0A: value = [s.f32() for i in range(4)]
elif t == 0x0B: value = [s.f32() for i in range(4)]
elif t == 0x0C: value = tgi.get_resource(s.u8())
elif t == 0x0D: value = s.p16()
else: raise Exception("Unknown TXTC parameter type %s" % t)
hash[id] = value
return True
示例2: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read(self, stream, resources=None):
s = StreamReader(stream)
self.version = s.u32()
use_tgi = not isinstance(resources, TGIList)
tgi = resources
if use_tgi:
tgi = TGIList(order='IGT', use_length=False, package=resources, count_size=8)
tgi.begin_read(stream)
if self.version >= 7:
cFabrics = s.i8()
for fabric_index in range(cFabrics):
key = tgi.get_resource(s.u8())
fabric = TextureCompositor(key)
fabric_len = s.u32()
with BytesIO() as fabric_stream:
fabric_stream.write(stream.read(fabric_len))
fabric_stream.seek(0, SEEK_SET)
fabric.read(fabric_stream, tgi)
self.fabrics.append(fabric)
self.target_size = s.u32()
self.part_type = s.u32()
assert s.u8() == 0
cSteps = s.i32()
if self.version >= 0x08:
assert s.u8() == 0
self.steps = []
for step_index in range(cSteps):
self.steps.append(self.read_step(stream, tgi))
if use_tgi:
tgi.end_read(stream)
else:
assert s.u32() == 0
示例3: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read(self, stream, resources):
s = StreamReader(stream)
self.age_gender = s.u32()
self.edge_color = s.u32()
self.specular_color = s.u32()
self.specular_power = s.f32()
self.is_genetic = bool(s.u8())
示例4: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read(self, stream, resources):
s = StreamReader(stream)
self.model = resources.get_block(s.u32(), ModelLod)
self.flags = s.u32()
self.id = s.u16()
self.is_sunshadow = bool(s.u16())
self.min_z = s.f32()
self.max_z = s.f32()
示例5: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read_rcol(self, stream, rcol):
s = StreamReader(stream)
self.read_tag(stream)
self.version = s.u32()
assert s.u32() == 0x00000000
self.children = [rcol.get_block(s.u32(), DecisionGraphNode.get_node_types()) for i in range(s.i32())]
self.parents = [rcol.get_block(s.u32(), DecisionGraphNode.get_node_types()) for i in range(s.i32())]
assert s.u32() == DEADBEEF
示例6: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [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
示例7: read
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read(self, stream, resource=None):
Event.read(self, stream)
s = StreamReader(stream)
self.prop_actor_name = s.u32()
self.object_actor_name = s.u32()
self.slot_name = s.u32()
self.unknown4 = s.u32()
self.matrix = [[s.f32() for i in range(4)] for i in range(4)]
示例8: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read_rcol(self, stream, rcol):
self.read_tag(stream)
s = StreamReader(stream)
self.version = s.u32()
cBones = s.i32()
names = [s.u32() for i in range(cBones)]
poses = [s.m43() for pose_index in range(cBones)]
self.bones = [self.Bone(names[i], poses[i]) for i in range(cBones)]
示例9: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read_rcol(self, stream, rcol):
s = StreamReader(stream)
self.read_tag(stream)
self.version = s.u32()
self.routing_slots = [RoutingSlot() for i in range(s.i32())]
self.container_slots = [ContainerSlot() for i in range(s.i32())]
self.effect_slots = [EffectSlot() for i in range(s.i32())]
self.target_slots = [TargetSlot() for i in range(s.i32())]
self.cone_slots = [ConeSlot() for i in range(s.i32())]
def read_names(slots):
for slot in slots: slot.name = s.hash(Slot.NAMES)
def read_bones(slots):
for slot in slots: slot.bone_name = s.u32()
def read_transforms(slots):
for slot in slots: slot.transform = s.m43()
def read_offsets(slots):
if any(slots):
for i in range(s.i32()):
slots[i].offset = SlotOffset([s.f32(), s.f32(), s.f32()], [s.f32(), s.f32(), s.f32()])
pass
pass
read_names(self.routing_slots)
read_bones(self.routing_slots)
read_transforms(self.routing_slots)
read_offsets(self.routing_slots)
read_names(self.container_slots)
read_bones(self.container_slots)
for slot in self.container_slots:
slot.flags = s.u32()
read_transforms(self.container_slots)
read_offsets(self.container_slots)
read_names(self.effect_slots)
read_bones(self.effect_slots)
read_transforms(self.effect_slots)
read_offsets(self.effect_slots)
read_names(self.target_slots)
read_bones(self.target_slots)
read_transforms(self.target_slots)
read_offsets(self.target_slots)
read_names(self.cone_slots)
read_bones(self.cone_slots)
read_transforms(self.cone_slots)
for cone_slot in self.cone_slots:
cone_slot.radius = s.f32()
cone_slot.angle = s.f32()
read_offsets(self.cone_slots)
pass
示例10: read_rcol
# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import u32 [as 别名]
def read_rcol(self, stream, rcol):
self.read_tag(stream)
s = StreamReader(stream)
self.version = s.u32()
name = s.hash(self.NAMES)
value = rcol.get_block(s.u32(),(MaterialDefinition, MaterialSet))
self.default_material = self.Element(name, value)
self.elements = []
cItems = s.u32()
for i in range(cItems):
value = rcol.get_block(s.u32(), (MaterialDefinition, MaterialSet))
name = s.hash(self.NAMES)
self.elements.append(self.Element(name, value))