FSIC Messageboard
  Old Tech Info
  Export from 3DSMax centered around origin

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Export from 3DSMax centered around origin
Tailslide
Pilot
posted 01-04- 04:20 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote

Aha finally figured out a shortcut for this!

Make a maxscript file like this:

$LWing.pos = [0,0,0]
$RWing.pos = [0,0,0]

With all your object names in it. Just run the script to make all your object centered around the origin! (Make sure to save the .max file first since you only want it like this for exporting). If you want to get sneaky you could add more code to call up the export plugin and undo all the moves after you export.

TS


------------------
________________________
TS Aircombat

IP: Logged

Tailslide
Pilot
posted 01-04- 05:23 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote
Here's the script I use to center all my yak parts, export them, then move them back to their original places. Make sure to do a move pivot to object center from the heirarchy tab for each object in your model so the objects center properly. If I was better at MaxScript I'd come up with a general purpose script that works on any object but this does what I need :


LWTip = $LWTip.pos
$LWTip.pos = [0,0,0]
RWTip = $RWTip.pos
$RWTip.pos = [0,0,0]
LAileron = $LAileron.pos
$LAileron.pos = [0,0,0]
RAileron = $RAileron.pos
$RAileron.pos = [0,0,0]
LWing = $LWing.pos
$LWing.pos = [0,0,0]
RWing = $RWing.pos
$RWing.pos = [0,0,0]
Canopy = $Canopy.pos
$Canopy.pos = [0,0,0]
Fuselage = $Fuselage.pos
$Fuselage.pos = [0,0,0]
Tail = $Tail.pos
$Tail.pos = [0,0,0]
RHStab = $RHStab.pos
$RHStab.pos = [0,0,0]
LHStab = $LHStab.pos
$LHStab.pos = [0,0,0]
RElevator= $RElevator.pos
$RElevator.pos = [0,0,0]
LElevator = $LElevator.pos
$LElevator.pos = [0,0,0]
Rudder = $Rudder.pos
$Rudder.pos = [0,0,0]
VStab = $VStab.pos
$VStab.pos = [0,0,0]

max file export

$LWTip.pos = LWTip
$RWTip.pos = RWTip
$LAileron.pos = LAileron
$RAileron.pos = RAileron
$LWing.pos = LWing
$RWing.pos = RWing
$Canopy.pos = Canopy
$Fuselage.pos = Fuselage
$Tail.pos = Tail
$RHStab.pos = RHStab
$LHStab.pos = LHStab
$RElevator.pos = RElevator
$LElevator.pos = LElevator
$Rudder.pos = Rudder
$VStab.pos = VStab


------------------
________________________
TS Aircombat


[This message has been edited by Tailslide (edited 01-04-2000).]

[This message has been edited by Tailslide (edited 01-04-2000).]

IP: Logged

Bryan Russell
Pilot
posted 01-04- 10:42 PM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
Tail,

These things are all collections so I think you could actually iterate through them and make us a nice generic script. I don't know what the collection is called but it would be something like objects[0].pos=[0,0,0]

Does this centre it around the pivot point?

IP: Logged

Tailslide
Pilot
posted 01-05- 02:28 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote
Yup. That's why I suggest centering the pivot point to each object first.

This scripting is really handy, I've got it levelling the wings before export now too. I think you'll find it's alot faster than the way we've been doing it.

TS

[This message has been edited by Tailslide (edited 01-05-2000).]

IP: Logged

Bryan Russell
Pilot
posted 01-05- 06:13 AM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
Tail, your mightly pioneering work in MaxScript inspired me to have another look. I did a more refined version as below


old_pos

for i=1 to objects.count do
(
old_pos[i] = objects[i].pos
objects[i].pos=[0,0,0]
)

exportFile "d:\sdoe\hurricane.obj"

for i=1 to objects.count do
(
objects[i].pos= old_pos[i]
)


This will move each object to the 0,0,0 position, export it with the OBJ2MAX dialogs, and then put them all back.

You can get fancy and use a File Save as dialog to get the exported file name but that MAXScript Help file is punishing enough on the sanity as it is.

You are right, this MAXScript is pretty useful, a pity the help file isn't

[This message has been edited by Bryan Russell (edited 01-05-2000).]

IP: Logged

Tailslide
Pilot
posted 01-05- 06:17 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote

Suhweet !

If you use:

max file export

it opens up a file save as dialog


TS

IP: Logged

Tailslide
Pilot
posted 01-05- 06:20 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote

Is there a way to tag objects so they won't get exported? I've got a lot of bits and pieces lying around in my project, I just want to export the plane parts..

TS

IP: Logged

Bryan Russell
Pilot
posted 01-05- 10:08 AM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
Apperantly r2.5 doesn't support max file export, only max file import and exportFile, wierd!

I think exporting only particular objects is a MAX2OBJ thing, and I don't know how that works even if it does

IP: Logged

Tailslide
Pilot
posted 01-05- 10:10 AM     Click Here to See the Profile for Tailslide   Click Here to Email Tailslide     Edit/Delete Message   Reply w/Quote

My script just exports the parts of my plane and leaves the rest.. oops looks like the one posted in this thread is old, I'll post the newer one when I get done work.

TS

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Fighter Squadron Information Center

(This site Copyright (c) 1999 Inertia LLC)

Powered by Infopop www.infopop.com © 2000
Ultimate Bulletin Board 5.45c