PDA

View Full Version : Automatically centering meshes to origin?


Tavor
01-06-2011, 10:59 AM
I have a max file full of props. Right now, each time I have to export one of them, I have to move the prop to the origin first (otherwise they come into the UDK with odd pivot points). Is there anyway to import props with custom pivot points without having to move them to the origin first?

Mark Dygert
01-06-2011, 11:23 AM
You could probably automate the move to origin and the placement of the pivot point through some simple scripting.

If you're a 3dsmax user. I wrote a simple script that moves the object to the world origin and puts the pivot point in the lowest center point. Feel free to use the "pivot to world zero" script if it works for you or crack it open and change it to something that fits. The script works on whatever you have selected so if you have a scene full of objects you can select it all and with one button it all pops to the world zero point.

http://dl.dropbox.com/u/2336353/SceneCleanUI.jpg
http://www.scriptspot.com/3ds-max/scripts/scene-clean

Bal
01-06-2011, 12:26 PM
Otherwise you could use MoP's awesome OBJ export tool :
http://www.polycount.com/forum/showthread.php?t=62330&page=2

It does FBX (and OBJ if you prefer, but UDK has better compatibility with FBX now) and centers the object on export if you want.
It's perfect for working with UDK, can select all your objects, and one click will export them all perfectly to their own file, ready to be imported to UDK (It puts the objects back where they were afterwards, so you can keep your objects organised however you want in your max scene.

dtschultz
01-06-2011, 01:00 PM
Woah! That's sweet. Thanks for sharing those scripts.

Tavor
01-07-2011, 11:18 AM
Thanks for the responses. Unfortunately I will have to try out MoP's script on my next project. Mark (hehe, same name), I tried out the script, but I couldn't "Ctrl+Z" to get the objects back to their positions.

Mark Dygert
01-07-2011, 11:27 AM
Good idea, I didn't know you wanted to put them back otherwise I would of suggested doing it differently, heh. We use it at work to make sure all of a characters pivot points are set to the correct place before we start skinning or animating so we never need to undo the action. MoP's tool seems like more of what you're looking for anyway.

I have some updating to do to the script, I'll make sure it's ctrl-z friendly in the next update thanks for letting me about that, I forgot to build that into it!

rasmus
01-10-2011, 11:42 PM
I use Keen's Batch Exporter do to the same thing, seems really similar to MoP's: http://www.scriptspot.com/3ds-max/scripts/keens-batch-exporter

Like Bal said, really great for MAX-to-UDK.

S2Engine
01-11-2011, 07:54 AM
Has anyone done anything like this for Maya? I'd be particularly interested if there were a feature to triangulate on export and then undo that as well.

xvampire
01-28-2012, 04:43 PM
I tried ( still learning) to make a simple maxscript, that do 3dsmax pivot as zero world origin export.
download the MS file here
http://www.scriptspot.com/3ds-max/scripts/selected-object-zero-world-3ds-max-export

it allow you to select multiple object as 1 file too :).

maxOps.cloneNodes $ cloneType:#copy newNodes:&nnl
select nnl
$.pos = [0,0,0]
actionMan.executeAction 0 "40373" -- File: Export Selected
actionMan.executeAction 0 "40020" -- Edit: Delete Objects



ps:
any tips how to rename the duplicated object exactly as the original name ( i want "propane" instead of "propane01" )?