GetFullTransform
Posted: Sat Sep 25, 2010 9:23 pm
I now realize that my camera tools are not accounting for parent transformations. So I need to be able to use the following MOHO.MohoLayer function. But I have no example code using this, and this description isn't all that clear to me:
void GetFullTransform()
Gets the layer's complete transformation at a given frame, including the effects of its parent layers.
Return value: none
frame (int): frame number
matrix (LM_Matrix): transform matrix to fill in
doc (MohoDoc): the document object
I think it means this:
GetFullTransform( frame, matrix, doc )
but it would be nice to have some example code using this, or some document explaining this call. Especially one that shows how the 'matrix' is defined and used.
UPDATE:
I think I've figured out how to call GetFullTransform:
transform_matrix = LM.Matrix:new_local()
moho.layer:GetFullTransform(frame, transform_matrix, moho.document)
['transform_matrix' is setup to be the transform matrix]
And the matrix can be applied like so:
matrix:Transform( vector3d )
['vector3d' is changed to to reflect the transform being applied ]
The problem is I have yet to find what this transform is based on. What does it use as an origin for its coordinate system? I've tried these with no success:
- the layer's position at frame 0 = (lx,ly,lz) at frame 0
- the world origin = (0,0,0)
That is, I need the 3D vector 'origin' such that:
transform_matrix( origin ) = (lx, ly, lz ) = current layer position
Has anyone ever had to deal with this before? If not, I may have found a bug in MOHO, since the transform matrix I seem to get isn't based on anything logical (that I can think of)...
void GetFullTransform()
Gets the layer's complete transformation at a given frame, including the effects of its parent layers.
Return value: none
frame (int): frame number
matrix (LM_Matrix): transform matrix to fill in
doc (MohoDoc): the document object
I think it means this:
GetFullTransform( frame, matrix, doc )
but it would be nice to have some example code using this, or some document explaining this call. Especially one that shows how the 'matrix' is defined and used.
UPDATE:
I think I've figured out how to call GetFullTransform:
transform_matrix = LM.Matrix:new_local()
moho.layer:GetFullTransform(frame, transform_matrix, moho.document)
['transform_matrix' is setup to be the transform matrix]
And the matrix can be applied like so:
matrix:Transform( vector3d )
['vector3d' is changed to to reflect the transform being applied ]
The problem is I have yet to find what this transform is based on. What does it use as an origin for its coordinate system? I've tried these with no success:
- the layer's position at frame 0 = (lx,ly,lz) at frame 0
- the world origin = (0,0,0)
That is, I need the 3D vector 'origin' such that:
transform_matrix( origin ) = (lx, ly, lz ) = current layer position
Has anyone ever had to deal with this before? If not, I may have found a bug in MOHO, since the transform matrix I seem to get isn't based on anything logical (that I can think of)...