Set Layer Transform?

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

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
User avatar
strider2000
Posts: 443
Joined: Sat Mar 07, 2015 5:14 pm
Contact:

Set Layer Transform?

Post by strider2000 » Sat Dec 19, 2015 3:13 pm

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.
My new website (just getting started) | M1 Characters for Moho
A.Evseeva
Posts: 33
Joined: Wed Apr 08, 2015 8:43 am
Contact:

Re: Set Layer Transform?

Post by A.Evseeva » Sat Dec 09, 2017 2:28 pm

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)
hayasidist
Posts: 2131
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Set Layer Transform?

Post by hayasidist » Sat Dec 09, 2017 5:40 pm

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
A.Evseeva
Posts: 33
Joined: Wed Apr 08, 2015 8:43 am
Contact:

Re: Set Layer Transform?

Post by A.Evseeva » Sun Dec 10, 2017 8:08 am

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.
hayasidist
Posts: 2131
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Set Layer Transform?

Post by hayasidist » Sun Dec 10, 2017 12:13 pm

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