Control changes focus based on value

Hey all!

I’m not sure how I want to focus this or what direction necessarily, however, I was thinking of an expression in Maya as opposed to a SDK connection.

Here’s the idea.

I have a rotation controller that only rotates in one axis, z in this case, all other channels are locked and hidden.
There are 3 joints, 2 are placed on either side of central joint. For this exercise, the center is non participating so therefore let’s call the active joints L and R.

jointL and jointR and arrow_ctrl.

When I rotated arrow_ctrl.rz <0, jointL.rz = -numbers for as long as arrow_ctrl.rz <0
When I rotate arrow_ctrl.rz>0, jointR.rz = numbers.
When arrow_ctrl.rz=0, both joints are at origin, well their origin, or 0 rotations.

I haven’t worked with expressions too much, so I’d first like to know if this is possible in Maya expression editor. I’m sure it is, I just am not sure how to go about it.

If there is a way to do it in the NodeEditor, then that would be fine as well.

Any ideas folks?

Thanks.

Sean

You can use ‘if’ statements in expressions if you want:

if (ctrl.rz > 0) jointR.rz = ctrl.rz;

But I would use one of Maya’s “condition” nodes, since the logic you just laid out pretty much exactly follows its internal logic, and nodes will pretty much always execute faster than expressions.

Thanks clam dragon. I’ll have to play around with that then. I haven’t used them much, nor the node editor. I’ve played with it a little but not a lot.

Thanks again!