Jump to content

Weird behavior for root motion animation


photo

Recommended Posts

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

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

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
×
×
  • Create New...