Skip to content

Commit ca90f15

Browse files
committed
USD data : Apply usdfixbrokenpixarschemas
This applies missing MaterialBindingAPI and SkelBindingAPI schemas to prims that are using them. The SkelBindingAPI fix is particularly important, as without it USD 23.11 doesn't recognise the skinning or blendshapes and `USDSceneTest.testSkelSkinning` and `USDSceneTest.testSkelBlendShapes` fail. The MaterialBindingAPI fix is less crucial, and just silences a warning.
1 parent 3590653 commit ca90f15

File tree

2 files changed

+51
-66
lines changed

2 files changed

+51
-66
lines changed
Lines changed: 44 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,53 @@
11
#usda 1.0
2-
# Source: https://graphics.pixar.com/usd/docs/api/_usd_skel__schema_overview.html
2+
#Source: https://graphics.pixar.com/usd/docs/api/_usd_skel__schema_overview.html
33
(
4-
startTimeCode = 1
5-
endTimeCode = 10
4+
endTimeCode = 10
5+
startTimeCode = 1
6+
upAxis = "Y"
67
)
8+
79
def SkelRoot "Model" (
8-
prepend apiSchemas = ["SkelBindingAPI"]
10+
prepend apiSchemas = ["SkelBindingAPI"]
911
)
1012
{
11-
def Skeleton "Skel" {
12-
uniform token[] joints = ["Shoulder", "Shoulder/Elbow", "Shoulder/Elbow/Hand"]
13-
uniform matrix4d[] bindTransforms = [
14-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)),
15-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1)),
16-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,4,1))
17-
]
18-
uniform matrix4d[] restTransforms = [
19-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)),
20-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1)),
21-
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1))
22-
]
23-
def SkelAnimation "Anim" {
24-
uniform token[] joints = ["Shoulder/Elbow"]
13+
def Skeleton "Skel" (
14+
prepend apiSchemas = ["SkelBindingAPI"]
15+
)
16+
{
17+
uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 4, 1) )]
18+
uniform token[] joints = ["Shoulder", "Shoulder/Elbow", "Shoulder/Elbow/Hand"]
19+
uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) )]
20+
rel skel:animationSource = </Model/Skel/Anim>
2521

26-
float3[] translations = [(0,0,2)]
27-
quatf[] rotations.timeSamples = {
28-
1: [(1,0,0,0)],
29-
10: [(0.7071, 0.7071, 0, 0)]
30-
}
31-
half3[] scales = [(1,1,1)]
32-
}
22+
def SkelAnimation "Anim"
23+
{
24+
uniform token[] joints = ["Shoulder/Elbow"]
25+
quatf[] rotations.timeSamples = {
26+
1: [(1, 0, 0, 0)],
27+
10: [(0.7071, 0.7071, 0, 0)],
28+
}
29+
half3[] scales = [(1, 1, 1)]
30+
float3[] translations = [(0, 0, 2)]
31+
}
32+
}
3333

34-
rel skel:animationSource = <Anim>
35-
}
36-
def Mesh "Arm" (
37-
prepend apiSchemas = ["SkelBindingAPI"]
38-
)
39-
{
40-
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
41-
int[] faceVertexIndices = [
42-
2, 3, 1, 0,
43-
6, 7, 5, 4,
44-
8, 9, 7, 6,
45-
3, 2, 9, 8,
46-
10, 11, 4, 5,
47-
0, 1, 11, 10,
48-
7, 9, 10, 5,
49-
9, 2, 0, 10,
50-
3, 8, 11, 1,
51-
8, 6, 4, 11
52-
]
53-
point3f[] points = [
54-
(0.5, -0.5, 4), (-0.5, -0.5, 4), (0.5, 0.5, 4), (-0.5, 0.5, 4),
55-
(-0.5, -0.5, 0), (0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, 0.5, 0),
56-
(-0.5, 0.5, 2), (0.5, 0.5, 2), (0.5, -0.5, 2), (-0.5, -0.5, 2)
57-
]
58-
rel skel:skeleton = </Model/Skel>
59-
int[] primvars:skel:jointIndices = [
60-
2,2,2,2, 0,0,0,0, 1,1,1,1
61-
] (
62-
interpolation = "vertex"
63-
elementSize = 1
64-
)
65-
float[] primvars:skel:jointWeights = [
66-
1,1,1,1, 1,1,1,1, 1,1,1,1
67-
] (
68-
interpolation = "vertex"
69-
elementSize = 1
70-
)
71-
matrix4d primvars:skel:geomBindTransform = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))
72-
}
34+
def Mesh "Arm" (
35+
prepend apiSchemas = ["SkelBindingAPI"]
36+
)
37+
{
38+
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
39+
int[] faceVertexIndices = [2, 3, 1, 0, 6, 7, 5, 4, 8, 9, 7, 6, 3, 2, 9, 8, 10, 11, 4, 5, 0, 1, 11, 10, 7, 9, 10, 5, 9, 2, 0, 10, 3, 8, 11, 1, 8, 6, 4, 11]
40+
point3f[] points = [(0.5, -0.5, 4), (-0.5, -0.5, 4), (0.5, 0.5, 4), (-0.5, 0.5, 4), (-0.5, -0.5, 0), (0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, 0.5, 0), (-0.5, 0.5, 2), (0.5, 0.5, 2), (0.5, -0.5, 2), (-0.5, -0.5, 2)]
41+
matrix4d primvars:skel:geomBindTransform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
42+
int[] primvars:skel:jointIndices = [2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1] (
43+
elementSize = 1
44+
interpolation = "vertex"
45+
)
46+
float[] primvars:skel:jointWeights = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] (
47+
elementSize = 1
48+
interpolation = "vertex"
49+
)
50+
rel skel:skeleton = </Model/Skel>
51+
}
7352
}
53+

contrib/IECoreUSD/test/IECoreUSD/data/shaderNameConflict.usda

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#usda 1.0
2+
(
3+
upAxis = "Y"
4+
)
25

3-
def Xform "shaderLocation"
6+
def Xform "shaderLocation" (
7+
prepend apiSchemas = ["MaterialBindingAPI"]
8+
)
49
{
5-
rel material:binding = </shaderLocation/materials/testMat>
610
custom float arnold:surface = 7
11+
rel material:binding = </shaderLocation/materials/testMat>
712

813
def Scope "materials"
914
{

0 commit comments

Comments
 (0)