def write_rcol(self, stream, rcol): s = StreamWriter(stream) self.write_tag(stream) s.u32(self.version) s.tgi(self.clip, 'ITG') s.tgi(self.track_mask, 'ITG') s.i32(len(self.actor_slots)) s.u32(0) s.u32(0) s.u32(0) for actor_slot in self.actor_slots: actor_slot.write(stream) s.i32(len(self.actor_iks)) for actor_ik in self.actor_iks: actor_ik.write(stream) s.u32(DEADBEEF) s.tgi(self.additive_clip) s.p32(self.clip_pattern, size=16) s.align() s.p32(self.additive_clip_pattern, size=16) s.align() s.u32(DEADBEEF) AnimationNode.write_rcol(self, stream, rcol)
def write(self, stream, resources=None): s = StreamWriter(stream) s.u16(self.TAG) s.u32(self.id) s.f32(self.time_code) s.f32(self.unknown1) s.f32(self.unknown2) s.u32(self.unknown3) s.u32(len(self.name)) s.zs(self.name) s.align()
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])
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 != 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])