|05 May 2013||#1|
Join Date: Aug 2010
scriptjob triggerd by position change
i want to setup a scriptjob that gets called everytime the position of a object in worldspace changes.
I tried using the attributeChange flag with the worldMatrix attribute, something like
scriptJob -attributeChange ($myObj + ".worldMatrix") myProc;
but unfortunately it seems that the worldMatrix attribute doesn't update automatically and so the scriptjob doesn't get called when the object is moved.
I can't use the translate attributes of the objects transform node since i need the scriptjob to get called also if the object is parented under a group that is moved.
i'm relatively new to mel so i hope there is a easy solution for this.
|05 May 2013||#2|
what the ?!?!portfolio
Join Date: Feb 2010
Probably many more elegant methods, but you could parent constrain a locator to the object whose movement that you want to track, then use the translate of that locator to trigger script node. As long as the loc is outside of that hierarchy then it would also be triggered if any other parts of the hierarchy affected the position of the control (The parent group that you mentioned.)
Hope that helps...or keeps you busy until the real answer comes in.
|Thread Closed share thread|