No ""*"" function for undefined- Max script problem

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, I am using 3ds Max 2015 and a custom script to open .skn files(League of Legends 3d models native format). Some skn files I can open and others I cannot. Everytime I can't I get a message-- No ""*"" function for undefined. I never wrote a script nor do I know how to. Is there an easy fix for this or does it require a lot of resources-knowledge to solve?
The script:
/*
League of Legends Maxscript Model Importer
by nightFlarer
A maxscript to import .skn files
*/
fname = getOpenFileName \
caption:"League of Legends Skin Model File" \
types:"League of Legends Skin Model File(*.skn)|*.skn" \
historyCategory:"LeagueofLegendsObjectPresets"
f = fopen fname "rb"
clearlistener()
fn ReadFixedString bstream fixedLen =
(
local str = ""
for i = 1 to fixedLen do
(
str0 = ReadByte bstream #unsigned
str+= bit.intAsChar str0
)
str
)
Face_array=#()
Vert_array=#()
UV_array=#()
--Structure for the Header in skn files
magic=readlong f #unsigned
numMat=readshort f #unsigned
numObj=readshort f #unsigned
--Structure for a material block in skn files
matInd=readlong f #unsigned
charName=ReadFixedString f 64
startVertex=readlong f #unsigned
numVertices=readlong f #unsigned
startIndex=readlong f #unsigned
numIndices=readlong f #unsigned
--data block in skn files
numIndices=readlong f #unsigned
numVertices=readlong f #unsigned
--read faces
for x = 1 to numIndices/3 do(
fa=readshort f #unsigned+1
fb=readshort f #unsigned+1
fc=readshort f #unsigned+1
append Face_array[fc,fb,fa]
)
--read vertices
for x = 1 to numVertices do( -- vertex loop
vx=readfloat f
vy=readfloat f
vz=readfloat f
boneindex=readlong f #unsigned
w1=readfloat f
w2=readfloat f
w3=readfloat f
w4=readfloat f
nx=readfloat f
ny=readfloat f
nz=readfloat f
tu=readfloat f
tv=readfloat f
append Vert_array[vx,vz,vy]
append UV_array[tu,tv*-1+1,0]
)
msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
--convertTo msh PolyMeshObject
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]
rotate msh (angleaxis -180 [0,0,1])
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f
I provided the example files- one that I can view and edit and other I can not.
And since .skn is not a valid extension I can not upload it here so I added a filedropper links(Both files are ~450Kb)