W4 AssetCreator

From Ciliz|W4

Scope

The W4 game engine uses its own asset storage format. Therefore, before using any fbx asset, it has to be converted. This can be done using the W4AssetCreator tool that comes with the W4 SDK.

W4AssetCreator converts assets from Autodesk FBX (.fbx) format. Other formats are not supported.

Mesh Example

Let’s take the Utah teapot as an example. If you view the file using the utility Autodesk FBX Review, you will see something similar to the following figure.

cb84552c-5001-4127-9d9d-1e93f9c96696.png

Pay attention to the orientation of the teapot spout when viewing fbx. As a result, the same teapot is displayed, but with a slight difference.

3aa4d02a-5152-44d6-9168-13a155f1b049.png

If you compare the drawings, you may notice that the spout of the teapot has changed its directed after the program execution. This happens due to differences in coordinate systems.

The FBX coordinate system Scene Axis and Unit Conversion is right-handed (with the Y pointing up), whereas W4 coordinate system is left-handed (the the Y axis is also pointing up).

Animated mesh Exmple

Take, for example, Rigged Hand.

If you view it using Autodesk FBX Review you will see approximately the following:

As a result of conversion, the following animation is shown:

Short manual

W4AssetCreator parameters

Below is the output of the application (if no parameters specified):

 W4 Asset Creator
 Usage:
 ./W4AssetCreator [OPTION...] [name] [output]
 
 FLAGS options:
 -h, --help           print help
 --material arg   add material to asset (default: "")
 --root arg       root directory for all relative paths (except output)
 (default: /Users/p.steinberg/dev/w4-framework)
 --image arg      add image to asset (default: "")
 --particles arg  add particles to asset (default: "")
 --fbx arg        input fbx file
 --pn arg         name of plugin (default: "")
 --pp arg         plugin params (default: "")
 --scale arg      scale for converter
 --no-animation   no export animations from input fbx file
 --animation arg  add animation from fbx file. format
 'path[:%stackName%=%animationName%;...]' (default: "")
 
 POSITIONAL options:
 --name arg    asset name, default is 'asset' (default: asset)
 --output arg  output directory, default is current directory. Result
 output is %output%/%name%.w4a file (default:
 /Users/p.steinberg/dev/w4-framework) 

Additional description:

--root - please pay attention to this parameter. If it is not specified, all relative paths are taken from the folder from which the application is launched

--fbx - path to the *.fbx file that will be converted to asset, you can specify only one

--scale - scale for all entities exported from (--fbx)

--no-animation - if set, no animations are exported from the fbx file specified in the argument (--fbx)

--animation - adding animations to the asset (animations are located separately). If desired, you can rename the animation when adding (see the format described above)

--material - path to the material JSON that will be added to the asset (you can specify several)

--image - path to the image that will be added to the asset (you can specify several)

--particles - path to the description of particles in json format (you can specify several)

--pn, --pp - arguments for the plugin system (TBD)

There are two positional arguments:

  • Name of the created asset.
  • Path to the folder in which the asset will be located.

Usage Example

 W4AssetCreator --root=path/to/resources/root \
          --material=resources/materials/back1.mat,resources/materials/crowd.mat,resources/materials/dissolve_twoTextures.mat \
          --material=resources/materials/paperboy.mat,resources/materials/platform.mat,resources/materials/postament.mat,resources/materials/step.mat \
          --animation="A_PaperBoy_Dance2.fbx:Take 001=Crewman,A_PaperBoy_Flip.fbx:Take 001=Flip" \
          --image=resources/textures/dissolve.png,resources/textures/T_Homer_Face_D.png,resources/textures/T_PaperBoy_Body_D.png \
          --image=resources/textures/T_PaperBoy_Head_D.png,resources/textures/T_PaperBoy_LeftHand_D.png,resources/textures/T_PaperBoy_RightHand_D.png \
          --image=resources/textures/T_PaperBoy_Pants_D.png,resources/textures/T_trio_Head_D.png \
          --image=resources/textures/T_PaperNinja_Body_D.png,resources/textures/T_PaperNinja_Pants_D.png,resources/textures/T_PaperNinja_LeftHand_D.png \
          --image=resources/photos/W4_01.jpg,resources/photos/W4_02.jpg,resources/photos/W4_03.jpg,resources/photos/W4_04.jpg,resources/photos/W4_05.jpg \
          --image=resources/photos/W4_06.jpg,resources/photos/W4_07.jpg,resources/photos/W4_08.jpg,resources/photos/W4_09.jpg,resources/photos/W4_10.jpg \
          --image=resources/photos/W4_11.jpg,resources/photos/W4_12.jpg,resources/photos/W4_13.jpg,resources/photos/W4_14.jpg,resources/photos/W4_15.jpg \
          --image=resources/photos/W4_16.jpg,resources/photos/W4_17.jpg,resources/photos/W4_18.jpg,resources/photos/W4_19.jpg \
          --fbx=SK_PaperBoy_T_Pose.fbx \
          --no-animation \
          AssetName \
          asset/destination/directory