-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Mesh .updateMorphTargets(): Added BufferGeometry support #11285
Conversation
src/objects/Mesh.js
Outdated
|
||
for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) { | ||
|
||
name = morphAttribute[ m ].name || m; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be a good idea to make sure the name is always a string? Or do you think it doesn't matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe it's cleaner if we always ensure strings. I'll change this 👍
Might need to make some updates to |
I need to debug this in order to understand the code. We should currently run into this log here because |
By the way I had a search through code in /src and /examples/js and couldn't find any other places where this will cause an issue. Although I may have missed something of course! |
@looeee It is important, that the name of the morph attribute matches the name of the KeyframeTrack. const morphAttribute = new THREE.BufferAttribute( morphPositions, 3 );
morphAttribute.name = 'animation001';
geometry.morphAttributes.position.push( morphAttribute ); Have a look at the following nomenclature const track = new THREE.NumberKeyframeTrack( '.morphTargetInfluences[animation001]', [ 0.0, 5 ], [ 0.0, 1.0 ], THREE.InterpolateSmooth );
|
So, the |
No, they are identical. Normally, clips would not be created manually but like this: // setup clips with THREE.AnimationClip
// we assume geometry.morphAttributes was created by a loader
const clips = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphAttributes.position, 10 );
const clip = THREE.AnimationClip.findByName( clips, 'animation' );
const mixer = new THREE.AnimationMixer( mesh );
const animationAction = mixer.clipAction( clip ); |
Check out the implementation of |
Should we also remove the hack in /cc @takahirox |
I haven't followed the entire discussion yet but I suppose |
Thanks! |
see #11277