Skip to main content

Skinning

Since CGI 3.14, skinning animations can be played by importing skinning FBX or glTF files. However, the following limitations exist.

  • The maximum number of joints associated with each vertex is 4.
  • If the number of joints associated with a skinning mesh is 100 or less, skinning is performed using a shader.
  • If the number of joints associated with the skinning mesh is 101 to a maximum of 255, skinning processing will be performed on the CPU, but performance will decrease.
  • CGI Studio manages rotation using Euler, so it may not be possible to reproduce the animation.
  • If SkinningMesh and the SkinningMesh's parent Transform are not identity matrices and the SkinningMesh's posture does not give the expected result, please set the identity matrix for SkinningMesh and the SkinningMesh's parent Transform.
  • If SkinningMesh and Joint Nodes are placed under a Group, the changes made in the Group's Transform will be applied to the SkinningMesh twice.

In addition to the above, please note the following limitations when importing skinning in FBX file format.

  • FBX format FbxSkin::eDualQuaternion and FbxSkin::eBlend are not supported.
  • FbxCluster::eAdditive in FBX format is not supported.
  • Importing multiple animations is not supported.

SkinningMesh

Note that you can create a SkinningMesh that can be used on Scene Composer by importing an FBX/glTF file that contains at least one skinning. The properties of a SkinningMesh created by importing is as follows.

Skin (Common Properties)
drawing-4-1725634469.png
Line Width

It is only added if the [ Import as wireframe ] option is enabled when importing an FBX file that contains skinning. This specifies the line width of the mesh when it is rendered as wire.

  • The actual line width is determined by rounding the specified width to the nearest integer.
  • If the setting is less than “1”, it is always set to “1”.
Enable CPU Skinning

Specifies if CPU Skinning is enabled or not. If enabled, vertex shaders other than those provided for skin can be used with Skinning Mesh. 

Note: CPU skinning calculations are slow and should thus be avoided. If enabled, the shader must be edited or configured so that skinning is not done in the shader.

Other Properies items

The following property items are set at importing and cannot be changed.

drawing-4-1715328271.png
Joint Node Sets a joint node.
Enable Inverse Bind Matrix

Specifies if Inverse Bind Matrix is enabled or not. If enabled, then the joint uses the Inverse Bind Matrix. If disabled, then the joint uses the identity matrix.

Inverse Bind Matrix Used to bring coordinates being skinned into the same space as joint.

Adding imported scenes

Import of FBX or glTF files, including skinning, is performed using the standard procedure (FBX import procedure, glTF import procedure). After importing, creating new scenes and animations  from the scenes and animations contained in the imported resources.

  1. Select a scene contained in the imported resource and choose [ Add Scene From Template... ] from the context menu.
    • The [ Add New Scene 3D ] dialog will appear.
    • For more information on  the  [ Add Scene From Template... ]  feature, see here.
  2. Make the necessary settings on the [ Add New Scene 3D ] dialog and press [ OK ] button.
    • The scene will be added as a new scene in the Solution Explorer panel, in the Solution>Scenes folder.
    • The scene tree panel will display the added scene.

      drawing-4-1715315754.png

SkinningMesh is added to the imported scene (red frame in the right figure above). 

If the imported scene does not contain any camera or light nodes, add them to the new scene from Node 3D in the Toolbox panel and make the necessary settings.

Add Render Target

Adds the camera of the added scene to the render target.

When a camera node is added
  1. Displays the Render Targets panel.
    • A camera with the added scene name has already been added in the panel.

  2. Check the checkboxes for the added cameras.
If the imported scene contains a camera
  1. In the Render Targets panel, select Render Target and then [ Add Camera to Render Target... ] from the context menu.
    • The [ Choose Item ] dialog will appear.

  2. Expand the Scenes folder in the [ Choose Item ] dialog and select the cameras in the scene you added.

  3. Press the [ OK ] button in the dialog.

Add imported animations

To play the skinning animation in Player, add the animation in the imported resource.

  1. Select an animation contained in the imported resource and choose [ Add Animation From Template... ] from the context menu.
    • The [ Add New Animations ] dialog will appear.
    • For more information on  the  [ Add Animation From Template... ]  feature, see here.

  2. Make the necessary settings on the [ Add New Animations ] dialog and press [ OK ] button.
    • The scene will be added as a new scene in the Solution Explorer panel, in the Solution>Animations folder.

Play skinning animation

Player is used to play back skinning animations in a composed scene.

  1. Press the [ Play selected scenario... ] icon on the toolbar to launch Player.
    • If you have not saved the solution before this operation, the [ Save Solution ] dialog will appear and you will be asked to save the solution.
    • By pressing the [ OK ] button in the dialog, the asset file will be automatically generated and opened in CGI Player.

  2. In the CGI Panel, check the target scene from the scene list on the left side.
    drawing-4-1715316125.png


  3. Select the animation to be played from the toolbar pull-down menu.
    drawing-4-1715316183.png


  4. Press the Play button on the toolbar to execute the animation playback.
    • The skinning animation specified in the display panel is played.
      drawing-4-1715328731.png
      SkinningAnime.gif