This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Question] I need help with this script  (Read 1058 times)

detonatorss

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 233
    • View Profile
[Question] I need help with this script
« on: April 04, 2012, 11:42:12 am »
hello to everyone i nned help for this script that i founded into pastebin can anyone help me ¿?

Script:

import four.m2 as CataM2
import four.skin as CataSkin
from pym2_3.m2 import *
from pym2_3.skin import *

cata = CataM2.M2File("Male\GoblinMale.M2")
cataskin = CataSkin.SkinFile("Male\GoblinMale00.skin")

wotlk = M2File()
wotlk.hdr = cata.hdr
#change header version
wotlk.hdr.version = 264
wotlk.name = cata.name
wotlk.gSequ = cata.gSequ
wotlk.animations = cata.animations
wotlk.anim_files = cata.anim_files
wotlk.anim_lookup = cata.anim_lookup
wotlk.bones = cata.bones
wotlk.key_bones = cata.key_bones
wotlk.vertices = cata.vertices
wotlk.colors = cata.colors
wotlk.textures = cata.textures
wotlk.transparency = cata.transparency
wotlk.uv_anim = cata.uv_anim
wotlk.tex_replace = cata.tex_replace
wotlk.renderflags = cata.renderflags
wotlk.bone_lookup = cata.bone_lookup
wotlk.tex_lookup = cata.tex_lookup
#wotlk.tex_units = cata.tex_units #no
#add texunit
tu = Lookup()
tu.Id = 0
wotlk.tex_units.append(tu)
wotlk.hdr.tex_units.count += 1

wotlk.trans_lookup = cata.trans_lookup
wotlk.uv_anim_lookup = cata.uv_anim_lookup
wotlk.bounding_triangles = cata.bounding_triangles
wotlk.bounding_vertices = cata.bounding_vertices
wotlk.bounding_normals = cata.bounding_normals
wotlk.attachments = cata.attachments
wotlk.attach_lookup = cata.attach_lookup
wotlk.events = cata.events
wotlk.lights = cata.lights
#wotlk.cameras = cata.cameras #no
for i in cata.cameras:
   t = Camera()
   t.Type = i.Type
   t.FOV = i.UnkAnim.KeySubs[0].values[0]
   t.FarClip = i.FarClip
   t.NearClip = i.NearClip
   t.TransPos = i.TransPos
   t.Pos = i.Pos
   t.TransTar = i.TransTar
   t.Target = i.Target
   t.Scaling = i.Scaling
   wotlk.cameras.append(t)
wotlk.camera_lookup = cata.camera_lookup
wotlk.ribbon_emitters = cata.ribbon_emitters
wotlk.particle_emitters = cata.particle_emitters

wotlkskin = SkinFile()
wotlkskin.header = cataskin.header
wotlkskin.indices = cataskin.indices
wotlkskin.tri = cataskin.tri
wotlkskin.prop = cataskin.prop
wotlkskin.mesh = cataskin.mesh
wotlkskin.texunit = cataskin.texunit
for i in wotlkskin.texunit:
   i.texunit = 0


wotlk.write("WMale\GoblinMale.m2")
wotlkskin.write("WMale\GoblinMale00.skin")
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Desktop


Laptop

detonatorss

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 233
    • View Profile
Re: [Question] I need help with this script
« Reply #1 on: April 04, 2012, 04:26:54 pm »
How I Use the Script ?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Desktop


Laptop