Re: [Gimp-developer] Brush dynamic ideas.

2008-10-25 Thread Brian Allen Vanderburg II
[EMAIL PROTECTED] wrote:
> On Saturday 25 October 2008 11:02:57 Brian Allen Vanderburg II wrote:
>
>   
>> Anyhow I though about some more ideas for a brush dynamics system, these
>> are just some ideas  I doubt I could do much with them myself though but
>> I may try to familiarize myself with the code anyhow.
>> 
> Most of what you have suggested has already been detailed. There is a concept 
> of curves driven dynamics GUI. But there is nobody to realize it. Thats where 
> it is stuck now. I am capable of making the functionality, but not the GUI.
>   
I'm more of a C++ person (esp when it comes to GUIs) or python and 
usually use wxPython/wxWidgets so I don't really know much about how GTK 
works that much.
>> Anyway those are the ideas.  I doubt any of those are compatible with
>> the current code though.
>> 
> Compatible in what sense? The dynamics calculation system is very simple and 
> rather extensible. when a brush needs a value ie "opacity" it queries a 
> function for it. The function returns the mixed value based on the coord set 
> passed an the state of dynamics options. Extending it is very simple.  Making 
> the GUI for it and linking it to code is not(at least for me). If you would 
> be 
> interested of working on it, it would be great.
>   
I've only done a little so far on GIMP 2.6.0 code.  I've made a small 
change that makes it where jitter is controlled also by brush dynamics 
so that when jitter is enabled and a dynamic is also enabled, it will be 
used.  Tested with velocity, faster motion causes a smaller jitter.

Here is a diff showing whats done.  I've no idea if the diff is the 
correct format as I'm used to doing 'svn diff' and not just 'diff -r 
oldpath newpath'.

I can't seem to figure what prescale does.  No matter how I adjust it in 
the interface the result always seems the same.  If velocity is set to 
color, slow motion yields the first color and faster motion yields the 
second color, whether the slider is all the way to the right or the left.


Brian Vanderburg II

Only in gimp-2.6.0/app/gui: gimpdbusservice-glue.h
diff -r gimp-2.6.0/app/paint/gimpbrushcore.c 
gimp-2.6.0-new/app/paint/gimpbrushcore.c
641a642
 >   gdouble real_jitter;
645c646,650
<   jitter_dist  = g_rand_double_range (core->rand, 0, 
core->jitter);
---
 >   real_jitter = core->jitter *
 > gimp_paint_options_get_dynamic_jitter (paint_options,
 >
&paint_core->cur_coords);
 >
 >   jitter_dist  = g_rand_double_range (core->rand, 0, 
real_jitter);
diff -r gimp-2.6.0/app/paint/gimppaintoptions.c 
gimp-2.6.0-new/app/paint/gimppaintoptions.c
48a49
 > #define DEFAULT_PRESSURE_JITTER   FALSE
56a58
 > #define DEFAULT_VELOCITY_JITTER   FALSE
64a67
 > #define DEFAULT_RANDOM_JITTER FALSE
97a101
 >   PROP_PRESSURE_JITTER,
105a110
 >   PROP_VELOCITY_JITTER,
113a119
 >   PROP_RANDOM_JITTER,
218a225,228
 >   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_PRESSURE_JITTER,
 > "pressure-jitter", NULL,
 > DEFAULT_PRESSURE_JITTER,
 > GIMP_PARAM_STATIC_STRINGS);
247a258,261
 >   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_VELOCITY_JITTER,
 > "velocity-jitter", NULL,
 > DEFAULT_VELOCITY_JITTER,
 > GIMP_PARAM_STATIC_STRINGS);
276a291,294
 >   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_RANDOM_JITTER,
 > "random-jitter", NULL,
 > DEFAULT_RANDOM_JITTER,
 > GIMP_PARAM_STATIC_STRINGS);
457a476,479
 > case PROP_PRESSURE_JITTER:
 >   pressure_options->jitter = g_value_get_boolean (value);
 >   break;
 >
485a508,511
 > case PROP_VELOCITY_JITTER:
 >   velocity_options->jitter = g_value_get_boolean (value);
 >   break;
 >
513a540,543
 > case PROP_RANDOM_JITTER:
 >   random_options->jitter = g_value_get_boolean (value);
 >   break;
 >
647a678,681
 > case PROP_PRESSURE_JITTER:
 >   g_value_set_boolean (value, pressure_options->jitter);
 >   break;
 >
675a710,713
 > case PROP_VELOCITY_JITTER:
 >   g_value_set_boolean (value, velocity_options->jitter);
 >   break;
 >
703a742,745
 > case PROP_RANDOM_JITTER:
 >   g_value_set_boolean (value, random_options->jitter);
 >   break;
 >
1247a1290,1327
 >
 > gdouble
 > gimp_paint_options_get_dynamic_jitter   (GimpPaintOptions *paint_options,
 >  const GimpCoords *coords)
 > {
 >   gdouble jitter = 1.0;
 >
 >   g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), 1.0);
 >   g_return_val_if_fail (coords != NULL, 1.0);
 >
 >   if (paint_options->pressure_options->jitter ||
 >   paint_options->velocity_options->jitter ||

Re: [Gimp-developer] Brush dynamic ideas.

2008-10-25 Thread Alexia Death
On Saturday 25 October 2008 11:02:57 Brian Allen Vanderburg II wrote:

>
> Anyhow I though about some more ideas for a brush dynamics system, these
> are just some ideas  I doubt I could do much with them myself though but
> I may try to familiarize myself with the code anyhow.
Most of what you have suggested has already been detailed. There is a concept 
of curves driven dynamics GUI. But there is nobody to realize it. Thats where 
it is stuck now. I am capable of making the functionality, but not the GUI.

> Anyway those are the ideas.  I doubt any of those are compatible with
> the current code though.
Compatible in what sense? The dynamics calculation system is very simple and 
rather extensible. when a brush needs a value ie "opacity" it queries a 
function for it. The function returns the mixed value based on the coord set 
passed an the state of dynamics options. Extending it is very simple.  Making 
the GUI for it and linking it to code is not(at least for me). If you would be 
interested of working on it, it would be great.

-- Alexia
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] Brush dynamic ideas.

2008-10-25 Thread Martin Nordholts
Brian Allen Vanderburg II wrote:
> Anyhow I though about some more ideas for a brush dynamics system, these 
> are just some ideas  I doubt I could do much with them myself though but 
> I may try to familiarize myself with the code anyhow.
>   

Hi and thanks for the suggestions! They are however not very original
and along the lines of what most other people propose as far as an
improved brush dynamics system goes. What is needed is less proposals
and more people actually writing some code ;)

It's great to hear you are curious about the code. The best place to
hang around when getting acquainted to the code is #gimp @ irc.gnome.org
as this is where the core developers also hang around. Feel free to drop
by and ask any questions you have. You also probably will want to get in
touch with Alexia_Death who has a few brush dynamics hacks up her sleeve.

BR,
Martin
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer