kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
263 stars 39 forks source link

morph targets are not implemented #18

Closed kcoley closed 6 years ago

kcoley commented 6 years ago

Implement morph targets, which should help with https://github.com/kcoley/gltf2usd/issues/17

donmccurdy commented 6 years ago

I was under the impression USD(Z?) only supports keyframe and skeletal animation, not morph targets / blend shapes. Have you found docs or examples to suggest otherwise?

kcoley commented 6 years ago

@donmccurdy with their latest release before SIGGRAPH, they added support for skeletons and morph targets. Here is a link to some of their Doxygen documentation: https://graphics.pixar.com/usd/docs/api/_usd_skel__schemas.html#UsdSkel_BlendShape

donmccurdy commented 6 years ago

Awesome, thanks!

enzyme69 commented 6 years ago

@kcoley Is blendshapes working already for USDZ?

ox commented 6 years ago

@enzyme69 I'm working on it in #16. If you want to see my progress, you can check out this branch.

wave-electron commented 5 years ago

@kcoley Blend Shapes has partial support now in USD v19.05. With some great help in the usd interest group I managed to get @ox morphedCube.usda test file working. I've attached the working usda file as zip.

In the original usda file these timecode below were wrongly set to 0

endTimeCode =  101
startTimeCode =1

and rel skel: animationSource = was added to the correct location below.

def Skeleton "skel"
            {

               rel skel:animationSource = <anim>

                def SkelAnimation "anim"

to run the usda file in usdview use command line:

usdview morphedCube.usda

There is also another problem on the MacOS installed of v19.05

to get the morphed targets rendering in the viewer

you need to open the interpreter and enter the following:

from pxr import UsdSkel UsdSkel.BakeSkinning(usdviewApi.stage.Traverse())

you also need to make sure you've pushed "play" on the animation

morphedCube.usda.zip

wave-electron commented 5 years ago

@kcoley I've attached what the current version of gltf2usd produces with the same archive animatedMorphCube.gltf usda attached below as zip file.

Apart from the issues I posted above. It is also missing the blendShapeWeights.timeSamples data for some reason?

float[] blendShapeWeights.timeSamples = {
                        0: [0, 0],
                        1: [0.00128, 0],
                         .....
                         100: [0, 0.00506],
                        101: [0, 0],

Current_animatedMorphCube.usda.zip