freehand drawing with pen pressure opacity

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

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

Slyanim wrote:If this mod is done, I would totally okay with the separated layer compromise. It would be easier, if layers had setting checkboxes like / show or render just strokes / show or render just fills - and There would be a layer for the strokes - check the strokes only - and a reference layer for fills - check fills only -.
It would be a great frame by frame/ traditional animation solution too. You can manipulate fills and stroke after you finish the whole scene.( It's not possible in bitmap softwares.) In my head of course, but probably it would be difficult to do it in real life! :D

So what can I do to make this point coloring / pen pessure script come true? I'm a total noob in any code language, but I'm very excited.
I'm working on this now, and my first tests are working very well.

Image

Just having trouble getting a stroke to start 100% opaque.
Slyanim
Posts: 23
Joined: Wed Jan 25, 2017 11:42 pm

Re: freehand drawing with pen pressure opacity

Post by Slyanim »

I've just made a Quick sketchy test. The point was to triyng the stroke boss layer / fill reference layer combo. I created the 'fake' pen pressure sensitive stroke opacity.( It's a Quick rigged character because I didn't have time to frame by frame animation and after that manually create the point color opacity stuff. )
So I drawed the character and created the point color stuff. After that I created a reference layer, remove the strokes and clear the point colors. It's not that time consuming (of course at a rigged character), but I wondered create an action or something to automate the progress. I wanted to try the styles options. I applied a style to the strokes and want to change the attributes. I could change stroke size, colors etc.,

/// but I couldn't change stroke brush :(. I don't know why, maybe it's my fault, but it would be great the styles could change stroke brushes too. I wanted to upload the animation too, but tinypic didn't allow it:(

/// EDIT! : I watched Chucky awesome tutorial on youtube about frame by frame animation and how to distroy delicious mellons :). I can change brush styles now! Maybe the problem was that I don't merge strokes. ( BIG MISTAKE)

Image Image
Last edited by Slyanim on Thu Feb 02, 2017 3:21 am, edited 1 time in total.
Slyanim
Posts: 23
Joined: Wed Jan 25, 2017 11:42 pm

Re: freehand drawing with pen pressure opacity

Post by Slyanim »

synthsin75 wrote:
I'm working on this now, and my first tests are working very well.

Just having trouble getting a stroke to start 100% opaque.
WoW!! It looks great! Well done! How is it work? Pen pressure?
Anyway good luck and thanks for your effort!! :)
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

Slyanim wrote:
synthsin75 wrote:
I'm working on this now, and my first tests are working very well.

Just having trouble getting a stroke to start 100% opaque.
WoW!! It looks great! Well done! How is it work? Pen pressure?
Anyway good luck and thanks for your effort!! :)
Yeah, it's pen pressure. Right now I'm just testing the code in with the stroke width, so pressure is doing width and transparency. But I'll get around to wiring up its own option.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: freehand drawing with pen pressure opacity

Post by chucky »

Oh Yeah... who da man?
YOU da man!

Very awesome. What more can I say.

I wonder if the tint tool could use a checkbox for tint/not tinting fills?
Even better if we had that stackable shapes feature back... maybe this is another argument for that?

Or ... IF the shape/ style itself had a tint override in the fill/stroke just like the colours in style.
Maybe that would be the best way to have full control?
Yes that would be something for the dev's but with this opacity thing working well, that could be an option?
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

I've tried stacking shapes (which you can do if you select extra points, even temporary ones, to make the subsequent shapes), but any shape created on a colored point is effected.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: freehand drawing with pen pressure opacity

Post by chucky »

synthsin75 wrote:I've tried stacking shapes (which you can do if you select extra points, even temporary ones, to make the subsequent shapes), but any shape created on a colored point is effected.
Ah ! Of course, That's why the third option would be the best, if dev are up for it.
Slyanim
Posts: 23
Joined: Wed Jan 25, 2017 11:42 pm

Re: freehand drawing with pen pressure opacity

Post by Slyanim »

Synthsin75! Just WOW! I never thought that will be possible, especially this fast! Many thanks for your work! I'm looking foward your script! It will be a game changer!

Chuck! I've just watched your tutorial video about frame by frame animation and watermelon distruction :). That's a clever method, workflow. The video was informative for me. Because of the video I figured out why I couldn't change brush styles. So many thanks for share that video!

Returned to the stroke / fill layer problem. If I made this method - create a frame by frame layer - ( probably like in Chuck tutvid) with pen pressure opacity strokes. Meanwhile I create a reference layer for just fill. (but if I fill shape, it would be messed up, because of the base point color changes). There are a hidden menu for every layers ( in the layers panel - after layer names - triangle shape). If I unchecked the strokes, brushes and shape effect on the fill layer than Moho showed a clean fill and of course on the stroke layer unchecked fills etc. -- It's similar like toon boom sub layer what Chuck mentioned. At least Moho display it, but ignore it when render the animation. Is there any settings to allow those layer details at render too? If it doesn't exist, would it be hard to script a ' not ignore layer details ' checkbox to the renderer?


