Jorisshh

Members
  • Content Count

    10
  • Joined

  • Last visited

About Jorisshh

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Jorisshh

    Loading animations from separate files

    Sweet baby Jesus I got it working with the createAnimationRange and copyAnimationRange thanks for sharing your demo! Not sure why a skeleton swap doesn't work. If I find out I'll be sure to report back
  2. Jorisshh

    Loading animations from separate files

    @Dad72 Thanks for the suggestion, but sadly this didn't fix it either I tried updating the post matrix before and after loading in the new animations, but this didn't make much of a difference. Here's the playground demo: https://playground.babylonjs.com/#2FP2YG#14 I've tried both my own animations, as well as the ones @dbawel suggested. EDIT: A found a clue (it's something...). When enabling the skeleton debug mode I can confirm that the skeleton plays the animation as intended. The mesh just doesn't deform correctly with the skeleton.
  3. Jorisshh

    Loading animations from separate files

    @dbawel Sadly these animations gave a very strange result: I'm still looking for potential solutions; And even though I get 'closer' the animations never look a 100% correct - Thanks for all your help; Starting to love this community already As for your ImportMesh issue, I think the scene you've passed into the ImportMesh call is null, causing the error.
  4. Jorisshh

    Loading animations from separate files

    @Deltakosh I tried using both Load, LoadAssetContainer (with & without addAllToScene) and Append, but this doesn't seem to make a difference. This is just the 1st keyframe on the walking animation though? So naturally, it's different. The rig is exactly the same, both come from Mixamo. Is there any demo, existing concept of loading in animations that I can use? I really don't see how swapping out an identical skeleton can cause this behavior. If anyone knows about a source I can work from I'll gladly take it.
  5. Jorisshh

    Loading animations from separate files

    @Deltakosh I don't think the problem stems from the files themselves so much, loading in animations directly works perfectly fine. The problem only arises when I first load the t-pose and then load the animation file and replace the animation skeleton with the t-pose character. Complete repo case: Load t-pose character (no animations, just mesh + skeleton) Load walk animation Swap out t-pose character's skeleton with walk animation skeleton (same skeleton / same bones) Play animation on walk animation skeleton (now attached to t-pose character) -> Causes strange interference of t-pose in the animation I created 2 playgrounds Loading t-pose, then loading animation and swapping out the skeleton of the loaded animation (t-pose influences animation): https://playground.babylonjs.com/#2FP2YG#9 Loading mesh + skeleton + animation directly (single file) (works as expected): https://playground.babylonjs.com/#IIGMMJ @dbawel I greatly appreciate it. If there's anything I can do to help out please let me know.
  6. Jorisshh

    Loading animations from separate files

    @dbawel @Deltakosh I used Maya to export the characters. Is there a guide for Maya or some standard workflow that we could adhere by? I decided to try blender, But I ultimately get similar results. I've attached the 2 blender files to this post; 1 is the t-pose and the other a sneaky walk animation that just doesn't play right (if loaded 2nd). I don't think it's an issue with the animations though. Loading in the animation directly works just fine; Loading in the t-pose and then attaching the animation messes it up. All animations work as expected when directly loaded, just not when I assign the skeleton to the t-pose character (standard rig from Mixamo, on both the t-pose and the animations). Do I need to re-index the bones or something? character.blend character@sneak.blend
  7. Jorisshh

    Loading animations from separate files

    @dbawel Thanks, for your detailed answer. The t-pose skinned mesh had some rotations on the arms and translation on the root node, so I removed these, however, this didn't resolve the issue. Shouldn't the newly loaded animations overwrite the entire transform of the bones? Why is the final result t-pose transform + new animation transform? I've done the following to make the most simple setup possible, but it still doesn't work. - Removed all translations and scalings from the skinned main mesh. - Created a super simple animation for the character where he rotates his upper body. - Loaded in the new animation When loading in the new animation and swapping out the skeletons (see code snippets above), it still doesn't work. Look around animation when loading the character directly (what it's supposed to look like): BABYLON.SceneLoader.ImportMesh("", "./assets/models/babylon/", "character@lookaround.babylon", this._scene, function(meshes, particleSystems, skeletons, animationGroups){ }); When first loading the skinned base mesh and later loading the look around animation // Loading base mesh BABYLON.SceneLoader.ImportMesh("", "./assets/models/babylon/", "character.babylon", this._scene, function(meshes, particleSystems, skeletons, animationGroups){ // Loading animation BABYLON.SceneLoader.Load("./assets/models/babylon/", "character@lookaround.babylon", t._engine, function(s) { // Replace bones and play animation let children = t._player.getChildMeshes(); for(let i = 0; i < children.length; i++) { if(children[i].skeleton) { children[i].skeleton = s.skeletons[0]; // children[i].updatePoseMatrix(children[i].getWorldMatrix().invert()); // children[i].updatePoseMatrix(s.skeletons[0].getPoseMatrix()); } } t._scene.beginAnimation(s.skeletons[0], 0, 59, true); }); }); Again, loading in the look around animation (or walk, idle, etc) works fine. The problem only occurs if I first load the base character, replace the skeleton and then play.
  8. Jorisshh

    Loading animations from separate files

    @dbawel Thanks for the suggestion. I've just tried out Edge, Chrome, and Firefox and it seems consistent between all browsers. I've created a playground example at https://playground.babylonjs.com/#2FP2YG#9
  9. Jorisshh

    Loading animations from separate files

    @Deltakosh Thanks for the quick reply. This issue happens every time I load in an additional animation for the character, even if it happens before rendering. I've tried mesh.updatePoseMa´╗┐trix(BABYLON.Matrix.Invert(mesh.getWorldMatrix()) as well as mesh.needInitialSkinMatrix = !mesh.needInitialSkinMatrix But no luck I've created a playground sample scene where I replicated the issue (happens in both 3.2.0 stable and 3.3 alpha) https://playground.babylonjs.com/#2FP2YG#9
  10. Babylonjs has been great so far, but yesterday I ran into an issue that I can't seem to fix. Problem: I'm trying to load in additional animations from .babylon files, however, when playing the animations on the original character it seems the original character's blend pose interferes with the newly loaded animation. The main character is a skinned mesh in a T-Pose without any animations. I then load in the walking animation (code snippet below) Loading the main character: BABYLON.SceneLoader.ImportMesh("", "./assets/models/babylon/", "character.babylon", this._scene, function(meshes, particleSystems, skeletons, animationGroups){ // Init character }); // later BABYLON.SceneLoader.Load("./assets/models/babylon/", "character@walk.babylon", t._engine, function(s) { // Copy all skeletons let children = t._player.getChildMeshes(); for(let i = 0; i < children.length; i++) { if(children[i].skeleton) { children[i].skeleton = s.skeletons[0]; // children[i].updatePoseMatrix(s.skeletons[0].getPoseMatrix()); } } t._scene.beginAnimation(s.skeletons[0], 0, 59, true); }); However, I get this result. The t-pose is blended into the character animations causing this super wide stance; Which would suggest the walking animation transforms are relative? Can I make them absolute? Loading the character@walk.babylon file at the start makes it behave as expected. I simply want to load it in at a later time. Preferably I wouldn't change the skeleton or bones but instead, copy over the animators onto the main rig, but this didn't seem to work either. Any help would be greatly appreciated.