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42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975


UsdRi module — pxr-usd-api 105.1 documentation

pxr-usd-api

 »
Modules »
UsdRi module

 

# UsdRi module

Summary: The UsdRi module provides schemas and utilities for authoring USD that encodes Renderman-specific information, and USD/RI data conversions.

Classes:

MaterialAPI
Deprecated

SplineAPI
Deprecated

StatementsAPI
Container namespace schema for all renderman statements.

TextureAPI
Deprecated

Tokens

class pxr.UsdRi.MaterialAPI
Deprecated
Materials should use UsdShadeMaterial instead. This schema will be
removed in a future release.
This API provides outputs that connect a material prim to prman
shaders and RIS objects.
For any described attribute Fallback Value or Allowed Values
below that are text/tokens, the actual token is published and defined
in UsdRiTokens. So to set an attribute to the value”rightHanded”, use
UsdRiTokens->rightHanded as the value.
Methods:

Apply
classmethod Apply(prim) -> MaterialAPI

CanApply
classmethod CanApply(prim, whyNot) -> bool

ComputeInterfaceInputConsumersMap(...)
Walks the namespace subtree below the material and computes a map containing the list of all inputs on the material and the associated vector of consumers of their values.

CreateDisplacementAttr(defaultValue, ...)
See GetDisplacementAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateSurfaceAttr(defaultValue, writeSparsely)
See GetSurfaceAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateVolumeAttr(defaultValue, writeSparsely)
See GetVolumeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get
classmethod Get(stage, path) -> MaterialAPI

GetDisplacement(ignoreBaseMaterial)
Returns a valid shader object if the"displacement"output on the material is connected to one.

GetDisplacementAttr()
Declaration

GetDisplacementOutput()
Returns the"displacement"output associated with the material.

GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetSurface(ignoreBaseMaterial)
Returns a valid shader object if the"surface"output on the material is connected to one.

GetSurfaceAttr()
Declaration

GetSurfaceOutput()
Returns the"surface"output associated with the material.

GetVolume(ignoreBaseMaterial)
Returns a valid shader object if the"volume"output on the material is connected to one.

GetVolumeAttr()
Declaration

GetVolumeOutput()
Returns the"volume"output associated with the material.

SetDisplacementSource(displacementPath)

param displacementPath

SetSurfaceSource(surfacePath)

param surfacePath

SetVolumeSource(volumePath)

param volumePath

static Apply()
classmethod Apply(prim) -> MaterialAPI
Applies this single-apply API schema to the given prim .
This information is stored by adding”RiMaterialAPI”to the token-
valued, listOp metadata apiSchemas on the prim.
A valid UsdRiMaterialAPI object is returned upon success. An invalid
(or empty) UsdRiMaterialAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters
prim (Prim) – 

static CanApply()
classmethod CanApply(prim, whyNot) -> bool
Returns true if this single-apply API schema can be applied to the
given prim .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates whyNot with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters

prim (Prim) – 
whyNot (str) – 

ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) → NodeGraph.InterfaceInputConsumersMap
Walks the namespace subtree below the material and computes a map
containing the list of all inputs on the material and the associated
vector of consumers of their values.
The consumers can be inputs on shaders within the material or on node-
graphs under it.

Parameters
computeTransitiveConsumers (bool) – 

CreateDisplacementAttr(defaultValue, writeSparsely) → Attribute
See GetDisplacementAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

CreateSurfaceAttr(defaultValue, writeSparsely) → Attribute
See GetSurfaceAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

CreateVolumeAttr(defaultValue, writeSparsely) → Attribute
See GetVolumeAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

static Get()
classmethod Get(stage, path) -> MaterialAPI
Return a UsdRiMaterialAPI holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdRiMaterialAPI(stage->GetPrimAtPath(path));

Parameters

stage (Stage) – 
path (Path) – 

GetDisplacement(ignoreBaseMaterial) → Shader
Returns a valid shader object if the”displacement”output on the
material is connected to one.
If ignoreBaseMaterial is true and if the”displacement”shader
source is specified in the base-material of this material, then this
returns an invalid shader object.

Parameters
ignoreBaseMaterial (bool) – 

