Rules#
- class omni.asset_validator.core.AlmostExtremeExtentChecker
The world space extents of any Boundable should be within 2^40 units of the origin. Failure to meet this requirement will result in the offending object being discarded by the RTX renderer.
In order to avoid reaching the RTX imposed limit an “almost extreme” check is used that looks for Boundable Prims that a more than 2^38 units from the origin.
Values are compared raw without consideration of linear units
Only the default time code is considered
The value of authored extent will be used for the check, even if they are incorrect
- class omni.asset_validator.core.AnchoredAssetPathsChecker
Asset references should use anchored paths. For reproducible results, asset references should use anchored paths (paths that begin with “./” or “../”) rather than absolute paths or search paths. Paths containing “../” should also be encapsulated and avoid to target locations above the asset root.
- CheckStage(stage)
Check the given usdStage.
- CheckLayer(layer)
Check the sublayers of the given layer.
- class omni.asset_validator.core.ExtentsChecker
Boundable prims have the extent attribute. For point based prims, the value of the extent must be correct at each time sample of the point attribute
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- ResetCaches()
Reset any caches the rule owns. Called whenever stage authoring occurs, such as when we iterate through VariantSet combinations.
- class omni.asset_validator.core.IndexedPrimvarChecker
For Primvars with non-constant values of interpolation, it is often the case that the same value is repeated many times in the array.
An indexed primvar can be used in such cases to optimize for data storage if the primvar’s interpolation is non-constant (i.e. uniform, varying, face varying or vertex).
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.KindChecker
All kinds must be registered and conform to the rules specified in the USD Glossary.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- ResetCaches()
Reset any caches the rule owns. Called whenever stage authoring occurs, such as when we iterate through VariantSet combinations.
- class omni.asset_validator.core.LayerSpecChecker
This checker validates all LayerSpecs to ensure their type names and values types conform to SdfValueTypeNames. Also, their value types (including timesamples) should match the underlying type names.
- CheckLayer(layer: Layer)
Check the given SdfLayer.
- class omni.asset_validator.core.ManifoldChecker
Counts the number of non-manifold edges and vertices. A non-manifold edge has more than two adjacent faces. A non-manifold vertex as more than two adjacent border edges, where a border edge is an edge with only one adjacent face.
Works on non time varying geometry.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.MaterialOldMdlSchemaChecker
Rule ensuring that the deprecated MDL schema is not being used.
The deprecated MDL schema worked by setting the ‘info:implementationSource’ property to ‘mdlMaterial’. The location of the MDL module was passed in via a custom attribute called ‘module’ of type ‘asset’. and the subIdentifier was passed in via a custom called ‘name’ of type ‘string’ or ‘token’.
- update_deprecated_mdl_schema(
- _: Stage,
- prim: Prim,
Update UsdShade.Shader prims that are using the deprecated MDL schema.
- Updating will make the following changes:
Set the ‘info:implementationSource’ attribute to ‘sourceAsset’.
Set the ‘info:mdl:sourceAsset’ attribute to the value held by the ‘module’ attribute of type ‘asset’.
Set the ‘info:mdl:sourceAsset:subIdentifier’ attribute to the value held by the ‘name’ attribute of type ‘string’ or ‘token’.
If either the ‘module’ or ‘name’ attributes do not exist or if they are not of the expected types, then no update will occur and a warning message will be issued.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.MaterialOutOfScopeChecker
USD ignores material bindings which target materials that are outside the payloads’ hierarchy.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.MaterialPathChecker
MDL assets require absolute paths or relative paths prefixed with
./to resolve properly. This Rule suggests to prefix ambiguous MDL asset path(s) with a./to enforce that it is a relative path (i.e./M_PlantSet_A13.mdl).- CheckUnresolvedPaths(unresolvedPaths)
We collect all unresolved paths, this is because all AssetResolvers are already applied and unresolved paths computed here are correct. Any missing path should be validated against this set.
- CheckDependencies(usdStage, layerDeps, assetDeps)
We collect all assetDeps, this is because all AssetResolvers are already applied and resolved paths computed here are correct. Any existing path should be validated against this set.
- classmethod fix_path_callback(
- stage: Stage,
- attribute: Attribute,
Suggestion to fix the path. The fix should take into account the location of the layer to be fixed.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.NormalsExistChecker
Check that meshes have normals. All meshes should have normals unless they have the subdivision scheme set. Meshes cannot have both normals and subdivision set.
- classmethod set_to_none(
- _: Stage,
- mesh: Mesh,
Sets subdivision scheme to None
- classmethod remove_non_primvar_normals(
- _: Stage,
- mesh: Mesh,
Remove the non-primvar normals attribute from the mesh
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.OmniDefaultPrimChecker
When working with layers that represent assets, it is often useful to have a single, active, Xformable or Scope type root prim as the layers default prim.
- class omni.asset_validator.core.OmniMaterialUsdPreviewSurfaceChecker
Rule ensuring that UsdShadeShader prims conform to the UsdPreviewSurface specification.
- class omni.asset_validator.core.OmniOrphanedPrimChecker
Prims usually need a
deforclassspecifier, not justoverspecifiers. However, such overs may be used to hold relationship targets, attribute connections, or speculative opinions.
- class omni.asset_validator.core.OmniSkelUpgradeChecker
Omniverse had integrated a prototype of alternate skinning modes that ended up diverging from OpenUSD. This tries to migrate skinning and annotate the currently unsupported in OpenUSD weighted blend mode with an Omniverse specific API schema. Following are the rules:
If Legacy Omniverse property skel:skinningMethod is presented but OpenUSD supported primvars:skel:skinningMethod is not presented, it should add warning.
If Legacy Omniverse property skel:skinningMethod is presented and its value is ‘DualQuaternion’, it should offer migration path to add new property supported by stock USD.
If Legacy Omniverse property skel:skinningMethod is presented and its value is ‘WeightedBlend’ but no property primvars:skel:skinningBlendWeights is authored, it should warn user about that.
- CheckPrim(prim: Prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.PointsPrecisionErrorChecker
Points must be defined such that the smallest meaningful increment between values is less than 1.0 linear units.
Value greater than this limit have insufficient precision to represent small adjustments, leading to severe rounding, loss of detail, and major rendering or simulation artifacts.
- class omni.asset_validator.core.PointsPrecisionWarningChecker
Points should be defined such that the smallest meaningful increment between values is less than 0.01 linear units.
Value greater than this limit have insufficient precision to represent fine grained adjustments, leading to severe rounding, loss of detail, and major rendering or simulation artifacts.
- class omni.asset_validator.core.ShaderImplementationSourceChecker
Shader prims require a source implementation, which can be one of “id” (for builtins), “sourceAsset” (for assets), or “sourceCode” (for inline JIT compiled shaders). Source Asset or Source Code Shaders can have multiple implementations (e.g. one per renderer) which are differentiated by an arbitrary sourceType prefix.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.SkelBindingAPIAppliedChecker
A prim providing skelBinding properties, must have SkelBindingAPI applied on the prim.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.SubdivisionSchemeChecker
USD default value for subdivision scheme is Catmull-Clark. This is often overlooked and so set incorrectly for tessellated CAD geometry.
This checker ensures that the subdivision scheme is explicitly defined. When it is defined, there is a choice between using subdivision or not.
Use the presence of normals to decide what to suggest as a fixer operation. If there are explicit normals, offer an option to disable subdivision to avoid overwriting these normals. If there are no normals, offer the option to enable subdivision so that normals are created.
Note that these choices are not always going to be the right ones, but they are reasonable defaults.
- classmethod set_to_none(
- _: Stage,
- mesh: Mesh,
Sets subdivision scheme to None
- classmethod set_to_catmull_clark(
- _: Stage,
- mesh: Mesh,
Sets subdivision scheme to Catmull-Clark.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.SupportedFileTypesChecker
For maximum portability, assets should only use file types that are widely supported across platforms. This includes specific formats for USD files, images, and audio. Use only the following file types: USD files: usda, usdc, usd, usdz Image files: png, jpeg/jpg, exr Audio files: M4A, MP3, WAV
- CheckZipFile(
- zip_file: Usd.ZipFile,
- package_path: str,
Scan all files in the usdz file and check if they are allowed.
- CheckUnresolvedPaths(
- unresolvedPaths: list[str],
We check the file types of all unresolved paths.
- CheckDependencies(
- _,
- layer_deps: list[Layer],
- asset_deps: list[str],
We check the file types of all layer_deps and asset_deps.
- class omni.asset_validator.core.TypeChecker
All prims must have a type defined.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UnusedMeshTopologyChecker
Points which are not referenced by the indices can be removed.
Works on non time varying geometry.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UnusedPrimvarChecker
Values which are not referenced by the indices in a primvar can be removed.
Works on non time varying geometry.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UsdAsciiPerformanceChecker
For performance reasons, large arrays and time samples are better stored in crate files. This alerts users to any layers which contain large arrays or time sample dictionaries stored in .usda or ASCII backed .usd files.
- CheckLayer(layer: Layer)
Verify the contents of the the ASCII layer won’t create performance issues.
- class omni.asset_validator.core.UsdDanglingMaterialBinding
Rule ensuring that the bound material exists in the scene.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UsdGeomSubsetChecker
Ensures that a valid family name attribute is set for every UsdGeomSubset that has a material binding.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UsdLuxSchemaChecker
In USD 21.02, Lux attributes were prefixed with inputs: to make them connectable. This rule checker ensure that all UsdLux attributes have the appropriate prefix.
- LUX_ATTRIBUTES: set[str] = {'angle', 'color', 'diffuse', 'enableColorTemperature', 'exposure', 'height', 'intensity', 'length', 'normalize', 'radius', 'shadow:color', 'shadow:distance', 'shadow:enable', 'shadow:falloff', 'shadow:falloffGamma', 'shaping:cone:angle', 'shaping:cone:softness', 'shaping:focus', 'shaping:focusTint', 'shaping:ies:angleScale', 'shaping:ies:file', 'shaping:ies:normalize', 'specular', 'temperature', 'texture:format', 'width'}
List of attributes to check prefixes for.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UsdMaterialBindingApi
Rule ensuring that the MaterialBindingAPI is applied on all prims that have a material binding property.
- CheckPrim(prim)
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.UsdzUdimLimitationChecker
Texture UDIMs are not supported in USDZ files in Nvidia Omniverse. Nvidia Omniverse currently (kit 107.0.3) does not support texture tiles (UDIMs) in USDZ files.
- CheckZipFile(
- _: Usd.ZipFile,
- package_path: str,
We check all dependent usdz layers for UDIM textures.
- class omni.asset_validator.core.ValidateTopologyChecker
Validate the topology of a mesh on all time samples.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.WeldChecker
If attributes contain equal values they can be unified and the indices adjusted accordingly.
Works on non time varying geometry.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.
- class omni.asset_validator.core.ZeroAreaFaceChecker
Faces with zero area can be removed. May produce welding after removal.
Works on non time varying geometry.
- CheckPrim(prim: Prim) None
Check the given prim, which may only exist is a specific combination of variant selections on the UsdStage.