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] [-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: [])
-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
See Asset Validator for more details.
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.
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.
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"