port9001

Members
  • Content count

    9
  • Joined

  • Last visited

  1. port9001

    Blender Export Rotations

    @JCPalmer @Deltakosh Ended up being something silly I was doing. Not sure if it's appropriate to delete this topic (doesn't appear I have the ability to do so) but thanks for taking a look.
  2. port9001

    Blender Export Rotations

    Yes, I am working with multiple blends. Perhaps that is not ideal? I'm still working out what the right workflow would be Blender -> Babylon so open to changing things up if it makes it easier. Unfortunately switching to a rest mode didn't change anything. Strangely I noticed whenever I export it always switches to the last action after the export is complete. I had to create an action with the name "zrest" to prevent this from happening. Perhaps I'll try recreating my models into one blend file and seeing if that helps.
  3. port9001

    FPS down after a while

    Likely a copy-paste problem. @raymondwilliams fix your link so we can take a look
  4. Probably a good question for @JCPalmer: I am looking for some advice regarding rotations of exported Blender models. During the creation of the two models below I used the Blender alignments, i.e. I used front view when editing the front of the model, right view to edit what I considered the right side, etc. However, when I export them they have different alignments than expected. The box model is just a simple test cube. It does not have an armature. The "dude" model does have an armature. Still, it is aligned with the same axes as the box. Neither model has any rotation (all 0's). Both are using the default XYZ Euler rotation mode. The dude is slightly elevated (y axis) but is otherwise at 0, 0. I would not expect the red dot to be visible in the Babylon shot. I have not rotated either mesh in Blender, only imported them with SceneLoader.ImportMesh.
  5. port9001

    Blender Exporter with Multiple Actions

    GitHub issue isn't me. I marked this topic as done. Thanks for the earlier help getting the actions assigned correctly. Yeah, that's interesting. If I change my actions to names without hyphens they link up with the armature. I assume this because there's only one mesh/armature present in the .blend? I've been doing a 1 .blend per model/mesh approach up until now. Is it more typical to have all of the needed meshes in one file?
  6. port9001

    Blender Exporter with Multiple Actions

    @mecanicus Hey thanks for the link! This gave me a clue as to why my animation was not being exported. In my .blend file my mesh was named "character" but my armature had the default name of "Armature". I had originally named my actions with the hyphen format so they were named "character-walk" and "character-walkblock". Turns out I needed to use the armature/skeleton name, not the mesh name. I renamed my actions to "Armature-walk" (also could have renamed the armature) and it exported correctly. So for future readers/reference: in order for the Exporter to know that your actions belong to your armature, name them with the format of <ArmatureName>-<ActionName>.
  7. port9001

    Blender Exporter with Multiple Actions

    Yeah, understood. I've attached the .blend file I'm working with. I spent some time trying various ways of adding and setting animations to the armature. Nothing I tried got picked up by the exporter. The only time I've seen it process animations is when the animations were attached to the mesh itself (as in first post). I'm probably just not attaching/adding/assigning the actions correctly? dude5_anim2.blend
  8. port9001

    Blender Exporter with Multiple Actions

    @JCPalmer I appreciate the help! I apologize for the Promises. I've been working with them for years now and they come pretty naturally to me. The code is cleaner without them though so thanks for the tip. I was able to remove the default 'Action' using the NLA Editor (a feature I'm not familiar with but Google recommended). It's gone finally. I'm not sure that matters much but it clears up that aspect of this problem. I then cleared the actions from the mesh. Finally I selected the Amature and set it's action (right click > Set Action) to "character-walk". Here is my new log output Exporter version: 5.5.0, Blender version: 2.79 (sub 0) ========= Conversion from Blender to Babylon.js ========= Scene settings used: selected layers only: false flat shading entire scene: false inline textures: false texture directory: C:\source\omnispace\assets\babylon\ Python World class constructor completed processing begun of skeleton: Armature, id: 0 processing begun of bone: Body, index: 0 processing begun of bone: Torso, index: 1 processing begun of bone: Head, index: 2 processing begun of bone: Arm_L, index: 3 processing begun of bone: Forearm_L, index: 4 processing begun of bone: Hand_L, index: 5 processing begun of bone: Arm_R, index: 6 processing begun of bone: Forearm_R, index: 7 processing begun of bone: Hand_R, index: 8 processing begun of bone: Leg_L, index: 9 processing begun of bone: Foot_L, index: 10 processing begun of bone: Leg_R, index: 11 processing begun of bone: Foot_R, index: 12 processing begun of mesh: character processing begun of Standard material: Material num positions : 82 num normals : 82 num uvs : 0 num uvs2 : 0 num colors : 328 num indices : 444 Skeleton stats: Total Influencers: 286 Avg # of influencers per vertex: 3.4878 Highest # of influencers observed: 8, num vertices with this: 1 exported as 8 influencers num skeletonWeights and skeletonIndices: 656 processing begun of camera (UniversalCamera): Camera processing begun of light (POINT): Lamp ========= Writing of scene file started ========= ========= Writing of scene file completed ========= ========= end of processing ========= elapsed time: 0 min, 0.0671 secs As you can see the blank Action is now gone. Unfortunately so is all of the animation processing. And the animations array is now empty and there's no ranges in the JSON. It seems the animations are not linked to the Armature although they seem to be in Blender?
  9. Hello all. I need some help figuring out why my animations won't play. I am a JavaScript developer delving into the world of Blender so I'm sure I'm missing something obvious. Versions: Blender 2.79 BabylonJS Blender Exporter 5.5.0 BabylonJS 3.2.0-alpha4 First off I have created a simple mesh in Blender with an Armature. I attached the Armature, weight painted it, and use Pose Mode + the Action Editor to create an Action. This part worked fine, beyond the pains of learning a new skill. My mesh has 3 total Actions that I can see: Action (which I did not create, it was there by default and I don't know how to remove it) character-walk (my final walk action) character-walkblock (a blockier version of the walk animation that I left for the purposes of testing use of multiple actions in BabylonJS) The walk and walkblock animations both play and render fine in Blender. The Action has no frames so does nothing. I'm not sure if Action is significant or not but I'm at a loss of how to remove it. I used the BabylonJS Exporter to create a .babylon file of my scene. Here is the log output: Exporter version: 5.5.0, Blender version: 2.79 (sub 0) ========= Conversion from Blender to Babylon.js ========= Scene settings used: selected layers only: false flat shading entire scene: false inline textures: false texture directory: C:\source\omnispace\assets\babylon\ Python World class constructor completed processing begun of skeleton: Armature, id: 0 processing begun of bone: Body, index: 0 processing begun of bone: Torso, index: 1 processing begun of bone: Head, index: 2 processing begun of bone: Arm_L, index: 3 processing begun of bone: Forearm_L, index: 4 processing begun of bone: Hand_L, index: 5 processing begun of bone: Arm_R, index: 6 processing begun of bone: Forearm_R, index: 7 processing begun of bone: Hand_R, index: 8 processing begun of bone: Leg_L, index: 9 processing begun of bone: Foot_L, index: 10 processing begun of bone: Leg_R, index: 11 processing begun of bone: Foot_R, index: 12 processing action Action: in[0 - 1], out[0 - 1] processing begun of mesh: character animation processing begun WARNING: action Action has no frames, ignored. processing action walk: in[1 - 33], out[0 - 33] processing action walkblock: in[1 - 33], out[40 - 73] processing begun of Standard material: Material num positions : 82 num normals : 82 num uvs : 0 num uvs2 : 0 num colors : 328 num indices : 444 Skeleton stats: Total Influencers: 286 Avg # of influencers per vertex: 3.4878 Highest # of influencers observed: 8, num vertices with this: 1 exported as 8 influencers num skeletonWeights and skeletonIndices: 656 processing begun of camera (UniversalCamera): Camera processing begun of light (POINT): Lamp ========= Writing of scene file started ========= ========= Writing of scene file completed ========= ========= end of processing ========= elapsed time: 0 min, 0.1393 secs Which looks fine, beyond the warning about Action not having frames. Finally I import the mesh in my project. Here's the code for how I do that: scene.executeWhenReady(function () { let loadedMeshes, loadedSkeletons; return new Promise(resolve => { BABYLON.SceneLoader.ImportMesh("", "dist/babylon/", "character.babylon", scene, (meshes, particleSystems, skeletons) => { loadedMeshes = meshes; loadedSkeletons = skeletons; // None of these work (note I tried each of them by itself, not all at once) // scene.beginAnimation(meshes[0], 1, 20, true, 0.5); // scene.beginAnimation(meshes[0].skeleton, 1, 20, true, 0.5); // scene.beginAnimation(skeletons[0], 1, 20, true, 0.5); // skeletons[0].beginAnimation("Action", true, 0.5); // skeletons[0].beginAnimation("walk", true); // skeletons[0].beginAnimation("character-walk", true); resolve(); }); }) .then(() => { const light = new BABYLON.HemisphericLight("ambient", new BABYLON.Vector3(0, 1, 0), scene); light.specular = new BABYLON.Color3(0, 0, 0); // Turn off reflections from this light const unitsAway = 30; camera = new BABYLON.FollowCamera("camera", new BABYLON.Vector3(unitsAway, unitsAway, -unitsAway), scene); camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA; // Here we make height 1/2 of width, a typical isometric style camera.orthoTop = unitsAway / 2; camera.orthoBottom = -unitsAway / 2; camera.orthoLeft = -unitsAway; camera.orthoRight = unitsAway; // target the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // attach the camera to the canvas camera.attachControl(this.canvas, false); engine.runRenderLoop(function () { // Register a render loop to repeatedly render the scene scene.render(); }); }) .then(() => { // They don't work here either (note I tried each of them by itself, not all at once) // scene.beginAnimation(loadedMeshes[0], 1, 20, true, 0.5); // scene.beginAnimation(loadedMeshes[0].skeleton, 1, 20, true, 0.5); // scene.beginAnimation(loadedSkeletons[0], 1, 20, true, 0.5); // loadedSkeletons[0].beginAnimation("Action", true, 0.5); // loadedSkeletons[0].beginAnimation("walk", true); // loadedSkeletons[0].beginAnimation("character-walk", true); }); }); The mesh loads and there are no errors. But none of the animation statements cause it to use any of the actions. There are some interesting things I noted in the .babylon file JSON: