Rigging: Constrain object so that it only inherits motion in one direction


#1

Hello all,

There might be a simple solution to this, or maybe not, but I’d like to do something like this:
https://gyazo.com/104fa2ebf758ed3a2de57de4bf4f3665
The link shows a simple setup of a keyframed null pushing a ratchet along one axis.
For the sake of the above GIF, I keyframed both the driver null, as well as the ratchet’s position, but would love to know a simple, relatively fool-proof way of generating the ratchet’s animation through motion inheritance, rather than keyframe.

In this case, I’d want the ratchet to inherit cumulative position values from the driver-null only along the negative z-axis animation, but not the positive.
Can this be done with a regular ol’ Constraint tag (or other tag that is not an Expresso tag?)
If Expresso is the only solution, would anyone be able to suggest a tutorial that covers this problem specifically?

Many thanks!!
NpF


#2

Here’s an XPresso solution. The pawl is on a spline and when the looped align to spline position % is > 0, it triggers a monoflop timer that cranks the ratchet along by one unit.

https://www.dropbox.com/s/kf1iwdouko7397e/ratchet.c4d?dl=1


#3

Not a specific answer to your question - jed1949 looks like he has you covered, but here’s another Xpressio approach that might help. In this example it’s set up to change the object colour when a secondary object is moved in +Z, but not when moved in -Z. It switches output by comparing direction of movement.

[compare direction switch](http://vantagegraphics.co.uk/POTW/compare direction_02.c4d)