resources

3DSMax


How To Install the 3DS Max plugin

The plugin is designed for 3DS Max 2015 or later. To download it, go to the Github project (https://github.com/BabylonJS/Exporters/tree/master/3ds%20Max).

github

In this folder, you can find the source code of the exporter if you want to update it, and a zip file Max2Babylon-XX.zip (where XX is the exporter version, currently 0.20.0). Click on the zip file, and click on the Download button.

github download

Extract the content of the zip file on your computer, and open the directory corresponding to your 3DS Max version. By default, Windows blocks all .dll files coming from the web, so we have to unblock them first. Select the first .dll file, and with a right click select Properties, select Unblock, and then OK.

dll unblocking

Repeat this process for all .dll files. Finally, make sure 3ds Max is not running, and move all .dll files into the installation directory of 3DS Max (in C:/Programs/Autodesk/3ds Max 2015/bin/assemblies). The next time you will start 3ds Max, the plugin will be automatically launched, and a new tab should appear:

plugin visible

Congratulations! You did it!

Features

Exported features

  • Scene

    • Clear color
    • Ambient color
    • Fog
    • Environment texture (.dds)
  • Cameras

    • Fov
    • MinZ
    • MaxZ
    • Speed (*)
    • Inertia (*)
    • Collisions (*)
    • Position
    • Target / Rotation
    • Animations: Position, Target, Fov
  • Lights

    • Omni / spot / directional / Ambient(Hemispheric)
    • Shadows maps for directional lights (Variance shadow maps can be actived by checking [Absolute Map Bias] in light properties)
    • Inclusion / exclusion lists
    • Position / direction
    • Intensity
    • Diffuse
    • Specular
    • Animations: Position, direction, intensity, diffuse
  • Meshes

    • Visibility
    • Renderable
    • Shadows
    • Collisions (*)
    • Pickable (*)
    • Position / rotation / scaling
    • Smoothing groups
    • Skin
    • Geometry (position, normal, color, texture coordinates (2 channels))
    • Instances
    • Morph targets
    • Show Bounding box and submeshes bounding boxes (*)
    • Animations: Position, scaling, rotation, visibility, bones
  • Materials

    • Multi-materials
    • Alpha
    • Diffuse color and texture
    • Ambient color and texture
    • Specular color and texture
    • Bump
    • Emissive color and texture
    • Opacity texture
    • Reflection texture
    • Fresnel for diffuse, emissive, opacity and reflection
    • Physical materials (PBR)
  • Textures

    • UV offset / scaling / angle
    • Level
    • Coordinates mode (Spherical, planar, explicit)
    • Wrapping (Clamp, mirror, wrap)
  • Hierarchies are exported

(*): Through custom UI

Scene properties

If you right-click on your scene, you will have a menu Babylon -> Babylon Properties: All the available blend modes are listed below:

Property button

The scene properties allow you to do these things:

  • Set the scene gravity
  • Export quaternions for all nodes instead of Euler angles. If this option is selected, an exported model rotation won’t be updated by setting its rotation parameter. Instead, you will have to use the rotationQuaternion parameter.
  • Create a default skybox from the environment texture when scene is being loaded. An environmnent texture must be setup to enable this feature.
  • Set the blur effect intensity applied to the skybox texture. By default it is slightly blurred. Setting value to 0 disables the blur effect.

You surely noticed the submenu Babylon Actions Builder. This tool allows you to visually design your actions. More info here

Scene properties

Object properties

With a right click on a mesh, select the menu Babylon -> Babylon Properties to open the window Object Properties:

Object properties

With this window, you can set the following properties:

  • Check collisions: Activate it to enable collisions between the camera and this object. False by default.
  • Do not export: Self-explanatory, this object won’t be exported. False by default.
  • Pickable: This object can be picked with the mouse. False by default.
  • Try to optimize vertices: The Babylon exporter will try to optimize the number of vertices to export instead of exporting everything naively (if a vertex is part of two faces, this vertex won’t be exported twice with this option checked). False by default.
  • Show bounding box: Display the bounding box of this object in the scene. False by default.
  • Show submeshes bounding boxes. Same as above. False by default.
  • Alpha index: Used to sort transparent meshes. The mesh with the bigger alpha index is rendered first (then the depth is taken into account). Default value is 1000.
  • Auto animate: All animations for this object will start when this object is being added to the scene. True by default.
  • From/To/Loop: The starting and ending frame for this object, and if the animation loops. Default values are 0, 100 and true.
  • Impostor: Add an impostor to this object. Default is none.
  • Mass/Friction/Restitution: set the physics value of the impostor. Default values are 0.20, 0.20, and 0.20.

Light properties

If you create a standard light and right click on it, select the menu Babylon -> Babylon Properties to display this window:

Light properties

The options Do not export, and animations are exactly the same as the Object properties window.

Camera properties

Camera properties

In this window, you can choose the kind of camera you want to create in Babylon.js. You can also:

  • Check collision: The camera can collide against objects where check collisions is activated.
  • Apply gravity: The camera will be subject to the scene’s gravity (in the Scene properties window)
  • Ellipsoid: With collisions enabled, the camera will be wrapped in an ellipsoid, the size of which can be set here.
  • Speed / inertia: The speed and inertia of the camera. Default values are 1 and 0.9.
  • Animations: Same as in Object properties window.

The exporter window

When your scene is ready to be exported, click on the Babylon tab on the top menu, and click on Babylon File Exporter to display the exporter window.

export window

This window is composed of 3 panels:

  • A top panel with a file path and a button. With this panel, you choose where your Babylon file will be exported by clicking on the right button.
  • Several options and two buttons Export and Export & Run
  • A log panel

The Export button should be used to create the Babylon file representing your scene. The Export & Run button will also create the Babylon file, but will also launch your default browser and run the newly made Babylon file. This button is very useful if you just want to test the render of your scene in Babylon.js.

As babylon.js script is retrieved directly from the official website directly, you should have internet access in order to correctly use Export & Run.

The log panel indicates in real time which mesh has been exported, which material, and if there are any problems with these objects.

What you should know

Camera

If you want to test your scene right away by using the button Export & Run, your scene should have a camera created. Otherwise, the log panel will display the warning “No camera defined” and a default one would be created at runtime but won't be exported in .babylon file.

If you have more than one camera, the first one will be set as activeCamera in Babylon.

Light

If you don’t have any lights in your scene, the exporter will add a hemispheric light by default. The log panel will display the warning “No light defined – A default hemispheric light was added for your convenience”.

Pivot and position

The object position will be defined with your object pivot position. In the image below, the pivot position is not at the center of the box: updating the object position in Babylon.js will update this pivot position, and not the box position.

pivot

Negative scale

Using a negative scale will reverse the normal of your objects. These objects will appear correctly in 3DSMax, but incorrectly in a Babylon.js application.

Animations

Cameras, lights and meshes have custom properties (Right-click and select "Babylon properties" menu) to automatically launch animations at startup.

Animations are exported by sampling keyframes which can generate a lot of data. To reduce file size, you can opt to use linear interpolation instead of bezier or TCB.

Consideration about bones

To ensure that bones are correctly exported, you have to use the Skin modifier. Skin should be positioned at origin. More info here

Physical materials

The handling of physical materials is mimic from glTF format. Detailed explanations here

Texture transparency

Babylon supports PNG, DDS and TGA formats for texture transparency. You can choose to include the transparency directly in your diffuse texture, or create an opacity map. Here are the options to check if you want to have transparency on your diffuse texture:

texture

Now that you know all about the exporter features, it’s time to use it!

Using the exporter

First, create the model you will be using in the Key class. I choose to create a simple key (you might recognize a little inspiration from the Zelda games). As you can see, the key has 3 key frames creating a floating animation. Its material has no diffuse color (set to black), but a self-illumination color (corresponding to the emissive color in Babylon.js).

key

The only thing left to do is to export this key as a Babylon file, and we’re done with 3DS Max. As the animation is going from frame 0 to frame 80, the Babylon properties for this object have to be updated. And we’re done!

animation