1USDGENSCHEMAFROMSDR(1)           User Commands          USDGENSCHEMAFROMSDR(1)
2
3
4

NAME

6       usdgenschemafromsdr - manual page for usdgenschemafromsdr 22.05b
7

DESCRIPTION

9       usage: usdgenschemafromsdr [-h] [--noreadme] [-v]
10
11              [schemaConfig] [schemaGenerationPath]
12
13              This  script generates dynamic schema.usda, generatedSchema.usda
14              and plugInfo.json. The schema.usda is generated by  parsing  ap‐
15              propriate sdrNodes provided in a config file. Along with provid‐
16              ing sdrNodes types and identifier, the config file also provides
17              a  list of subLayers which the auto populated schema.usda should
18              sublayer. Code generation can also be optionally enabled via the
19              json config, note that code generation is disabled by default.
20
21              The script takes 3 arguments:
22
23              - a json config, providing sdrNodes via sourceType, sdrNodeIden‐
24              tifiers
25
26              or explicit list of absolute asset file paths (sourceAssetNodes)
27              and a list of sublayers.
28
29              -  a  destination directory. Note that a schema.usda with appro‐
30              priate
31
32              GLOBAL prim providing a libraryName in its customData,  must  be
33              present at this location. This is also the location where gener‐
34              atedSchema.usda, plugInfo.json will get exported.  In  the  case
35              code generation is explicitly enabled in the config, libraryPath
36              must also be provided along with libraryName in the  customData,
37              else usdGenSchema will fail.
38
39              -  an optional noreadme to ignore generating a README.md provid‐
40              ing brief
41
42              explaination of the contents of the directory.
43
44              This  script  will  run  usdGenSchema  on  the  auto   populated
45              schema.usda.
46
47              The schema.usda populated specifications from the provided sdrN‐
48              odes using UsdUtils.UpdateSchemaWithSdrNode and  skipCodeGenera‐
49              tion  metadata  will  be  set  to true, unless explicitly marked
50              False in the config for this schema.usda.
51
52              UsdUtils.UpdateSchemaWithSdrNode is responsible for:
53
54              Updates the given schemaLayer with  primSpec  and  propertySpecs
55              from sdrNode metadata.
56
57              A renderContext can be provided which is used in determining the
58              shaderId namespace,  which  follows  the  pattern:  "<renderCon‐
59              text>:<SdrShaderNodeContext>:shaderId". Note that we are using a
60              node's context (SDR_NODE_CONTEXT_TOKENS) here to  construct  the
61              shaderId  namespace,  so  shader parsers should make sure to use
62              appropriate SDR_NODE_CONTEXT_TOKENS in the node definitions.
63
64              overrideIdentifier parameter is the identifier which  should  be
65              used  when  the  identifier  of the node being processed differs
66              from the one Sdr will discover at runtime,  such  as  when  this
67              function  is def a node constructed from an explicit asset path.
68              This should only be used when clients know the identifier  being
69              passed  is  the  true  identifier which sdr Runtime will provide
70              when querying using GetShaderNodeByIdentifierAndType, etc.
71
72              It consumes the following attributes (that manifest as Sdr meta‐
73              data) in addition to many of the standard Sdr metadata specified
74              and parsed (via its parser plugin).
75
76              Node Level Metadata:
77
78              - "schemaName": Name of the new schema populated from the  given
79              sdrNode
80
81              (Required)
82
83              - "schemaKind": Specifies the UsdSchemaKind for the schema being
84
85              populated  from  the  sdrNode.  (Note that this does not support
86              multiple apply schema kinds).
87
88              - "schemaBase": Base schema from which the new schema should in‐
89              herit
90
91              from. Note this defaults to "APISchemaBase" for an API schema or
92              "Typed" for a concrete scheme.
93
94              - "apiSchemasForAttrPruning": A list of core API  schemas  which
95              will be
96
97              composed  together and any shared shader property from this prim
98              definition is pruned from the resultant schema.
99
100              - "typedSchemaForAttrPruning": A core typed schema which will be
101
102              composed together  with  the  apiSchemasForAttrPruning  and  any
103              shared  shader property from this prim definition is pruned from
104              the resultant schema. If no  typedSchemaForAttrPruning  is  pro‐
105              vided  then  only  the  apiSchemasForAttrPruning are composed to
106              create a prim definition. This will only be used  when  creating
107              an APISchema.
108
109              - "apiSchemaAutoApplyTo": The schemas to which the sdrNode popu‐
110              lated
111
112              API schema will autoApply to.
113
114              - "apiSchemaCanOnlyApplyTo": If specified, the API schema gener‐
115              ated
116
117              from  the  sdrNode  can  only  be validly applied to this set of
118              schemas.
119
120              - "providesUsdShadeConnectableAPIBehavior": Used to enable a
121
122              connectability behavior for an API schema.
123
124              - "isUsdShadeContainer": Only used when
125
126              providesUsdShadeConnectableAPIBehavior is set to true. Marks the
127              connectable prim as a UsdShade container type.
128
129              - "requiresUsdShadeEncapsulation": Only used when
130
131              providesUsdShadeConnectableAPIBehavior  is  set to true. Config‐
132              ures the UsdShade encapsulation rules governing its connectable‐
133              Behavior.
134
135              -  "tfTypeNameSuffix": Class name which will get registered with
136              TfType
137
138              system. This gets appended to the domain name to  register  with
139              TfType.
140
141              -  "schemaPropertyNSPrefixOverride":  Node  level metadata which
142              can drive
143
144              all node's properties namespace prefix. This can be  useful  for
145              non  connectable  nodes which should not get UsdShade inputs and
146              outputs namespace prefix.
147
148              Property Level Metadata:
149
150              - "usdVariability": Property level metadata  which  specifies  a
151              specific
152
153              sdrNodeProperty  should  have its USD variability set to Uniform
154              or Varying
155
156              - "usdSuppressProperty": A property level metadata which  deter‐
157              mines if
158
159              the  property should be suppressed from translation from args to
160              property spec.
161
162              - "propertyNSPrefixOverride": Provides a way to override a prop‐
163              erty's
164
165              namespace  from  the default (inputs:/outputs:) or from a node's
166              schemaPropertyNSPrefixOverride metadata.
167
168              Sdr Property Metadata to SdfPropertySpec Translations
169
170              - A "null" value for Widget sdrProperty metadata translates to
171
172              SdfPropertySpec Hidden metadata.
173
174              - SdrProperty's Help metadata (Label metadata if  Help  metadata
175              not
176
177              provided)  translates  to SdfPropertySpec's Documentation string
178              metadata.
179
180              - SdrProperty's Page metadata translates to SdfPropertySpec's
181
182              DisplayGroup metadata.
183
184              - SdrProperty's Label metadata translates to SdfPropertySpec's
185
186              DisplayName metadata.
187
188              - SdrProperty's Options translates to SdfPropertySpec's Allowed‐
189              Tokens.   - SdrProperty's Default value translates to SdfProper‐
190              tySpec's Default
191
192              value.
193
194              - Connectable input properties translates to InterfaceOnly
195
196              SdfPropertySpec's CONNECTABILITY.
197
198   positional arguments:
199       schemaConfig
200              A json config providing sdrNodes via sourceType,  sdrNodeIdenti‐
201              fiers  or  explicit list of absolute asset file paths (sourceAs‐
202              setNodes).  Note that for nodes specified under sourceAssetNodes
203              we  will  use the basename stripped of extension as the shaderId
204              for nodes we create.  And also optionally providing  a  list  of
205              sublayers  which  the schema.usda will sublayer. Code generation
206              can also be optionally enabled via the json  config,  note  that
207              code  generation  is disabled by default. [Default: ./schemaCon‐
208              fig.json]').  Example json config file:
209
210       {      "sdrNodes": {
211
212       "renderContext": "myRenderContext",
213              "sourceType": [
214
215       "sdrIdentifier1",
216              "sdrIdentifier2", "sdrIdentifier3"
217
218       ],     "sourceAssetNodes": [
219
220       "/absolutepath/to/sdrNodeIdentifyingAsset1.extension,
221              "/absolutepath/to/sdrNodeIdentifyingAsset1.extension,
222
223       ],     }, "sublayers": [
224
225       "usd/schema.usda",
226              "usdGeom/schema.usda", "usdLux/schema.usda" ],
227
228       "skipCodeGeneration": True
229              }
230
231       schemaGenerationPath
232              The target directory where the code  should  be  generated.  The
233              script  assumes  a basic schema.usda is defined at this location
234              with a GLOBAL  prim  configured  with  appropriate  libraryName.
235              [Default: .]
236
237   options:
238       -h, --help
239              show this help message and exit
240
241       --noreadme
242              When specified a README.md will not be created in the schemaGen‐
243              erationPath explaining the source of the contents of this direc‐
244              tory.
245
246       -v, --validate
247              This  is  passed  to usdGenSchem to verify that the source files
248              are unchanged.
249
250
251
252usdgenschemafromsdr 22.05b       November 2023          USDGENSCHEMAFROMSDR(1)
Impressum