-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1432 from johnhaddon/facevaryingNormalSkinning
USD PrimitiveAlgo : Fix loading of facevarying skinned normals
- Loading branch information
Showing
4 changed files
with
166 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
contrib/IECoreUSD/test/IECoreUSD/data/skinnedFaceVaryingNormals.usda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#usda 1.0 | ||
( | ||
defaultPrim = "main" | ||
metersPerUnit = 0.01 | ||
upAxis = "Y" | ||
) | ||
|
||
def SkelRoot "main" ( | ||
kind = "component" | ||
) | ||
{ | ||
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)] | ||
|
||
def Mesh "pCube1" ( | ||
prepend apiSchemas = ["SkelBindingAPI"] | ||
) | ||
{ | ||
uniform bool doubleSided = 1 | ||
float3[] extent = [(-0.5, -0.5, -0.5), (0.5, 0.5, 0.5)] | ||
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4] | ||
int[] faceVertexIndices = [0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 1, 0, 1, 7, 5, 3, 6, 0, 2, 4] | ||
normal3f[] normals = [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0)] ( | ||
interpolation = "faceVarying" | ||
) | ||
point3f[] points = [(-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (-0.5, 0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5)] | ||
matrix4d primvars:skel:geomBindTransform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ) | ||
int[] primvars:skel:jointIndices = [0, 0, 0, 0, 0, 0, 0, 0] ( | ||
elementSize = 1 | ||
interpolation = "vertex" | ||
) | ||
float[] primvars:skel:jointWeights = [1, 1, 1, 1, 1, 1, 1, 1] ( | ||
elementSize = 1 | ||
interpolation = "vertex" | ||
) | ||
uniform token[] skel:joints = ["joint1"] | ||
rel skel:skeleton = </main/joint1> | ||
uniform token subdivisionScheme = "none" | ||
} | ||
|
||
def Skeleton "joint1" ( | ||
prepend apiSchemas = ["SkelBindingAPI"] | ||
customData = { | ||
dictionary Maya = { | ||
bool generated = 1 | ||
} | ||
} | ||
) | ||
{ | ||
uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )] | ||
uniform token[] joints = ["joint1"] | ||
uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )] | ||
rel skel:animationSource = </main/joint1/anim> | ||
|
||
def SkelAnimation "anim" | ||
{ | ||
uniform token[] joints = ["joint1"] | ||
quatf[] rotations.timeSamples = { | ||
1: [(1, 0, 0, 0)], | ||
24: [(0.7071, 0.7071, 0, 0)], | ||
} | ||
half3[] scales = [(1, 1, 1)] | ||
float3[] translations = [(0, 0, 0)] | ||
} | ||
} | ||
} | ||
|