Skip to content

Tools for working with NcEngine asset and package files.

License

Notifications You must be signed in to change notification settings

NcStudios/NcTools

Repository files navigation

NcTools

Tests License

A collection of tools for managing and converting NcEngine assets, or .nca files.

NcTools consists of two projects: the NcAsset library for importing .nca asset files, and the nc-convert command line utility for converting asset files to the .nca format.

NcAsset Overview

To use NcAsset, simply call the appropriate import function, and provide the path to the .nca file you want to import:

#include "ncasset/Import.h"

auto myTexture = nc::asset::ImportTexture("path/to/texture.nca");

nc-convert Overview

nc-convert is used to convert various file types to the .nca format, which is required by NcAsset. Here's an example of converting a single file to an .nca:

> nc-convert -t mesh -s path/to/input.fbx -n myMesh -o outDir

The asset type, source file, and output asset name must be supplied with the -t, -s, and -n flags, respectively. Optionally, and output directory may be given with -o.

You can also use a JSON manifest file to convert many files at once:

{
    "globalOptions": {
        "outputDirectory": "./",
        "workingDirectory": "./"
    },
    "mesh": [
        {
            "sourcePath": "path/to/mesh1.fbx",
            "assetNames": [
                {
                    "subResourceName" : "mesh1head",
                    "assetName" : "head"
                },
                {
                    "subResourceName" : "mesh1shoulders",
                    "assetName" : "shoulders"
                }
            ]
        },
        {
            "sourcePath": "path/to/mesh2.fbx",
            "assetName": "mesh2"
        }
    ],
    "texture": [
        {
            "sourcePath": "path/to/texture.png",
            "assetName": "myTexture"
        }
    ]
}
> nc-convert -m manifest.json

nc-convert will skip files that are already up-to-date when using a manifest. Relative paths within globalOptions are interpreted relative to the manifest.

For more information, see the help text for nc-convert and the docs on input file requirements and .nca formats

NcCommon is a public dependency of NcAsset. The following third-party libraries are used internally by nc-convert: Assimp, AudioFile, and stb.

Build Options


NC_TOOLS_BUILD_CONVERTER

Default: OFF
Build the nc-convert executable.

NC_TOOLS_BUILD_TESTS

Default: OFF
Build tests

NC_TOOLS_STATIC_ANALYSIS

Default: OFF
Enable static analysis (MSVC Only)