RSS/Atom feed Twitter
Site is read-only, email is disabled

create a custom tool or run script at cursor?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

create a custom tool or run script at cursor? Dexter Filmore 07 Nov 23:54
  create a custom tool or run script at cursor? Ofnuts 09 Nov 13:34
   create a custom tool or run script at cursor? Dexter Filmore 11 Nov 02:31
    create a custom tool or run script at cursor? Ofnuts 12 Nov 08:18
     create a custom tool or run script at cursor? Dexter Filmore 13 Nov 18:48
      create a custom tool or run script at cursor? Rob Antonishen 13 Nov 19:49
Dexter Filmore
2012-11-07 23:54:17 UTC (over 12 years ago)

create a custom tool or run script at cursor?

Is there a way to have a custom tool that executes commands where I point?

I'd like to have a tool that where I click takes the foreground color via pipette and in the same spot immediately applies "fill" with the settings the fill tool is set at.

Script pseudo code would be:

get cursor position use pipette at cursor pos to FG color apply "fill" at cursor position

Can that be scripted?

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--(+)@ s-:+ a C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h>++ r* y?
------END GEEK CODE BLOCK------
Ofnuts
2012-11-09 13:34:17 UTC (over 12 years ago)

create a custom tool or run script at cursor?

On 11/08/2012 12:54 AM, Dexter Filmore wrote:

Is there a way to have a custom tool that executes commands where I point?

I'd like to have a tool that where I click takes the foreground color via pipette and in the same spot immediately applies "fill" with the settings the fill tool is set at.

Script pseudo code would be:

get cursor position use pipette at cursor pos to FG color apply "fill" at cursor position

Can that be scripted?

I don't know any way to get at the pointer coordinates when the script is called. There are ways to give it coordinates (using a vector), but this is not as dynamic.

Dexter Filmore
2012-11-11 02:31:11 UTC (over 12 years ago)

create a custom tool or run script at cursor?

Am Friday 09 November 2012 14:34:17 schrieb Ofnuts:

On 11/08/2012 12:54 AM, Dexter Filmore wrote:

Is there a way to have a custom tool that executes commands where I point?

I'd like to have a tool that where I click takes the foreground color via pipette and in the same spot immediately applies "fill" with the settings the fill tool is set at.

Script pseudo code would be:

get cursor position use pipette at cursor pos to FG color apply "fill" at cursor position

Can that be scripted?

I don't know any way to get at the pointer coordinates when the script is called. There are ways to give it coordinates (using a vector), but this is not as dynamic.

How do you mean by using a vector, and what by "not as dynamic"?

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--(+)@ s-:+ a C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h>++ r* y?
------END GEEK CODE BLOCK------
Ofnuts
2012-11-12 08:18:07 UTC (over 12 years ago)

create a custom tool or run script at cursor?

On 11/11/2012 03:31 AM, Dexter Filmore wrote:

Am Friday 09 November 2012 14:34:17 schrieb Ofnuts:

I don't know any way to get at the pointer coordinates when the script is called. There are ways to give it coordinates (using a vector), but this is not as dynamic.

How do you mean by using a vector, and what by "not as dynamic"?

See http://gimp.open-source-solution.org/manual/gimp-tool-path.html

It's not as dynamic because you have to set the path, then switch to the script, providing the path. It's not like a tool that uses the mouse clicks directly.

Dexter Filmore
2012-11-13 18:48:51 UTC (over 12 years ago)

create a custom tool or run script at cursor?

Am Monday 12 November 2012 09:18:07 schrieb Ofnuts:

On 11/11/2012 03:31 AM, Dexter Filmore wrote:

Am Friday 09 November 2012 14:34:17 schrieb Ofnuts:

I don't know any way to get at the pointer coordinates when the script is called. There are ways to give it coordinates (using a vector), but this is not as dynamic.

How do you mean by using a vector, and what by "not as dynamic"?

See http://gimp.open-source-solution.org/manual/gimp-tool-path.html

It's not as dynamic because you have to set the path, then switch to the script, providing the path. It's not like a tool that uses the mouse clicks directly.
_______________________________________________ gimp-user-list mailing list
gimp-user-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-user-list

That would actually work almost quite as well if one can get the script only to do things at the nodes. Possible?

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d--(+)@ s-:+ a C++++ UL++ P+>++ L+++>++++ E-- W++ N o? K-
w--(---) !O M+ V- PS+ PE Y++ PGP t++(---)@ 5 X+(++) R+(++) tv--(+)@ 
b++(+++) DI+++ D- G++ e* h>++ r* y?
------END GEEK CODE BLOCK------
Rob Antonishen
2012-11-13 19:49:47 UTC (over 12 years ago)

create a custom tool or run script at cursor?

That would actually work almost quite as well if one can get the script only
to do things at the nodes. Possible?

Sure - here is a script that labels each point of a node:

http://ffaat.poweredbyclear.com/incoming/scripts/RMA_label_points.scm

The key chunk you are interested in is here:

; get all the points in the path as a ((x1 x1) (x2 y2) ...) list (while (< counter numstrokes) ; for each stroke in the path (set! points (caddr (gimp-vectors-stroke-get-points inPath (vector-ref strokelist counter))))

(set! numpoints (/ (cadr (gimp-vectors-stroke-get-points inPath (vector-ref strokelist counter))) 6))

(let ((pcount 0))
(while (< pcount numpoints)
(set! pointlist (append pointlist (list (list (vector-ref points (+ (* pcount 6) 2)) (vector-ref points (+ (* pcount 6) 3))))))

(set! pcount (+ pcount 1)) )
)
(set! counter (+ counter 1)) )

Of course, it needs a few defines up front....

-Rob A>