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 Tools Display Modes
  05 May 2013
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
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.
  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!

  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
Society of Digital Artists

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

All times are GMT. The time now is 10:24 AM.

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