Help on custom brush creation

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
isd
Posts: 90
Joined: 02 Aug 2007, 11:42

Help on custom brush creation

Post by isd »

I would like to create a brush which jitter displays a random color comprised in a close HUE difference.
For example let's say my brush has a big jitter factor.
If I chose the Red color when I paint I would have each jittered instance displayed with a different color (red or orangish-red or pinkish-red, well colors close to red).
There is an option to do this almost instantly in photoshop but I can't manage to do it with tvpaint. Some hint?
User avatar
Peter Wassink
Posts: 4437
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Help on custom brush creation

Post by Peter Wassink »

you cannot do it directly in TVP (this is a standing feature request)
but here is a workaround.

-create an animation layer with a black shape (your brush shape)
depending on the needed ammount of colorvariation you should make it up to 255 frames long.
make it turn from black to white over the length of the layer:
open FXstack> coloradjust, on the first frame set a key [C] for brightness 0% and the on last frame a key with brightness 100%
select entire layer (double click under it) apply FXstack

-pick up the animation as a custombrush.

-in the Tool panel set the colormode of the custombrush to Luma.

-set Anim to random.


now the brush will paint and randomly chose a color between whichever two colors are selected as the A and B color in the mainpanel
the closeness of the Hue value depends on the choice of A and B colors
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
isd
Posts: 90
Joined: 02 Aug 2007, 11:42

Re: Help on custom brush creation

Post by isd »

Oh thank you very much it works ^^
But it is not very easy to have to select 2 colors,
is there a way to have the second color being calculated from the A color (with some formula for example HUE+25)?
User avatar
Peter Wassink
Posts: 4437
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Help on custom brush creation

Post by Peter Wassink »

yes i'm pretty sure this is possible, you'd have to type a script command for that.
but i don't know how you can find out what to type. :?
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Help on custom brush creation

Post by Svengali »

Wouldn't it be easier to just use the color picker in slider mode?

1. Establish APen color
2. click twice on BPen color and copy from the APen color
3. use the sliders interactively (or the numbers) to visually set the relative offset of the BPen color?

Peter, neat little workaround!

Sven
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Help on custom brush creation

Post by ematecki »

Or use the "Windows > Color Variation Panel"...
Quicktime is DEAD. Get over it and move on !
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Help on custom brush creation

Post by Mads Juul »

Here is a little script that random sets the bpen from the A Pen color
Is that interresting?

Code: Select all

randomValue = 25
tv_getAPen
aColor =  result
PARSE aColor aRed aGreen aBlue aAlpha

redRand = RND(randomValue)-RND(randomValue)
greenRand = RND(randomValue)-RND(randomValue)
blueRand = RND(randomValue)-RND(randomValue)

bRed = aRed+redRand
bGreen = aGreen+greenRand
bBlue = aBlue+blueRand

tv_setBPen bRed bGreen bBlue aAlpha
User avatar
Animark
Posts: 505
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Help on custom brush creation

Post by Animark »

Hey, this script made me thinking the first time in George (?).

I tweaked it a little bit. I increased the randomValue to 100 and added 50 to every later randomized value to get clearer results.

Code: Select all

    randomValue = 100
    tv_getAPen
    aColor =  result
    PARSE aColor aRed aGreen aBlue aAlpha

    redRand = RND(randomValue+50)-RND(randomValue+50)
    greenRand = RND(randomValue+50)-RND(randomValue+50)
    blueRand = RND(randomValue+50)-RND(randomValue+50)

    bRed = aRed+redRand
    bGreen = aGreen+greenRand
    bBlue = aBlue+blueRand

    tv_setBPen bRed bGreen bBlue aAlpha
I added the script to a brush that uses "luma stamp" as color mode to slide or switch to colors between APen and BPen. Every click on this brush generates a random BPen color from APen color. I added the brush to this posting for everybody who likes to play with it. It's also interesting to change its animation from random to -pressure.

It is a little bit like a function I mentioned and wished before here.
Attachments
BPenRNDBrush.tvpx
BPen Color Random Brush
(293 KiB) Downloaded 824 times
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Re: Help on custom brush creation

Post by malcooning »

Cool script. I like it.
thanks.
Post Reply