Jump to content

How to Convert, Make or Get Animated Meshes for Babylon Js (Solved)


En929
 Share

Recommended Posts

I've been having some real trouble trying to convert my animated meshes to a .babylon file. I made my animated character in Mixamo. I tried using blender, and the regular meshes WITHOUT animation work. But, when I try to export my animated mesh, I got a bunch of errors and I didn't even get a .babylon file from Blender at all. I use the 2.78 version of Blender.

Plus, I saw the exporters on the github website and I simply don't understand it. I'm a bit of amateur and there doesn't seem to be any clear instructions on how to convert animated meshes to the .babylon format or a format that would work in Babylonjs.

Thus, what do i do?

Link to comment
Share on other sites

Hi @En929 :) Here is a rigged character - a Mixamo freebie -  that I imported into Blender (.dae format exported from Mixamo ) then animated in Blender :

Zed

So it can be done.  But a a couple of questions.

1. What version of the Blender Baybylon Exporter (BBE) are you using? It should be v5+

2. With your cursor in the 3D window, hit the "N" key - it will open a properties panel on right side of the 3D window. Now check the area called "Transform" for both the armature and the mesh(es). If there are any unapplied rotation and scaling transforms - see example image below - you are going to have problems

cheers, gryff  :)

post-7026-0-71172300-1445397086.png

Link to comment
Share on other sites

Gryff,  I was using the Babylon 5.2.1 exporter for Blender. The animated character that I have came with the animations already mixed in via Mixamo. I was using the FBX format because for some reason, my character doesn't appear in Blender when I use the Collada dae format and all seems to work well when I import my fbx character into Blender; except for when I try export it (I admit, I kind of suck at Blender and wish that there were more options - I wish there was an option for a program callled Fragmotion). I was wondering how do I apply bones in Blender? I used the Object tab, to apply rotation and location. But, I don't know if that was the right thing to do. 

Link to comment
Share on other sites

Maybe this could help. Below, is what my Blender screen looks like before I export my animated character. As one could see, all of my animations load properly, the materials are there, etc. But, I don't know what I'm doing wrong here:

 

BlenderExporting1.thumb.png.f097876f1aab380a5646f2436658710d.png

 

Now, these are the errors that I get after TRYING to export my .fbx file to the .babylon file. In fact, the file doesn't export at all and  I get no .babylon file

that shows up in my folder after exporting. Thus, I don't know what to do and what all of these things mean. With regular meshes I don't have any problems, but with

animated meshes the errors below occur:

 

BlenderExporting2.thumb.png.a6cb1f9e4c4cb76d9be7dad1975e6a2e.png

                              

Link to comment
Share on other sites

TY @En929 for the pics. I'm worried about the values of the scale and rotation in the upper images. They are the same as the image I posted - and it is not going to work.:o

Here is the Zed character again - this time exported from Mixamo with and idle animation ( a freebie)

Zed Idle

I exported from Mixamo as a .dae again,imported it into Blender with all the options checked and a minimum chain length of 1, applied the transforms (so there is no rotation and scale values are 1) Then exported

It has been a while since I was at the Mixamo site - and things have changed - but when you go to "Queue Download" you have an option to "Save with Skin"  - that way you don't just get the bones. And you also have a number of options for the number of bones in the rig.

Could you post your .blend file so I can look at it?

cheers, gryff :)

 

Link to comment
Share on other sites

Hey @gryff, after wrestling with the file below for a while yesterday, I was finally able to get my collade files into blender, mix the animations (namely the T-Pose and the Walking animation) together. I was unable to download the Collada animation file with its skin from Mixamo, but here's what I did: In Blender in object mode I: 

1. Uploaded the Mixamo T-Pose (or what Blender renamed to "Amataur001") and then I uploaded the Mixamo animation (or what Blender remamed to "Amataur002").

2. After both files were uploaded into Blender, I went into the "Dope Sheet" mode via the tabs on the left.

2. I selected Amataur002  in the menu/list on the far right side

