LK_ToggleKeysFilter - Filter layer panel by animated layers

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Lukas
Posts: 1296
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Lukas »

This tool filters the layer panel by layers that have keys, so you can easily see what layers have been animated.
Click the tool again, to see all layers again.
I'd suggest disabling Moho > Preferences > Layers/Objects > 'Search filter always shows parent layers of matching items' for best results.

Download link:
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Daxel »

Great idea! Thanks for sharing
User avatar
Lukas
Posts: 1296
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Lukas »

I re-uploaded the .zip linked in the original post and included another button that does a similar thing (you need the new utility file too):
  • LK_HideStaticLayers
It doesn't do any filtering with the layer panel, but it just hides all non-animated layers in the viewport. When you click it again it shows ALL layers. So you probably want to use "hide in editing view" and "don't render this layer" when using this button.

At first I was thinking of putting these both in a single button, but you don't always want to do both at the same time.
User avatar
Lukas
Posts: 1296
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Lukas »

synthsin75 wrote: Fri Aug 20, 2021 5:55 pm I did something similar here: https://www.lostmarble.com/forum/viewtopic.php?t=31246
Ah of course you did 😅

I didn't know of MohoLayer:ClearLayerKeyCount(), that's interesting. I did it differently because I got weird results without the clearlayerkeycount function and now I know why! Might adopt it if I ever need to update it.

My script also sets and clears the filter for the layer panel so you don't have to filter manually and the tag disappears when you're not filtering.
User avatar
synthsin75
Posts: 9968
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by synthsin75 »

Lukas wrote: Sun Aug 22, 2021 9:09 am
synthsin75 wrote: Fri Aug 20, 2021 5:55 pm I did something similar here: https://www.lostmarble.com/forum/viewtopic.php?t=31246
Ah of course you did 😅
Great minds think alike. :wink:
I didn't know of MohoLayer:ClearLayerKeyCount(), that's interesting. I did it differently because I got weird results without the clearlayerkeycount function and now I know why! Might adopt it if I ever need to update it.
I had forgotten I used that.
My script also sets and clears the filter for the layer panel so you don't have to filter manually and the tag disappears when you're not filtering.
Yeah, yours sounds like it automates more of the process.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Daxel »

Thank you, both are very good solutions. And a combination of both would probably be even better: to have a handy automatic button like Lukas did but to be based on tags so you can go back to normal without having to show all layers. But I don't know if that's possible.
User avatar
Lukas
Posts: 1296
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_ToggleKeysFilter - Filter layer panel by animated layers

Post by Lukas »

Daxel wrote: Mon Aug 23, 2021 12:26 am Thank you, both are very good solutions. And a combination of both would probably be even better: to have a handy automatic button like Lukas did but to be based on tags so you can go back to normal without having to show all layers. But I don't know if that's possible.
Yeah that's possible. I'm using the buttons as they are now for a while though. They are suited for my projects. But I'll keep it in mind.
Post Reply