Introducing 3ds MAX to UE4 FBX and t3d Exporter MaxScript

Update 09/11/2014 : TS_Tools v1.1 update!

**DOWNLOAD TS_TOOLS v 1.1
**
Hello everybody!

I’m proud to release a pretty major update to TS_Tools. Not only have I made some major upgrades to the FBX Exporter based on community feedback, I’m also happy to release the second script, TS_UE4NameUCXPrimitives!

TS_UE4NameUCXPrimitives
A simple script that names selected objects based on a packed object’s name to make them into collision shells for use in UE4!

How it works:

  1. Create your concave collision primitives in MAX
  2. Select your collision primitives
  3. Run the script, which temporarily hides the selected shell objects
  4. Select the base mesh
  5. All the selected meshes are named correctly and will import into UE4 as collision shells!

Next up is, of course the big update to:
TS_UE4FBXExporter v1.1
The big, new feature is the ability to export out UCX_ meshes for collision along with your objects! this was requested over at Polycount in this thread: http://www.polycount.com/forum/showthread.php?t=138894
I tried to make it very artist-friendly, allowing them to simply select the base mesh and having the script find all the appropriately named UCX_ objects, shifting them along with each mesh and exporting them.

Features:

  • Export each selected mesh to an individual FBX file

  • Move each mesh to 0,0,0 for export (Then put it back where it belongs when it’s done like my kids NEVER DO!)

  • Name Each FBX according to the MAX scene name

  • Export any matching UCX_ collision primitives automatically

  • Allows you to use a grid object to set an arbitrary origin (For really big scenes)

  • Just make a Grid helper and name it UE4_Grid and the script will detect it

  • Copy the location, position and scale or selected objects to the clipboard using Unreal-friendly syntax allowing you to paste thousands of objects objects into your UE4 maps with a couple of clicks!

What’s new in 1.1

  • NEW: Exports UCX collision geometry! Just ensure your naming is correct, and the script will detect the appropriate UCX primitives for export. Note: they do NOT need to be selected or visible!

  • NEW: Allows users to explicitly set the export directory. This stays saved in the max file permanently and will be reloaded

  • NEW: Users can reset the saved export path to use the default export path

  • Fixed: Export Window now identifies errors and offers some helpful tooltips

  • Fixed: Export path textfield identifies when no export path is available

  • Fixed: Interface updates when the max file is loaded, saved or reset, showing the correct paths, etc.

  • Fixed: Disabled Geometry-specific export options when the object position is being exported (To help notify the user as to what mode they are in)

  • Fixed: Checks to see if export path is valid and asks user if they want to create the export path if it doesn’t exist, rather than just making one

Here’s a video of both the new renamer and updated exporter in action:
[FONT=Times New Roman]

Original post:
Here’s a script that I’ve had tucked away for a looong while now. I had originally wrote it to work with UE3/UDK so that I could export tons of stuff from MAX scenes easily.

UE4 makes a LOT of that stuff easier, but there’s still some things that are a bit of a pain in the butt. Namely 1) When I have a bunch of meshes in a single MAX file and I want to get them all into UE4 but I don’t want to have them stacked in MAX or have to to manually move them to 0,0,0 to export, and 2) When I have a bunch of objects that are in specific locations in MAX that I want to get into UE4 (Think lightpoles along a road or buildings within a city, etc.)

So, here’s my solution:

Introducing UE4 FBX Exporter : TS_UE4FBXExporter (sexy name, I know)!

[FONT=Times New Roman]**DOWNLOAD TS_TOOLS and READ THE FULL TUTORIAL
Note, version 1.1 has been released, see above for more details!
**

What’s it let you do?

  • Export each selected mesh to an individual FBX file

  • Move each mesh to 0,0,0 for export (Then put it back where it belongs when it’s done like my kids NEVER DO!)

  • Name Each FBX according to the MAX scene name

  • Allows you to use a grid object to set an arbitrary origin (For really big scenes)

  • Just make a Grid helper and name it UE4_Grid and the script will detect it

  • Copy the location, position and scale or selected objects to the clipboard using Unreal-friendly syntax allowing you to paste thousands of objects objects into your UE4 maps with a couple of clicks!

[FONT=Times New Roman]http://4.bp.blogspot.com/-dqjBYEtdT-0/U88fzA2iwqI/AAAAAAAABrM/i_5P-Ur_Y9I/s1600/Screenshot+2014-07-22+20.36.30.png

2 Likes

So easy to use! Thanks a lot, . :slight_smile:

