chewman
09-19-2004, 07:32 AM
Hey peoples,
I'm in need of some help here. I've got several attributes attached to an object. What I want is when you enter a value of 1 into one of the attributes, some other attributes are then turned off and left non keyable, then when you enter in 0, those values are keyable and therefore visible.
So what I've done is selected my object, opened up the expression editor and selcted the 'by object/attribute name' filter then typed in the expression:
if (MT_4WDcontroller.awdOn == "off" || MT_4WDcontroller.awdOn == 0) {
setAttr -lock true "MT_4WDcontroller.allWheelSpin";
setAttr -lock false "MT_4WDcontroller.frontWheelSpin";
setAttr -lock false "MT_4WDcontroller.rearWheelSpin";
} else if (MT_4WDcontroller.awdOn == "on" || MT_4WDcontroller.awdOn == 1) {
setAttr -lock false "MT_4WDcontroller.allWheelSpin";
setAttr -lock true "MT_4WDcontroller.frontWheelSpin";
setAttr -lock true "MT_4WDcontroller.rearWheelSpin";
}
After that I pressed the 'create' button.
Then on my value which I wanted to toggle on and off.. I typed in 1 (for on) and it locked the value that I wanted, great. So I type in 0 (for off) but it doesn't unlock the the attribute and it doesn't lock the other attributes either.
I don't know how to get around this seeminly easy problem. if ANYONE can help. it'd be MUCH appreciated!
I'm in need of some help here. I've got several attributes attached to an object. What I want is when you enter a value of 1 into one of the attributes, some other attributes are then turned off and left non keyable, then when you enter in 0, those values are keyable and therefore visible.
So what I've done is selected my object, opened up the expression editor and selcted the 'by object/attribute name' filter then typed in the expression:
if (MT_4WDcontroller.awdOn == "off" || MT_4WDcontroller.awdOn == 0) {
setAttr -lock true "MT_4WDcontroller.allWheelSpin";
setAttr -lock false "MT_4WDcontroller.frontWheelSpin";
setAttr -lock false "MT_4WDcontroller.rearWheelSpin";
} else if (MT_4WDcontroller.awdOn == "on" || MT_4WDcontroller.awdOn == 1) {
setAttr -lock false "MT_4WDcontroller.allWheelSpin";
setAttr -lock true "MT_4WDcontroller.frontWheelSpin";
setAttr -lock true "MT_4WDcontroller.rearWheelSpin";
}
After that I pressed the 'create' button.
Then on my value which I wanted to toggle on and off.. I typed in 1 (for on) and it locked the value that I wanted, great. So I type in 0 (for off) but it doesn't unlock the the attribute and it doesn't lock the other attributes either.
I don't know how to get around this seeminly easy problem. if ANYONE can help. it'd be MUCH appreciated!
