28
28
; The GNU Public License is available at
29
29
; http://www.gnu.org/copyleft/gpl.html
30
30
31
- (define (script-fu-hex-grid img inLayer inElement inLength inOrientation inStroke inXoff inYoff inColour )
31
+ (define (script-fu-hex-grid img inLayer
32
+ inElement
33
+ inLength
34
+ inOrientation
35
+ inStroke
36
+ inXoff
37
+ inYoff
38
+ inColour
39
+ inBrushtoUse)
32
40
(let*
33
41
(
34
42
(width (car (gimp-image-width img)))
117
125
; (gimp-message "ok to line 115")
118
126
119
127
(gimp-context-set-paint-method " gimp-paintbrush" )
120
- (set! brushTemp (car (gimp-brush-new " HexGrid Temp Stroke Circle Brush" )))
121
- (gimp-brush-set-shape brushTemp BRUSH-GENERATED-CIRCLE)
122
- (gimp-brush-set-hardness brushTemp 0.99 )
123
- (gimp-brush-set-radius brushTemp (round (+ (/ inStroke 2 ) 1.0 )))
124
- (gimp-brush-set-spacing brushTemp 20.0 )
125
- (gimp-brush-set-spikes brushTemp 2 )
126
- (gimp-brush-set-aspect-ratio brushTemp 1.0 )
127
- (gimp-brush-set-angle brushTemp 1.0 )
128
128
129
- (gimp-context-set-brush " HexGrid Temp Stroke Circle Brush" ) ; was brushTemp variable
130
- (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
131
- (gimp-context-set-brush-size inStroke)
132
- (gimp-context-set-dynamics " Dynamics Off" )
129
+ (if (= inBrushtoUse 0 )
130
+ (begin
131
+
132
+ (set! brushTemp (car (gimp-brush-new " HexGrid Temp Stroke Circle Brush" )))
133
+ (gimp-brush-set-shape brushTemp BRUSH-GENERATED-CIRCLE)
134
+ (gimp-brush-set-hardness brushTemp 1.0 )
135
+ (gimp-brush-set-radius brushTemp (round (+ (/ inStroke 2 ) 1.0 )))
136
+ (gimp-brush-set-spacing brushTemp 20.0 )
137
+ ; (gimp-brush-set-spikes brushTemp 2)
138
+ ; (gimp-brush-set-aspect-ratio brushTemp 1.0)
139
+ ; (gimp-brush-set-angle brushTemp 1.0)
140
+
141
+ (gimp-context-set-brush " HexGrid Temp Stroke Circle Brush" ) ; was brushTemp variable
142
+ (gimp-context-set-paint-mode LAYER-MODE-NORMAL)
143
+ (gimp-context-set-brush-size inStroke)
144
+ (gimp-context-set-brush-spacing 0.2 )
145
+ (gimp-context-set-dynamics " Dynamics Off" )
146
+ )
147
+ )
133
148
134
149
(gimp-edit-stroke-vectors inLayer varPath)
135
150
136
151
137
152
138
153
; (gimp-image-remove-vectors img varPath)
139
- (gimp-brush-delete brushTemp)
140
- (gimp-brushes-refresh)
154
+ (if (= inBrushtoUse 0 )
155
+ (begin
156
+ (gimp-brush-delete brushTemp)
157
+ )
158
+ )
159
+ ; (gimp-brushes-refresh)
141
160
142
161
; done
143
162
(gimp-image-undo-group-end img)
149
168
150
169
(script-fu-register " script-fu-hex-grid"
151
170
" <Toolbox>/Script-Fu/Render/Pattern/Hex Grid"
152
- " Draw a hex grid on the image. Less advanced version.\n hexgrid.scm"
171
+ " Draw a hex grid on the image. Less advanced version. Creates a brush in the background. \n hexgrid.scm"
153
172
" karlhof26"
154
173
" karlhof26"
155
174
" March 2020"
160
179
SF-ADJUSTMENT " Length of Element" ' (70 2 400 1 10 0 SF-SPINNER)
161
180
SF-OPTION " Hex Orientation" ' (" Horizontal" " Vertical" )
162
181
SF-ADJUSTMENT " Line Width (px)" ' (2 1 400 1 10 0 SF-SPINNER)
163
- SF-ADJUSTMENT " Horizontal Offset" ' (0 0 399 0.5 10 1 SF-SPINNER)
164
- SF-ADJUSTMENT " Vertical Offset" ' (0 0 399 0.5 10 1 SF-SPINNER)
182
+ SF-ADJUSTMENT " Horizontal Offset (px) " ' (0 0 399 0.5 10 0 SF-SPINNER)
183
+ SF-ADJUSTMENT " Vertical Offset (px) " ' (0 0 399 0.5 10 0 SF-SPINNER)
165
184
SF-COLOR " Color" " black"
185
+ SF-OPTION " Brush to use" ' (" Default" " Current Brush settings" )
186
+
166
187
)
167
188
168
189
; end of script
0 commit comments