Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: shape keys/morphing support #142

Open
ArnCarveris opened this issue Feb 9, 2022 · 6 comments
Open

Feature request: shape keys/morphing support #142

ArnCarveris opened this issue Feb 9, 2022 · 6 comments

Comments

@ArnCarveris
Copy link

Hi,
I haven't found suitable job class for make facial expressions and etc (https://www.youtube.com/watch?v=ypRhJAfJXAc),
maybe I miss some building blocks for that?

How hard is to make such feature?

@guillaumeblanc
Copy link
Owner

Hi,

there's no vertex morphig implementation in ozz, which is how I understand your request. Of course it's interesting, but I think working on vertices is a different domain (compared to working on joints), in terms of data structures, compression, optimizations... I would also suspect that a lot of that work should be done on the GPU.

Have you considered animating facial expressions with joints ?

Cheers,
Guillaume

@infosia
Copy link
Contributor

infosia commented Feb 28, 2022

Sorry for interrupting but I'm interested in this too. I'm guessing ozz may be able to support weights animation channel in order to support morph target animation in glTF, I expect it just consists of float array weights and can be treated similar way that gltf2ozz.cc does for rotation/translation/scale.

maybe related:

@JSandusky
Copy link

Just importing the weight tracks should be sufficient. I feel this is off into the realm of things like phase-matching (which requires no changes, just ratio management and external data for where the phases are) where the onus is on the end-user and the only real requisite Ozz-side is to grab those weight tracks if they exist in the converter tools.

@guillaumeblanc
Copy link
Owner

Hi,

If it's not vertex but animation morphing, then yes supporting weighted animations should help and be doable. To be sure we talk about the same thing, could you give a link to gltf specs that describes the weight animation channel? Is that it ?

Ozz importer/converter already support animated float tracks. It is exposed via the "tracks" parameter in *2ozz tools. It outputs ozz::animation::Tracks that can be sampled at run time. The implementation is only available in fbx2ozz (and inspired by fbx node properties), as I couldn't find any similar feature on gltf specs. But the importer supports them, and "only" requires to overload track related functions.

  • Would gltf spec match with the way ozz importer identify tracks (ozz identifies properties on nodes, with a ppt name) ?
  • Is there an open gltf model that demonstrate the feature ?
  • The feature is up for grab. I'm glab to help if anyone is interested.

Cheers,
Guillaume

@ArnCarveris
Copy link
Author

@infosia
Copy link
Contributor

infosia commented Mar 7, 2022

So I expect morph weights can be expressed as a float track in ozz, but it may be a bit tricky for ozz because glTF stores arbitrary number of morph targets, which equals number of targets in the mesh's primitive.

Animation output accessor has following layout:

n - number of weights (equals number of targets)
c - number of keyframes

[W1, W2, ..., Wn] * c

Maybe this discussion thread would help understand the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants