View Full Version : MEL/Expression help needed
cmdrhappy 07-26-2006, 10:16 PM Can anyone help me with this expression?
if (LippyCircle.KeyableBase = 0) {setAttr -k off LippyCircle.rotateX;};
what this does now is Lock the KeyableBase Attribute, what I want it to do is not quite that.
I've already checked the Spelling and everything of that sort all the names are correct and in the right caps.
Im trying to set up an attribute on my Base controller that will allow you to hide or show the Keyable base without having to use the Connection editor.
Im not sure if this can even be done. Please any help would be great.
|
|
tfall
07-27-2006, 03:29 AM
You overlooked the "==" in the if statement:
if (LippyCircle.KeyableBase == 0)
{setAttr -k off LippyCircle.rotateX;};
- Terry
cmdrhappy
07-27-2006, 04:03 PM
Awesome, Thanks alot. I hadn't even thought about that http://forums.cgsociety.org/images/icons/icon11.gif
cmdrhappy
07-28-2006, 12:21 AM
Ok still doesn't work, heres my exact Expression and it says its correct but it doesn't actually do anything when KeyableBase is set to 0...
if (LippyCircle.KeyableBase == 0) {setAttr -k off LippyCircle.rotateX;};
Anyone got any bright idears?http://forums.cgsociety.org/images/icons/icon3.gifhttp://forums.cgsociety.org/images/icons/icon5.gif
enbee
07-28-2006, 01:59 AM
throw a "-channelBox true" in there. as in:
setAttr -keyable false -channelBox true LippyCircle.rotateX;
Does that work?
SajNT
07-28-2006, 08:07 AM
Ok still doesn't work, heres my exact Expression and it says its correct but it doesn't actually do anything when KeyableBase is set to 0...
if (LippyCircle.KeyableBase == 0) {setAttr -k off LippyCircle.rotateX;};
Anyone got any bright idears?http://forums.cgsociety.org/images/icons/icon3.gifhttp://forums.cgsociety.org/images/icons/icon5.gif
Expression will only evaluate itself during a playback. The problem is, you don't see an immediate feedback as well if you've got LippyCircle selected when you playback, with the expression running. You need to just unselect it, then select it again and you can see the attribute is hidden.
To understand more what i'm talking about, save your scene, then paste this into your expression at the end of yours, inside the loop:
xform -ws -t 0 1 0 LippyCircle;
LippyCircle will only move IF the condition of .KeyableBase is 0, and it'll only start evaluating that statement at the next frame.
Hope this helps! ; j
CGTalk Moderation
07-28-2006, 08:07 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.