Simple question about animation

Hi,
I’ve an Egg file with a character who is walking
in Pview, he his walking and the character is going from one point to another.
I’d like him to walk but without changing his position (have the hike fixed for example).
Is there a simple method ?
I’m going to force the setPos of the bone hike (and i’dont know if it’s possible). Is it the good approach ?
Thanks in advance
Greg

you can use chickns synthetic root bone. it was made to solve exactly that issue.

i for my part simply add a new bone, and move that with linear interpolation over the walked distance. in the code end i use the same speed. works quite ok. it’s pretty much the same as the SRB above but hand-made.

for more information about the SRB please refer to the chicken manual

Thank you Thomas
I’ve found in the documentation :

I’ll test this solution
Greg

My problem is resolved, but i think, it’s not the solution of http://freefr.dl.sourceforge.net/project/chicken-export/Chicken/Chicken%20R42/test-modelR42.zip.zip

I’ve made an SRB which in the same spirit (i think).
The bone is following my model.

In panda, i’ve the bone X,Y,Z with self.srb.getPos():

self.srb = render.attachNewNode('srb-dummy')
avatar.exposeJoint(self.srb, 'modelRoot', 'SyntheticRootBone')

when i play the animation, the pos X,Y,Z of my avatar don’t change, but my SRB yes, relatively to the pos Avatar.
So, it’s easy to make him fixed at the screen with that.

But in the code of the example test-modelR42.zip, it seems not to function like that. The model is fixed, and the SRB is moving relatively, so to make him move at the screen, we must add the bone position to the avatar coord.

Why i don’t have the same ? I’ve forgotten something ?
[b]To be clear:

  • The model of the example (fleur) is walking at the same place in Pview
  • Not mine
    Why ? [/b]

In the doc:

I don’t understand, the fleur character in the example has only one animation, and at the first frame, it’s 0,0,0. But, in Pview, it doesn’t move while walking. It’s what i want.

Hi Thomas,
You have probably met the same problem with the position of the Bone used for calculate the delta of the animation.

i’ve the code :
srb = render.attachNewNode(‘srb-dummy’)
perso.exposeJoint(srb, ‘modelRoot’, ‘SyntheticRootBone’)

With that i can use the position of this bone to correct the position of my object

BUT : The position of this bone (srb.getPos()) is not good until it has been drawing to screen by the graphic card !
So, each time we draw the first frame (at each cycle of the animation), the position is not correct.

Look at this :
perso 1: 30.0 50.0 10.0 / 1.49240005016 1.55857002735 -1.50504994392
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955

The first frame has been drawed 4 times and the very first time, it’s not good.
And again :

perso 49: 30.0 50.0 10.0 / -3.3917798996 -3.94430994987 -1.50504004955
perso 1: 30.0 50.0 10.0 / -3.3917798996 -3.94430994987 -1.50504004955
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955
perso 1: 30.0 50.0 10.0 / -0.601334989071 1.78621995449 -1.50504004955

There is a solution to get the good position ?
Thanks in advance

actually… i didnt encounter that problem. i dont not use the SRB at all.

in blender i make my animation. when i’m done, i add a new bone to my armature, and make it the parent of my armature i had so far.
then i take the distance between start and end point of my walk cycle, and add the same distance to the bone i just added in the opposite direction. then i set the interpolation for that bone to “linear” and export it. as a result. my model walks on the spot. in code i use the same distance as speed value for my walk distance.
that sollution is a bit manual but i my animation are very stable with no sliding over the ground.

oh, strange solution - but it functions, this is a good point.

My solution is good too, i thought it was the same of you because when fixing the Synthetic Root Bone, it doesn’t do the same that the chicken Egg Exporter documentation.

The Bone position is moving and i’ve only to do that :
perso.setPos(pos_perso-pos_srb) to have the walk on the spot (thanks for this expression).
but i must correct the position the first time the first frame is drawed. It’s strange…