Switch layer in a particle layer

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Pierre Gombaud
Posts: 161
Joined: Mon Feb 23, 2015 2:15 am
Location: France
Contact:

Switch layer in a particle layer

Post by Pierre Gombaud »

In this exemple file (Google Drive Link), I have a green shape and an orange shape both inside a switch layer
This switch layer is inside a particle layer. Only the first shape, green, is displayed
On the timeline, I want to switch to the orange shape.

If I do that, Moho will not update the particles, meaning the green shape only is used - Is there a way to fix that?

I tried with a smartbone to switch the content of the switch layer, and by showing/hidding the vector layers too but no success...
I guess it has something to do with the duration of the particles which aligns with the timeline duration, if that makes sense
Meaning it is not possible to switch a shape while being used for generating particles so every instances of the particle layer are replaced at the same time?

Expected result:
Image

Real result:
Image
Last edited by Pierre Gombaud on Sat Nov 15, 2025 10:05 am, edited 3 times in total.
User avatar
slowtiger
Posts: 6315
Joined: Thu Feb 16, 2006 9:53 am
Location: Berlin, Germany
Contact:

Re: Switch layer in a particle layer

Post by slowtiger »

Just tested: a switch layer with 4 bitmaps cycling through (don't forget to set the last key to cycle), put into a particle layer: works.
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 M2 Pro OS 13.7.6
User avatar
Pierre Gombaud
Posts: 161
Joined: Mon Feb 23, 2015 2:15 am
Location: France
Contact:

Re: Switch layer in a particle layer

Post by Pierre Gombaud »

slowtiger wrote: Sat Nov 15, 2025 8:02 am Just tested: a switch layer with 4 bitmaps cycling through (don't forget to set the last key to cycle), put into a particle layer: works.
Yes, it will work with a cycle but, I guess, because Moho will pick one of the bitmaps at a random moment on the timeline of the particle lifetime
If you switch manually the bitmap layer on the main timeline, the already generated particles will keep using the previously displayed bitmap
What I want here is to replace every instance of the particles (the old, current and future ones) with one of the sub-layer of the switch layer all at once

Something like that below - From the switch layer, the layer 1 (circle) is then replaced by the layer 2 (star) by the particle layer:
Image

It's tricky to explain with words, so hopefully my message makes sense
User avatar
slowtiger
Posts: 6315
Joined: Thu Feb 16, 2006 9:53 am
Location: Berlin, Germany
Contact:

Re: Switch layer in a particle layer

Post by slowtiger »

Just put the two layers inside the switch layer, create the keys, set to cycle. That's it.

This is my setup:
- particle layer
- - switch layer (each sublayer shows up for 10 frames, then cycle)
- - - red star
- - - green circle

Result: lots of particles all switching from red to green at the same time.
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 M2 Pro OS 13.7.6
User avatar
Pierre Gombaud
Posts: 161
Joined: Mon Feb 23, 2015 2:15 am
Location: France
Contact:

Re: Switch layer in a particle layer

Post by Pierre Gombaud »

slowtiger wrote: Sat Nov 15, 2025 9:07 am Just put the two layers inside the switch layer, create the keys, set to cycle.
I totally understand what you explain here, unfortunately it's not exactly what I have in mind
The idea is not to cycle different layers of a switch layers indefinitely but to switch the particles all at once at any given moment
Let say on the main timeline from frame 1 to frame 20, switch layer shows layer 1 and particle layer use this layer 1 only, then from frame 20 to frame 100, switch layer shows layer 2 so particle layer uses layer 2 only
Doing a cycle on the switch layer animation channel won't do the trick, unfortunately
User avatar
slowtiger
Posts: 6315
Joined: Thu Feb 16, 2006 9:53 am
Location: Berlin, Germany
Contact:

Re: Switch layer in a particle layer

Post by slowtiger »

OK, you want to switch all particles only once at the same time. Well, set the switch layer to exactly that, without any cycle key. Works here.
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 M2 Pro OS 13.7.6
User avatar
Pierre Gombaud
Posts: 161
Joined: Mon Feb 23, 2015 2:15 am
Location: France
Contact:

Re: Switch layer in a particle layer

Post by Pierre Gombaud »

Sorry, maybe I'm missing something here but, switching layers from the switch layer will not update all the particle once at the same time
Do you mind sharing an exemple file? I would be really happy if the solution were that simple!
User avatar
slowtiger
Posts: 6315
Joined: Thu Feb 16, 2006 9:53 am
Location: Berlin, Germany
Contact:

Re: Switch layer in a particle layer

Post by slowtiger »

Ah, now it gets interesting, because it works on this setup: Moho 13.5 on Mac.

But when I open the same file in Moho 14.3 on another Mac it doesn't work! Only the first switch layer shows.

Sorry for the confusion, but I didn't expect this since particle and switch layers haven't changed over versions for a very long time.
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 M2 Pro OS 13.7.6
User avatar
Pierre Gombaud
Posts: 161
Joined: Mon Feb 23, 2015 2:15 am
Location: France
Contact:

Re: Switch layer in a particle layer

Post by Pierre Gombaud »

Ah that would explain why, then - Thank you for checking that, I believe this behavior of the particle layer has changed during a minor version of Moho 14
In my case, I think I'll simply duplicate the file and export the two versions I need of the particle layers
User avatar
synthsin75
Posts: 10383
Joined: Mon Jan 14, 2008 2:20 pm
Location: Oklahoma
Contact:

Re: Switch layer in a particle layer

Post by synthsin75 »

You might be able to do this setup instead:
Switch
- Particle
- - green
- Particle
- - orange

But there might be issues with the particles being out of sync when you switch them.
User avatar
slowtiger
Posts: 6315
Joined: Thu Feb 16, 2006 9:53 am
Location: Berlin, Germany
Contact:

Re: Switch layer in a particle layer

Post by slowtiger »

Yes, I also tried to make a reference layer to the particle layer and switch visibility, but the particles don't line up.
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 M2 Pro OS 13.7.6
User avatar
hayasidist
Posts: 3921
Joined: Wed Feb 16, 2011 11:12 am
Location: Kent, England

Re: Switch layer in a particle layer

Post by hayasidist »

seems ok here (win 10, 14.4) for switching the particle layers or manually toggling visibility. However, switching the actual particle doesn't -- moho seems to want to finish what it started with the 'previous' shape (but you've found that already)

https://www.mediafire.com/file/vl4qd9or ... .moho/file

maybe because I copied the particle group and edited the actual particle vectors - so I kept the same "random" in both????
User avatar
Greenlaw
Posts: 10648
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: Switch layer in a particle layer

Post by Greenlaw »

synthsin75 wrote: Sun Nov 16, 2025 10:48 am You might be able to do this setup instead...
But there might be issues with the particles being out of sync when you switch them.
I did that yesterday shortly after Pierre posted, but in my setup, I made a reference of the original particle layer, hoping this kept the two particle layers in sync. It worked as you might expect.

I had noticed something odd when the particles overlapped slightly: over time, the sorting order changed, which somewhat disrupted the pattern. I tried cheating this by animating the sprite on Z to drift back over time, but Moho seemed to ignore this. (Yes, I was using 'true' depth settings.) That's a different issue though, and if the particles are spread out like in Pierre's example, it works fine.

I should post the test...BRB.
Last edited by Greenlaw on Sun Nov 16, 2025 2:00 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 10648
Joined: Mon Jun 19, 2006 9:45 am
Location: Los Angeles
Contact:

Re: Switch layer in a particle layer

Post by Greenlaw »

Here we go...

Image
I had to make an adjustment so the particles don't overlap. I'll post an example of that issue in a minute.

BTW, it doesn't matter that the second Particle Layer is a Reference because there are no keyframeable properties in the Particles window. It would be nice if we got this feature in a future release. (As a matter of fact, I would love for EVERYTHING in Moho to be keyframeable, not just particle layer options.) :)
Last edited by Greenlaw on Sun Nov 16, 2025 2:36 pm, edited 2 times in total.
User avatar
Maestral
Posts: 608
Joined: Tue Jan 27, 2009 8:44 am
Location: Belgrade, Serbia

Re: Switch layer in a particle layer

Post by Maestral »

Image

Apparently, Greenlaw and I arrived at the same conclusion.
Post Reply