1
$\begingroup$

I want bone A when starts to rotate, disables a constraint on bone B. (The eye symbol)

My guess is by using a driver. BUT, I don't have any clue to do it.

Added info: Start to rotate means, when I manually rotate the bone (bone A). What's the constraint doesn't matter. All I need to know is how to disable/enable a constraint of another bone, when I start manually rotate the bone A. If it were possible. If the driver is the way, I don't have any idea how to set it up, because the default, doens't give any effect

$\endgroup$
5
  • $\begingroup$ Just right click on the eye and from the menu "add driver"? Or could you be more specific and describe what is not working? $\endgroup$
    – lemon
    Commented Dec 2, 2020 at 14:47
  • $\begingroup$ How to setup the driver? Is using a driver is the right way to achieve what I want to do? $\endgroup$
    – Juan Feju
    Commented Dec 2, 2020 at 16:13
  • $\begingroup$ Driver can be the way, just test the rotation in it. But so far only you is aware of the context: you should add more details. What do you mean by "start rotate", what is the constraint, etc. $\endgroup$
    – lemon
    Commented Dec 2, 2020 at 16:16
  • $\begingroup$ Sorry, I thought I was clear enough... well, start to rotate means, when I manually rotate the bone (bone A). What's the constraint doesn't matter. All I need to know is how to disable/enable a constraint of another bone, when I start manually rotate the bone A. If it were possible. If the driver is the way, I don't have any idea how to set it up, because the default, doens't give any effect. $\endgroup$
    – Juan Feju
    Commented Dec 2, 2020 at 16:30
  • 1
    $\begingroup$ @JuanFeju you should edit that info into your original question, comments can be lost $\endgroup$ Commented Dec 2, 2020 at 18:08

1 Answer 1

2
$\begingroup$

That can be this kind of setting:

enter image description here

Here three bones: one parent and two children.

Bone.002 has a constraint: track to an empty.

The constraint activation has de driver:

var is based on Bone.001 and its "W" rotation in quaternion mode and local space.

The driver expression is to test if "W" is below 1. In this case that mutes the constraint.

The eye corresponds to a "mute" property, so a True value to mute.

enter image description here

Complement

If you want the constraint to be "mute forever", you can use a little script.

Add a custom prop to the constraint target (the empty here), named "prop" and set to 0 by default.

enter image description here

Then execute this script:

import bpy

def lock_constraint(self,rotation):

    self.target["prop"] += abs(1 - rotation)
    
    return self.target["prop"] > 0    

bpy.app.driver_namespace["lock_constraint"] = lock_constraint

"lock_constraint" will be known in driver space, so that you can use it in the driver:

enter image description here

As "prop" can only grow, once the other bone is rotated the constraint will stay mute.

$\endgroup$
4
  • $\begingroup$ Ok, now I get it. But, what if I don't care what the value of the rotation is. As long it was rotated it should disable the constraint. That means even the transformation W is from 2 and back to below 1. And how to keep the constraint transformation value of bone 002? I mean so the bone wont return to the origin. $\endgroup$
    – Juan Feju
    Commented Dec 2, 2020 at 17:32
  • $\begingroup$ mmm... that's why I wanted more details : ) ... first though, call some Python function in the driver. $\endgroup$
    – lemon
    Commented Dec 2, 2020 at 17:33
  • $\begingroup$ Is this involving scripting? $\endgroup$
    – Juan Feju
    Commented Dec 2, 2020 at 17:37
  • $\begingroup$ Yes some little script. To be tested but should work: add a custom property to the armature and use it to know if any rotation has already occured. Something like that. $\endgroup$
    – lemon
    Commented Dec 2, 2020 at 17:44

You must log in to answer this question.

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