-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Examples: Refactor BVH demo. #25763
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
Examples: Refactor BVH demo. #25763
Conversation
|
@Mugen87 I notice that skeletal animation in glTF gets loaded differently than in BVH. In glTF, the tracks are bound to the target bone directly, whereas in BVH it targets the Could we instead create BVH tracks similar to how the GLTFLoader does it, targeting the bones directly? The dummy skinned mesh pattern seems like almost as much of a hack as the // This would work
mixer = new THREE.AnimationMixer( results.skeleton.bones[0] );
// This too
const boneContainer = new THREE.Group();
boneContainer.add( result.skeleton.bones[ 0 ] );
mixer = new THREE.AnimationMixer( boneContainer ); |
|
I favor to look at skeletons and skinned meshes as coupled entities. A skeleton might be shared across multiple skinned meshes but having skeleton without a skinned mesh in the scene does not sound like a valid use case to me. |
Isn't this how GLTFLoader loads animation files without meshes? I often wind up with bare skeletons in my scene when working with glTF animations. Take for instance this file: [email protected] If you drag that into https://threejs.org/editor/ it adds the bones to the scene and can play the animation on them, yet there is no SkinnedMesh in the hierarchy. The corresponding I use bare skeletons in the scene for visualization animations (SkeletonHelper doesn't require SkinnedMesh input) and for IK retargeting where you may need to compute world positions of joints in the source animation. These use cases don't require a mesh. |
|
I see. This is indeed a valid use case. With regard to the glTF spec it's okay to update |
|
Sure, I have opened a PR in #25811 |

Related issue: -
Description
The example
webgl_loader_bvh.htmluse the following pattern to animate an instance ofSkeletonHelper:The purpose of this line is to mimic an instance of
SkinnedMeshso the helper can directly be used as the root object of the scene's animation mixer.To me this is a hack and error-prone since the helper instance is obviously no skinned mesh which can lead to issues in subsequent code that expects "real" skinned meshes. Hence, I suggest a different approach for the example by creating a "dummy" skinned mesh, properly bind the skeleton, adding the bones and then use it with animation mixer.
I propose this change in regard to #25751 where the retargeting methods also rely on the
skeletonHelper.skeletonhack (which is no good when studying the related issue).