CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 05-10-2013, 08:53 AM   #1
New Member
Sebastian Schierwater
Nuremberg, Germany
Join Date: Aug 2010
Posts: 2
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.

Old 05-10-2013, 02:38 PM   #2
what the ?!?!
animatedfox's Avatar
Benjamin Fox
Seat 43
Join Date: Feb 2010
Posts: 897
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.
Old 05-10-2013, 04:14 PM   #3
New Member
Sebastian Schierwater
Nuremberg, Germany
Join Date: Aug 2010
Posts: 2
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!

Old 05-10-2013, 04:14 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:15 AM.

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