Jump to content

Mesh morph animation in Babylon.js


Recommended Posts

Hello fellows!

 

I've been working on my school project, as I've mentioned before somewhere, and I'm taking a break from terrain generation, and getting back to importing some models as meshes, but I've found something I can't get through.

 

Namely, I'm trying to use some files as models acquired from http://www.ro.me  (because these are the cutest, and they fit my needs), but the problem is that they are in three.js' format, and I've devoted my time to implement this featurette in Babylon.js.

 

The problem is, that I need my models animated, and the three.js format (in my case) uses mesh morph animation. That is practically a keyframe based animation just like the skeleton animation in babylon, but no skeletons, instead all the vertices for all keyframes.

 

Is there any support for such things (I'll do the format conversion) in babylon? Or can you think of a clever workaround, given you know all the hidden bits of babylon? 

 

If you deem my case unsolvable, can you suggest a place where I can browse for animatable models (with bones for babylon then)?

 

Thanks in advance,

Alex

Link to comment
Share on other sites

Thanks! I myself was also thinking about that alternative, but I thought that might be somehow slower than a stock function (for some unknown WebGL dark trickery).

 

Is this feature, you plan to insert, simply wrapping this workaround in a function, or somewhat more complex? If so, I might try to implement it, as I'm going to have to do it anyway.

(Also, I use typescript, and you mentioned that you would want to move there too)

Link to comment
Share on other sites

Ok DK - I'm sending you two .blend files you can play with.

 

1: is a ball that has two shape keys - "squish" and "squash". It has a short animation but apart from that it is a very simple file.

 

2: is a "talking head". Still very simple though it is four objects - head two eyes and teeth.

 

I gather from watching your recent talk that you may not be too familiar with Blender so the image below is to describe the layout of the files:

 

A - the scene layout - just make sure that "Male Head" is selected and you will see all the other stuff

 

B - the properties of the current selected object. Make sure the little triangle is selected and you will see the shape key window. You will see 3 shape keys, open, wide, upper in the red box. The first two control vertices of the whole mouth and the last one just the upper lip. The "Basis" is the unaltered orginal mesh.

 

C - The shape key editor - a window for creating shape key animations. Below it is the basic Blender animation timeline - click arrow keys to play. Notice the three shape keys in the purple box. LMB and drag on the green flag with a number and you can scrub through the animation and the values in the purple box will change.

 

If you want to delete theys animation keys, put your mouse over this animation window and making sure all keys are selected (they will be bright yellow-orange) hit the X key and then confirm "delete key frames". To simply select all key frames - tap the A key till they are that bright yellow orange colour.

 

D - is a window containing a text file describing the mixes of the three shape keys that roughly describe the basic Preston Blair phonemes for speech. ( only in the "talking head" file)

 

Hope I am not being insulting with the image and the above - just do not want you confused at all.

 

I will PM you with a link to the zip files.

 

If the new Blender exporter looks to be working with shape keys - please post so I can try it out.. Looking forward to trying some lip syncing.

 

If you need anything else - just ask.

 

cheers, gryff :)

 

post-7026-0-98550300-1400513829_thumb.jp

Link to comment
Share on other sites

  • 5 months later...

Yes.  It was not made part of the BABYLON repository / namespace.  It is in the MORPH namespace, in the Extensions repository.

 

Version 1.0 could not actually do the talking shown in the above thread.  Working on 1.1 which will.  See this thread for this.

http://www.html5gamedevs.com/topic/10210-webaudio-support-for-version-20/

 

Some 1.0 examples are in this thread.  The name at the time was BABYLON.Automaton.  The Tablecloth & Multi-group are the ones to concern yourself with:

 

http://www.html5gamedevs.com/topic/9779-alert-shape-shifters-are-in-our-midst-automatons-preview/

Link to comment
Share on other sites

  • 3 months later...

Hi,

 

Is there any news on morph targets?

 

I was playing around with putting a talking head from 3ds max into babylon and realised it wasn't supported yet.

 

I imagine getting it into the 3ds max exporter is even further down the road (is this even planned or will it just be blender?) so will put this in hold for now, I'm glad it is being worked on though, this will be a really great feature!

Link to comment
Share on other sites

I am doing work in that area, though I also see it on road map.  My focus is in the before render architecture (not animation system) , and I also do not believe in the importing of morph targets, per se.

 

Rather, I import shape keys from Blender, grouping them together.  This has 3 effects over directly importing morph targets:

  • You can have multiple groups, say one for face, & two for hands.
  • A group limits the vertices that need changing, not the whole mesh, which improves CPU performance.
  • You can make an infinite # of morph targets for each shape key group, once on the babylon side.

My first implementation also combined morphing with POV movement & rotation.  I have since pulled out POV to make it standalone.  MORPH now subclasses it, though that has not been pushed up to repository.

 

I have experimented with speech & voice syncing.  I am waiting on MakeHuman 1.1 to come out, so things are in a holding pattern.  Their road map has shifted the date, again & again. http://bugtracker.makehuman.org/versions/2

 

I have no need to do anything with 3ds max.

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...