MarianG Posted August 27, 2016 Share Posted August 27, 2016 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. Quote Link to comment Share on other sites More sharing options...
dbawel Posted August 28, 2016 Share Posted August 28, 2016 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 Quote Link to comment Share on other sites More sharing options...
MarianG Posted August 28, 2016 Author Share Posted August 28, 2016 Can I send you a PM with my character, and tell me what is wrong with ? Or a link with live demo ? Please. Quote Link to comment Share on other sites More sharing options...
MarianG Posted August 28, 2016 Author Share Posted August 28, 2016 I think it's because, although all meshes share the same skeleton, when I export them it generate different skeletons for each mesh. And when I apply blend each skeleton blend animations with a delay. Quote Link to comment Share on other sites More sharing options...
dbawel Posted August 28, 2016 Share Posted August 28, 2016 @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 Quote Link to comment Share on other sites More sharing options...
MarianG Posted August 30, 2016 Author Share Posted August 30, 2016 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. Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 5, 2016 Author Share Posted September 5, 2016 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 Quote Link to comment Share on other sites More sharing options...
adam Posted September 5, 2016 Share Posted September 5, 2016 The head has a different path than the eyes, since the head is rotating with the body (in an arc). The eyes appear to be moving in a straight line. I think I'd remove the animation from the eyes and just attach them to the head bone. Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 5, 2016 Author Share Posted September 5, 2016 Hey Adam, unfortunatelly here I can't repo all the animations, but in some cases, the foot has strange blend, as you can see in first pic. Can I sent you a fbx to take a look at animation? Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 19, 2016 Author Share Posted September 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 19, 2016 Share Posted September 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 19, 2016 Share Posted September 19, 2016 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 Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 19, 2016 Author Share Posted September 19, 2016 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? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 19, 2016 Share Posted September 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2016 Share Posted September 20, 2016 matrix are actually using this code path: https://github.com/BabylonJS/Babylon.js/blob/master/src/Animations/babylon.animation.ts#L488 But yep this is still a Lerp function. @JCPalmer are you ok to share your SlerpMatrix code? I can integrate it if you want Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 21, 2016 Share Posted September 21, 2016 @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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 21, 2016 Share Posted September 21, 2016 I switched to Lerp because DecomposeLerp was not working on all cases Just can't remember where the problem was Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 21, 2016 Author Share Posted September 21, 2016 Hi. I'll put 2.5-alpha up to server in a few minutes. I'll attach the model too. Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 21, 2016 Author Share Posted September 21, 2016 Done. Same link Sorry, I don't know how to "ping" peoples :)) test(3).FBX Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 22, 2016 Share Posted September 22, 2016 Maybe add a method property, defaulting to Lerp. I can see it never failing, and much lower over head. When you have rotation, user could change method. I can see on 2 causes for failure, one of the decomposes returned wrong data, or Quaternion.Slerp not working right with some data. Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 23, 2016 Author Share Posted September 23, 2016 Hi. Please let me know when I can test it. It's important to me to be fixed this function. Thanks. I want to help you but i don't know how to do it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.