Image Image
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

No, those are just layer display settings that only work in the workspace, just like the general Quality Display settings.
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

Okay, test this out and see how it works.

https://dl.dropboxusercontent.com/u/536 ... eehand.zip

I even managed to get it to pull stroke color from any applied style, but changing the color in the style will not then change the pressure opacity stroke color.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: freehand drawing with pen pressure opacity

Post by chucky »

Hmm Is there a trick to this Wes?
Could I be missing something? Freehand works great- nice icon btw :)
But I'm not getting any opacity changes.
Slyanim
Posts: 23
Joined: Wed Jan 25, 2017 11:42 pm

Re: freehand drawing with pen pressure opacity

Post by Slyanim »

chucky wrote:Hmm Is there a trick to this Wes?
Could I be missing something? Freehand works great- nice icon btw :)
But I'm not getting any opacity changes.
In the freehand options the first checkbox is pen pressure stroke opacity. Check it :)

Wes! It is really good! Bravo! I've tested it a little. I have some remark for the script. It become really slow, if you use Merge strokes, and the separate strokes interact each other. It's not a problem when you uncheck the Merge strokes. The concept is working!! Maybe the script needs some improvements. So it Works like that: draws a simple 100 % opacity stroke meanwhile automatically assign color alpha to the vector points and it's done -- roughly. How are the color points work in this case? I can change the radius of color points strenght with the color points tool for sure. I think maybe the color strenght radius is to large, but I don't know.

By the way! THANK YOU!!

Image Image
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: freehand drawing with pen pressure opacity

Post by chucky »

Ok, it does work.
It was a restart moho thing.
Wow Wes, you did it.

And it looks very much like water color, really cool.
Did anyone notice how good it looks before lifting the stylus?

It seems the feature does slow down moho a fair bit ( which of course is not the script's fault)
Also point tinting does not have an option to apply by plot either which would look better with brushes ( also not the scripts fault)

I hope MIke sees this and tries it and keeps it in mind for later,

What would be good for now is if you could adjust the sensitivity or range.
Very impressive Wes , I'm amazed at how simple you made that llok.
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

Slyanim wrote:Wes! It is really good! Bravo! I've tested it a little. I have some remark for the script. It become really slow, if you use Merge strokes, and the separate strokes interact each other. It's not a problem when you uncheck the Merge strokes. The concept is working!! Maybe the script needs some improvements. So it Works like that: draws a simple 100 % opacity stroke meanwhile automatically assign color alpha to the vector points and it's done -- roughly. How are the color points work in this case? I can change the radius of color points strenght with the color points tool for sure. I think maybe the color strenght radius is to large, but I don't know.

By the way! THANK YOU!!
I'm not seeing any interaction w/ or w/o merge strokes enabled. Do you have some other option enabled too? You might be seeing smoothing or something.
I think I can improve it's performance, but that means you will not get an opacity preview as you draw a stroke.
I played with the strength, but didn't find anything but the default to be any better for general use. Since you cannot change the point color with the color points tool without also effecting the opacity, I think I'm going to add a color edit for selected points. I may add a strength setting as well, but for now you can change the strength with the color points tool.


chucky wrote:Ok, it does work.
It was a restart moho thing.
Wow Wes, you did it.

And it looks very much like water color, really cool.
Did anyone notice how good it looks before lifting the stylus?

It seems the feature does slow down moho a fair bit ( which of course is not the script's fault)
Also point tinting does not have an option to apply by plot either which would look better with brushes ( also not the scripts fault)

I hope MIke sees this and tries it and keeps it in mind for later,

What would be good for now is if you could adjust the sensitivity or range.
Very impressive Wes , I'm amazed at how simple you made that llok.
Yeah, that opacity preview while drawing is the performance hog, which I think I can improve.
Like I said above, I've got a few improvements in mind. I think I could add a custom range. May take some time.

My priorities for this tool are, in order:
  • Improve performance
  • Add selected points color editor (that preserves the opacity)
  • Perhaps see about updating the color from a saved style with an update button
    So changes to saved styles can be easily applied to colored point strokes.
  • Add strength setting
  • Add custom range setting
nice icon btw
Thanks.
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: freehand drawing with pen pressure opacity

Post by synthsin75 »

Slyanim, I can see the interaction with merged strokes you were talking about. I just wasn't drawing strokes close enough to each other. This happens because the strokes share the same shape, so the colored points of one stroke effect other strokes nearby. I would consider this a feature, since it allows very nice blending and built-up darkening of existing strokes.


Here's a new version:
https://dl.dropboxusercontent.com/u/536 ... d%20v2.zip

Let me know if this seems to perform any better.
Post Reply