GetDisplacementAttr() → Attribute
Declaration
token outputs:ri:displacement
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token

GetDisplacementOutput() → Output
Returns the”displacement”output associated with the material.

static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.

Parameters
includeInherited (bool) – 

GetSurface(ignoreBaseMaterial) → Shader
Returns a valid shader object if the”surface”output on the material is
connected to one.
If ignoreBaseMaterial is true and if the”surface”shader source is
specified in the base-material of this material, then this returns an
invalid shader object.

Parameters
ignoreBaseMaterial (bool) – 

GetSurfaceAttr() → Attribute
Declaration
token outputs:ri:surface
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token

GetSurfaceOutput() → Output
Returns the”surface”output associated with the material.

GetVolume(ignoreBaseMaterial) → Shader
Returns a valid shader object if the”volume”output on the material is
connected to one.
If ignoreBaseMaterial is true and if the”volume”shader source is
specified in the base-material of this material, then this returns an
invalid shader object.

Parameters
ignoreBaseMaterial (bool) – 

GetVolumeAttr() → Attribute
Declaration
token outputs:ri:volume
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token

GetVolumeOutput() → Output
Returns the”volume”output associated with the material.

SetDisplacementSource(displacementPath) → bool

Parameters
displacementPath (Path) – 

SetSurfaceSource(surfacePath) → bool

Parameters
surfacePath (Path) – 

SetVolumeSource(volumePath) → bool

Parameters
volumePath (Path) – 

class pxr.UsdRi.SplineAPI
Deprecated
This API schema will be removed in a future release.
RiSplineAPI is a general purpose API schema used to describe a named
spline stored as a set of attributes on a prim.
It is an add-on schema that can be applied many times to a prim with
different spline names. All the attributes authored by the schema are
namespaced under”$NAME:spline:”, with the name of the spline providing
a namespace for the attributes.
The spline describes a 2D piecewise cubic curve with a position and
value for each knot. This is chosen to give straightforward artistic
control over the shape. The supported basis types are:

linear (UsdRiTokens->linear)
bspline (UsdRiTokens->bspline)
Catmull-Rom (UsdRiTokens->catmullRom)

Methods:

Apply
classmethod Apply(prim) -> SplineAPI

CanApply
classmethod CanApply(prim, whyNot) -> bool

CreateInterpolationAttr(defaultValue, ...)
See GetInterpolationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreatePositionsAttr(defaultValue, writeSparsely)
See GetPositionsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateValuesAttr(defaultValue, writeSparsely)
See GetValuesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get
classmethod Get(stage, path) -> SplineAPI

GetInterpolationAttr()
Interpolation method for the spline.

GetPositionsAttr()
Positions of the knots.

GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetValuesAttr()
Values of the knots.

GetValuesTypeName()
Returns the intended typename of the values attribute of the spline.

Validate(reason)
Validates the attribute values belonging to the spline.

static Apply()
classmethod Apply(prim) -> SplineAPI
Applies this single-apply API schema to the given prim .
This information is stored by adding”RiSplineAPI”to the token-valued,
listOp metadata apiSchemas on the prim.
A valid UsdRiSplineAPI object is returned upon success. An invalid (or
empty) UsdRiSplineAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters
prim (Prim) – 

static CanApply()
classmethod CanApply(prim, whyNot) -> bool
Returns true if this single-apply API schema can be applied to the
given prim .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates whyNot with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters

prim (Prim) – 
whyNot (str) – 

CreateInterpolationAttr(defaultValue, writeSparsely) → Attribute
See GetInterpolationAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

CreatePositionsAttr(defaultValue, writeSparsely) → Attribute
See GetPositionsAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

CreateValuesAttr(defaultValue, writeSparsely) → Attribute
See GetValuesAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

static Get()
classmethod Get(stage, path) -> SplineAPI
Return a UsdRiSplineAPI holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdRiSplineAPI(stage->GetPrimAtPath(path));

Parameters

stage (Stage) – 
path (Path) – 

GetInterpolationAttr() → Attribute
Interpolation method for the spline.
C++ Type: TfToken  Usd Type: SdfValueTypeNames->Token  Variability:
SdfVariabilityUniform  Fallback Value: linear  Allowed Values :
[linear, constant, bspline, catmullRom]

