Page 1 of 1

Unknown face index type..

Posted: Fri Dec 26, 2014 3:47 am
by TGE
I'm writing a MaxScript for a relatively simple format, but I can't figure out how to get the faces.
http://pastebin.com/1KjEw8TV
That's what they look like when I log them.
I attached the script and some samples.
MH_SKN.7z
I must add that they match with the vertex IDs in the weights section.

Re: Unknown face index type..

Posted: Fri Dec 26, 2014 8:00 am
by MichaelDarkAngel
Add one to the faces when you are reading them.

Code: Select all

for x = 1 to DataCount do (
	f1 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	f2 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	f3 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	print (((("f ")+f1 as string)+(" ")+f2 as string)+(" ")+f3 as string)
	append UV_Array [tu,tv,0]
 	append Face_Array [f1,f2,f3]
)
MaxScript array indexes are one-based not zero-based.

--MDA

Re: Unknown face index type..

Posted: Fri Dec 26, 2014 2:02 pm
by TGE
MichaelDarkAngel wrote:Add one to the faces when you are reading them.

Code: Select all

for x = 1 to DataCount do (
	f1 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	f2 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	f3 = (readlong f)+1
	tu = readfloat f
	tv = (readfloat f)*-1
	print (((("f ")+f1 as string)+(" ")+f2 as string)+(" ")+f3 as string)
	append UV_Array [tu,tv,0]
 	append Face_Array [f1,f2,f3]
)
MaxScript array indexes are one-based not zero-based.

--MDA
Ah silly me, it was late and for some reason I keep forgetting the simplest of things!
Thank you.