Override Value on same object from different ctrls

Hello,

I’m trying to setup two controls, for instance ctrlA and ctrlB, which both control the same value on the same object. How can I set it up that the ctrl in which the value is changed, overrides the current value of the controlled object?

Thank you

Depends on the package - I know in Maya you can feed both values into a plusMinusAverage node and shunt the result into the object to be controlled.
Either that or Driven Keys.

I give you a better example.

ctrlA attr value = 0
crtlB attr value = 1

Object attr controlled of ctrlA and ctrlB value = 0

Now i want that if i change the value of ctrlA to 1 that the value of the object attr also changes to 1. But if i then switch the ctrlA value to 2, the object attr should change to 2. The controlled attr should always show the last entered value of either ctrlA or ctrlB, which ever was changed the last.

you can do this with a ScriptJob

Example:

import maya.cmds as cmds

def change1():
	value = cmds.getAttr('pCube1.visibility')
	cmds.setAttr('pPlane1.visibility', value)
	
def change2():
	value = cmds.getAttr('pPlane1.visibility')
	cmds.setAttr('pCube1.visibility', value)
	
cmds.scriptJob( attributeChange=['pCube1.visibility', change1] )
cmds.scriptJob( attributeChange=['pPlane1.visibility', change2] )

you can use a blendcolors node in maya to set both controls as a driver to the driven object.

then with an expression you set the blender of the blend colors node to the object that is selected last