Set Layer Transform?

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
strider2000
Posts: 506
Joined: Sat Mar 07, 2015 5:14 pm
Contact:

Set Layer Transform?

Post by strider2000 »

Is there any way to set a layer transform? Or, alternatively to get the rotation, scale and translation values of a transform?

Basically I'm wanting to take the transforms from a parent, remove them from the parent and apply them to the child. I see GetLayerTransform, but I don't see a SetLayerTransform, or a matrix variable in the Moho Layer. I do see the translation, scale and rotation values in the Moho Layer. I guess I can accumulate those, but it seemed like the tools were using the matrix. At this point I'm guessing that they're using the matrix for the world to screen tranformations only :( but I'm hoping someone can show me something simple that I'm overlooking.

Thanks.
User avatar
A.Evseeva
Posts: 61
Joined: Wed Apr 08, 2015 8:43 am
Contact:

Re: Set Layer Transform?

Post by A.Evseeva »

strider2000 wrote: Basically I'm wanting to take the transforms from a parent, remove them from the parent and apply them to the child.
Did You solve the problem?
I tried to do the same and it seems to me I did.(But only for layers with no shear transform and no XY rotation)
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Set Layer Transform?

Post by hayasidist »

Hi Alexandra. I got a long way with all that in my "bake" script -- http://www.mediafire.com/file/ob4vvnin58ovccz/Bake.zip - more here: viewtopic.php?f=9&t=28275&p=160048
User avatar
A.Evseeva
Posts: 61
Joined: Wed Apr 08, 2015 8:43 am
Contact:

Re: Set Layer Transform?

Post by A.Evseeva »

Thank You very much, I did not know about this script.
It has no conversion from matrix to position, rotation and so on, but it seems to me now this conversion is not necessary.
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Set Layer Transform?

Post by hayasidist »

there's more here on "splitting" the layer transform matrix into rotation / translation / shear / scale / flip: http://www.kelleytown.com/forum/animato ... IC_ID=2201 if that's useful
Post Reply