| Item | Quantity | Price | |
|---|---|---|---|
| Your cart is empty. Check out our collection of 3d models! | |||
Prices in:
Clear Cart
Home » Forums » Maya Boards » MEL » EE: channels locking/unlocking each other? Topic 22 of 7084
Expressions only evaluate when the time changes, or when you edit them. You need to use a scriptJob that triggers when an attribute changes.
global proc myProc() {
if (`getAttr pCube1.translateX` > 10) {
setAttr -lock true pCube1.scaleX;
}
else {
setAttr -lock false pCube1.scaleX;
}
}
scriptJob -ac pCube1.translateX myProc;
| Item | Quantity | Price | |
|---|---|---|---|
| Total | 0 | $0.00 () | |
| Your cart is empty. Check out our collection of 3d models! | |||
Prices in:
Clear Cart
| Name | Contributions | Posts |
|---|---|---|
| Will McCullough | 766 | 21224 |
| fileadmin | 424 | 0 |
| axyz-design | 378 | 0 |
| peter_pan03 | 356 | 0 |
| stefano tartarotti | 303 | 0 |
| Mesh Factory | 292 | 0 |
| PerspectX | 283 | 0 |
| Tomasz Rozkosz | 253 | 0 |
| allen pan | 222 | 0 |
| Plutonius | 220 | 0 |
| Name | Downloads |
|---|---|
detachSeparate.mel |
832,864 |
TrueGlass |
823,268 |
The Andy Rig |
585,466 |
Sergio |
458,375 |
LWOImpR4-R5_043 |
430,907 |
Tiny |
326,791 |
Smedge .6 |
208,192 |
Ocean Shader |
181,436 |
silver shader |
172,764 |
At The Sea |
160,837 |
Hi there,
I have a question;
is it possible to create an expression which ensures that when the value of a certain channel is < then X a different channel will stay locked.
For example, I have these 2 channels;
If the 1st channel, called "eyes_digits" (Float: min val 0, max val 10), < 10,
the second channel called "eyes_expressions" (Enum: 6 possibilities) is locked.
Else, if channel "eyes_digits" = 10, (or == 10??)
channel "eyes_expressions" is unlocked.
- I am working in the Expression Editor because I want it to constantly check the 'if statement'.
- I want to use this because the 2nd channel should not be keyable while animating if channel1 is has a lesser value then 10.
My current expression looks like this... It doesn`t update (constantly check) and only works once after 'editing'...
I am a nooby at scripting, it was just an attempt:) here it is;
//Expression Editor Script Example
if (cc_expression01.eyes_digits < 10) {
setAttr -lock true cc_expression01.eyes_expressions;
}else{
setAttr -lock false cc_expression01.eyes_expressions;
}
If anyone could help me out I would really appreciate it!:)
Thanks in forward,
Mark