jchristof Posted September 12, 2015 Share Posted September 12, 2015 I've downloaded an fbx model from Mixamo, imported the fbx into blender and then exported to .babylon. When I load the model and begin a bone animation, the model distorts. Could someone tell me what I'm doing wrong? BABYLON.SceneLoader.ImportMesh("Akai", "scenes/", "skintest.babylon", this.scene, function (newMeshes, particleSystems, skeletons) { newMeshes.forEach(s=> s.material = mat2); newMeshes[0].rotation.x = -Math.PI / 2; newMeshes[0].scaling.x = .2; newMeshes[0].scaling.y = .2; newMeshes[0].scaling.z = .2; newMeshes[0].position.y = -20; that.scene.beginAnimation(newMeshes[0].skeleton, 0, 10, false, .1); }); skintest.log.txt Quote Link to comment Share on other sites More sharing options...
gryff Posted September 12, 2015 Share Posted September 12, 2015 Hi jchristof - welcome to the babylon forum Does the animation have a frame 0 in Blender**? If so try deleting it and then re-exporting your model. The fbx import into Blender with animation has been under development - I'm not sure whether it is still perfected yet. So the issue maybe with Blender as opposed to BJS. cheers, gryff ** or the first frame of the animation - check to see if it is the T-pose. Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 12, 2015 Author Share Posted September 12, 2015 Blender shows that the animation fbx does not start in the t-pose. Mixamo can provide separate files for the t-pose and each animation. Is it possible to load the files in babylon.js and programatically use the animation fbx with the t-pose fbx? I'm looking for an alternative to resetting the pose in each separate animation file. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 12, 2015 Share Posted September 12, 2015 Hi again jchristof. I have and account with Mixamo but I have never tried using their fbx animations with Blender. So I will investigate a little further this weekend. In the meantime maybe others have suggestions. cheers, gryff Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 12, 2015 Author Share Posted September 12, 2015 Thanks gryff. If this helps and is allowed by the forum: Akai_E_Espiritu.fbx.txtback_flip_to_uppercut.fbx.txt Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 12, 2015 Share Posted September 12, 2015 Just for the sake of it, we have a fbx exporter:https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/FBX Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 12, 2015 Author Share Posted September 12, 2015 Thanks - the converter is encountering an issue when applied to this animation fbx with or without /sk: Quote Link to comment Share on other sites More sharing options...
MidnightCow Posted September 12, 2015 Share Posted September 12, 2015 My first attempts at importing skinned animation over the past couple of days resulted in a distorted animated mesh. I was asking for trouble because i was exporting skinned animation from Cinema4D via FBX to 3dsMax and then into .babylon format via the Max exporter. The problem turned out to be the mesh object had been scaled down in c4d prior to skinning it. I reset the scaling in c4d, reskinned and reexported over to Max and it ran fine in Babylon. Anyway, the point is just, sometimes unnoticed mismatches like these that are handled fine by the original app can cause problems, and also impossible for a export plugin dev to diagnose :/ Also to add, the animation played back fine in max, and wasn't until exported to Babylon that the problem became obvious.. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 13, 2015 Share Posted September 13, 2015 @jchristop: It seems that you are not using the right exporter. The right one is FBXExporter.exe Quote Link to comment Share on other sites More sharing options...
MidnightCow Posted September 13, 2015 Share Posted September 13, 2015 Is there a copy of the exporter exe somewhere? All i can see are project solutions for visual studio in the folder.. Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 13, 2015 Author Share Posted September 13, 2015 Just a quick update as I'm still investigating - I built the FbxExporter.exe against the Autodesk VS 2013 sdk - there are some warnings for me, but the project build without an error. (buildlog.txt) FbxExporter.exe converts back_flip_to_uppercut.fbx => back_flip_to_uppercut.babylon file. The images for material are output in a .fbm directoryNow when I load back_flip_to_uppercut.babylon with ImportMesh, the model loads file with it's material. Animation starts immediately, even though I did not specify it to start. Even if I load like this, the model animates without stopping BABYLON.SceneLoader.ImportMesh("", "scenes/", "back_flip_to_uppercut.babylon", this.scene, function (newMeshes, particleSystems, skeletons) { that.scene.stopAnimation(newMeshes[0]);} Here is back_flip_to_uppercut.babylon up to the indices:{"activeCameraID":"defaultcamera","ambientColor":[0,0,0],"autoClear":true,"cameras":[{"animations":[],"applyGravity":false,"autoAnimate":false,"autoAnimateFrom":0,"autoAnimateLoop":false,"autoAnimateTo":0,"checkCollisions":false,"ellipsoid":[0.20000000298023224,0.89999997615814209,0.20000000298023224],"fov":0.85759997367858887,"id":"defaultcamera","inertia":0.89999997615814209,"maxZ":2010.053466796875,"minZ":4.0201067924499512,"name":"defaultcamera","position":[-0.025035858154296875,99.823860168457031,-402.01068115234375],"rotation":[0,0,0],"rotationQuaternion":[0,0,0,1],"speed":40.301033020019531,"target":[-0.025035858154296875,99.823860168457031,-0.99967765808105469],"type":""}],"clearColor":[0.20000000298023224,0.20000000298023224,0.30000001192092896],"fogColor":[0,0,0],"fogDensity":0,"fogEnd":0,"fogMode":0,"fogStart":0,"gravity":[0,0,-0.89999997615814209],"lights":[{"angle":0,"animations":[],"autoAnimate":false,"autoAnimateFrom":0,"autoAnimateLoop":false,"autoAnimateTo":0,"diffuse":[1,1,1],"direction":[0,0,0],"excludedMeshesIds":[],"exponent":0,"groundColor":[0,0,0],"id":"default_light","includedOnlyMeshesIds":[],"intensity":1,"name":"default_light","parentId":"defaultcamera","position":[0,0,0],"range":3.4028234663852886e+038,"specular":[1,1,1],"type":0}],"materials":[{"alpha":1,"ambient":[0,0,0],"backFaceCulling":true,"bumpTexture":{"animations":[],"coordinatesIndex":0,"coordinatesMode":0,"getAlphaFromRGB":false,"hasAlpha":false,"isCube":false,"isRenderTarget":false,"level":1,"name":"back_flip_to_uppercut.fbm/akai_normal.png","uAng":0,"uOffset":0,"uScale":1,"vAng":0,"vOffset":0,"vScale":1,"wAng":0,"wrapU":true,"wrapV":true},"diffuse":[1,1,1],"diffuseTexture":{"animations":[],"coordinatesIndex":0,"coordinatesMode":0,"getAlphaFromRGB":false,"hasAlpha":false,"isCube":false,"isRenderTarget":false,"level":1,"name":"back_flip_to_uppercut.fbm/akai_diffuse.png","uAng":0,"uOffset":0,"uScale":1,"vAng":0,"vOffset":0,"vScale":1,"wAng":0,"wrapU":true,"wrapV":true},"emissive":[0,0,0],"id":"175","name":"Akai_MAT","specular":[0.20000000298023224,0.20000000298023224,0.20000000298023224],"specularPower":60,"wireframe":false}],"meshes":[{"alphaIndex":0,"animations":[],"applyFog":false,"autoAnimate":false,"autoAnimateFrom":0,"autoAnimateLoop":false,"autoAnimateTo":0,"billboardMode":0,"checkCollision":false,"hasVertexAlpha":false,"id":"15_RootNode","infiniteDistance":false,"instances":[],"isEnabled":true,"isVisible":true,"name":"15_RootNode","pickable":true,"position":[0,0,-0],"receiveShadows":false,"rotationQuaternion":[-0,-0,0,1],"scaling":[1,1,1],"showBoundingBox":false,"showSubMeshesBoundingBox":false,"skeletonId":-1,"subMeshes":[],"visibility":1},{"alphaIndex":0,"animations":[],"applyFog":false,"autoAnimate":true,"autoAnimateFrom":0,"autoAnimateLoop":true,"autoAnimateTo":24,"billboardMode":0,"checkCollision":false,"hasVertexAlpha":false,"id":"174_Akai","indices":buildlog.txt Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 13, 2015 Author Share Posted September 13, 2015 Only about 20 of the 170 original frames appear to animate - so I'm looking into where the other frames went, and how to stop the model from auto animating. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 14, 2015 Share Posted September 14, 2015 @midnighgCow: https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/FBX/Redist @jchristof: You code should work if you stop the animations on mesh.skeleton (The mesh is not animated. but the skeleton is) Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 14, 2015 Author Share Posted September 14, 2015 Oops - I'm blaming that on the any parameter but this doesn't work for me either: BABYLON.SceneLoader.ImportMesh("", "scenes/", "walking.babylon", this.scene, function (newMeshes, particleSystems, skeletons) { that.scene.stopAnimation(newMeshes[0].skeleton);}BTW - loving babylon.js + typescript. Quote Link to comment Share on other sites More sharing options...
Romanichel_2.0 Posted September 14, 2015 Share Posted September 14, 2015 Ok, the problem about the truncation of the anim seems to be related to the fact that there are 2 animation takes in the fbx (and the exporter is somewhat buggy with these files : it uses the first take present in the file for getting timing info, and it takes the first take containing animations for each node to get the animation keys). The first take in the file (Take 001), does not contain animation keys, but it has a 30 frames durationThe second take (mixamo.com), contains animation keys and is 175 frames long. So the plugin think there is only 30 frames of animation (it gets that from the first take it finds), and extract only those 30 from the animation data. As a quick workaround, you can try to import the fbx in 3DS max and reexport it with only 1 animation take (you can use FbxReview to check that).In the same time, I will make a fix allowing to specify which animation take to export in the tool. Simon Quote Link to comment Share on other sites More sharing options...
Romanichel_2.0 Posted September 14, 2015 Share Posted September 14, 2015 Problem solved in my private forkhttps://github.com/simonferquel/Babylon.jsPR incoming . Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 14, 2015 Author Share Posted September 14, 2015 @Romanichel_2.0 - confirmed that this does seem to produce a full backflip animation. I ran the redist x64 console. I'll look at this a bit closer later on to figure out what the Take 001 means in terms of why it's there etc. and educate myself more on the tech. C:\Users\jon.martin\Downloads\babylon fbx tools x64>FbxExporter.exe back_flip_to_uppercut.fbx . /animstack:mixamo.comversion : 2015.09.14Usage : FbxExporter <path to fbx file> <outdir> [/fps:60|30|24] [/skipemptynodes] [/animstack:"animstack name"]Animation stacks :[ ] Take 001(41 - 1000)[X] mixamo.com(0 - 5833) Nice work - thanks! Quote Link to comment Share on other sites More sharing options...
Romanichel_2.0 Posted September 14, 2015 Share Posted September 14, 2015 The 2 takes seem to suggest that the fbx comes from a merge of different assets:- 1 asset contains the 3D mesh with its materials and its bindings to the skeletton- 1 asset contains an animation to the same skeletton It's a very common way to do for 3D artists and animators as it allows different meshes to be bound to the same skeletton and share the same set of animations. In you file, the Take001 anim stack does not contains any animation key, and it shows the 3D model in T-pose (seems to come from the file containing the 3D mesh and skeleton binding info) and the mixamo.com anim stack contains the bones' animation keys. If you take a look at the FbxRerouteSkeleton project, it allows you to do exactly this kind of merges, with an FBX file containing only skeleton animations, and others containing only static 3D meshes bound to the same skeleton. Quote Link to comment Share on other sites More sharing options...
jchristof Posted September 14, 2015 Author Share Posted September 14, 2015 That explanation is really helpful as I'm learning how this stuff works - thanks! Quote Link to comment Share on other sites More sharing options...
dongchai Posted May 5, 2016 Share Posted May 5, 2016 I didn't understand how to export a babylon file. for example I have a fbx file called "car.fbx" then i run command line run FbxExporter.exe ./car.fbx ./ but I got nothing. how to export please? Quote Link to comment Share on other sites More sharing options...
Ravi Posted July 4, 2018 Share Posted July 4, 2018 Looks like this thread is old one and link provided above for FbxExporter project is not available (https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/FBX) Please provide details how we can export .fbx/obj/stl or any other 3D file format to .babylon programmatically. I am using Angular 4 / Node JS as technology. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2018 Share Posted July 5, 2018 I answered on your other topic Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.