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

Skinning use cases and examples #1403

Open
6 of 11 tasks
donmccurdy opened this issue Jul 24, 2018 · 16 comments
Open
6 of 11 tasks

Skinning use cases and examples #1403

donmccurdy opened this issue Jul 24, 2018 · 16 comments
Labels
needs discussion Issue or PR requires working group discussion to resolve. spec:skinning specification

Comments

@donmccurdy
Copy link
Contributor

donmccurdy commented Jul 24, 2018

We currently do not have example assets for many of the less-common situations involving skinning, which has prompted questions about whether they are valid and how to implement them.

Have examples:

TBD:

In each case, if we find that an example cannot be consistently implemented we may tighten the spec accordingly.

@donmccurdy
Copy link
Contributor Author

@bghgary would some of these be reasonably within scope for glTF-Asset-Generator to output? I can start making some one-off models in Blender if not.

@bghgary
Copy link
Contributor

bghgary commented Jul 25, 2018

@donmccurdy Some of these are planned already. See https://github.com/bghgary/glTF-Asset-Generator/issues/437. I think the only ones that are not covered are the first one and last one.

@donmccurdy
Copy link
Contributor Author

donmccurdy commented Sep 17, 2018

Added another edge case above, "Node references a skin but not a mesh.". See #1448.

@lexaknyazev
Copy link
Member

@donmccurdy This isn't allowed by schema:

"dependencies": {
"weights": [ "mesh" ],
"skin": [ "mesh" ]
},

@donmccurdy
Copy link
Contributor Author

Ah good to know. Removed the addition above.

@donmccurdy donmccurdy added the needs discussion Issue or PR requires working group discussion to resolve. label Sep 19, 2018
@donmccurdy
Copy link
Contributor Author

Added A subset of joints in one skin are reused in another skin. above, per #1454.

@donmccurdy
Copy link
Contributor Author

Thanks to @kcoley, @stevk, and @bghgary, for adding new test cases in glTF-Asset-Generator, with more on the way. 🎉

From those that are available now, I've filled in three of the "example" links above:

Joint hierarchy is intermixed with non-joint nodes. (donmccurdy/three-gltf-viewer#101)

This works fine for all of the three implementations tested (BabylonJS, ThreeJS, PlayCanvas). We may want to test a native engine like Unreal or Unity as well, but it seems like this case can probably be allowed, and should possibly be mentioned as an implementation note. It is a known use case that engines may attach objects to bones after loading, and I see no reason to disallow it in the model itself.

Animation transforming parents of joints (works) or parents of skinned mesh (no effect). (#1195)

Works in all three, and the spec is already clear on this case.

Some or all joints are detached from the scene hierarchy (#1383)

Works only in BabylonJS. I'm not sure whether this should be allowed.

@zellski
Copy link
Contributor

zellski commented Nov 14, 2018

Pragmatic question -- for an exporter like FBX2glTF, do you think it's reasonable to cater to the loaders that have issues with your example #1 (joints form a strict subset of the relevant sub-scene-graph) by simply adding the inactive but tree-connecting nodes as joints in the skin? It definitely solves the issue I'm working on, but I'm not clever enough to figure out if it's likely to cause other issues on some esoteric models.

@bghgary
Copy link
Contributor

bghgary commented Nov 14, 2018

I've update the first comment with the latest examples from asset generator v0.6. The only one that is missing is the >4 joints one because no engines support it right now.

@bghgary
Copy link
Contributor

bghgary commented Nov 14, 2018

adding the inactive but tree-connecting nodes as joints in the skin?

Would you also add weights and inverse bind matrices for them? I think the down side is that it costs more space?

@zellski
Copy link
Contributor

zellski commented Nov 14, 2018

adding the inactive but tree-connecting nodes as joints in the skin?

Would you also add weights and inverse bind matrices for them? I think the down side is that it costs more space?

I would, and it does, which is irritating. Still, it's per-node waste rather than per-vertex waste, and on the models I just tested on, the size increase is a small fraction of a percent. I can live with that (and if others hate it it's easy to add command line flags). I'm more worried about unintended side effects I hadn't though of –– to say I'm weak on skinning is an understatement.

@bghgary
Copy link
Contributor

bghgary commented Nov 14, 2018

I don't call myself an expert on skinning either, but I don't think there will be any side effects. BTW, which viewers don't work correctly without this?

@zellski
Copy link
Contributor

zellski commented Nov 15, 2018

BTW, which viewers don't work correctly without this?

The bug report I received mentioned Blender glTF import & Windows 3D Viewer.

I didn't test Blender, but the latter stumbles like this:
image

If we peek at the bones we see unnaturally many of them are rooted in the same spot on the lumbar spine. The misplaced limbs (head, left arm, right arm) all sit on nodes that don't don't have FbxSkin deformers in the original FBX, so they don't become joints. Maybe the loader assumes a tree, interprets this skeleton as four disjoint trees, and roots them all in the common shared ancestor node?

image

After the "fix" all is well (and animations run correctly too, so WEIGHTS_0 and JOINTS_0 appear to be undisturbed).
image

Yikes, that was a lot of large images. Sorry to spam.

@bghgary
Copy link
Contributor

bghgary commented Nov 15, 2018

Yes, confirmed with 3D viewer. This will get fixed as we require that the app pass all asset generator tests.

@zen85
Copy link

zen85 commented Dec 22, 2018

I also have the problem that constraints on a mesh to another mesh or parenting does not really work. i get it to the point where the mesh gets positioned correctly once in the beginning but does not move along when iE the hand of the model moves.

i am relativly new to this: do i understand you correctly that this is a known issue of the exporter (in my case Blender) but you need testdata to solve that issue? because i would happily provide you with that if you tell me what you need and i can safe some of your precious time since it seems you are busy on so many forums answering our questions. can i contribute/support you at this somehow?

i just want to attach supersimple eyebrows on my robotface with morph-targets to get some kind of expression in that face. or is there another route to get that working? i want to achive something similar to that: https://threejs.org/examples/?q=morph#webgl_animation_skinning_morph

@donmccurdy
Copy link
Contributor Author

@zen85 it sounds like you're describing a bug in a Blender exporter? If you haven't already, could you file a bug on the exporter you're using? If it's the one that ships with Blender, glTF-Blender-IO, we're tracking a related issue here: KhronosGroup/glTF-Blender-IO#75.

If you're able to share an example model and attach it to the issue above, that would be helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Issue or PR requires working group discussion to resolve. spec:skinning specification
Projects
None yet
Development

No branches or pull requests

5 participants