Animate the origin of layers

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
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Animate the origin of layers

Post by ponysmasher » Sun Jul 24, 2011 1:50 pm

Just wrote this script and so far it seems to work: Download here

Here's how it works:
YouTube clip
User avatar
GCharb
Posts: 2202
Joined: Mon Oct 10, 2005 2:31 am
Location: Saint-Donat, Quebec, Canada
Contact:

Post by GCharb » Sun Jul 24, 2011 4:15 pm

Cool, will have a look at it.

Seems like something that could be useful, already have a few ideas in mind.

Thanks!
jonbo
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

Post by jonbo » Sun Jul 24, 2011 4:42 pm

This looks pretty cool, pony, I'm going to have to play with this one and your camera script. You're putting these out faster then I can get a good handle on them. Thanks for these. Maybe I'll get ahead of your output one of these days :)
funksmaname
Posts: 3107
Joined: Tue May 29, 2007 11:31 am
Location: Nelson, New Zealand

Post by funksmaname » Sun Jul 24, 2011 9:15 pm

Nice one Pony! keep on smashin'
User avatar
Víctor Paredes
Posts: 4887
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

Post by Víctor Paredes » Sun Jul 24, 2011 10:12 pm

absolutely great!
I'll check tomorrow with more time.
thank you very much!
Víctor Paredes
Former Moho Product Manager
Rigger and animator in Cartoon Saloon
My Youtube Channel - My webinars
User avatar
uddhava
Posts: 310
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava » Tue Jul 26, 2011 12:09 pm

ponysmasher,

I tried out this script, but when I tried moving the origin it wouldn't move at all. Lua Consule reads....

....error in function 'layer'. argument#2 is 'nil'; 'number' expected.

I have version 8.01 of ASPro and I use Windows 7.

udd

Looks nice though. uddhava
ponysmasher
Posts: 370
Joined: Thu Aug 05, 2004 2:23 am
Location: Los Angeles
Contact:

Post by ponysmasher » Tue Jul 26, 2011 12:44 pm

uddhava wrote:ponysmasher,

I tried out this script, but when I tried moving the origin it wouldn't move at all. Lua Consule reads....

....error in function 'layer'. argument#2 is 'nil'; 'number' expected.

I have version 8.01 of ASPro and I use Windows 7.

udd

Looks nice though. uddhava
Did you create a layer with the same name as the layer you want to animate the origin of and add ".origin" to the end?

If the layer where you want to animate the origin is called "My fabulous layer", then you have to create a layer called "My fabulous layer.origin".
The keyframes for the layer have to be stored somewhere so my solution is to store them in that layer.

Oh right, I think the .origin layer also has to be a top layer, that is not inside another layer. Haven't added any code for checking group or bone layers (yet).
User avatar
uddhava
Posts: 310
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava » Tue Jul 26, 2011 1:28 pm

I did what you said and now the origin will move again, but the same error message comes up and it doesn't create a keyframe. It doesn't animate.
jonbo
Posts: 896
Joined: Thu Apr 08, 2010 2:53 am

Post by jonbo » Tue Jul 26, 2011 1:38 pm

Hey Udd, you get that error because you are embedding the script on the wrong layer. You embed it on the first layer not the .origin layer. Watch the video again, you'll see what I mean. I did that too at first and got that same error you got.
User avatar
uddhava
Posts: 310
Joined: Tue Nov 04, 2008 7:24 pm
Location: American back in Hungary

Post by uddhava » Tue Jul 26, 2011 2:12 pm

jonbo wrote:Hey Udd, you get that error because you are embedding the script on the wrong layer. You embed it on the first layer not the .origin layer. Watch the video again, you'll see what I mean. I did that too at first and got that same error you got.
Okay, that fixed the problem. Actually all of my problems with this script came from not watching the video carefully enough.

Thanks jonbo.

Thanks ponysmasher, sorry for my negligence. Btw, I notice more and scripts are listed on your website. Great contribution!
Post Reply