*NEW* Switch Icons (updated 12/13/21)

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Hoptoad
Posts: 619
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: *NEW* Switch Icons (updated 8/16/21)

Post by Hoptoad »

I'm using Moho 13.5, but I'm on Mac with a M1 chip. Maybe it's because of that?

To eliminate the possibility that the problem was somehow rooted in the Moho 12.5 rigged character I had imported into 13.5, I just created a new character completely in 13.5. It's basically a head with a switch layer that has two vector layers inside for the eyes: named Open and Blink.

I tested your script again and yes, there is a mouse click that does nothing before the mouse click which scrubs in the workspace.

Hmm. Now that I think about it, this click-does-nothing behavior was going on before I used your script. It may be a Moho 13.5 bug.

EXPERIMENTING...

Uh oh, it does seem to be a Moho bug of some sort.

I created a vector layer with a Star shape in it, then I created a second vector layer with a Triangle shape in it. Pretty simple stuff.

The Select Points Tool does not work with the initial mouse click when I go back into a vector layer. The tool does not draw a box to select points; it does nothing. I have to click a second time for it to work. After that, it works every time as expected, as long as I remain in the same layer.

But when I leave the vector layer and go a different vector layer, once again the tool will not select any points on the initial click.

I'm not 100% sure, but I think there have been other occasions while animating in 13.5 where the first click was ignored. I'm 99% sure I was having to click twice when translating points recently.

I never did a screen video capture before, or I would show you. Sorry for the de-rail. Your script is awesome.
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 8/16/21)

Post by synthsin75 »

No problem, Hoptoad. While I didn't wish it was a Moho bug, I am glad it's not my script. Thanks for investigating it.
Seems to be a general problem with window focus (at least I'm assuming the first click restores the window/workspace focus), that behaves differently on Mac and PC.

I went ahead and added dynamic cursors to the tool, don't know if that will help you any.
User avatar
Hoptoad
Posts: 619
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: *NEW* Switch Icons (updated 8/16/21)

Post by Hoptoad »

The changing cursor is helpful. Thanks!
User avatar
Designspaceman
Posts: 39
Joined: Sun Oct 04, 2009 1:47 pm

Re: *NEW* Switch Icons (updated 8/16/21)

Post by Designspaceman »

Wow. This script makes a lot of things much much much easier. Why don't you work for LM? Your Ideas are always close to what moho animators need.
So maybe you should at least get some donations from those who can affort (e.g. me) to support your work.
Thank you very much!
Steven aka Designspaceman
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 8/16/21)

Post by synthsin75 »

Designspaceman wrote: Sun Sep 26, 2021 8:26 am Wow. This script makes a lot of things much much much easier. Why don't you work for LM? Your Ideas are always close to what moho animators need.
So maybe you should at least get some donations from those who can affort (e.g. me) to support your work.
Thank you very much!
Steven aka Designspaceman
Thanks for the kind words, Steven.
LM is aware of us scripters, but have their own developers with their own vision for Moho.

There's a link in my signature for donations. I appreciate anything I get, especially from anyone using my scripts for commercial work.
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by synthsin75 »

Update to fix crash in 13.5.2: https://dl.dropboxusercontent.com/s/2wq ... s.zip?dl=0

Some change in 13.5.2 made it so I can no longer update the timeline and layers window when you click a switch icon. So now these update when you click or click & drag in the workspace.
Probably not a big deal, since no one has used it in 13.5.2, but fixed when they do.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: *NEW* Switch Icons (updated 12/13/21)

Post by Daxel »

synthsin75 wrote: Tue Dec 14, 2021 12:55 am Update to fix crash in 13.5.2: https://dl.dropboxusercontent.com/s/2wq ... s.zip?dl=0

Some change in 13.5.2 made it so I can no longer update the timeline and layers window when you click a switch icon. So now these update when you click or click & drag in the workspace.
Probably not a big deal, since no one has used it in 13.5.2, but fixed when they do.
Thank you Wes!
Maybe that change is also the culprit of those situations when you need to click somewhere to keep working? Or a try to fix it? Right now I'm not sure if that still happens on the latest .2 version
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by synthsin75 »

Daxel wrote: Tue Dec 14, 2021 11:44 am Maybe that change is also the culprit of those situations when you need to click somewhere to keep working?
That's been an issue for quite some time (many versions). It seems to be an issue with input fields not releasing focus.
User avatar
SemiRespect
Posts: 12
Joined: Tue Jan 12, 2021 2:39 am

Re: *NEW* Switch Icons (updated 12/13/21)

Post by SemiRespect »

I'm sure this is me not knowing as much as I should, but I put the lua and the icon in my custom scripts folder it's there but when i click it I see the mouse icon change but all it seems to do is scrub my timeline, I'm not seeing anything about icons for my switch or anything? Would anyone be able to diagnose what I've done wrong (which is probably obvious) Thanks!
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by synthsin75 »