Wow, this will help me out instead of exporting each object individually I can select them all and export all at once :D. Thank you for making this :).

Fantastic job ! This will be most beneficial when exporting to UE4. Keep up the great work!

Thanks everybody :smiley:
If you run into any issues/bug or have a feature suggestion, don’t hesitate to let me know. I’ve already got some minor improvements and additions planned:

  • Make the interface more contextual: Grey options out when using it to export locations for example (You’d never want to export everything to 0,0,0 or show the FBX dialog int hat case)
  • Add more object types such as lights
  • Let the user set the export directory explicitly
  • Have it export groups as a single FBX so artists don’t have to collapse everything into a single object (how they deal with lightmapping UVs is their problem!

I’ll keep this thread updated when there’s a new build!

Thanks . Very handy script. I’m looking forward for updates.

Dream come true! :slight_smile: thanks !

I dont have any knowlede regarding scripting in unrealengine so this question may be silly but is there a reason why the unreal editor part of the process places only boxes instead of the actual static meshes ?

I’m glad you like it :smiley:

The reason is really a design choice. When you paste objects into UE4, they have a reference to the static mesh. In UE4, that uses a path and asset name like this:


Begin Map   Begin Level
      Begin Actor Class=StaticMeshActor Name=OrbitCollision Archetype=StaticMeshActor'/Script/Engine.Default__StaticMeshActor'
         Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0 ObjName=StaticMeshComponent0 Archetype=StaticMeshComponent'/Script/Engine.Default__StaticMeshActor:StaticMeshComponent0'
         End Object
         Begin Object Name=StaticMeshComponent0
            StaticMesh=StaticMesh'/Engine/EditorMeshes/EditorCube.EditorCube'
            RelativeLocation=(X=-549.982,Y=-3223.1,Z=0.0)
            RelativeScale3D=(X=1.05805,Y=1.05805,Z=1.05805)
            RelativeRotation=(Pitch=0.0,Yaw=0.0,Roll=0.0)
            CustomProperties 
         End Object
         StaticMeshComponent=StaticMeshComponent0
         Components(0)=StaticMeshComponent0
         RootComponent=StaticMeshComponent0
         ActorLabel="OrbitCollision"
      End Actor
   End Level
Begin Surface
End Surface
End Map




This is the relevant part:


            StaticMesh=StaticMesh'/Engine/EditorMeshes/EditorCube.EditorCube'

I could have had the user specify some sort of root path or something, but that’s proved complicated to my teammates int he past as it forces a very rigid workflow on them as well as naming conventions in MAX, etc.

This way, you can choose whatever static mesh in UE4 you want to put in each location.

I’d love to find a more direct way of doing it, but it’s a good-enough quick and dirty solution :stuck_out_tongue:

Thank you sir. Can’t wait till i can use this!

Hello @,
I’ve been using your scirpt for a while and I didn’t have any problems. Today I tried to export couple objects and I wasn’t able to do so. Export Path has changed to "export". Do you know how to change it back? Also, what’s interesting, I wasn’t able to uninstall this script. I deleted .ms file from scripts\Startup Autodesk’s sub-folder but it was still there.

Cheers

Mr , Thanks for hte feedback! The export path isn’t being set because you haven’t saved your .max file! I’ll add that as a future feature/error check to warn the user that there’s no export folder available.

To uninstall, you need to find your usermacros folder. Autodesk has placed in the obvious location:
C:\Users\YOURUSERNAME\AppData\Local\Autodesk\3dsMaxDesign\2014 - 64bit\ENU\usermacros

Thank you ! I’ve just tested this again and it works, so yeah… my bad. I didn’t know that.

Anyway, I would like to add your script to our forum (with all credits of course).

Cheers,
Michal

Thanks for sharing this script, looks helpful :slight_smile:

I don’t have access to maya or ue4 right now but, does this work for maya (.ma) files aswell? :slight_smile:

****> Go for it! Where’s the forum at?

> It’s only for MAX. I don’t know mel scripting at all :frowning:

Awwww, too bad. Thanks anyway tho :slight_smile: it’s lovely to hear people write plugins like these!

It’s here: Unreal Engine 4 blog | Unreal Engine 4 Blog

I’ll add a new post this week.

Thanks

,
I added new post as promised: 3ds Max Script: FBX Exporter from Tom Shannon | Unreal Engine 4 blog

Cheers,
Michal

Wooo! I’m famous!

Hello all, I’ve updated the exporter and added a new tool! :smiley: Check the top post for more info.