xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Use Maxscript To Import Models, [Video Guide]
X360_Guy
post Dec 28 2010, 04:29 AM
Post #1


X-S Enthusiast


Group: Members
Posts: 4
Joined: 7-November 07
Member No.: 361864



thought I'd drop this here, during my free time off during the holidays I wanted to make a video guide on how to use MaxScript aka 3dsmax to import models.

these videos will show you some basics on using maxscript to import data from random binary files...

I'm fairly new to maxscript, or programing in general so please forgive me if I got a thing here or there wrong. tongue.gif

http://www.youtube.com/watch?v=1ORnfYnlXOw
http://www.youtube.com/watch?v=dbPLKe-yMmY
http://www.youtube.com/watch?v=CEwSgXxkZMc
http://www.youtube.com/watch?v=NeQYfxi8KW4

the PMD samples I got from the MikUMikuDance, some PMD were packed with the program.

http://www.geocities.jp/higuchuu4/index_e.htm

and here is the sample script I did in the video

CODE

f = fopen "E:\\Hacking Projects\\PMD\\MEIKO.pmd" "rb"
clearlistener()


fn ReadFixedString bstream fixedLen =
(
    local str = ""
    for i = 1 to fixedLen do
    (
        str0 = ReadByte bstream #unsigned
        if str0!=0xFD AND str0!=0xFC do str+= bit.intAsChar str0
    )
    str
)


Face_array=#()
Vert_array=#()
UV_array=#()


fileName =ReadFixedString f 3
fileVersion=readfloat f
modelName=ReadFixedString f 20
comments=ReadFixedString f 256


count=readlong f #unsigned


for x = 1 to count do(

vx=readfloat f
vy=readfloat f
vz=readfloat f
p4=readfloat f
p5=readfloat f
p6=readfloat f
tu=readfloat f
tv=readfloat f
p9=readshort f
p10=readshort f
p11=readshort f
append Vert_array[vx,vz,vy]
append UV_array[tu,tv,0]
)



count=readlong f #unsigned

print count


for x = 1 to count/3 do(
fa=readshort f #unsigned+1
fb=readshort f #unsigned+1
fc=readshort f #unsigned+1
append Face_array[fc,fb,fa]
)



msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
msh.name=modelName
-- 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]


Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f


User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 18th June 2013 - 10:38 PM