Non-continuous displacement in armature action


(Bandoler) #1

If you have time, sit down, relax and let me explain.

Imagine i’ve modelled a tentacle like the one in “The day of the tentacle” by LucasArts™. If you don’t know it, imagine a standing tentacle (modelled with one simple bones chain) that moves around jumping. I’m trying to animate it and i’ve come with the following problem:
I’ve designed an action in which the tentacle bends back slowly, and the forward quickly, so it jumps and lands somewhat further in the direction it was looking. The animation doesn’t look bad, but now i want to ue it in the real-time engine. I create a sensor for a keypress, attaching it to the action. When i press it, everything goes fine: it jumps forward. When i press it again, the tentacle appears in the first position again and repeats the action. This is logical, as i haven’t updated the position of it’s “origin”.
If i try to make it advance applying a force after making it dynamic, it starts moving already when its bending backwards (which is wrong), and it’s also very difficult to control it.
A simpler way of making this is displacing the object’s origin after all the animation is made the given constant amount. This would be enough for my purposes, but i would need a sensor going off when the action is finished and this is not possible as far as i know. I came up with the idea of translating at the beginning of the action the mesh to the end position, and design the action so that it had the origin in the place where the jump would end, but i failed to do it, as everything is relative to the parent bone.
Then i’ve thought of making the action of jumping without moving the tentacle of its place (jumping on the same place), and combining it with displacement (as i’ve seen it is done in some tutorials for walking cycle), but this has the problem i mention in the topic: The displacement of the tentacle it’s not continuous: it moves more in the frames that are in the middle of the action and it doesn’t move at all in the firsts or lasts frames (when bending).

Summarizing in one question : Does anybody know how to make this non-uniform advancement of an object during it’s actions?

I suppose i’ve made it too long, but i’ve tried to explain it the best i can.

Thanks in advance.

Bandoler!


(wiseman303) #2
  1. Give the armature an int property called frame.

  2. Give the armature an alwayse sensor, truepulse on, set to 1. connect it through an and controller to an action actuator and a property actuator.

  3. Use the property play mode in the action actuator. Set the property to frame.

  4. Set the property in the property actuator to frame, set the value to 1.

  5. Add a property sensor. Set the type to range, the property to frame, and the min and max to the frame numbers you want the motion to start and stop respectively.

  6. Connect this through an and controller to a motion actuator. Set the motion you want.


(Bandoler) #3

Thank you very much for your answer. It has tought me many things i didn0t know. However i haven’t managed to make it work yet. I’ve done the following (sorry for the big image):

http://prospectus.sf.net/blender1.png

This is to make the tentacle jump and when the action finishes to displace it 4 units forward (is this correct?) considering that 4 units is what the tentacle advances in the jump animation. I would still need to reset the animation after updating the position, to work well. But now, the frame remain constant and i cannot make it jump: nothing happens when i press “Up”.

I want to say that what you see in the pic is not the tentacle, but a simplified model i’ve done to try it from workplace. It’s better modelled, really … :slight_smile:

Again thanks,

Bandoler(!)


(wiseman303) #4

OK, I see some problems.

  1. Delete your first action actuator (the one named ‘act’)

  2. Disconnect the property actuator from the controller it’s on (cont1), then connect it to the controller that connects to the keyboard sensor (cont).

  3. In the property actuator (act2), change ‘Assign’ to ‘Add’ by clicking and dragging. (The same way you changed your action actuator to ‘property’)

  4. In the property sensor (sensor2), change where it says ‘Equal’ to ‘Interval’ by clicking and dragging.

  5. Change the motion actuator. (When using Dloc,) the value is added to the objects position every frame 4 units every frame is way to fast. To make it move 4 units overt the course of a 40 frame animation, change the value to 0.1 (4/40).

  6. (This part is necessary if you want your animation to play more than once.) Add another keyboard sensor, set it up like the one you already have, then click the little ‘Inv’ button on it. Now connect it through another and controller to a property actuator. in the prop field fill in frame, and put 1 in the value field.

I think that’s everything. Hope it works this time :slight_smile:


(Bandoler) #5

Ok.

Thanks. With these modifications it worked well. It still would require some adjusting but i’ve already seen what i wanted to see about this part of blender (i’m “evaluating” it), and what it can do.

(Bandoler)