Paintbrush plugin

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
TDolce
Posts: 36
Joined: Sat Oct 30, 2004 3:02 am
Location: Germantown, TN

Paintbrush plugin

Post by TDolce »

It would be great if someone created a plugin that automatically gave the artist a smooth freehand looking line with variable line widths..... I know Moho has some settings to get close to this,..but it doesn't quite get it and the approach is not straight forward. I think seeeing that The Tab and Toon Boom Studio can do this, then it must be able to be done. Someone also created a plugin to do this for a program called Dogwaffle which originally could not achieve this on its own. Anyone out there able to do this?
Todd Dolce
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

yah i cant see why it couldnt be done, i'd definatly appreciate this
User avatar
kdiddy13
Posts: 381
Joined: Tue Aug 03, 2004 10:26 pm
Location: New Zealand
Contact:

Post by kdiddy13 »

Sorry, lots of questions:

Do you mean without a tablet? How does it differ from what you can already do in Moho (with a tablet or manually going back and adjusting line width)? Could you post a picture of the effect you want?
Last edited by kdiddy13 on Mon Mar 07, 2011 4:54 am, edited 1 time in total.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

If I'm getting what you're saying (but some really specific requests would help), there are a few things that could be done.

1. By the variable line widths, are you referring to the fact that you don't have visual feedback on the pen pressure driven line width while drawing (which I'd like to fix anyway) or do you wan't a setting to somehow randomly (or harder, in some way intelligently) automatically assign variable line widths? I'm sure it's possible to give at least some visual feedback on line width, but without a pretty extensive rewrite it would probably be difficult to make the "preview" line exactly represent the final line. If an decent approximation is enough, I believe that's possible.

2. What are you not able to get in Freehand with the current settings? There were 2 possibilities I thought might be helpful. One is to define keys (say 1-9) that would allow you to change the pixel and angle tolerances on the fly while drawing. This might be better, but might be clumsy in use. I'm thinking about it. Another option might be to make, in particular, the pixel tolerance (the minimum sitance between new points a time-based variable. So, the faster you are drawing a line the fewer points you will get. That might be a good solution. For that matter , you could also tie it line width, with the lines getting wider (or narrower) as you draw faster. I see that that's how it's done in Dogwaffle 1.2.

Lemme know what you think, and I'll see what I can do.

--Brian
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

have you seen flash brush tool? it lets you 'paint' with vectors... im not sure what math would be involved, i guess it would be very complicated.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

I could, in a rough theoretical way, how that might be working. I need to get a whole lot better at scripting before I try something like that. It would be a really cool tool, though. I'll keep that in mind, but at the moment I think I might just be able to tweak the Freehand tool. I'm leaning towards making it time based.

--Brian
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

small steps lead to great things ;)
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Okay, that's enough for tonight.. So here's my first version of the modified Freehand tool script , Freehand 2. I did a few things to it.

First, it now draws out all of the "potential" points, and also shows you a good approximation of the curve you are going to get, instead of the lines you would get especially if you set the pixel tolerance high. I say "potential" points because when you let the mouse button up, the part of the script that works on the Angle Tolerance goes into action and deletes points with relative angles between them that are less than what you specified. It helps give you feedback on what that setting is really doing. If you see too many points staying or disappearing when you let the mouse up, you know right off which way to tweak the setting.

Next, I added a control that makes it draw fewer points the faster you are drawing a segment of a line. If you set the Speed Tolerance to zero, it works just as it always did. But as you set the number higher, the points will get progressively farther apart the faster you draw. In playing with it as I was putting it together, it seems to cut down on a lot of useless points when you're sketching. The timing factor depends on how many CPU clock cycles the program is using, instead of an absolute clock (the one built into Lua only gets as fast as full seconds), so the default setting I put in may be way off on a different processor than mine. there's plenty of room for adjustment, so I don't see it as being a problem. So, you can draw quick lines with little detail, and slow down for the fiddly bits.

Last, I threw in a setting to vary the line width depending on how fast you're drawing. Draw a section of a line quickly, and the line gets thicker. Thinner when it's slower. Usable already, but needs a little work to get it where I want. Still, it seems to fit the bill. Of course, you still have the option to use pen pressure if you've got a tablet.

I still have to whip up something so you can see the line widths as you are drawing. That should come pretty soon. The only thing thats kind of odd is, if you stop drawing suddenly while you are still below your time limit, you won't see the point where the cursor is at until you start moving again.

