PDA

View Full Version : Exporting many objects each to separate file?


Strob
03-01-2006, 12:08 AM
Hi!

I have a newbie question about maxscript.

I'm trying to write a very simple script. I want to export all the objects in my scene to separate files in obj format. the reason is that if I put many objects it becomes too heavy and the exporter destroy my mesh.

So I thought it would go like this:

i select all my objects et execute:

for i in selection do
(
max file export selected
)

But this gives me the unexpected result of exporting many files containing all my objects in each of them (each obj file contains ALL the object instead of just one...)


thanx in advance for helping

CarlosA
03-01-2006, 12:38 PM
try it like this

for i in selection do
(
max file export i
)

little typo.
cheers,
Los.

handiklap
03-01-2006, 02:39 PM
Carlos' script would work, but it would be a real pain for exporting more than a few objects, having to type in a filename for each one. If you're dealing with more than a few objects (with unique names), you might try:

exportArray = $ as array
for obj in exportArray do
(
select obj
exportFile (obj.name + ".OBJ") #noPrompt selectedOnly:true
)

like I said, they must have unique names to work, otherwise you'll just be overwriting some. however, some renaming could be easily done if you don't have unique names.

Strob
03-01-2006, 04:19 PM
Hi!


Thanks handiklap that's the way to do it!!!

CGTalk Moderation
03-01-2006, 04:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.