SemiRespect wrote: Wed Dec 22, 2021 11:35 pm I'm sure this is me not knowing as much as I should, but I put the lua and the icon in my custom scripts folder it's there but when i click it I see the mouse icon change but all it seems to do is scrub my timeline, I'm not seeing anything about icons for my switch or anything? Would anyone be able to diagnose what I've done wrong (which is probably obvious) Thanks!
At the top of the workspace is the tool options bar. You need to generate icons, with the update button (hover over to see description), and then the icons are in the dropdown for the switch layer.
User avatar
SemiRespect
Posts: 12
Joined: Tue Jan 12, 2021 2:39 am

Re: *NEW* Switch Icons (updated 12/13/21)

Post by SemiRespect »

synthsin75 wrote: Wed Dec 22, 2021 11:48 pm At the top of the workspace is the tool options bar. You need to generate icons, with the update button (hover over to see description), and then the icons are in the dropdown for the switch layer.

I knew I was missing something obvious, I see it, I clicked the box with the red x & they all appeared, everyone is right, this is a wonderful script & you are a shining star in the moho universe
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by synthsin75 »

SemiRespect wrote: Wed Dec 22, 2021 11:55 pm I knew I was missing something obvious, I see it, I clicked the box with the red x & they all appeared, everyone is right, this is a wonderful script & you are a shining star in the moho universe
Ah, you need to put the syn_resources folder in your Scripts/ScriptResources folder. That's the icon for that red X you're seeing.
User avatar
synthsin75
Posts: 9978
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by synthsin75 »

Updated to disable custom cursors in v12 and older: https://dl.dropboxusercontent.com/s/2wq ... s.zip?dl=0
HOWLING_ABANDON
Posts: 9
Joined: Thu Jan 06, 2022 1:45 am

Re: *NEW* Switch Icons (updated 12/13/21)

Post by HOWLING_ABANDON »

Oh wow! This is awesome!


synthsin75 wrote: Sat May 22, 2021 10:33 pm https://dl.dropboxusercontent.com/s/2wq ... s.zip?dl=0

This tool allows you to animate switches using thumbnail images of the actual switch.

Installation: In your custom content folder, put syn_switch_icons.lua and syn_switch_icons.png in Scripts/Tool. Put the syn_resources folder in Scripts/ScriptResources.

Generate/update button: Generate/update switch thumbnails on frame zero for the selected switch layer/s. You can also alt-click this button to render thumbnails for every switch in the document.
Settings:
  • Icon size: Select small, large, or input your own custom thumbnail size.
  • Arrangement: The thumbnails can be arranged horizontally, vertically, or in blocks. If you only animate one at a time, horizontal will keep it from blocking the workspace. If you need to animate several at once, vertical or square will allow you to see more at a time.
  • Reverse sort: Select whether to reverse the sorting of the switches in the tool options bar or the thumbnails in each switch drop down. This might help if they over run the available space.
  • Spacing: Set how much space is between multiple switch drop downs. This can help keep their thumbnails from overlapping.
  • APPLY button: apply settings changes (or hit <enter> twice to apply) [UPDATE 8/15/21]
  • [UPDATE 8/1/21] Workspace scrub time speed: You can now scrub through the timeline by clicking & dragging in the workspace, so you don't have to move your cursor so far from the switch icons. This setting lets you adjust the relative speed between mouse dragging and timeline scrubbing.
  • Delete all thumbnails: This deletes all the thumbnails stored for the project. If you're done with a project, there's no need to keep them.
  • [UPDATE 12/13/21] Fix for crashing v13.5.2. Some change in 13.5.2 made it so I can no longer update the timeline and layers window when you click a switch icon. So now these update when you click or click & drag in the workspace.
If you switch between two of the same layer type, you'll need to hit ENTER to refresh the tool's UI and show the current layer's switch drop down.

Use:
The drop downs stay open until you hit enter, change layers, or move to/from frame zero. So you can just scrub down the timeline hitting the appropriate switch icon as you go to animate any switch.

There's now a colorized icon option included. Just install that icon and change line 14, as noted in the script.


Enjoy.

Special thanks to A.Evseeva for contributing code and Lukas for Mac testing and code.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: *NEW* Switch Icons (updated 12/13/21)

Post by Greenlaw »

Believe it or not, I only just now got around to trying Switch Icons. (Sorry for taking so long Wes.)

Wow, this is a very cool alternative to using the Switch Selection window. Because of its non-linear nature, I can see this being especially useful for Switch Layers with an extra-long list of drawings and when specific drawings are hard to find. And I love how it's so easy to set up.

One request: can the background color be made editable, or at least use a neutral (gray) color? In my first test, I used a black outline for a basic mouth shape and the mouth is not visible when it is closed.

Image

Thanks for creating and sharing this amazing tool Wes! 😸
Post Reply