USDGENSCHEMAFROMSDR(1)
β¨ NAME β¨
usdgenschemafromsdr β manual page for usdgenschemafromsdr 26.11.1, in the User Commands section π
πΈ DESCRIPTION πΈ
Okay so bestie, usdgenschemafromsdr is the script that generates dynamic schema.usda, generatedSchema.usda and plugInfo.json. The schema.usda is generated by parsing appropriate sdrNodes provided in a config file. Along with providing sdrNodes types and identifier, the config file also provides a list of subLayers which the auto populated schema.usda should sublayer. Code generation can also be optionally enabled via the json config β note that code generation is disabled by default. π
usage: usdgenschemafromsdr [-h] [--noreadme] [-v]
[schemaConfig] [schemaGenerationPath]
The script takes 3 arguments:
- a json config, providing
sdrNodesviasourceType,sdrNodeIdentifiersor explicit list of absolute asset file paths (sourceAssetNodes) and a list of sublayers. The asset file paths might also contain environment variables, so users must set these prior to running the script. - a destination directory. Note that a
schema.usdawith appropriateGLOBALprim providing alibraryNamein itscustomData, must be present at this location. This is also the location wheregeneratedSchema.usda,plugInfo.jsonwill get exported. In the case code generation is explicitly enabled in the config,libraryPathmust also be provided along withlibraryNamein thecustomData, elseusdGenSchemawill fail. - an optional
noreadmeto ignore generating aREADME.mdproviding brief explaination of the contents of the directory.
This script will run usdGenSchema on the auto populated schema.usda.
If regenerating schemas, it's recommended to set the USD_DISABLE_AUTO_APPLY_API_SCHEMAS environment variable to true in order to prevent any previously generated auto-apply API schemas from being applied to the specified schema bases which can result in extra properties being pruned. No cap, that one matters. π
The schema.usda populated specifications from the provided sdrNodes using UsdUtils.UpdateSchemaWithSdrNode and skipCodeGeneration metadata will be set to true, unless explicitly marked False in the config for this schema.usda.
UsdUtils.UpdateSchemaWithSdrNode is responsible for:
Updates the given schemaLayer with primSpec and propertySpecs from sdrNode metadata.
A renderContext can be provided which is used in determining the shaderId namespace, which follows the pattern: "<renderContext>:<SdrShaderNodeContext>:shaderId". Note that we are using a node's context (SDR_NODE_CONTEXT_TOKENS) here to construct the shaderId namespace, so shader parsers should make sure to use appropriate SDR_NODE_CONTEXT_TOKENS in the node definitions.
overrideIdentifier parameter is the identifier which should be used when the identifier of the node being processed differs from the one Sdr will discover at runtime, such as when this function is called on a node constructed from an explicit asset path. This should only be used when clients know the identifier being passed is the true identifier which sdr Runtime will provide when querying using GetShaderNodeByIdentifierAndType, etc.
It consumes the following attributes (that manifest as Sdr metadata) in addition to many of the standard Sdr metadata specified and parsed (via its parser plugin). π«Ά
π§© Node Level Metadata:
"schemaName"β Name of the new schema populated from the givensdrNode(Required)"schemaKind"β Specifies theUsdSchemaKindfor the schema being populated from thesdrNode. (Note that this does not support multiple apply schema kinds)."schemaBase"β Base schema from which the new schema should inherit from. Note this defaults to"APISchemaBase"for an API schema or"Typed"for a concrete scheme."apiSchemasForAttrPruning"β A list of core API schemas which will be composed together and any shared shader property from this prim definition is pruned from the resultant schema."typedSchemaForAttrPruning"β A core typed schema which will be composed together with theapiSchemasForAttrPruningand any shared shader property from this prim definition is pruned from the resultant schema. If notypedSchemaForAttrPruningis provided then only theapiSchemasForAttrPruningare composed to create a prim definition. This will only be used when creating anAPISchema."apiSchemaAutoApplyTo"β The schemas to which thesdrNodepopulated API schema willautoApplyto."apiSchemaCanOnlyApplyTo"β If specified, the API schema generated from thesdrNodecan only be validly applied to this set of schemas."providesUsdShadeConnectableAPIBehavior"β Used to enable a connectability behavior for an API schema."isUsdShadeContainer"β Only used whenprovidesUsdShadeConnectableAPIBehavioris set to true. Marks the connectable prim as aUsdShadecontainer type."requiresUsdShadeEncapsulation"β Only used whenprovidesUsdShadeConnectableAPIBehavioris set to true. Configures theUsdShadeencapsulation rules governing itsconnectableBehavior."tfTypeNameSuffix"β Class name which will get registered withTfTypesystem. This gets appended to the domain name to register withTfType."schemaPropertyNSPrefixOverride"β Node level metadata which can drive all node's properties namespace prefix. This can be useful for non connectable nodes which should not getUsdShadeinputs and outputs namespace prefix.
π Property Level Metadata:
"usdVariability"β Property level metadata which specifies a specificsdrNodePropertyshould have its USD variability set toUniformorVarying"usdSuppressProperty"β A property level metadata which determines if the property should be suppressed from translation from args to property spec."propertyNSPrefixOverride"β Provides a way to override a property's namespace from the default (inputs:/outputs:) or from a node'sschemaPropertyNSPrefixOverridemetadata.
π Sdr Property Metadata to SdfPropertySpec Translations
- A
"null"value for WidgetSdrShaderPropertymetadata translates to'hidden'in theSdfPropertySpec'suiHintsmetadata dictionary. SdrShaderProperty's Help metadata (Label metadata if Help metadata not provided) translates to theSdfPropertySpec'suserDocBriefanduserDoccustom metadata strings.SdrShaderProperty's Page metadata translates to'displayGroup'in theSdfPropertySpec'suiHintsmetadata dictionary.SdrShaderProperty's Label metadata translates to'displayName'in theSdfPropertySpec'suiHintsmetadata dictionary.SdrShaderProperty's Options translates to either'allowedTokens'(when either labels or values are provided) or'valueLabels'(when both labels and values are provided) in theSdfPropertySpec'suiHintsmetadata dictionary. For backwards compatibility, setUSD_POPULATE_LEGACY_ALLOWED_TOKENSto writeallowedTokensin addition tovalueLabelsfor string- and token-valued attributes that provide both labels and values.SdrShaderProperty's Default value translates to theSdfPropertySpec's Default value.- Connectable input properties translates to
InterfaceOnlySdfPropertySpec'sCONNECTABILITY.
π₯ positional arguments:
schemaConfig β A json config providing sdrNodes via sourceType, sdrNodeIdentifiers or explicit list of absolute asset file paths (sourceAssetNodes). Note that for nodes specified under sourceAssetNodes we will use the basename stripped of extension as the shaderId for nodes we create. If node paths specified in sourceAssetNodes contain any environment variables, user is required to set these prior to running the script. And also optionally providing a list of sublayers which the schema.usda will sublayer. Code generation can also be optionally enabled via the json config, note that code generation is disabled by default. [Default: ./schemaConfig.json]'). Example json config file:
{ "sdrNodes": {
"renderContext": "myRenderContext",
"sourceType": [
"sdrIdentifier1",
"sdrIdentifier2", "sdrIdentifier3"
], "sourceAssetNodes": [
"/absolutepath/to/sdrNodeIdentifyingAsset1.extension,
"/absolutepath/to/sdrNodeIdentifyingAsset1.extension,
], }, "sublayers": [
"usd/schema.usda",
"usdGeom/schema.usda", "usdLux/schema.usda" ],
"skipCodeGeneration": True
}
schemaGenerationPath β The target directory where the code should be generated. The script assumes a basic schema.usda is defined at this location with a GLOBAL prim configured with appropriate libraryName. [Default: .]
π options:
-h,--helpβ show this help message and exit--noreadmeβ When specified aREADME.mdwill not be created in theschemaGenerationPathexplaining the source of the contents of this directory.-v,--validateβ This is passed tousdGenSchemto verify that the source files are unchanged.
β from your bestie usdgenschemafromsdr 26.11.1, October 2026 πβ¨
π¦ where this page comes from
- arch rolling: usd 26.11.1-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms