Closed bigrig2212 closed 1 year ago
Is there supposed to be something that gets set here to make the GLBs work in CharacterController?
Or maybe that the anim.exist objects are set to false? Seems like something not working with setActionMap function.
Or this bit... where rangeName is not of type AnimationGroup
@bigrig2212 have you had any luck? also have the same question.
EDIT: can confirm GLB animations are not implemented (or correctly)
Try remove this._hasAnims
from the function below:
It worked for me!
//removed to get GLB to work, if (!this._stopAnim && anim != null && this._hasAnims)
if (!this._stopAnim && anim != null) {
if (this._prevAnim !== anim) {
if (anim.exist) {
if (this._isAG) {
if (this._prevAnim != null && this._prevAnim.exist) this._prevAnim.ag.stop();
//TODO use start instead of play ?
//anim._ag.play(anim._loop);
//anim._ag.speedRatio = anim._rate;
anim.ag.start(anim.loop, anim.rate);
} else {
this._skeleton.beginAnimation(anim.name, anim.loop, anim.rate);
}
}
this._prevAnim = anim;
}
}
@bigrig2212 Sorry was away and missed this. You are right , I must have broken something. @echan00 Thanks for looking into this and the fix
Hopefully I can get to this by end of this week.
@bigrig2212 @echan00 This should be fixed. The previous version (0.4.3) constructor took AnimationGroup as a parameter The new alpha version constructor can take a ActionMap/AnimationGroup as parameter A bug broke backward compatibility. Have now fixed that bug.
Next time I will build alpha versions in their own branch so as to not break existing test/demos.
Please test and close if it works for you.
Yay, your fix works great. This sample was key to getting it working: https://github.com/ssatguru/BabylonJS-CharacterController/blob/master/tst/testAnimationGroup.js
Hi - just downloaded, npm installed and clicked "test animation group (using a .glb file)" Character moves around, but does not change animation state (frozen state). Haven't dived into it yet... but that's what i get on first install. Works fine in .babylon format.