GetPositionsAttr() → Attribute
Positions of the knots.
C++ Type: VtArray<float>  Usd Type: SdfValueTypeNames->FloatArray
Variability: SdfVariabilityUniform  Fallback Value: No Fallback

static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.

Parameters
includeInherited (bool) – 

GetValuesAttr() → Attribute
Values of the knots.
C++ Type: See GetValuesTypeName()  Usd Type: See GetValuesTypeName()
Variability: SdfVariabilityUniform  Fallback Value: No Fallback

GetValuesTypeName() → ValueTypeName
Returns the intended typename of the values attribute of the spline.

Validate(reason) → bool
Validates the attribute values belonging to the spline.
Returns true if the spline has all valid attribute values. Returns
false and populates the reason output argument if the spline has
invalid attribute values.
Here’s the list of validations performed by this method:

the SplineAPI must be fully initialized
interpolation attribute must exist and use an allowed value
the positions array must be a float array
the positions array must be sorted by increasing value
the values array must use the correct value type
the positions and values array must have the same size

Parameters
reason (str) – 

class pxr.UsdRi.StatementsAPI
Container namespace schema for all renderman statements.
The longer term goal is for clients to go directly to primvar or
render-attribute API’s, instead of using UsdRi StatementsAPI for
inherited attributes. Anticpating this, StatementsAPI can smooth the
way via a few environment variables:

USDRI_STATEMENTS_READ_OLD_ENCODING: Causes StatementsAPI to read
old-style attributes instead of primvars in the”ri:”namespace.

Methods:

Apply
classmethod Apply(prim) -> StatementsAPI

CanApply
classmethod CanApply(prim, whyNot) -> bool

CreateRiAttribute(name, riType, nameSpace)
Create a rib attribute on the prim to which this schema is attached.

Get
classmethod Get(stage, path) -> StatementsAPI

GetCoordinateSystem()
Returns the value in the"ri:coordinateSystem"attribute if it exists.

GetModelCoordinateSystems(targets)
Populates the output targets with the authored ri:modelCoordinateSystems, if any.

GetModelScopedCoordinateSystems(targets)
Populates the output targets with the authored ri:modelScopedCoordinateSystems, if any.

GetRiAttribute(name, nameSpace)
Return a UsdAttribute representing the Ri attribute with the name name, in the namespace nameSpace.

GetRiAttributeName
classmethod GetRiAttributeName(prop) -> str

GetRiAttributeNameSpace
classmethod GetRiAttributeNameSpace(prop) -> str

GetRiAttributes(nameSpace)
Return all rib attributes on this prim, or under a specific namespace (e.g."user").

GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetScopedCoordinateSystem()
Returns the value in the"ri:scopedCoordinateSystem"attribute if it exists.

HasCoordinateSystem()
Returns true if the underlying prim has a ri:coordinateSystem opinion.

HasScopedCoordinateSystem()
Returns true if the underlying prim has a ri:scopedCoordinateSystem opinion.

IsRiAttribute
classmethod IsRiAttribute(prop) -> bool

MakeRiAttributePropertyName
classmethod MakeRiAttributePropertyName(attrName) -> str

SetCoordinateSystem(coordSysName)
Sets the"ri:coordinateSystem"attribute to the given string value, creating the attribute if needed.

SetScopedCoordinateSystem(coordSysName)
Sets the"ri:scopedCoordinateSystem"attribute to the given string value, creating the attribute if needed.

static Apply()
classmethod Apply(prim) -> StatementsAPI
Applies this single-apply API schema to the given prim .
This information is stored by adding”StatementsAPI”to the token-
valued, listOp metadata apiSchemas on the prim.
A valid UsdRiStatementsAPI object is returned upon success. An invalid
(or empty) UsdRiStatementsAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters
prim (Prim) – 

static CanApply()
classmethod CanApply(prim, whyNot) -> bool
Returns true if this single-apply API schema can be applied to the
given prim .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates whyNot with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters

prim (Prim) – 
whyNot (str) – 

