GetFullTransform

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Peteroid
Posts: 162
Joined: Thu Aug 12, 2010 3:57 am
Location: las vegas, NV
Contact:

GetFullTransform

Post by Peteroid »

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)...
[==Peter==]
User avatar
patricia3d
Posts: 726
Joined: Thu May 31, 2007 4:38 am
Location: India
Contact:

Post by patricia3d »

I think you are going to 3D. Just Great. I don't know Lua but I know python a little bit, they also use matrix for 3D.
User avatar
Peteroid
Posts: 162
Joined: Thu Aug 12, 2010 3:57 am
Location: las vegas, NV
Contact:

Post by Peteroid »

kkrawal wrote:I think you are going to 3D. Just Great. I don't know Lua but I know python a little bit, they also use matrix for 3D.
hehe....

I figured how to do this without the GetFullTransform() matrix... and I have improved all my camera tools accordingly (new versions can downloaded).
[==Peter==]
User avatar
Peteroid
Posts: 162
Joined: Thu Aug 12, 2010 3:57 am
Location: las vegas, NV
Contact:

Post by Peteroid »

rajlostmarble wrote:The theory of noetics centers around the idea that the human mind is capable of affecting or even doing work to the physical world.

___________________________


Ski Holidays|Ski Holiday
Actually, I've always thought the ability for thought to be able to translate to apparently un-physics driven motion (such as the ability to walk or move one's fingers as one decides, in deference to external environmental factors) as proof of free-will.

Though what this has to do with the topic I have NO idea... lol :)
[==Peter==]
User avatar
Axlen
Posts: 23
Joined: Sat Oct 16, 2010 8:37 pm
Location: USA - Milwaukee
Contact:

Post by Axlen »

raj... is either a a semi-smart spam-bot, or someone that just likes to post random thoughts. I've read other posts by this raj... and that's my opinion.

Anyway, thanks for your camera efforts. I've not had the chance to really try them out yet though.
Bifocals are both wonderful and a PITA.
Post Reply