Tutorials

Learn new skills with our bite sized lessons

How to export Forest Pack to Unreal
How to export Forest Pack (and RailClone) to Unreal using Datasmith
Technologies:
Forest Pack, RailClone

Resources

  • Forest Pack Logo, The Scatteting tool for 3ds Max
  • RailClone Logo

Unreal Engine's Datasmith tools support exporting Forest Pack and RailClone objects to Unreal with no need to Instantiate using Forest Tools. To use these features you need to install a Datasmith plugin for 3ds Max that's compatible with the Unreal Engine version that you are using.  

To export a full Forest Pack or RailClone object to Unreal

  1. Select the Forest or RaiLClone object(s) you wish to export. Go to File > Export > Export Selected
  2. Choose a file name and change the filetype to Datasmith
  3. In the Datasmith Export options. Make sure that Include is set to Selection
    Datasmith Export Options
  4. Click Export. And wait a while. Depending on the number of instances and sources geometry this can take anything from a few seconds to a few minutes. 
  5. Once that’s done, switch over to Unreal and click the Datasmith button
    Datasmith Button
  6. Select the file you just exported from 3ds Max and click Open
  7. Choose the folder in which you wish to save the Forest Objects. Create a new one if necessary, then click OK
  8. Next, the import options will open. Change the  settings as desired and then click Import
    Datasmith Import Options
  9. Datasmith creates a single Actor in the Unreal Engine Level, named according to the name of the object in 3ds Max. 

Each Forest or RailClone object is reconstructed in Unreal as a Hierarchical Static Mesh. This is a very efficient way of creating thousands of instances in real-time. It also creates a Static Mesh asset for each unique piece of geometry. In Forest Pack this will match the number of source models, in RailClone it depends on whether segments are sliced or bent as to whether they are instance or not and therefore exported as unique items.

If you click on a Hierarchical Static Mesh actor, you will see that it contains one Hierarchical Static Mesh component for each asset as well a list of all the individual instances. From here you can swap the geometry if you like simply by selecting another Static Mesh from the content browser and clicking the Use Selected Assets button.

To export only Bounding Boxes

  1. Locate and select the source geometry used by the Forest objects you wish to export. With a Forest Object selected, you can do this easily by right-clicking and selecting the Select Forest Custom Objects option. 

  2. Add a Datasmith Attributes Modifier to each one. Change the Export Geometry As option to Bounding Box. When this is active, a simple box is exported in place of the original geometry, allowing you to swap it for something much more optimised in Unreal. 
    Datasmith Attributes Modifier
  3. Go to File > Export > Export Selected
  4. Choose a file name and change the filetype to Datasmith
  5. In the Datasmith Export options. Make sure that Include is set to Selection
    Datasmith Export Options
  6. Click Export. And wait a while. Depending on the number of instances and sources geometry this can take anything from a few seconds to a few minutes. 
  7. Once that’s done, switch over to Unreal and click the Datasmith button
    Datasmith Button
  8. Select the file you just exported from 3ds Max and click Open
  9. Choose the folder in which you wish to save the Forest Objects. Create a new one if necessary, then click OK
  10. Next, the import options will open. Change the  settings as desired and then click Import
    Datasmith Import Options

Locating source objects and adding Datasmith modifiers can be a somewhat tedious task if you have a lot of Forest Objects in the scene. So we have written a script to automate the process. It’s a part of the ForestToolbox, an ever-evolving set of handy functions that registered users can download from our forum. To use this:

  1. Select one or more Forest Objects.
  2. In the Datasmith section, change the mode to Bounding Box and click Add Modifier
    Forest Toolbox UI

Swapping Source Objects in Unreal

Once a scatter has been imported into Unreal, it's possible to swap the source geometry. You might want to do this if you've just imported bounding boxes, or if you've imported meshes that are not well optimised for realtime and you want to replace them with something more performant. There are two ways depending on how many items there are in a scatter. 

For scatters in the early thousands or less

  1. Select the Hierarchical Static Mesh actor and in the Details panel, select the Hierarchical Static Mesh component for the object you wish to replace. 
  2. Select an object you wish to substitute from the Content Browser
  3. Click the Use Selected Asset in Content Browser button to assign the new object to the Hierarchical Static Mesh component. All instances will be updated. 
    Static Mesh
     

For scatter greater than a few thousand objects 

The Hierarchical Static Mesh Component lists all the instances in the UI. Because of this, scatters that contain too many objects can cause slow-down or freezing as the UI attempts to list all the items. To swap items like this, you can use a different approach that doesn't involve you needing to open the UI for the component. Here's how:

  1. In the Content Browser, find the folder containing the placeholder assets used in the scatter. 
  2. Open a second Content Browser and locate the object you’d like to substitute
  3. Drag the new plant into the same folder as the placeholder. Makes sure you choose Copy. This is so that you don’t accidentally end up deleting items from the content browser that you might need later. 
    Replace Bounding Boxes
  4. Now select the new object and the placeholder object. 
  5. Right Click and select Asset Actions > Replace References 
    Replace References
  6. A dialog opens. From the list you need to select the asset you wish to keep. The unselected assets will be removed and the references swapped to the selected asset. 
    Replace references Options
  7. Click Consolidate Assets
  8. The scatter will update in the scene. 
  9. Using this technique you can easily swap any geometry imported from Forest Pack.