Skip to content

Merging fbx animations into glb, node rotation #665

Answered by iiLearner
iiLearner asked this question in Q&A
Discussion options

You must be logged in to vote

it took me a while to understand what dom meant but I finally figured it out and had it working.
Code below:

// find the skin
  const skin = root.listSkins()[0]
    
  // get animation channels
  const animationChannels = root.listAnimations()[0].listChannels()

  animationChannels.forEach((channel) => {
    const curTargetNode = channel.getTargetNode().getName()
    const newTargetNode = skin.listJoints().find((node) => node.getName() === curTargetNode)
    if (newTargetNode) channel.setTargetNode(newTargetNode)
  })

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@iiLearner
Comment options

@donmccurdy
Comment options

Comment options

You must be logged in to vote
1 reply
@donmccurdy
Comment options

Comment options

You must be logged in to vote
1 reply
@krazyjakee
Comment options

Answer selected by iiLearner
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants