LK_LayerFinder

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

Moderators: Víctor Paredes, Belgarath, slowtiger

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

LK_LayerFinder

Post by Lukas »

Quickly find and select layers with keys and rig layers

This is basically an extra layers-panel to quickly find and select layers with keys and rig layers without needing to filter the original layer panel. You can use both at the same time.

Only works with Moho version 14.0 and up.
Image
BigBoiiiJones
Posts: 77
Joined: Sun Mar 22, 2020 11:33 pm

Re: LK_LayerFinder

Post by BigBoiiiJones »

Lukas wrote: Fri Sep 15, 2023 12:40 pm Quickly find and select layers with keys and rig layers

This is basically an extra layers-panel to quickly find and select layers with keys and rig layers without needing to filter the original layer panel. You can use both at the same time.

Only works with Moho version 14.0 and up.
Image
This is pretty cool. Just curious though you think it's possible to do something like this but for shapes in a layer? With the new liquid shapes it could be messy trying to figure out what order all the shapes are in so having a layer like panel display all of them and even rename name them and reorder them through dragging would be amazing.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: LK_LayerFinder

Post by Greenlaw »

Oh, that's clever, Lukas! I'll try it out tonight.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_LayerFinder

Post by Daxel »

Thanks for sharing! I tried it a little bit and when I opened the panel it displayed the animated layers correctly. However, pressing the arrow buttons or trying to change the mode gives me an error on the line 200. When I tried to close it and open it again, it crashed.
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_LayerFinder

Post by Lukas »

Daxel wrote: Sat Sep 16, 2023 11:20 am Thanks for sharing! I tried it a little bit and when I opened the panel it displayed the animated layers correctly. However, pressing the arrow buttons or trying to change the mode gives me an error on the line 200. When I tried to close it and open it again, it crashed.
Can you double check if you have the latest versions of both LK_LayerFinder and FO_Utilities? If you are, could you send me your moho file so I can try to figure out the issue? Does it crash on any file? Does it also crash on any of the startup files? Thank you!
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_LayerFinder

Post by Daxel »

Lukas wrote: Sat Sep 16, 2023 12:31 pm
Daxel wrote: Sat Sep 16, 2023 11:20 am Thanks for sharing! I tried it a little bit and when I opened the panel it displayed the animated layers correctly. However, pressing the arrow buttons or trying to change the mode gives me an error on the line 200. When I tried to close it and open it again, it crashed.
Can you double check if you have the latest versions of both LK_LayerFinder and FO_Utilities? If you are, could you send me your moho file so I can try to figure out the issue? Does it crash on any file? Does it also crash on any of the startup files? Thank you!


I created a new file and just made one bone layer with 5 vector layers inside with a shape on each one, and I had the same problem, so it seems to happen in any file:

LK_LayerFinder.lua:200: attempt to call a nill value (method 'ListLayersOfType')

I'm double checking the files and I have a doubt: where should the utilities file be? I have a folder named "utility" inside my "scripts" folder, but I'm not sure if I created that folder or if that is the correct place to put these utility files. Or should they be inside the tool folder?
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_LayerFinder

Post by Lukas »

‘FO_Utilities’ goes into the ‘Utility’ folder
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_LayerFinder

Post by Daxel »

Lukas wrote: Sat Sep 16, 2023 4:11 pm ‘FO_Utilities’ goes into the ‘Utility’ folder
I already intalled scripts like that. However, some script was not working one day and I tried moving the utilities to the tool folder to see if that helped. It didn't seem to matter so I left them there too just in case. I kept installing scripts correctly using the utility folder but turns out that the utility files that I left in the tool folder were causing this problem and some othe one that I never managed to understand. What a stupid mistake. But hey, so happy that I finally understood it.

Sorry for the false positive. I made quick tests and it seems to work correctly. And to my surprise it works automatically, which is pretty cool.
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_LayerFinder

Post by Lukas »

No problem! Good to hear it works for you now.

I just updated LK_LayerFinder again btw. Squashed a different bug. New version is at MohoScripts.com
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_LayerFinder

Post by Lukas »

BigBoiiiJones wrote: Fri Sep 15, 2023 10:11 pmJust curious though you think it's possible to do something like this but for shapes in a layer? With the new liquid shapes it could be messy trying to figure out what order all the shapes are in so having a layer like panel display all of them and even rename name them and reorder them through dragging would be amazing.
Yes, it’s been on my mind too. It’s possible I think. (except for dragging, but there’s other ways)

A floating window like this is a new scripting technique though, so I’m curious if this is stable enough to continue down this path and create more
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: LK_LayerFinder

