Batch Export/Import

Version: 
v04.02
Date Updated: 
05/03/2014
Author Name: 
Jos Balcaen

This is a free script, for non commercial use.

This is the perfect script to transfer your models from 3ds Max to ZBrush/Unity/UDK/...
Basically it batch exports objects to multiple files.
Supported formats : max, obj, fbx, 3ds, ase, dwf, dwg, dxf, dae.

General features

  • Very easy to use script
  • All options are saved.This means all checkboxes, text fields will remember your change.

Export features

  • Reset geometry. Apply the boxmethod to every object (reset transformation etc.). Optionally move the pivot to the origin.
  • Delete turbosmooth. Delete the TurboSmooth modifier before exporting.
  • Move to [0,0,0]. Move objects to the origin before exporting
  • Rotate the objects before exporting (to fix rotation problems)
  • Scale the objects before exporting (to fix scale issues)
  • Name change. Add prefix and/or postfix to the name of the objects before exporting.
  • Combine collision mesh. Mesh with the same name and the given prefix/postifx will be exported together (ex. UCX_).
  • Combine LOD's. Meshes with the given prefix/postfix will be exported to the same file. For example _LOD* (* means numbering) for unity.
  • Group support. Objects in a group are automatically exported to the same file. If the Collapse groups option is enabled, the group will be collapsed to one mesh.

So no need for an export scene. You can check the options and everything will be perfectly exported.
After exporting the scene will be restored.

This script has been updated several times by user requests.
If you have any remarks, requests or feedback, feel free to contact me.

 

Additional Info: 

How to install

You can easily run the script by dragging it in 3ds Max. If this doesn’t work, choose MAXScript -> Run Script…

Create button

If you want a button in 3ds max, you need to create one yourself. Here are the steps:

    • Save the script to a location. (Example C:\Program Files\Autodesk\3ds Max 2013\scripts\)
    • Open the MAXScript editor (MAXScript -> MAXScript Editor…) and create a new script (File -> New)
    • Copy paste the following code:

 

macroScript JosBatchExporterImporter
category:"Custom"
tooltip:"Export/Import multiple objects/files v04"
buttonText:"EXP/IMP"
(
 fileIn @"C:\\JosBalcaen_Batch_Exporter_Importer.mse"
)

  • Change the path to the location where you saved the file
  • Run the code (Tools -> Evaluate All) .
  • Don’t worry, nothing should’ve happen.
  • Go to Customize -> Customize User Interface
  • go to the ToolBar tab and choose as group “Main UI” and Category “Custom”.
  • Drag Export/Import multiple objects/files v04 somewhere on the Main Toolbar to create a button
Version Requirement: 
2011/2012/2013/2014/2015
AttachmentSize
josbalcaen_batch_exporter_importer.mse51.01 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
joma's picture

nesting

Somebody know if it's posible whith this plugin or another put each mesh in diferent positions in a 2D plane? Like a nesting, Several meshes whitout collisions. Thanks

mdko's picture

yes, I'm exporting from the

yes, I'm exporting from the same scene. I could test it with admin rights, I'll let you know if it works.

jos's picture

I'll fix it

Thanks for reporting!
I'll have a look this weekend.

-- edit --
I just had a look; On my pc, the settings get saved in the dialog.
There is no code on my side that saves fbx settings, I just show the options dialog the first time. The next object gets exported with the same settings automatically by max.
Are you exporting from the same scene? Can you test if you run 3ds max with administration rights?

I could manually save all settings from the dialog that are exposed, but seems overkill as max does it for you..

Cheers,
Jos

mdko's picture

fbx export settings?

Heya,

Great script, but I have a problem. When I manually export a model to Unreal engine 4, I set FBX to use the 2013 version, set the units to centimeters, etc. And this gives me a correctly scaled model in UE4.

But when I use your script, only the first object (that gives the FBX dialog) gets the correct scale in UE4. The rest of the objects all have their scale set incorrectly.

Am I correct in assuming the script saves the settings of your first FBX dialog, then uses that for all remaining exports? Because if that is the case, this function does not seem to work properly at this moment.

Thanks for your hard work,
Mdko

Nik's picture

Very helped!

Thank you very much!
Great script

Used export into separate files

Luos_83's picture

thanks!

Ooh thanks, had some troubles with my wrists so took me a while to reply!
Will try this asap!

edit: works like a charm for me!
Will let the great Unity community know about this tool.

you rock like a baksteen!

also funny that in your script it says:
"export objects with a given prefix together. UCX_ for udk for example (user request by Edward Duke-Cox)"

Whom I talked to on a regular basis back in the UT days.
just got totally sentimental :)

jos's picture

New version

Rewrote the whole script. Added some new features like LOD support, scaling and rotating. Should be what you want..
Cheers

Luos_83's picture

Lod support

Goedendag Jos,

I have been using your tool since it first came out, I've practically grown up with it, so from bottom of my heart, thank you for this tool!

I got a few requests, which might be a looooong shot, but I know the whole Unity community would love you for this.

There is this thing in Unity Pro where you can import Level Of Detail meshes together and they will automatically assign the proper Lods to the main mesh.

Basically if a mesh ends with _LOD0 (Meshname_LOD0 for instance) in its name and the second with _LOD1, third with _LOD3 if exported together as one file Unity will see it as one mesh with the LODS applied to it.

Would there be a chance you could add a feature that looks at the end of a mesh name and if it is _LOD0 it will look for _LOD1, _LOD2, etc and combine them in one exported file.
(So i can batch export 100's of files instead of one group of 3 each time)

Because sadly for now, the batch exporter only increased workflow a little bit.

(already suggested to Unity to also combine them if they are separate files, but obviously I am ignored)

There are also two other things Unity does wrong with .FBX (its main import file)
1. It resizes all .fbx to 0.01 times the original size.
For this an option to resize meshes on export would be great!
2. I need to rotate the pivot 90 degrees on the X axis (so Y axis is upwards) of all my meshes before exporting as .fbx because for some reason Unity ignores this option in the .fbx export options.

I hope this is clear, my dutch has always been better than my english!
Cheers and take care!

Edit: a coder friend got the _LOD part working on your script actually, If you care I am allowed to share it with you!

jos's picture

Can you send me a sample

Can you send me a sample scene so I reproduce the problem? I'm rewriting the whole script now..

climus's picture

problem

After exporting the model names disappear. Model name in Russian

AttachmentSize
snimok.png 29.97 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.