scriptjob triggerd by position change

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2013
scriptjob triggerd by position change

Hi

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.


thanks!
 
  05 May 2013
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.
~Ben
 
  05 May 2013
thanks, that is actually a good workaround. though i'm pretty sure there must be a direct way to do this.
but for now this works, thanks!

~seb
 
  05 May 2013
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:58 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.