Delayed Layer References

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Delayed Layer References

Post by Stan »

This is a menu/button script. It takes the currently selected layer and creates a number of references with a certain timing offset, so each reference's animation plays with a delay of several frames.

The default X and Y offset values are the layer's bounding box dimensions, so if you just click OK then the references will be added back to back with no space between them.

Image

Image

Image

Download link: http://mohoscripting.com/uploads/1/sz_d ... s_1.11.zip
Last edited by Stan on Thu Apr 13, 2017 4:29 am, edited 4 times in total.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Delayed Layer References

Post by synthsin75 »

Thanks, Stan! Looks awesome!
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Delayed Layer References

Post by Greenlaw »

That's trippy!

Thanks for posting the tool, Stan. Looking forward to trying it out.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Delayed Layer References

Post by Víctor Paredes »

Wow, another fantastic and clever script this week!
Thank you very much for sharing it.

I have been playing with it and have some feedback for it (and, of course, you are free to consider it :)):

The Layer Translation channel is used to move the delayed referenced layers, that means you can't modify that channel after the references are created, because it's not referenced to the original layer.
Also related to layer translation, the script only offsets the first layer translation keyframe for the references. So, if you have more than one translation key, the references start in the new position, but then go back to the original layer position, creating a weird animation.

To solve it, maybe the script could have the option to create a group for each reference and translate the group instead of the layer itself.
I tried to manually do this group trick, but the script is not working for groups right now.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
F.M.
Posts: 497
Joined: Thu Nov 04, 2004 4:29 pm
Location: Between my ears

Re: Delayed Layer References

Post by F.M. »

Thank you for sharing!
"and then Man created god!"
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: Delayed Layer References

Post by Stan »

Víctor Paredes wrote:Wow, another fantastic and clever script this week!
Thank you very much for sharing it.

I have been playing with it and have some feedback for it (and, of course, you are free to consider it :)):

The Layer Translation channel is used to move the delayed referenced layers, that means you can't modify that channel after the references are created, because it's not referenced to the original layer.
Also related to layer translation, the script only offsets the first layer translation keyframe for the references. So, if you have more than one translation key, the references start in the new position, but then go back to the original layer position, creating a weird animation.

To solve it, maybe the script could have the option to create a group for each reference and translate the group instead of the layer itself.
I tried to manually do this group trick, but the script is not working for groups right now.
Thank you Victor, excellent idea!
"Put Each Reference in a Group Layer" - I added that option to the new version (1.1). The link in the first post is updated. Enjoy!
Merry Christmas and Happy New Year to everyone!

Image
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Delayed Layer References

Post by Víctor Paredes »

Stan wrote:"Put Each Reference in a Group Layer" - I added that option to the new version (1.1). The link in the first post is updated. Enjoy!
Merry Christmas and Happy New Year to everyone!

Image
Wow! Thank you very much, Stan!
I'm having a lot of fun with this script and will try to use in the project I'm working on.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: Delayed Layer References

Post by chucky »

Cool Stan...!
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Delayed Layer References

Post by dkwroot »

This could be really powerful if you can figure out a way to get it to work with image textures.

Image
Ahroo
Posts: 41
Joined: Sat Jun 11, 2011 7:53 pm

Re: Delayed Layer References

Post by Ahroo »

Thank you, Stan!
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: Delayed Layer References

Post by Stan »

Thanks to Victor Paredes, I have made a little modification to the script - now you can use negative values for the timeline delay, that will move the references to the left side in Sequencer (the explanation is here). The link in the first post is updated. Enjoy!

Image
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Re: Delayed Layer References

Post by Lost Marble »

I missed this when it was originally posted, but wow! This is a really cool idea! Thanks for sharing the script, Stan!
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: Delayed Layer References

Post by Stan »

Lost Marble wrote:I missed this when it was originally posted, but wow! This is a really cool idea! Thanks for sharing the script, Stan!
Thank you Mike!
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
User avatar
jezjones29
Posts: 339
Joined: Tue Jan 31, 2006 9:43 pm
Location: Wales, UK
Contact:

Re: Delayed Layer References

Post by jezjones29 »

I've been having some fun with this - thanks for sharing!
Is there any way to add Z and Rotate options?
Stan
Posts: 199
Joined: Sun Apr 19, 2009 3:22 pm

Re: Delayed Layer References

Post by Stan »

jezjones29 wrote:Is there any way to add Z and Rotate options?
Yeah, I was thinking about version 2, with Z axis, rotations, randomization, etc. That would be kind of making it an alternative to the particles layers. But finding some spare time for it is always a problem. I'll try my best though. Maybe this upcoming weekend.
________________________________________________________________________
https://mohoscripting.com/ - Unofficial Moho Lua scripting documentation
https://mohoscripts.com/ - The best place to publish and download scripts for Moho
Post Reply