Jump to content

Animations Blend


MarianG
 Share

Recommended Posts

Hi guys. 

I have a new little problem with a babylonjs feature :)

it's about this piece of code
 

skeleton.enableBlending(0.05); 

So, I have 2 flying animations: horizontal fly and vertical fly, and I try to do the blend between these animations using babylonjs blend function, and it works well, but there is a little problem, and I don't know, i miss something or it's a bug.

Here is the proof.

The problem are the eyes and foots.

And both animations work good, without blend.

 

orizontal.png

vertical.png

blend.png

blend2.png

Link to comment
Share on other sites

Need a link to a scene or a PG to provide and answer. At the very least, provide your parenting code - and if the eyes are not parented and are influences by any bone other than as a child, then this will never work for you. But I assume the eyes are children of a skeleton bone or other object in the head. However, it appears that deformations are occurring in your charcter's eyes - and thus your code needs to be corrected. However, if there are no deformations being passed to the eyeballs, then you're somehow blending animation in the eyeballs - which I would have no idea how to solve - again without reviewing both parenting in your scene and/or in your code.

DB

Link to comment
Share on other sites

@bulisor - I wouldn't assume this is a result of a delay. If you send a link to the scene, that will most likely provide us (other devs) enough info to determine the cause. Otherwise, if we arn't able to figure it out from the scene itself, we might require the original scene in Blender or whatever app you're using to bind your mesh to the skeleton. But start with posting a link, and if you are ale to do this soon today, yu might have a solution or at least the assistance you require to solve this without any further delay. Although, it still appears to be a "setup" issue with either the binding, the parenting, or perhaps both. So it will most likely require correcting in a seperate application and re-importing into BJS. But again, this is all unknown until we can look at the code and assets directly. 

And to get the quickest result and assistance, please post both a link to the scene as well as the 3D application file prior to converting to .babylon (as I assume this is your pipeline) - or even better, export an FBX file in addition to the native 3D file format so any user can view in whatever 3D application they currently use. If I can view these soon today, I would guess you'll have your answer soon - by myself or whoever gets it first and has time today. Otherwise, I wouldn't continue to work on this at all, as I would bet it is an issue with your initial character setup which will affect everything you've done with the character thus far, as well as anything ele you do until the problm is solved.

Cheers,

DB

Link to comment
Share on other sites

Hi dbawel

Sorry for late reply. 
In this time i combine a few meshes in one, but I still have 4 different meshes, and again 3dsMax exporter export foreach mesh a new skeleton, but they all have the same skeleton. And i'm pretty sure that is the problem of wrong blending.

I'll send you a fbx file to check it, but i think exporter is the problem.

Link to comment
Share on other sites

Hi guys. After a few discussions with the guy that hired me, now I cand share with you a live demo of my problem. 


Thank you very much, and take a look, maybe you can help me.

PS:  I still have problem that the mesh are huge, so we decided that if one of you can help us to make it more "playable" but still realistic, he will maybe hired you too.

PS2: Sorry my english :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm stil having a problem with this blend function :))

Take a look here.

Now the character is only one mesh, but the body is still deforming when he go from vertical to horizontal and back. And i'm pretty sure it's something from blend function

PS: The wings problem is from the animations, but his head no.

Link to comment
Share on other sites

This looks like the quality you get when trying to Lerp a Matrix, as opposed to the DecomposeLerp version just below.  The Lerp version has weird intermediate poses when there is much rotation.  It took me forever to get the decomposed method working in my code.  I do not call DecomposeLerp, because it creates too many temp objects, so I have my own, along with a SlerpToRef.

I also store everything already broken out (rotation / translation / scale), and only just plug in the final 16 values directly in the bones "local" property at the very end.

Sorry I cannot fix this, but I know for sure what it is.

Link to comment
Share on other sites

Well, @bulisor : I looked at you demo and took a screenshot (attached image) . Is one of your problems the area of the feathers in the red rectangles?

If so, it looks to me like , in "BlenderSpeak" that some of the feather vertices are weight painted to bones not in the "wings" but rather bones in other parts of the skeleton.

Not an animation issue I know, but are some faces of the mesh missing or have normals facing the wrong way ?

cheers, gryff :)

verts1.png

Link to comment
Share on other sites

Hi. Griff I know that issues, and you are right,... but my problem is that when character go from horizontal to vertical his head and body narrows.
 

Hi JCPalmer. You say that is definitely from animation, I men from transforms used in process of rigging or something like that? And it's not a problem of babylon or codeing?

Link to comment
Share on other sites

No, it is definitely a "problem" of babylon.  It looks exactly like when I was turning the head on a model.  Problem seems too strong a word though, more like low quality.

That blending code checks if there is a Lerp function, and uses if found.  Fine for a Vector3 like position, but Matrix.Lerp does not work well when rotation is involved.  DecomposeLerp(), the old Lerp, is much more involved, so that is probably why who ever did this switched it out.

Link to comment
Share on other sites

@Deltakosh, what happens if Matrix.DecomposeLerp() is used?  Since the guts of it used to be named Lerp, I am assuming the old Lerp had a problem.

That is what I am based on, except that I am storing everything permanently "decomposed" in a class I call QI.MatrixComp.  Saves having to do it twice every frame, then throw all the pieces away.  Also, the skeleton part of my animation system is basically "blending", in BJS animation terminology, from pose to pose.  I get much more mileage with everything as rotation / translation / scale sub-components, and just updating the element of the Local matrix.

Another thing I am doing is scaling poses made with different skeleton as part of a library of poses to skeletons which have different rest rotations & translation values.  That is what I was doing Vector3 & Quaternion division for in the other topic (and getting division by zero errors).

I would like to see is what using DecomposeLerp, the old Lerp, looks like.  That is a one line change that is actually less work for you just to do.  If @bulisor could make a separate page loading 2.5.-alpha, we could see them side by side.  I do not have any test data of my own in BABYLON.Animation format.

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