Message 1 of 7

Not applicable
01-10-2019
02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to evaluate a simple expression every frame inside Maya 2018, but the result is wrong.
The funny part is that the same expression is working in Maya 2015.
Here is my expression :
vector $location = << mainControl.translateX, mainControl.translateY, mainControl.translateZ >>; vector $oldlocation; if(frame == 0) { $oldlocation = $location; } float $speed = mag($location - $oldlocation); print($oldlocation); print("\n"); $oldlocation = $location;
I am just trying to get the speed of an object in movement.
In Maya 2015, oldlocation (which I print) is changing as expected.
In Maya 2018, its always 0. It seems like declaring $oldlocation sets it to (0,0,0).
How am I supposed to get the speed of the object in Maya 2018 ?
Solved! Go to Solution.