Message 1 of 4
Maya MEL not working dynamically - Why?

Not applicable
01-21-2012
02:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
How I should make a dynamic script that at a certain time when I do a job in Maya the script evaluate that, currently it just applies information at the time of execution.(I need script be evaluating constantly rather than static evaluation at the time of execution)
Here is more information:
I have written a MEL script doing the job of both the multiplyDivide node and Condition Node of maya at the same time for extending the joint.scale value when needed.
Regularly we use two Maya node to say to Maya that if our Ik curve is scaled in a certain direction, and if that scale exceeds the scale of relative joints, do add a particular value(result from a particular formulations as you know) to the relative axis of the joint.
Now when I run the script it get executed correctly but since at that time the conditional value is false(is $crv_length smaller than $num or the same) nothing happens even when I scale the IK curve. After all how I should make the script dynamic.
Here is the code:
How I should make a dynamic script that at a certain time when I do a job in Maya the script evaluate that, currently it just applies information at the time of execution.(I need script be evaluating constantly rather than static evaluation at the time of execution)
Here is more information:
I have written a MEL script doing the job of both the multiplyDivide node and Condition Node of maya at the same time for extending the joint.scale value when needed.
Regularly we use two Maya node to say to Maya that if our Ik curve is scaled in a certain direction, and if that scale exceeds the scale of relative joints, do add a particular value(result from a particular formulations as you know) to the relative axis of the joint.
Now when I run the script it get executed correctly but since at that time the conditional value is false(is $crv_length smaller than $num or the same) nothing happens even when I scale the IK curve. After all how I should make the script dynamic.
Here is the code:
*********************************************************
float $crv_Length = `getAttr ctrl_info1.arcLength`;
float $num = 9.662;
if ($crv_Length > $num)
{
float $resultCrv = $crv_Length / $num;
float $test_1 = `getAttr test1.scaleX`;
setAttr $test_1 ($test_1 + $crvLength);
float $test_2 = `getAttr test2.scaleX`;
setAttr $test_2 ($test_2 + $crvLength);
float $test_3 = `getAttr test3.scaleX`;
setAttr $test_3 ($test_3 + $crvLength);
float $test_4 = `getAttr test4.scaleX`;
setAttr $test_4 ($test_4 + $crvLength);
}
********************************************************