Page 1 of 1

Help on custom brush creation

Posted: 27 Mar 2010, 10:20
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?

Re: Help on custom brush creation

Posted: 27 Mar 2010, 11:40
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

Re: Help on custom brush creation

Posted: 27 Mar 2010, 12:46
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)?

Re: Help on custom brush creation

Posted: 27 Mar 2010, 13:19
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. :?

Re: Help on custom brush creation

Posted: 27 Mar 2010, 16:19
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

Re: Help on custom brush creation

Posted: 29 Mar 2010, 08:04
by ematecki
Or use the "Windows > Color Variation Panel"...

Re: Help on custom brush creation

Posted: 31 Mar 2010, 15:07
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

Re: Help on custom brush creation

Posted: 31 Mar 2010, 18:48
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.

Re: Help on custom brush creation

Posted: 01 Apr 2010, 20:23
by malcooning
Cool script. I like it.
thanks.