Animation property bindings are wrong when mesh or bone names are same

I have one fbx file including two model, with same named skinned meshes and bones, as above picture shows.

This fbx file also includes one animation data for those two models, same named frame tracks but with different values.

When i use animationmixer to clip animationaction from that animation data, and check out property bindings of the clipped animationaction, i found that all the same named frame trackes targeting the first object, as above picture shows. This will cause when playing the animation only one model can be updated, and with wrong behavior (because the updated model not only affected by its own animation data but also the other one’s).

So my problem is can i handle this kind of situation with threejs’s animation system to let each model apply its own animation ? It seems like the property bindings of the animationaction is handled by the frame tracks “name” property, is there any way to make it with uuid or something like that ?

While you wait for the correct solution, here is plan B:

Plan B:
When the FBX is loaded, the models and the animations are stored in JS objects. You can recursively traverse the data for the second model and rename main into main2:

  • path:"main.quaternion"
  • targetObject: Group {... name: 'main', ...}
    targetObject: Group {... name: 'main2', ...}
  • and so on

Plan B is brutal, so use it only in extreme circumstances. I still hope there might be an elegant solution.

Thanks for your advice, it is brutal but can solve my problem.

I found the PropertyBinding has a function named parseTrackName to parse animation tracks by the track name that matched with multiple forms.

However, the FBXLoader used model’s node name to name the track when parsing animation tracks, that is the true reason to cause my problem.
I don’t know why the model name but not the uuid is used by default in FBXLoader, if there is an option or callback function to change the default behavior of naming track names would be good i think.

If you know exactly how to make FBXLoader work for your case, you may copy FBXLoader.js into your local development space, modify it and use the modified version. BTW, are the UUID-s read from the FBX file or are they generated on-the-fly by the loader? This is important, because in the first case they will be persistent, in the other case – they will be different every time.

you can also use individual meshes as roots, i e create two animation mixers - then you dont need to rename anything

That’s how i solve my problem now. :sweat_smile:

The UUIDs are created when Meshes, Groups, Bones etc. are created in threejs, not in FBX files. It is different every time but doesn’t matter, because every time parsing FBX file and animation tracks the UUID is unique to an 3D Object.

I know the root param for animation mixer, but in my case one FBX file contains all the mesh and animation data, it is hard to distinguish which mesh corresponding to which animation without the ID, So the UUID way is best for me.