Jump to content

tower of babel output file for serializing (combining) shape key deformations


lst60916
 Share

Recommended Posts

Hi, my friends,

Recently I try TOB ( tower of babel) exporter to get the mesh for babylonjs.

I try to export the shape keys under the group of ENTIRE_MESH config.

However, after I deform another shape key after the first shape key is deformed completely.

I find it initially referenced the BASIS shape key group and then execute the next shape key .

It seems to be fixed in the QI lib.js .

I'm wondering if there is any approach that I can make the following happens? 

------------------------------------------

Blender ShapekeyA ( from 0~1, default as 0)

Blender ShapekeyB ( from 0~1, default as 0)

key = Qi.deformation("ENTIRE_MESH"  ,"ShapekeyA", 1 , duration)
mesh.queueSingleEvent(key);
key = Qi.deformation("ENTIRE_MESH"  ,"ShapekeyB", 1 , duration)
mesh.queueSingleEvent(key);

=======> in the recommened way, finally, I can get the mesh with (ShapekeyA=1 )&& (ShapekeyB=1)

instead of  ( ShapekeyA returing to BASIS ) && ( ShapekeyB=1) 

 

Any advice will be appreciated 

Thank you so much!

Link to comment
Share on other sites

If you are referring to multiple key mixing.   QI is built for multi-key mixing (24 key mixing example).  The QI.Deformation class is actually a simplified subclass of QI.VertexDeformation.  QI.Deformation is useful when you only have one target key, & deforming from basis.  There is even a further simplified form, called directly thru the mesh:

mesh.queueDeform("ENTIRE_MESH", "KEYA", 1, duration);

QI.VertexDeformation handles mixing.  One way would be:

mesh.queueSingleEvent(new QI.Deformation("ENTIRE_MESH", "KEYA", 1, duration));
mesh.queueSingleEvent(new QI.VertexDeformation("ENTIRE_MESH", "BASIS", ["KEYA","KEYB"],[1,1], duration));

The way to think about it is, you as a developer do not care what might be or will be when you submit queue a target to morph to.  When a deformation is finally executed, diffs what ever the current state is with the target requested.  If you had to keep track of what the state of QI.ShapeKeyGroup was, it would be much more difficult.

= = = = = = = = =

If you are referring to independent areas of the same mesh.  You may have multiple QI.ShapeKeyGroup on the same mesh.  On the example above, the eyes and the eyelids each have there own groups.  To do that in Blender, set the names of the keys in the format "GROUP1-KEYA" & "GROUP2-KEYB".  You might then:

mesh.queueDeform("GROUP1", "KEYA", 1, duration);
mesh.queueDeform("GROUP2", "KEYB", 1, duration);

Each group has it own independent queue, so if nothing was in either queue, both would happen at the same time.  If you wanted them run sequentially, you could:

var preReq = mesh.queueDeform("GROUP1", "KEYA", 1, duration);
mesh.queueDeform("GROUP2", "KEYB", 1, duration, null, null, {requireCompletionOf: preReq});

Note for multiple groups, beware of conflicting groups deforming the same vertices, see.  Also, from the Automaton example above, FACE & EYELIDS share.  See how expressions have a blinkable setting to avoid conflicts?

Link to comment
Share on other sites

  • 2 weeks later...

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