[Closed] in Coordsys obj [Transform Matrix?]
I’ve got a little hiccup. I want a 3D position in another object’s coordsys but even though I can feed it:
in coordsys obj $.pos
I can’t seem to be able to do:
tim = $.pos
in coordsys obj tim
Any reason for that? Shouldn’t both be equivalent? Is there a work around? Right now I’m creating a point and then deleting it which is awkward and wasteful.
temppoint = point position:tim
in coordsys obj temppoint.pos
delete temppoint
My guess is because you are asking for a point3 in relation to the obj, instead of what is the position of $ in the coordinate system of obj. From the Maxscript help:
Accessing coordinate properties such as position, center, rotation axis, and so on, within a coordsys context causes those values to be delivered relative to the given coordsys.
A point3 value isn’t a property of the object.
-Eric
Oh right I was thinking of it backwards like
In Coordsys obj was a function modifying the point3 value. But it’s a context so the actual function was calling the $.pos in that context.
If I just want to convert one transform into another object’s local transform is there a matrix operation that would do that? Parenting is *. Would it be division?
From the Maxscript “Modifier Sub-Object Transform Properties” page:
To convert from world to local coordinates, you multiple the world coordinates by the inverse of the nodes objecttransform matrix.
Hope that helps,
-Eric
Another thought is use the Expose Transform (ExposeTm) Helper. It has script access to get/set the nodes, and you can retrieve the local/world values directly from it as well.
-Eric