So, the file is a Zip, just unzip it into your Moho\Scripts\Tools directory, wherever that is. The file just has the script, icon and cursor files, and nothing that conflicts with anything existing. If you are using the official Moho 5 (the only one I've tried it on), you get a new catergory called "Other" at the bottom of the Tool window. Easy. If you are still using one of the Betas and you can't see the new Tool (It's like the regular Freehand icon but with a "2" next to the pencil), you can replace you're "_tool_list.txt" with this one, and everything should be cool. And sorry if any of these instructions are mucked up for you Mac folks, but I ain't got one.

Comments, criticisms, suggestions are all welcome. I'm out - shoulda gone to sleep hours ago. Happy scribbling.

--Brian
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

nice ! 8) keep it comin
User avatar
TDolce
Posts: 36
Joined: Sat Oct 30, 2004 3:02 am
Location: Germantown, TN

More on the lines

Post by TDolce »

HeyGuys,..sorry I started the thread and ran,...I'm back.

OK,...I will refer to three different approaches that would be awesome.

1). As in a very cool app called Xara X,...you can draw a line and it will look like a line. BUT,...you can then select from about 10 choices of variable lines (the one I tend to choose starts out at a point and gets fatter and then goes back down to a point.) and when you select it (while your flat line is selected, it changes the flat consistent width line to a variable line which shows so much more life and interest!

2) It would be great if you could get a great response from a graphics tablet that responds to the pressure of the pen. The harder you press, the fatter the line, the lighter you press,..the the thinner the line.

3) One of the biggies that boithered me about Moho from day one which I still did not see any improvement on in version 4, was the inability to get a nice smooth (NON-JAGGY) curve. This drove me nuts! I changed the settings as instructed,..but never got that nice smooth curve in a freehand line. It always had a pixelated or choppiness to it that just seemed too unprofessional for that "finished" look.

Todd
Todd Dolce
User avatar
TDolce
Posts: 36
Joined: Sat Oct 30, 2004 3:02 am
Location: Germantown, TN

Painting with Vectors plugin

Post by TDolce »

Yeah and something else similar to what I think Spas was referring to,...there was a program called Living Cels that showed SO much promise and honestly was the app I was saving up for until Microsoft bought the company and sheleved the project. It was called LivingCels and it was truly a pioneer in 2D animation and was waaaaaay ahead of the pack in its approach. A leader like Moho is too.

It gave you beautiful paint brush lines that looked as if you were using a paint brush when you made your lines. I mean these were not just a nice variable line,..these were like paint strokes with blends and bleeds and all in a vector application!!! The beauty was that it was an animation program and it allowed for a whole new beautifully softer feel to cartoon animation.

Their flagship vectpr graphics app. Expression has the same paint stroke abilities and that is still alive and is now a free app by Microsoft. Point being,...that painting with vectors is N-I-C-E!!!

Todd
Todd Dolce
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

i talked to the creator of expression, livingcels is still being developed but microsoft are makign him work on something else at the moment..he couldnt disclose the info but it will be great news for expression users.

1) ahh well

2) moho does this already, its just not a live preview

3) smooth curves are easy in moho, first have anti aliasing turned on9read your manual)
if thats not what you mean, use the curvature tool.
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

I'd seen a lot about LiivingCels too. If you have the demo, I''d like it a lot. I'm spending more time than I can really justify learning how to script for Moho. That said, I would like to know exacly what you are talking about. Ther are a few limitations to the Moho-Lua interface, but I think there are either workarounds or places the interface can pretty easily be tuned up.

..Brian

Also. TDolce, had you tried the mod I did? I've been meaning to tweak it more, but I do think I've adressed many of the existing issues. Short of trying to implement a version of flash's paintbrush tool, which I will work on what, additionally, do you want?
Last edited by 7feet on Thu Nov 04, 2004 6:46 am, edited 1 time in total.
User avatar
spasmodic_cheese
Posts: 330
Joined: Wed Aug 04, 2004 2:02 am

Post by spasmodic_cheese »

i have the beta.... its unusable tho.
it doesnt save/load right. Ive been spending the last 3 weeks trying to cut out the save/load routines from expression and patch them in...since the programs are near identical.

*hates looking at asm now*
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Damn! Your trying to hook it up in assembler? Whatta hacker. A brother after my own heart. A bit would still be lovely.
Post Reply