def addTexture(self): tex = m2.Texture() self.m2.textures.append(tex) lu = m2.Lookup() lu.Id = self.m2.hdr.textures.count self.m2.tex_lookup.append(lu) self.comboBox.addItem(str(self.m2.hdr.textures.count)) self.m2.hdr.textures.count += 1 self.m2.hdr.tex_lookup.count += 1
def addAttachment(self,parbone = 0): att = m2.Attachment() att.Enabled.type = m2.DATA_INT att.bone = parbone lu = m2.Lookup() lu.Id = self.m2.hdr.attachments.count self.m2.attach_lookup.append(lu) self.m2.attachments.append(att) self.comboBox.addItem(str(self.m2.hdr.attachments.count)+": "+attachment_types[self.m2.attachments[self.m2.hdr.attachments.count].Id]) self.m2.hdr.attachments.count += 1 self.m2.hdr.attach_lookup.count += 1
def addTransparency(self): tr = m2.Transparency() tr.alpha.type = m2.DATA_SHORT tl = m2.Lookup() tl.Id = self.m2.hdr.transparency.count self.comboBox.addItem(str(len(self.m2.transparency))) self.m2.transparency.append(tr) self.m2.hdr.transparency.count += 1 self.m2.trans_lookup.append(tl) self.m2.hdr.trans_lookup.count += 1
def adduvanimation(self): tr = m2.UVAnimation() tr.translation.type = m2.DATA_VEC3 tr.scaling.type = m2.DATA_VEC3 tr.rotation.type = m2.DATA_QUAT tl = m2.Lookup() tl.Id = self.m2.hdr.uv_anim.count self.comboBox.addItem(str(len(self.m2.uv_anim))) self.m2.uv_anim.append(tr) self.m2.hdr.uv_anim.count += 1 self.m2.uv_anim_lookup.append(tl) self.m2.hdr.uv_anim_lookup.count += 1
def addBone(self): b = m2.Bone() b.translation.type = m2.DATA_VEC3 b.scaling.type = m2.DATA_VEC3 b.rotation.type = m2.DATA_QUAT lu = m2.Lookup() lu.Id = self.m2.hdr.bones.count self.m2.bones.append(b) self.m2.bone_lookup.append(lu) self.comboBox.addItem(str(self.m2.hdr.bones.count)+": "+KeyBoneTypes[self.m2.bones[self.m2.hdr.bones.count].KeyBoneId]) self.m2.hdr.bones.count += 1 self.m2.hdr.bone_lookup.count += 1