2
$\begingroup$

I'm trying to model something to be retractable and I can't figure out how to make the parenting system. The idea is that once the first shape hits a distance limit the second piece starts moving, then the 3rd, 4th etc.

Is that done with drivers? Constraints? A general idea would help me a lot already.

Thanks!

enter image description here

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

Drivers with IF conditions expression

As you mentioned, you could link the rotation of the pieces with a driver. In the expression you can use a ternary conditional operator (see for example: Is it possible to put an if statement into the scripted expression of a driver?) to make the rotation occour only when one reach te other.

Here's an example using this statement:

var if var>0 else 0

Given that the 2nd bar has on Z rotation=0° and the first one on the bottom something like -30°... the rotatation will be equal to Z until the first bar reaches in its rotation a value higher than zero. From that point going on the second bar will pick a rotation equal to the one of the first (var).

enter image description here

enter image description here

For subsequential pieces, you should just add an angle offset in the expression. Here's some examples:

enter image description here

enter image description here

enter image description here

Final result of the rig:

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ This is amazing and beyond what I expected for an answer. Thank you so much Carlo, I'll use this technique in a bunch of stuff from now on. Hope you have an amazing week and thanks again. :') $\endgroup$ Feb 27, 2023 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .