Rigging two bones with Drivers if/else staement

Bone A and Bone B belong to the same Armature

Bone A moves from 0 to 0.191 in local X Rotation Axis, with a limit rotation constraint

Bone B moves from 0 to 0.1 in local Y Location Axis, with a limit location constraints

How do I create a relationship between bone A and Bone B such that when:

a. Bone A reaches a value of 0.191, Bone B will become hidden in the outliner
b. Bone B reaches a value of 0.1, Bone A will become hidden in the viewport

I’m using Blender 3.3

Hi.

This is Drivers niche stuff.
In the Outliner, you should Add Driver to each of the Bone’s Hide Button (the screen icon); and by Editing such Driver, at the bottom of the Driver popup window, set up it to recall the other Bone’s Transform as we know it. But then, you shoud need to set the Driver’s Driver Settings: Type: as Scripted Expression; and you could probably use this script template on the Expression: placeholder

False if var <= 1.9999 else True
or
False if var >= 1.9999 else True

Note that in this template, I’m taking as reference a threshold of a 2.0000 value; because for some reason (also using Blender 3.3 LTS, notably 3.3.1 LTS) I get glitches I cannot understand whenever I’ve attempted exactly the value of 2, so I found out that I needed to set it as close as possible to 2.

I’ve never used this Button for Bones though. I find it a bit incoherent, UI-wise in Blender, that they have a screen icon instead of an eye icon; if they are only meant to Hide/Unhide the Bones in the Viewport but not ‘Enable’/‘Disable’ them —like in the multiple Options that we’ve got for Object Modifiers for example. Similar incoherence occurs with Bone Constraints, but in the contrary: they possess eye icon for Enable/Disable, instead of a screen icon.
I didn’t do the tests myself, but I’ve checked and what counts should be the description of the Buttons, not their icon; so I believe there is no such thing as ‘Enable’/‘Disable’ a Bone in the Outliner that theoretically would break the Rig.

Best Regards;
Pxy-Gnomes

2 Likes

Frankly, this sounds like something would cause a dependency loop. Any arbitrary property cannot have A depend on B which depends on A. Bones (and objects) are generally evaluated as an entire structure. When a property of one depends on a property of the other which depends on a property of the first one, it doesn’t matter what properties those are. Blender is not so intelligent to understand which properties actually depend on one another (and the nature of dependencies mean that this isn’t an easy problem-- many humans screw it up too.)

What can you have instead? You can have bone A’s visiblity depend on Bone C.

Weird interface stuff like this is usually better handled in a game engine. Blender is not designed to give any arbitrary interface that you want.

1 Like

I’ve finally found a solution. My plan was to hide a particular bone when the other bone reaches a particular value, so that it won’t be selectable.

I was able to solve it by playing around with the scale settings of the custom bone shape.

I applied a driver to both bones. A driver on Bone A to control the scale of custom shape of Bone B and vice versa.

And it works.

Thank you all.