CreateRiAttribute(name, riType, nameSpace) → Attribute
Create a rib attribute on the prim to which this schema is attached.
A rib attribute consists of an attribute “nameSpace” and an
attribute “name”. For example, the namespace”cull”may define
attributes”backfacing”and”hidden”, and user-defined attributes belong
to the namespace”user”.
This method makes no attempt to validate that the given nameSpace
and name are actually meaningful to prman or any other renderer.
riType
should be a known RenderMan type definition, which can be array-
valued. For instance, both”color”and”float[3]”are valid values for
riType .

Parameters

name (str) – 
riType (str) – 
nameSpace (str) – 

CreateRiAttribute(name, tfType, nameSpace) -> Attribute
Creates an attribute of the given tfType .
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.

Parameters

name (str) – 
tfType (Type) – 
nameSpace (str) – 

static Get()
classmethod Get(stage, path) -> StatementsAPI
Return a UsdRiStatementsAPI holding the prim adhering to this schema
at path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdRiStatementsAPI(stage->GetPrimAtPath(path));

Parameters

stage (Stage) – 
path (Path) – 

GetCoordinateSystem() → str
Returns the value in the”ri:coordinateSystem”attribute if it exists.

GetModelCoordinateSystems(targets) → bool
Populates the output targets with the authored
ri:modelCoordinateSystems, if any.
Returns true if the query was successful.

Parameters
targets (list[SdfPath]) – 

GetModelScopedCoordinateSystems(targets) → bool
Populates the output targets with the authored
ri:modelScopedCoordinateSystems, if any.
Returns true if the query was successful.

Parameters
targets (list[SdfPath]) – 

GetRiAttribute(name, nameSpace) → Attribute
Return a UsdAttribute representing the Ri attribute with the name
name, in the namespace nameSpace.
The attribute returned may or may not actually exist so it must be
checked for validity.

Parameters

name (str) – 
nameSpace (str) – 

static GetRiAttributeName()
classmethod GetRiAttributeName(prop) -> str
Return the base, most-specific name of the rib attribute.
For example, the name of the rib
attribute”cull:backfacing”is”backfacing”

Parameters
prop (Property) – 

static GetRiAttributeNameSpace()
classmethod GetRiAttributeNameSpace(prop) -> str
Return the containing namespace of the rib attribute (e.g.”user”).

Parameters
prop (Property) – 

GetRiAttributes(nameSpace) → list[Property]
Return all rib attributes on this prim, or under a specific namespace
(e.g.”user”).
As noted above, rib attributes can be either UsdAttribute or
UsdRelationship, and like all UsdProperties, need not have a defined
value.

Parameters
nameSpace (str) – 

static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.

Parameters
includeInherited (bool) – 

GetScopedCoordinateSystem() → str
Returns the value in the”ri:scopedCoordinateSystem”attribute if it
exists.

HasCoordinateSystem() → bool
Returns true if the underlying prim has a ri:coordinateSystem opinion.

HasScopedCoordinateSystem() → bool
Returns true if the underlying prim has a ri:scopedCoordinateSystem
opinion.

static IsRiAttribute()
classmethod IsRiAttribute(prop) -> bool
Return true if the property is in the”ri:attributes”namespace.

Parameters
prop (Property) – 

static MakeRiAttributePropertyName()
classmethod MakeRiAttributePropertyName(attrName) -> str
Returns the given attrName prefixed with the full Ri attribute
namespace, creating a name suitable for an RiAttribute UsdProperty.
This handles conversion of common separator characters used in other
packages, such as periods and underscores.
Will return empty string if attrName is not a valid property
identifier; otherwise, will return a valid property name that
identifies the property as an RiAttribute, according to the following
rules:

If attrName is already a properly constructed RiAttribute
property name, return it unchanged.
If attrName contains two or more tokens separated by a
colon, consider the first to be the namespace, and the rest the
name, joined by underscores
If attrName contains two or more tokens separated by a
period, consider the first to be the namespace, and the rest the
name, joined by underscores
If attrName contains two or more tokens separated by an,
underscore consider the first to be the namespace, and the rest the
name, joined by underscores
else, assume attrName is the name, and”user”is the namespace

Parameters
attrName (str) – 

SetCoordinateSystem(coordSysName) → None
Sets the”ri:coordinateSystem”attribute to the given string value,
creating the attribute if needed.
That identifies this prim as providing a coordinate system, which can
be retrieved via UsdGeomXformable::GetTransformAttr(). Also adds the
owning prim to the ri:modelCoordinateSystems relationship targets on
its parent leaf model prim, if it exists. If this prim is not under a
leaf model, no relationship targets will be authored.

Parameters
coordSysName (str) – 

SetScopedCoordinateSystem(coordSysName) → None
Sets the”ri:scopedCoordinateSystem”attribute to the given string
value, creating the attribute if needed.
That identifies this prim as providing a coordinate system, which can
be retrieved via UsdGeomXformable::GetTransformAttr(). Such coordinate
systems are local to the RI attribute stack state, but does get
updated properly for instances when defined inside an object master.
Also adds the owning prim to the ri:modelScopedCoordinateSystems
relationship targets on its parent leaf model prim, if it exists. If
this prim is not under a leaf model, no relationship targets will be
authored.

Parameters
coordSysName (str) – 

class pxr.UsdRi.TextureAPI
Deprecated
This API schema will be removed in a future release.
RiTextureAPI is an API schema that provides an interface to add
Renderman-specific attributes to adjust textures.
Methods:

Apply
classmethod Apply(prim) -> TextureAPI

CanApply
classmethod CanApply(prim, whyNot) -> bool

CreateRiTextureGammaAttr(defaultValue, ...)
See GetRiTextureGammaAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateRiTextureSaturationAttr(defaultValue, ...)
See GetRiTextureSaturationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get
classmethod Get(stage, path) -> TextureAPI

GetRiTextureGammaAttr()
Gamma-correct the texture.

GetRiTextureSaturationAttr()
Adjust the texture's saturation.

GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

static Apply()
classmethod Apply(prim) -> TextureAPI
Applies this single-apply API schema to the given prim .
This information is stored by adding”RiTextureAPI”to the token-valued,
listOp metadata apiSchemas on the prim.
A valid UsdRiTextureAPI object is returned upon success. An invalid
(or empty) UsdRiTextureAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters
prim (Prim) – 

static CanApply()
classmethod CanApply(prim, whyNot) -> bool
Returns true if this single-apply API schema can be applied to the
given prim .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates whyNot with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()

Parameters

prim (Prim) – 
whyNot (str) – 

CreateRiTextureGammaAttr(defaultValue, writeSparsely) → Attribute
See GetRiTextureGammaAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

CreateRiTextureSaturationAttr(defaultValue, writeSparsely) → Attribute
See GetRiTextureSaturationAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .

Parameters

defaultValue (VtValue) – 
writeSparsely (bool) – 

static Get()
classmethod Get(stage, path) -> TextureAPI
Return a UsdRiTextureAPI holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdRiTextureAPI(stage->GetPrimAtPath(path));

Parameters

stage (Stage) – 
path (Path) – 

GetRiTextureGammaAttr() → Attribute
Gamma-correct the texture.
Declaration
float ri:texture:gamma
C++ Type
float
Usd Type
SdfValueTypeNames->Float

GetRiTextureSaturationAttr() → Attribute
Adjust the texture’s saturation.
Declaration
float ri:texture:saturation
C++ Type
float
Usd Type
SdfValueTypeNames->Float

static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.

Parameters
includeInherited (bool) – 

class pxr.UsdRi.Tokens
Attributes:

bspline

catmullRom

constant

interpolation

linear

outputsRiDisplacement

outputsRiSurface

outputsRiVolume

positions

renderContext

riTextureGamma

riTextureSaturation

spline

values

bspline = 'bspline'

catmullRom = 'catmull-rom'

constant = 'constant'

interpolation = 'interpolation'

linear = 'linear'

outputsRiDisplacement = 'outputs:ri:displacement'

outputsRiSurface = 'outputs:ri:surface'

outputsRiVolume = 'outputs:ri:volume'

positions = 'positions'

renderContext = 'ri'

riTextureGamma = 'ri:texture:gamma'

riTextureSaturation = 'ri:texture:saturation'

spline = 'spline'

values = 'values'

© Copyright 2019-2023, NVIDIA.
      Last updated on Nov 14, 2023.