Script for automating Switch layers consecutively?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script for automating Switch layers consecutively?

Post by Greenlaw »

Greenlaw wrote: Sun Jul 04, 2021 6:08 pm Note that you'll need to keyframe every frame to switch. This isn't too awful to do if you use shortcuts or the Switch Selection window, and if the sequence isn't too long.
Whoops! This is incorrect. Sorry, it's been awhile since I last used this command but I just tried it out and after I converted the Image Sequence to a Switch Layer, Moho did automatically keyframe every layer in sequential order. So, ignore that post.
User avatar
mmmaarten
Posts: 271
Joined: Mon Sep 19, 2022 2:19 pm
Location: Utrecht, The Netherlands
Contact:

Re: Script for automating Switch layers consecutively?

Post by mmmaarten »

Greenlaw wrote: Sun Jul 04, 2021 6:03 pm 1. ...right-click on the Image Sequence layer and select Convert To Switch Layer...
Great feature and I was searching for something like this, however unfortunately this is broken in Moho 13.5.5; when hitting 'Convert to Switch Layer' it does some processing and than crashes/quits Moho abruptly. No error message. :cry:
It doesn't matter if I do this on an Image layer with a sequence of 250 frames (1920x1080, rendered by Moho itself), or when doing this on a layer with only 3 (!!) frames in the sequence (it only crashes sooner). And I tried it on a fresh new Moho file on a pretty powerful machine with 64GB of ram used for heavy 3d rendering, so this is no hardware requirement issue.

I've just created a ticket on Lost Marble.
slowtiger wrote: Sun Jul 04, 2021 6:04 pm Scripts > Images > Import Image Sequence does exactly that.
Can't find this script inside Moho 13.5.5, so looks like this one is removed in favour of the above method?
Adults should play more often
User avatar
slowtiger
Posts: 6081
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Script for automating Switch layers consecutively?

Post by slowtiger »

For new Moho versions it's now under Import > Image Sequence.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
mmmaarten
Posts: 271
Joined: Mon Sep 19, 2022 2:19 pm
Location: Utrecht, The Netherlands
Contact:

Re: Script for automating Switch layers consecutively?

Post by mmmaarten »

slowtiger wrote: Wed Aug 02, 2023 2:51 pm For new Moho versions it's now under Import > Image Sequence.
Thanks for your response. That one tho does the same as choosing 'Image Sequence' from the add layers menu; it imports the sequence to a single layer. That's something else. This thread I think was about loading a sequence into multiple image layers. So a layer per frame.

Actually tho, I was searching for something else and than found this thread and took a look if it could help me and than found out the issue.

What I really want is convert a list of selected Image Layers (or a group with images layers) into a single 'Image Sequence layer' (image layer with a sequence). Because than we could have the image sequence inside the PSD file as individual layers inside a group which we convert in Moho into a single image sequence layer. Or else like the above; keep the individual layers where we could convert the group of these layers into a switch layer and have some kind of script that automatically creates an action which switches the image-frames inside that switch (otherwise we need to set all keyframes ourselves everytime) Just posted this as a feature request to Lost Marble. I think that could really help with the PSD workflow :D

Hope this makes sense!
Adults should play more often
Post Reply