Importing Models Exported from DCC Tools

Currently, most Digital Content Creation (DCC) tools (3DS Max, Maya, Blender) can export models in FBX and glTF formats. These formats, exported by these tools, can be well received in Cocos Creator 3.0.

Exporting FBX

Because the coordinate system of the DCC tool and the game engine's coordinate system are not necessarily the same, some transformations are required when exporting a model to get the desired result in the engine. For example, Blender's coordinate system is X-axis right, Y-axis inward, and Z-axis upward, while Cocos Creator 3.x's coordinate system is X-axis right, Y-axis upward, and Z-axis outward, so the rotation needs to be adjusted to make the axes consistent.

The following uses Blender 2.8 as an example to introduce the model import process. First, create a model in Blender.

blender model

In Blender's FBX Export Options documentation, choose Up as Y Up and Forward as -Z Forward.

blender export

Imported into Cocos Creator, notice that the nodes are rotated by -90 on the X-axis in order to combine the axis with Cocos Creator. The axes are aligned.

blender export c3d

To use a different rotation value, Blender's FBX export plugin provides an experimental function, Apply Transform, which can directly transform the rotation data into the model's vertex data.

blender export bake

Notice that the rotation data is gone in Cocos Creator 3.x.

blender export bake c3d

Exporting glTF

Please read the following documents:

Possible issues

During the game development process, the orientation of the model may be used. For example, if some objects should face the player (using the LookAt() method), consider the initial orientation of the model. Here are two methods to adjust the initial orientation of the model.

  1. In Cocos Creator 3.x, the -Z-axis is used as the forward direction, while in Blender, the forward direction is +Y-axis, when making a model, the positive direction of the Y-axis should be used as the orientation of the object, and the derived transformation later, in Cocos Creator, the -Z-axis will be used as the front direction.
  2. To not change the orientation in the DCC tool, try adding a parent node to the imported model in the scene, and then rotate the model so that the initial orientation of the model is the -Z-axis. All subsequent rotation-related operations are based on the parent. A node is an operation object.

Artist's production specifications

  1. Reasonably formulating a sub-assets name under model assets (e.g mesh or material). Each modification of the sub-assets name will result in the loss of the place associated with the sub-assets in the project.

  2. When a part of the model needs to be transparent and a part does not need to be transparent, it should be exported into two materials. If it is a material export that is prone to model penetration, you need to manually adjust the material.

  3. External asset references, use relative path when exporting. Otherwise, under the cooperation of multiple people, the original asset path will not be recognized, resulting in the model's built-in materials cannot obtain the texture correctly and appear yellow. Autodesk 3ds Max export local path is modified as follows:

    relative path

results matching ""

    No results matching ""