[Request] Broken line script

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
8BitHobo
Posts: 12
Joined: Fri Jul 06, 2018 8:02 pm

[Request] Broken line script

Post by 8BitHobo »

I'm working on a project, and the backgrounds are all made in this stylized way in Affinity where you can make your lines have dashes. You can specify the gap and the length of the line to give a fairly random look. See below


Image

I've sort of achieved this effect in moho with a custom brush however due to the brush limitations the results dont look too crisp when making curves or increasing brush size, etc.
moho version:

Image


I could also add more points to lines and simply use the hide edge tool but this would make very simple shapes quite point heavy.

I was curious if this effect was possible with a script? To give the impression of having gaps without having to add points or making a custom brush that is.
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: [Request] Broken line script

Post by SimplSam »

I would absolutely suggest hide edge. I don't think a few additional points will make an ounce of difference to performance - unless you have some wacky animation of them.

I did also think about masking, but I think that's more work for little-no gain.
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
8BitHobo
Posts: 12
Joined: Fri Jul 06, 2018 8:02 pm

Re: [Request] Broken line script

Post by 8BitHobo »

I did experiment with masking but it loses the round edges to the line.
The hide edge is fine for static items like the background but when it come to animating the extra points get a bit tedious.
I might need to experiment with the brushes some more.
User avatar
Hoptoad
Posts: 619
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: [Request] Broken line script

Post by Hoptoad »

8BitHobo wrote: Wed Jul 26, 2023 6:05 pm I did experiment with masking but it loses the round edges to the line.
If your lines are squared at the ends, checkmark the box Round Caps in the Style tab. That should round the ends of lines.

I use "Hide Edge" to achieve a gap effect. I like that I can undo any single gap easily by clicking on it again with the Hide Edge tool.
User avatar
8BitHobo
Posts: 12
Joined: Fri Jul 06, 2018 8:02 pm

Re: [Request] Broken line script

Post by 8BitHobo »

Hoptoad wrote: Wed Jul 26, 2023 8:20 pm
8BitHobo wrote: Wed Jul 26, 2023 6:05 pm I did experiment with masking but it loses the round edges to the line.
If your lines are squared at the ends, checkmark the box Round Caps in the Style tab. That should round the ends of lines.

I use "Hide Edge" to achieve a gap effect. I like that I can undo any single gap easily by clicking on it again with the Hide Edge tool.
Oh yeah, I just mean the Lines get cut off when masking >_<
User avatar
Hoptoad
Posts: 619
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: [Request] Broken line script

Post by Hoptoad »

8BitHobo wrote: Wed Jul 26, 2023 11:30 pm Oh yeah, I just mean the Lines get cut off when masking >_<
Oh, think I understand. . .

There may be a way to accomplish what you want, as masking has a lot of variations; for example: Add to Mask But Keep Invisible, and Exclude Strokes.

Of course, what you want to do may be impossible or too difficult without a script, I don't know.

Good luck!
Post Reply