|
Author
|
Topic: Export from 3DSMax centered around origin
|
Tailslide Pilot
|
posted 01-04- 04:20 AM
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
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
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
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
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
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
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
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
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 | |