3. I clicked on the "key" menu at the bottom and selected "copy keyframes" from the key menu.

4. I selected Amataur001

5. I went back to the key menu and selected "paste keyframes"

And that's how I put the animations together in the file below and that's where I'm at now. Now, the problem is the distortion. It came out distorted in Blender. But, I did an experiment and exported my file as a .babylon file and imported it into Babylonjs, and it worked, However in Babylonjs, it came out even MORE distorted in the browser. Thus, these are my problems now. I posted the blend file, etc. below. And I hope that this makes sense. 

 

 

 

Link to comment
Share on other sites

@En929: Well I took a look at the blend file - it is a nightmare, :(

The file contains three armatures - Armature, Armature.001 and Armature.002  See first image below.

Some comments:

1. Armature.002 seems to have a walk animation that works but its "Rest" position seems to be the same as the first frame of the animation. It has no meshes parented to it - it is just an armature hanging about.

2. Armature does have meshes parented to it but has itself been parented to Armature.001 which has no bones(why?). The "Rest" position for Armature is a T-Pose. In addition it seems to have five bones not influencing the mesh but named after lights - 5 lights ? (See second image below). Only two lights exist in the scene and neither are a "Spotlight" which is what four of the bones are called.

3. Trying to use the action from Armature.002 with Armature will not work properly as they have different "Rest" Poses.

I find it hard to believe this came from Mixamo.

I would suggest going to Mixamo forums to get an explanation on how to exported skinned .dae models with animations.

cheers, gryff :)

armatures1.jpg

lights1.jpg

Link to comment
Share on other sites

@gryff yeah, it came from Mixamo. I simply put the T-Pose and Walking animations together since the walking animation only came with the bones with no mesh. I didn't see an option to export my animated mesh with its skin directly from Mixamo and plus I suck at Blender (which makes it worse) and I was lucky to even put the T-Pose and animated bones with my T Pose.

I actually usually use a program called Fragmotion to do my mesh animations. I wonder if there could be anything for that program.

Link to comment
Share on other sites

Ok @En929 here are the steps I use to get a .dae file with a mesh and animation :

Steps:

1. I open my Mixamo account, go to "MyAssets" and chose "MyCharacters" and click on the one I want (Image 1)

2. This takes me to Image 2 - I click on the "Find Animations" button

3. This takes me to Image 3 - where I can chose an animation by clicking on it, then make whatever adjustments I want, and finally click on the "View/Download" button

4. And now I see Image 4 - and hit the "Queue Download" button 

5. And a panel pops up that allows me to chose the format (.dae) and select "With Skin" and hit the "Queue Download" button once again - Image 5.- which leads to a page that allows me to download the file.

Then I import the file into Blender with all the check boxes checked and "Minimum Chain Length" set to 1 in the little options panel at bottom left of the importer.

See if you can do that.

cheers, gryff :)

 

 

step1.jpg

step2.jpg

step3.jpg

step4.jpg

step5.jpg

Link to comment
Share on other sites

Heyyyyyyy @gryff, it worked!!!!! I got my animated character inside of my browser. Below is a picture to prove it! I think that what you said above was the missing ingredient. All along, I was downloading my animated character the wrong way. Oddly, I wasn't able to get to the page that  you mentioned above maybe BECAUSE I've been clicking the wrong button and have been getting a different page all of this time, but I got it now and it works. Thanks for everything!!! I'm making more progress now! Yay!!! A big step!!

 

BrowserAnimationWorking.thumb.png.37c6c1a125c4ce252cd1e74dfa7b5372.png

Link to comment
Share on other sites

9 hours ago, En929 said:

it worked!!!!!

@En929 : Good :)  If you are happy, maybe change the title of the thread - add "SOLVED" at the start or end.

 

9 hours ago, En929 said:

, I wasn't able to get to the page that  you mentioned above maybe BECAUSE I've been clicking the wrong button

Yes those pages do not have an obvious path to follow.:( But now you can start experimenting :)

cheers, gryff :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...