Omni Asset Validator (CLI)

Command Line Interface

Utility for USD validation to ensure layers run smoothly across all Omniverse products. Validation is based on the USD ComplianceChecker (i.e. the same backend as the usdchecker commandline tool), and has been extended with additional rules as follows:

  • Additional “Basic” rules applicable in the broader USD ecosystem.

  • Omniverse centric rules that ensure layer files work well with all Omniverse applications & connectors.

  • Configurable end-user rules that can be specific to individual company and/or team workflows.

    Note this level of configuration requires manipulating PYTHONPATH prior to launching this tool.

Syntax

Use the following syntax to run asset validator:

usage: omni_asset_validator [-h] [-d 0|1] [-c CATEGORY] [-r RULE] [-D DISABLE_RULE] [-e] [-f] [-p PREDICATE] [URI]

Positional arguments

URI

A single Omniverse Asset.
> Note: This can be a file URI or folder/container URI. (default: None)

Options

-h, –help

show this help message and exit

-d 0| 1, –defaultRules 0|1

Flag to use the default-enabled validation rules. Opt-out of this behavior to gain finer control over the rules using the –categories and –rules flags. The default configuration includes:

(default: 1)

-c CATEGORY, –category CATEGORY

Categories to enable, regardless of the –defaultRules flag. Valid categories are:

(default: [])

-r RULE, –rule RULE

Rules to enable, regardless of the –defaultRules flag. Valid rules include:

(default: [])

-D RULE, –disableRules DISABLE_RULE

Rules to disable, override rules from –rule flags. Valid rules include:

(default: [])

-e, –explain

Rather than running the validator, provide descriptions for each configured rule. (default: False)

-f, –fix

If this is selected, apply fixes.

-p PREDICATE, –predicate PREDICATE

Report issues and fix issues that match this predicate. Currently: IsFailure IsWarning IsError HasRootLayer

–variants

Enable variants validation. Note: This can be expensive. (default: True)

–no-variants

Disable variants validation. (default: True)

See Asset Validator for more details.

Logging

During execution of the CLI, the output generated will be sent to logging (channel omni_asset_validator). The information generated depends on the log level, an overview is given here:

Log level

Information reported

FATAL

Exceptions raised during execution, including (but not limited to):

  • Import errors, i.e. misconfiguration.

  • Wrong arguments.

  • Issues with severity ERROR.

ERROR

Issues with severity FAILURE.

WARN

Issues with severity WARNING.

INFO

Normal execution output, including:

  • Progress (in percent) per each asset.

  • Failures/Errors/Warnings per Rule.

  • Total number of Failures/Errors/Warnings.

VERBOSE

Debugger execution output, including:

  • Aggregated time spent per rule.

Example:

[Info] [omni_asset_validator] --------------------------------------------------------------------------------------------------------------------------------
[Info] [omni_asset_validator] Summary per Rule:
[Info] [omni_asset_validator] UsdLuxSchemaChecker: 3 Failures / 0 Warnings / 0 Errors
[Info] [omni_asset_validator] IndexedPrimvarChecker: 0 Failures / 4 Warnings / 0 Errors
[Info] [omni_asset_validator] --------------------------------------------------------------------------------------------------------------------------------
[Info] [omni_asset_validator] Summary per Severity:
[Info] [omni_asset_validator] Failures: 9
[Info] [omni_asset_validator] Warnings: 4
[Info] [omni_asset_validator] Errors: 0
[Info] [omni_asset_validator] --------------------------------------------------------------------------------------------------------------------------------
[Verbose] [omni_asset_validator] Time per Rule:
[Verbose] [omni_asset_validator] IndexedPrimvarChecker: 0.001 s.
[Verbose] [omni_asset_validator] UsdLuxSchemaChecker: 0.001 s.
[Verbose] [omni_asset_validator] Total time: 0.002 s.
[Verbose] [omni_asset_validator] --------------------------------------------------------------------------------------------------------------------------------

Make sure to configure the appropriate level and handler to visualize that desired output. In the example section you can find quick ways to visualize INFO and VERBOSE.

Command Line Interface using USD Composer

Getting USD Composer installation path

Open Omniverse Launcher. On Library / USD Composer, beside the Launch button click the burger menu to view the settings. On Settings we can see the path of USD Composer installation.

USD Composer Settings

USD Composer Settings

Add it as environment variable.

In Windows:

set INSTALL_DIR=#See above
set KIT_PATH=%INSTALL_DIR%\kit

In Linux:

export INSTALL_DIR=#See above
export KIT_PATH=${INSTALL_DIR}\kit

Getting Asset Validation Core path

Open the Extension manager in USD Composer. In Windows / Extensions, select omni.asset_validator.core extension. On the extension information click on the path icon.

Asset Validation Core Path

Add it as environment variable.

In Windows:

set VALIDATION_PATH=#See above

In Linux:

export VALIDATION_PATH=#See above

Examples

Calling the help command

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --help"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --help"

Validating a file

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\asset.usda"

Validating a folder, recursively

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\"

Apply fixes on file

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix ${VALIDATION_PATH}\scripts\test\asset.usda"

Apply fixes on a folder, specific category

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix --category Usd:Schema %VALIDATION_PATH%\scripts\test\"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix --category Usd:Schema ${VALIDATION_PATH}\scripts\test\"

Apply fixes on a folder, multiple categories

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --fix --category Usd:Schema --category Basic %VALIDATION_PATH%\scripts\test\"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --fix --category Usd:Schema --category Basic ${VALIDATION_PATH}\scripts\test\"

Apply predicates, single file

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --predicate HasRootLayer %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --predicate HasRootLayer ${VALIDATION_PATH}\scripts\test\asset.usda"

Disable variants

Windows:

%KIT_PATH% --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py --no-variants %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py --no-variants ${VALIDATION_PATH}\scripts\test\asset.usda"

Displaying INFO level in STDOUT

Windows:

%KIT_PATH% -v --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} -v --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\asset.usda"

Displaying VERBOSE level in STDOUT

Windows:

%KIT_PATH% -vv --enable omni.asset_validator.core --exec "%VALIDATION_PATH%\scripts\omni_asset_validator.py %VALIDATION_PATH%\scripts\test\asset.usda"

Linux:

${KIT_PATH} -vv --enable omni.asset_validator.core --exec "${VALIDATION_PATH}\scripts\omni_asset_validator.py ${VALIDATION_PATH}\scripts\test\asset.usda"