Jump to content

Blender 'Shape Keys' > Babylon 'morphTargetManager'


Recommended Posts


I'm posting this partly to help anyone else who has struggled with this, but also to ask if I am doing something wrong / if this is a bug in the exporter.

When I export a mesh from Blender with 'Shape Keys', I have to create two Keys in addition to the Basis for it to work in Babylon.

One Key + basis: https://www.babylonjs-playground.com/#0XATER#1


Two keys + basis: https://www.babylonjs-playground.com/#0XATER



Link to comment
Share on other sites

Here's the positions for the vertices of mesh & targets for Key 1 (this is the one with only one shape key).

one shape key

Mesh vertex positions:


Target vertex positions for 'Key 1':


...the same.

This may be something for @V!nc3r to add to the docs until it's sorted.

Link to comment
Share on other sites

I just looked at the code & cannot see where this is wrong, so I made my own cube, added a basis & key.  Went into edit mode (while the key was selected) & colapsed a face in.  When I export, I get different values for the positions & target positions:

,"targets":[{"name":"Key 1"

Cannot reproduce.

Link to comment
Share on other sites

I think it is more accurate to say that each morph target is always exported with the same values.  The positions themselves are not directly exported in the first place.  A temp copy with all modifiers including current shapekey settings is made, & that is what gets exported.  This is very powerful.  You might have Mirror modifier for making a perfectly symmetrical mesh with only doing half the work.  You do not to HAVE TO apply your modifiers to do an export, since it would wreck more development.  Probably best to store all your shapekeys @ 0 in the .blend file to get your mesh exported without any influences per-applied.

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.

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.


  • Recently Browsing   0 members

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