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

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

Anonymous
Not applicable
5,430 Views
2 Replies
Message 1 of 3

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

Anonymous
Not applicable

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)

http://www.filedropper.com/canopen

http://www.filedropper.com/cantopen

0 Likes
5,431 Views
2 Replies
Replies (2)
Message 2 of 3

Steve_Curley
Mentor
Mentor

Most filetypes will not attach - simply Zip them first.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 3

Anonymous
Not applicable

OK. Here they are.

0 Likes