ScriptSpot

Forum topic · Scripts Wanted

3dmax export all selected objects to seperate OBJ files

By techmethod · 2008-12-02

Description

Hi,

I think this would be a very practical and simple script to write. Basically, when I switch from max to zbrush.. I want all objects selected in max, exported to SEPARATE obj files and maybe a prompt to enter in each file name(or possibly a keyword i.e "character" then saves each sequentially character1 character2 etc). This would save quite a bit of time when you have a character with lots of pieces to export.

If you know of a script or are interested in making one like this let me know!

Thanks

JP
techmethod@hotmail.com

Comments (16)

Anton Berg · 2010-03-13

Try the latest version of the script... I have uploaded this to the "normal" scriptspot script bank too... but I thought it would be easier to find here now...

This has some additional features regarding exporting sequences out from max... but in your case just put the sequence to: 1

and set the export format to:
DWG_ExporterExporterPlugin (yes that is the correct name ;-)

when the dwg settings open... DONT uncheck export selected object.. it is checked by default, just keep it like that.

this worked for me when I tried it.

Attachments

renyap · 2010-03-09

is there anyway i can export selected to dwg in maxscript?
i am doing a project regarding to this..
i really appreciate if someone can help

cheers

kutty · 2009-08-17

hi,, i would like to have this script to modification,, little bit,, like while the export should make the object export with the file name instead of the object name in the max, also if possible,, i want to export 6 object defined names which i want to export to specified folder, which should include the path in the script to define,, can anybody help.,,

LukeA · 2009-06-05

Hey I love this script but I am having troubles. It seems to lose the settings I need to get it right in Poser. I have manually exported hundreds of times and into Poser and everything works fine but this script seems to lose some settings so everything comes in real big.

Hopefully this is an easy fix as this script would make life so much easier.

Anton Berg · 2009-05-03

That should be no problem to do.
Is this request still interresting for you?
Could you describe the ideal scenario for you on how it should work.
Should you set a start, end frame, naming convention for frames... other features you need for this to work in your pipline.
If you want a fast reply just drop me a line to my email below.

ddustin · 2009-04-03

Can this be modified to create an obj sequence?

We have a realFlow seg that needs to be converted for a client.
Thanks

Anton Berg · 2009-08-23

I have made a new version of the script that supports exporting obj sequences..

http://scriptspot.com/3ds-max/mass-exporting-of-selected-objects-in-3dsm…

A tip (or bug) for everyone who has difficulties with the first file exported OK but the rest have a different scale or miss some of the settings you did set on the first object.

(someone mentioned importing into POSER).

The reson for this is that If I show the export dialog in 3dsmax and you choose a preset other then "none", then 3dsmax will export that object with thoose settings. But when I don´t show the dialog, max will always export with the settings made in the "None" preset.

Atlest I have not found a way to set that from maxscript.

SO FOR THIS SCRIPT TO WORK PROPERLY WITH OBJ... set your template to NONE, setup the settings you want in the "none" template, and then max will use those for the rest. Else you will end up with a unexpected result.

Mike_W · 2008-12-17

Hi,
the script works great, is it difficult to change it so that it outputs to an acsii format rather than a binary?

even when ascii is selected from the menu it still exports in binary.

If not does anyone know of a converion tool to convert the seperate files into ascii format.

Thanks

Anton Berg · 2008-12-18

I have uploaded a new version that might be a little annoying. Depends on how many objects you wan´t to export.

Tip just hold down the Enter key once you have selected the correct sttings...

-------
OK... this is caused by the same problem as the former issue. Since the export plugin is old and not 100% compatible with the current version of 3dsmax 2009. It doesn´t remember the setting of the Binary/Ascii setting from the first object. It returns to its default value.

But if I display the prompt for every object you export it remembers it. Very strange and stupid. The only half decent thing is that I show you the binary/ascii prompt for every object you export and all you have to do is to press ENTER to continue to the next object.

I am very sorry that I can´t solves nicer right now.
One solution might be to look for another STL exporter plugin for 3dsmax if that exists and hope that it has better maxscript support.

OgmaSoul3D
Anton Berg

Attachments

Anton Berg · 2008-12-15

Thank you for that input.. the first problem is that I forgot to define a variable. That should work now. But the next big problem is that there seems to be a BUG in the exportfile function in 3dsmax.

Certain file formats:
vrbl, stl, iges, htr

Seems to have a problem exporting a objectd with the SelectedOnly state in maxscript. This makes it very difficult to do exactly this script, since I need to select every object in turn and then export every single one.

I had to do a workaround for this and it should work with the Stl format, I am very uncertain for the rest of them.

So test this new script and see if it works!

Attachments

Mike_W · 2008-12-12

Hi,

I have been looking for a script like this for a while. I am however a complete beginner to using/editing these and am having an issue when using it.

I drag the script into 3ds max.
Select the objects i wish to export.
Change the file type to STL
Unselect prefix box
press export, select directory and press ok

An error then appears "no get function for undefined"

What am i doing wrong?

Any help would be much appreciated

Thanks

Anton Berg · 2008-12-10

Ok I made a new version which includes a dropDownlist of all the export formats that you have installed in your max.

I do NOT gurantee that this script works 100% with all different fileformats. I noticied that I had to choose "export selected only" in certain export dialogs.

I also saw that some formats that is shown in list doesent work at all.

But try it out, it might work for you and the good part is that it is 100% free ;-)

Attachments

Anton Berg · 2008-12-10

Thanks for that bug find!! I have uploaded a new version of the script.

And I wonder I shouldn´t make a more generic interface so you could export "any" available fileformat.

Attachments

Anton Berg · 2008-12-03

This is script that is made in 3dsmax 2009 I am not 100% certain that is works in older versions. I would highly recommend to get 3dsmax 2009 since they have upgraded the obj export plugin.

I made a small script that saves the selected 3dsmax objects as separate obj files.

try to just drag n drop the ms file onto 3dsmax to try it out.

workflow:
1. select objects
2. enter the prefix for the separate files
2.1 if you uncheck this the file will get the name of the object in 3dsmax
3. press export
3.1 after you pressed export you will select where to put the files.
3.2 for the first object you will get the export dialog so you can set the settings for the obj exporter and the same settings should be used for the rest of the exports.

I hope this works.

Happy Zbrushing!

Attachments

techmethod · 2008-12-03

WOW. Thank you soo very much Anton :P. The script works like a charm and you have created it exactly how I was envisioning
it!!

Thanks again,

JP

amsmntparks · 2008-12-09

Thanks for this script! I was able to modify it to export .X files and it saved me hours of tedious work.

Just a note though, the script in it's current form will skip the second object. Just change the second check in btn1 from "if > "2 to "if > 1" and it will get them all.
Thanks again!