PDA

View Full Version : Triggering an expression irrespective of time or a helper attribute



sriram viswanathan
09-06-2006, 05:00 AM
Hi All,

Apart from a `script job` or a `attribute triggered` method, is there any other method of firing `setAttr` expression via a plug ?

Example:

If i need to execute the following through an expression,

// Start of Expression
if (`getAttr transform.attribute`==0)
{
setAttr "node.plug" 0;
}
// End of Expression

the expression is time based, and only triggers to a time change or an helper attribute change(if the mel expression contains 2 plug connections within the same node). Is there any other way of triggering an expression irrespective of timechange/helper attr change???

glick_c
09-06-2006, 09:04 AM
You could also connect it to some other attribute? Using || (or)? Can you give me a little more info on what this is controlling?

sriram viswanathan
09-07-2006, 11:20 PM
hi,

my requirement is to create an int/float attribute with min 0 and max 1, where i can make a posemaker /poselibrary maker kind of thing using expressions. And the script is done and it does the job of creating an attribute and a helper attribute within the same transform to `setAttr` for all my controls to achieve a pose...

basically, when i bring the attribute to 1, the expression does not do its job without a time change or some helper attribute getting fired/triggered within the same node... i even tried with script job and its working, but its heavy and tommorrow i might have 100 poses in my pose node list, which will make my scene very heavy...

my goal w.r.t my current requirement is ---> when i switch on my pose, my pose should be achieved realtime and i dont want to build a helper attribute inorder to trigger my setAttr cmd each time nor will i want to scrub the time line to notice a change ...


usually when u create a mel button which does the job of setAttr, maya obeys it realtime cause its evaluated in that way... but an using expression for my requirment is heavy.. kindly suggest me some ideas to make expressions run on real time...

:)