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

Objects with shared NLA tracks from Blender are strangely linked #194

Closed
j-conrad opened this issue Apr 29, 2020 · 3 comments
Closed

Objects with shared NLA tracks from Blender are strangely linked #194

j-conrad opened this issue Apr 29, 2020 · 3 comments
Labels

Comments

@j-conrad
Copy link

When two objects in a glTF have NLA tracks on them that are shared between them, the viewer exhibits strange behavior when attempting to toggle the various animations.

In the provided example file, Torus and Cube share an animation track in common called TorusAction.
If I check or uncheck either TorusAction, it automatically toggles the other TorusAction. But this does not always match up with what animations are actually playing in the 3d view. Sometimes both animations play, neither play, or only one or the other plays.

I'm not sure if there's a way for the viewer's UI to indicate which actions are on which objects, but that could be a start to understanding what's going on.

I've included both the .blend and the .glb

AnimationExportTEST.zip

@donmccurdy
Copy link
Owner

Looks like I've made some incorrect assumptions about clip.name being unique:

this.clips.forEach((clip, clipIndex) => {
// Autoplay the first clip.
let action;
if (clipIndex === 0) {
actionStates[clip.name] = true;
action = this.mixer.clipAction(clip);
action.play();
} else {
actionStates[clip.name] = false;
}

... that said, using unique names is really a good idea across the board. Object3Ds/Meshes are also expected to have unique names for animation in three.js. I'm wondering if the exporter should be doing something to deduplicate these. 😕

@looeee
Copy link

looeee commented Aug 24, 2020

Continuing the discussion from discourse. Here's the original FBX discussed there.

ShineGreymon.zip

Converted to glb with FBX2GLTF. There are multiple animation tracks with the same name.

chr776.glb.zip

I'm wondering if the exporter should be doing something to deduplicate these. 😕

In this case, we don't know the original exporter (something called Unity Studio, possibly). However, maybe FBX2GLTF should be de-duplicating names. That said, there's nothing I could find in the glTF spec that says duplicate names are forbidden, so maybe it's the responsibility of the loader/viewer to handle this?

I've opened an issue on FBX2GLTF so let's see what they have to say: facebookincubator/FBX2glTF#273

EDIT: possibly related - mrdoob/three.js#15087

@donmccurdy
Copy link
Owner

Fixed in most recent release. ✅

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

No branches or pull requests

3 participants