Post by Daxel »

Lukas wrote: Sat Sep 16, 2023 5:30 pm A floating window like this is a new scripting technique though, so I’m curious if this is stable enough to continue down this path and create more
I hope so! because it opens so many possibilities. Do you think that the panel could be updated without the blinking effect? I mean the buttons and the names not dissapearing and appearing when the panel checks for animated layers.
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: LK_LayerFinder

Post by SimplSam »

Just resharing some work that @Rai López did in regards to a panel for Liquid Shapes (video)

Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: LK_LayerFinder

Post by Lukas »

SimplSam wrote: Sat Sep 16, 2023 10:54 pm Just resharing some work that @Rai López did in regards to a panel for Liquid Shapes (video) [...]
Oh right, nice! I would try to move it from a dropdown dialog into a modeless dialog (floating window), but that's up to him. 🙂
User avatar
Rai López
Posts: 2243
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Re: LK_LayerFinder

Post by Rai López »

First off, thanks, Lukas! All the work you are doing trying to take the most of modeless dialogs is priceless... I'm following it with a lot of interest because at some point I'd love to go that way for a tool I'm working on for a long time but, as you pointed out, it may still be a kind of a risky decision and surely I'd have to start with something smaller in order to can go ensuring 100% reliability/stability. I'd just have to find the time and a good enough reason...

Regarding your tool, at first I wondered why you didn't go for an ImageTextList instead of a button pile, but then I understood that well may be a performance decision, since buttons allow updating their text individually, and with a list widget I think you have to refresh all of its content upon any change (if memory serves and unless a workaround was possible). In any case, you got a very interesting approach by kind of faking lists behavior on which I didn't have thought before and one never know when something like that could come in handy, so thanks for sharing that too. BTW, I don't know if it would look very good in the end, but still it could worth a try... have you considered using a vertical Slider instead of the arrows for scrolling? That way one could go directly to any "page" (tick) in a more similar way scrollbars allow to do. But, well, just a thought...

Lukas wrote: Sun Sep 17, 2023 5:37 am
SimplSam wrote: Sat Sep 16, 2023 10:54 pm Just resharing some work that @Rai López did in regards to a panel for Liquid Shapes (video) [...]
Oh right, nice! I would try to move it from a dropdown dialog into a modeless dialog (floating window)
Thanks for bringing it to the forefront, @SimplSam! Cause, yeah... it was in fact the first thing that came to my mind with the new M14 scripting possibilities and after seeing Lukas's great advancements on this area, although that feature had to be developed in a very quick/dirty way more as a "demo" of how counting with some kind of visual feedback could help on dealing with shape management in general and new Liquid Shapes in particular than a ready to "real world" implementation, plus it was constructed over a previous version of the Select Shape tool, so I'd have at least to apply newest parts of the code in order to see how it behaves nowadays. If I got to achieve that and it turns to work well enough, I'll upload it for what it could worth... But, again, not sure how it would behave under real scenarios with, e.g., lots of shapes and so.

Lukas wrote: Sun Sep 17, 2023 5:37 am (CONT'D) but that's up to him. 🙂
Well, I'm sure you would do it by far much better than me, so (as far as I'm concerned) don't be shy! :lol:

And (🤔) I think that's all I wanted to comment for now... Cheers!
...
User avatar
Rai López
Posts: 2243
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Re: LK_LayerFinder

Post by Rai López »

OK, it wasn't so hard to update the code to its current state after all, and surprisingly it turned to work better than I remembered, as long as there is not too many shapes at least... but I think that's not the norm for most use cases. There are some known issues, e.g., the toolbar not always update correctly, the Name text field doesn't store name changes by pressing Enter key (but it does upon clicking elsewhere or pressing Tab), the dialog height not always adapts to viewport size (that part was kind of an experiment 🙄) and... maybe other ones I can't remember now. Apart from that, the idea is one have all the control (selection, renaming, ordering...) and visualization of shapes and their interaction regarding awesome Liquid Shapes. Well, basically, what can be seen in the video above...

If someone is interested, here it is the download link: lm_select_shape_20230918-0200_rl.zip

I think it is OK to leave it as an "lm" tool as long as you alert that IT ONLY HAS TO BE COPIED TO YOUR CUSTOM CONTENT FOLDER (just in case someone is unaware) and don't overwrite any original file of the program installation directory, isn't it? The reasoning after leave it as is, is there wouldn't have too much sense to have two Select Shape tools when the rest of functionalities remains just the same, so I hope it makes sense.

Well, as I said, for what it could worth... I hope not being spoiling the thread too much by posting all this here, though!
...
Post Reply