Reading the value of a transform while that transform is being manipulated


Hahah…sorry for all of the questions lately :wink:

Anywho…I noticed that if you declare something like this in a script controller

“x = obj.pos”

And then move the target object around (ie…drag it around in the viewport without letting go of the mouse button), the maxscript listener will print out all of the positions that you move the object to while the mouse button is still held down, but the value of x will only update once you depress the mouse button.

I’m currently trying to script something up that relies on positional/rotation data and I’d like it to update while the user is manipulating the object’s positional/rotational data (ie…while the using is changing the value of the transform, not just once the transform is changed)…so is there a way to read that data?


More specifically,

here’s the code included in the script controller (where “box” is the target node)

pos1 = box.position
dist1 = distance pos1 pos2
pos2 = pos1

print dist1

If you run that, you’ll notice that the value of pos1 only updates once you complete a transform manipulation (ie…once you click on an object, drag it and then depress the mouse button…it doesn’t update while you drag)


Deleted reply


Is “box” a varaible of the MaxScript controller?

I don’t have a problem doing this sort of thing with script controllers. They do update while dragging referenced objects.

I have a wheel controller that rotates the wheel if you drag around the parent car body.


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.