honya Posted February 23, 2019 Share Posted February 23, 2019 Hi, I found weird behavior, when i have root motion loop animation. When the animation passes from last frame to first frame, it's look like the "Position" bone position go backwards. Values from log file: 18:51:06 bonePosition x: -0.000014 y: 1.670226 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.677411 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.684526 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.691594 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.698737 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.705799 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.712829 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.719946 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 -- start go backward bone position 18:51:06 bonePosition x: -0.000014 y: 1.642935 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.415249 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 1.194012 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 0.968947 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 0.738425 z: -0.000008 18:51:06 x: -0.000014 y: 0.000000 z: -0.000008 18:51:06 pos x: 0.000000 y: 0.000000 z: 0.000000 18:51:06 bonePosition x: -0.000014 y: 0.518001 z: -0.000008 It cause that animation is not smooth, when the animation passes from last frame to first frame. When i ignore last frame and go to first frame from last frame - 1, the bone don't go backward, but animation is still not smooth. Test scene for Unigine Engineering 2.7.3.1, API C++, 64 bit, Float here root_anim.rar. Why this happen? Thanks Honya Link to comment
silent Posted February 25, 2019 Share Posted February 25, 2019 Honya, How this animation was generated? It was imported via FBX Importer with "Joints Reorientation" checkbox enabled? If you will reimport it an remove this checkbox - will be there any changes? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
honya Posted February 25, 2019 Author Share Posted February 25, 2019 Hi Silent, I reimported this animations in 2.7.2.1 version of Unigine from fbx, when "Joints Reorientation" checkbox not exist. Link to comment
demostenes Posted February 26, 2019 Share Posted February 26, 2019 (edited) Same with the 2.7.3 and without joint reorientation. Edited February 26, 2019 by demostenes Link to comment
alexander Posted February 27, 2019 Share Posted February 27, 2019 Hi Honya, The problem is in your animation. Bone "Hips" is not looped. I set the Y axis of this bone to 0 and animation started to look good. Best regards, Alexander AppWorldLogic.cpp Link to comment
demostenes Posted February 27, 2019 Share Posted February 27, 2019 Thanks, this helped. Link to comment
honya Posted February 27, 2019 Author Share Posted February 27, 2019 Thanks, it clarified where is the problem. And for second question, can skip blending between last and first frame, when it blending from 1,7 to 0,0 coordinates? I mean instantly set coordinates from first frame. I can this behavior to animate num frames - 1, but that means that i lost animation information from last frame? Honya Link to comment
alexander Posted February 28, 2019 Share Posted February 28, 2019 Hi Honya, ObjectMeshSkinned::setFrame() method doesn't do any interpolation/blending if you set an integer value like: 0, 1, 2, ... There is no magic in this function. If you set 0, 1, 2 - you will get the target frame immediately. If you set a real value like 0.5, 1.2, 2.33, then you will get a blended pose between the two nearest frames. Also instantly. Best regards, Alexander Link to comment
Recommended Posts