It is currently Sat Jun 06, 2026 12:26 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 1:57 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
today i cleaned my script folder, deleting various stuff that i never use

also i changed the path of my favorite scripts, so they appear at a destination i like best

did that with samj's Motif_Geometrique_3D
viewtopic.php?f=9&t=6844

originally it is under File -> Create -> Pattern
a place where i never look..... :(

i managed to change it, so its now under Filters -> Render -> Pattern :yes

also i changed the default colour to black, grey and white, instead of the tricolor

what i would like now, is the filter to reappear under 'Filter-> Repeat Last'

Rod gave an explanation how to do that, here:
viewtopic.php?f=8&t=7562

but i still cant do it :cry

can somebody please help me ?!



here is my customised samj script:

; Script-Fu Motif_Geometrique_1.scm
; Download :
;
; Copyright (C) 2013 samj ( http://aljacom.com/~gmic/ )
;
; Licence GPL
; Ce fichier est le Script-Fu "Motif_Geometrique_1.scm" pour Gimp.
; Ce Script-Fu "Motif_Geometrique_1.scm" est un logiciel libre ; vous pouvez

le redistribuer ou le modifier suivant les termes de la GNU General Public License
; telle que publiée par la Free Software Foundation ; soit la version 3 de la

licence, soit (à votre gré) toute version ultérieure.
; Ce Script-Fu "Motif_Geometrique_1.scm" est distribué dans l'espoir qu'il

sera utile, mais SANS AUCUNE GARANTIE ;
; pas même la garantie implicite de COMMERCIABILISABILITÉ ni d'ADÉQUATION à UN

OBJECTIF PARTICULIER.
; Consultez la GNU General Public License pour plus de détails.
; Vous devez avoir reçu une copie de la GNU General Public License en même

temps que GIMP ; si ce n'est pas le cas, consultez <http://www.gnu.org/licenses>
;
; Ce fichier Motif_Geometrique.scm est édité avec Notepad++ http://notepad-plus-

plus.org/
;
;
; Version 20130403 ajour ruban
; Version 20130402
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;
;
; Accès sur l'image par :
;
; Filters > Render > Pattern > 3D Motif Geometrique ...
;
;
;
;
; Principe :
; H1 H2
; ___ ___
; V1 | |
; V2 | |
; V3 | |
; V4 |___ ___|
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;
;


;*******************************************************************************************

***********
; FONCTION POUR DESSINER LE MOTIF
;*******************************************************************************************

***********


(define
(
Fonction_Motif_Geometrique_3D_samj
image
drawable
Origine_H
H1
H2
V1
V2
V3
V4
Color_1
Color_2
Color_3
*points*

)
(let*
(

;; rien

)



; triangle haut gauche

(set! *points* (cons-array 6 'double))

; déterminer les coordonnées des 3 points
(vector-set! *points* 0 Origine_H ) ; x0
(vector-set! *points* 1 0 ) ; y0
(vector-set! *points* 2 (+ Origine_H H1) ) ; x1
(vector-set! *points* 3 0 ) ; y1
(vector-set! *points* 4 Origine_H ) ; x2
(vector-set! *points* 5 V1 ) ; y2


(gimp-image-select-polygon
image ; image
2 ; operation
6 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_3)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)







; losange haut gauche

(set! *points* (cons-array 8 'double))

; déterminer les coordonnées des 4 points
(vector-set! *points* 0 Origine_H ) ; x0
(vector-set! *points* 1 V1 ) ; y0
(vector-set! *points* 2 (+ Origine_H H1) ) ; x1
(vector-set! *points* 3 0 ) ; y1
(vector-set! *points* 4 (+ Origine_H H1) ) ; x2
(vector-set! *points* 5 V1 ) ; y2
(vector-set! *points* 6 Origine_H ) ; x3
(vector-set! *points* 7 (+ V1 V2) ) ; y3

(gimp-image-select-polygon
image ; image
2 ; operation
8 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_1)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)


; losange milieu

(set! *points* (cons-array 8 'double))

; déterminer les coordonnées des 4 points
(vector-set! *points* 0 Origine_H ) ; x0
(vector-set! *points* 1 (+ V1 V2) ) ; y0
(vector-set! *points* 2 (+ Origine_H H1) ) ; x1
(vector-set! *points* 3 V1 ) ; y1
(vector-set! *points* 4 (+ (+ Origine_H H1) H2) ) ; x2
(vector-set! *points* 5 (+ V1 V2) ) ; y2
(vector-set! *points* 6 (+ Origine_H H1) ) ; x3
(vector-set! *points* 7 (+ V1 V2 V3) ) ; y3

(gimp-image-select-polygon
image ; image
2 ; operation
8 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_3)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)


; losange bas gauche

(set! *points* (cons-array 8 'double))

; déterminer les coordonnées des 4 points
(vector-set! *points* 0 Origine_H ) ; x0
(vector-set! *points* 1 (+ V1 V2) ) ; y0
(vector-set! *points* 2 (+ Origine_H H1) ) ; x1
(vector-set! *points* 3 (+ V1 V2 V3) ) ; y1
(vector-set! *points* 4 (+ Origine_H H1) ) ; x2
(vector-set! *points* 5 (+ V1 V2 V3 V4) ) ; y2
(vector-set! *points* 6 Origine_H ) ; x3
(vector-set! *points* 7 (+ V1 V2 V3) ) ; y3

(gimp-image-select-polygon
image ; image
2 ; operation
8 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_2)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)


; triangle bas gauche

(set! *points* (cons-array 6 'double))

; déterminer les coordonnées des 3 points
(vector-set! *points* 0 Origine_H ) ; x0
(vector-set! *points* 1 (+ V1 V2 V3) ) ; y0
(vector-set! *points* 2 (+ Origine_H H1) ) ; x1
(vector-set! *points* 3 (+ V1 V2 V3 V4) ) ; y1
(vector-set! *points* 4 Origine_H ) ; x2
(vector-set! *points* 5 (+ V1 V2 V3 V4) ) ; y2


(gimp-image-select-polygon
image ; image
2 ; operation
6 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_3)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)




; triangle haut droite

(set! *points* (cons-array 6 'double))

; déterminer les coordonnées des 3 points
(vector-set! *points* 0 (+ Origine_H H1) ) ; x0
(vector-set! *points* 1 0 )

; y0
(vector-set! *points* 2 (+ (+ Origine_H H1) H2) ) ; x1
(vector-set! *points* 3 0 )

; y1
(vector-set! *points* 4 (+ (+ Origine_H H1) H2) ) ; x2
(vector-set! *points* 5 V1 ) ; y2


(gimp-image-select-polygon
image ; image
2 ; operation
6 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_3)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)




; losange haut droite

(set! *points* (cons-array 8 'double))

; déterminer les coordonnées des 4 points
(vector-set! *points* 0 (+ Origine_H H1) ) ; x0
(vector-set! *points* 1 0 )

; y0
(vector-set! *points* 2 (+ (+ Origine_H H1) H2) ) ; x1
(vector-set! *points* 3 V1 ) ; y1
(vector-set! *points* 4 (+ (+ Origine_H H1) H2) ) ; x2
(vector-set! *points* 5 (+ V1 V2) ) ; y2
(vector-set! *points* 6 (+ Origine_H H1) ) ; x3
(vector-set! *points* 7 V1 ) ; y3

(gimp-image-select-polygon
image ; image
2 ; operation
8 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_2)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)


; losange bas droite

(set! *points* (cons-array 8 'double))

; déterminer les coordonnées des 4 points
(vector-set! *points* 0 (+ (+ Origine_H H1) H2) ) ; x0
(vector-set! *points* 1 (+ V1 V2) ) ; y0
(vector-set! *points* 2 (+ (+ Origine_H H1) H2) ) ; x1
(vector-set! *points* 3 (+ V1 V2 V3) ) ; y1
(vector-set! *points* 4 (+ Origine_H H1) ) ; x2
(vector-set! *points* 5 (+ V1 V2 V3 V4) ) ; y2
(vector-set! *points* 6 (+ Origine_H H1) ) ; x3
(vector-set! *points* 7 (+ V1 V2 V3) ) ; y3

(gimp-image-select-polygon
image ; image
2 ; operation
8 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_1)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)




; triangle bas droite

(set! *points* (cons-array 6 'double))

; déterminer les coordonnées des 3 points
(vector-set! *points* 0 (+ (+ Origine_H H1) H2) ) ; x0
(vector-set! *points* 1 (+ V1 V2 V3) ) ; y0
(vector-set! *points* 2 (+ (+ Origine_H H1) H2) ) ; x1
(vector-set! *points* 3 (+ V1 V2 V3 V4) ) ; y1
(vector-set! *points* 4 (+ Origine_H H1) ) ; x2
(vector-set! *points* 5 (+ V1 V2 V3 V4) ) ; y2


(gimp-image-select-polygon
image ; image
2 ; operation
6 ; num-segs
*points* ; segs
)

(gimp-context-set-foreground Color_3)

(gimp-edit-bucket-fill drawable 0 0 100 0 FALSE 0 0)

(gimp-selection-none image)
)
)



;*******************************************************************************************

***********
;
;*******************************************************************************************

***********




















;*******************************************************************************************

***********
; SCRIPT PRINCIPAL
;*******************************************************************************************

***********


(define
(
Motif_Geometrique_3D_samj
H1
H2
V1
V2
V3
V4
Color_1
Color_2
Color_3
Ribbon
Save_Pattern
Object_Name



)
(let*
(

(message (car (gimp-message-get-handler)))
(old_context_transform_direction (car (gimp-context-get-transform-

direction)))
(old_context_interpolation (car (gimp-context-get-interpolation)))
(old_context_recursion (car (gimp-context-get-transform-recursion)))
(old_context_transform_resize (car (gimp-context-get-transform-

resize)))
(old-fg (car (gimp-context-get-foreground)))
(old-bg (car (gimp-context-get-background)))

(old_context-antialias (car (gimp-context-get-antialias)))
(old_context-feather (car (gimp-context-get-feather)))
(old_context-feather-radiusx (car (gimp-context-get-feather-

radius)))
(old_context-feather-radiusy (cadr (gimp-context-get-feather-

radius)))
(old_context-sample-merged (car (gimp-context-get-sample-merged)))
(old_ontext-sample-criterion (car (gimp-context-get-sample-

criterion)))
(old_context-sample-threshold (car (gimp-context-get-sample-

threshold)))
(old_context-sample-transparent (car (gimp-context-get-sample-

transparent)))

(old-brush-size (car (gimp-context-get-brush-size)))
(old-brush-aspect-ratio (car (gimp-context-get-brush-aspect-ratio)))
(old-brush-angle (car (gimp-context-get-brush-angle)))
(old-brush-name (car (gimp-context-get-brush)))

(image)
(calque_motif)

(path)

(origine_log3 0)
(H1_log3 0)
(H2_log3 0)
(origine_log4 0)
(H1_log4 0)
(H2_log4 0)
(origine_log5 0)
(H1_log5 0)
(H2_log5 0)
(origine_log6 0)
(H1_log6 0)
(H2_log6 0)
(width 0)
(origine_symetrie 0)


)









;*******************************************************************************************

***********
; Tracer Origine 0
;*******************************************************************************************

***********

(if (= Ribbon 0)
(begin

(set! width (+ H1 H2) )

; créer une image pour le motif
(set! image (car (gimp-image-new width (+ V1 V2 V3 V4) 0)))

; créer le calque calque_motif
(set! calque_motif (car (gimp-layer-new image width (+ V1 V2

V3 V4) 1 "calque_motif" 100 0)))

(gimp-undo-push-group-start image)

(gimp-image-insert-layer image calque_motif -1 0)

(gimp-layer-add-alpha calque_motif)

(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
0 ; Origine_H
H1 ; H1
H2 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)
)


)


;*******************************************************************************************

***********
; RUBAN
;*******************************************************************************************

***********

(if (> Ribbon 0)
(begin

(if (= Ribbon 1)
(begin
(set! H1 (round (/ H1 (log 6) ) ) )
(set! H2 (round (/ H2 (log 6) ) ) )
(set! V1 (round (/ V1 (log 6) ) ) )
(set! V2 (round (/ V2 (log 6) ) ) )
(set! V3 (round (/ V3 (log 6) ) ) )
(set! V4 (round (/ V4 (log 6) ) ) )
)
)

(set! H1_log3 (round (* H1 (log 3) ) ) )
(set! H2_log3 (round (* H2 (log 3) ) ) )
(set! H1_log4 (round (* H1 (log 4) ) ) )
(set! H2_log4 (round (* H2 (log 4) ) ) )
(set! H1_log5 (round (* H1 (log 5) ) ) )
(set! H2_log5 (round (* H2 (log 5) ) ) )
(set! H1_log6 (round (* H1 (log 6) ) ) )
(set! H2_log6 (round (* H2 (log 6) ) ) )
(set! origine_log3 0)
(set! origine_log4 (+ origine_log3 H1_log3 H2_log3) )
(set! origine_log5 (+ origine_log4 H1_log4 H2_log4) )
(set! origine_log6 (+ origine_log5 H1_log5 H2_log5) )
(set! width (* 2 (+ origine_log6 H1_log6 H2_log6) ) )

; créer une image pour le motif
(set! image (car (gimp-image-new width (+ V1 V2 V3 V4) 0)))

; créer le calque calque_motif
(set! calque_motif (car (gimp-layer-new image width (+ V1 V2

V3 V4) 1 "calque_motif" 100 0)))

(gimp-undo-push-group-start image)

(gimp-image-insert-layer image calque_motif -1 0)

(gimp-layer-add-alpha calque_motif)

(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_log3 ; Origine_H
H1_log3 ; H1
H2_log3 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)


(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_log4 ; Origine_H
H1_log4 ; H1
H2_log4 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)


(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_log5 ; Origine_H
H1_log5 ; H1
H2_log5 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)



(Fonction_Motif_Geometrique_1_3D_samj
image ; image
calque_motif ; drawable
origine_log6 ; Origine_H
H1_log6 ; H1
H2_log6 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)

;Symétrie
(set! origine_symetrie (+ origine_log6 H1_log6 H2_log6 ) )
(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_symetrie ; Origine_H
H2_log6 ; H1
H1_log6 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)

(set! origine_symetrie (+ origine_symetrie H1_log6 H2_log6

) )
(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_symetrie ; Origine_H
H2_log5 ; H1
H1_log5 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)

(set! origine_symetrie (+ origine_symetrie H1_log5 H2_log5

) )
(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_symetrie ; Origine_H
H2_log4 ; H1
H1_log4 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)

(set! origine_symetrie (+ origine_symetrie H1_log4 H2_log4

) )
(Fonction_Motif_Geometrique_3D_samj
image ; image
calque_motif ; drawable
origine_symetrie ; Origine_H
H2_log3 ; H1
H1_log3 ; H2
V1 ; V1
V2 ; V2
V3 ; V3
V4 ; V4
Color_1 ; Color_1
Color_2 ; Color_2
Color_3 ; Color_3
0 ; *points*
)

; limite en largeur
(if (> width 512)
(begin
(set! width 512)
(gimp-image-scale image width (+ V1 V2 V3

V4))
)
)

)
)







;*******************************************************************************************

***********
;
;*******************************************************************************************

***********



(if (= Save_Pattern 1)
(begin
; déterminer le chemin complet du motif à sauvegarder
(set! path (string-append gimp-directory "/patterns/"

(strcat Object_Name "_" (number->string width ) "_" (number->string (+ V1 V2 V3 V4) )

".pat") ) )

; sauvegarder le motif sous :

"Object_Name"_"Selection_Size".pat
(file-pat-save 1 image (car (gimp-image-get-active-layer

image)) path path (strcat Object_Name "_" (number->string width ) "_" (number->string (+ V1

V2 V3 V4) ) ) )

; mettre à jour les motifs dans Gimp
(gimp-patterns-refresh)

; choisir le motif comme motif actif
(gimp-context-set-pattern (strcat Object_Name "_" (number-

>string width ) "_" (number->string (+ V1 V2 V3 V4) ) ) )

(gimp-image-delete image)

(gimp-message (string-append "Pattern Path :\n" path

"\nPattern Name:\n" Object_Name "_" (number->string width ) "_" (number->string (+ V1 V2 V3

V4) ) ) )
)
;else
(begin

(gimp-item-set-visible calque_motif TRUE)

; afficher l'image
(gimp-display-new image)

(gimp-undo-push-group-end image)
(gimp-displays-flush)

)
)









;*******************************************************************************************

***********
;
;*******************************************************************************************

***********







;*******************************************************************************************

***********

;; rétablir le mode message
(gimp-message-set-handler message)

(gimp-context-set-transform-direction old_context_transform_direction )
(gimp-context-set-interpolation old_context_interpolation)
(gimp-context-set-transform-recursion old_context_recursion)
(gimp-context-set-transform-resize old_context_transform_resize)
(gimp-context-set-background old-bg)
(gimp-context-set-foreground old-fg)


(gimp-context-set-antialias old_context-antialias)
(gimp-context-set-feather old_context-feather)
(gimp-context-set-feather-radius old_context-feather-radiusx old_context-

feather-radiusy)
(gimp-context-set-sample-merged old_context-sample-merged)
(gimp-context-set-sample-criterion old_ontext-sample-criterion)
(gimp-context-set-sample-threshold old_context-sample-threshold)
(gimp-context-set-sample-transparent old_context-sample-transparent)

(gimp-context-set-brush-default-size)
(gimp-context-set-brush-size old-brush-size)
(gimp-context-set-brush-aspect-ratio old-brush-aspect-ratio)
(gimp-context-set-brush-angle old-brush-angle)
(gimp-context-set-brush old-brush-name)






)
)





(script-fu-register "Motif_Geometrique_3D_samj"
_"<Image>/Filters/Render/Pattern/3D Motif Geometrique ..."
"3D pattern made of 3 colours"
"samj"
"samj"
"20130403"
""
SF-ADJUSTMENT "X 1 " '(16 1 128 1 5 0 1)
SF-ADJUSTMENT "X 2 " '(16 1 128 1 5 0 1)
SF-ADJUSTMENT "V 1 " '(16 1 64 1 5 0 1)
SF-ADJUSTMENT "V 2 " '(16 1 64 1 5 0 1)
SF-ADJUSTMENT "V 3 " '(16 1 64 1 5 0 1)
SF-ADJUSTMENT "V 4 " '(16 1 64 1 5 0 1)
SF-COLOR "Color 1 " '(255 255 255)
SF-COLOR "Color 2 " '(128 128 128)
SF-COLOR "Color 3 " '(0 0 0)
SF-OPTION "Ribbon (Wmax=512px) " '("A Without" "B

Ribbon small" "C Large ribbon")
SF-TOGGLE "Save Pattern" FALSE
SF-STRING "Pattern Name to save (DO NOT USE SPACES)

" "3d_Motif_Geometrique"


)

;; FIN


Attachments:
Motif_Geometrique.scm [20.26 KiB]
Downloaded 101 times
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:08 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Replace the last section of code with the following:

(script-fu-register "Motif_Geometrique_3D_samj"
  _"3D Motif Geometrique..."
  "3D pattern made of 3 colours"
  "samj"
  "samj"
  "20130403"
  ""
  SF-ADJUSTMENT "X 1 " '(16 1 128 1 5 0 1)
  SF-ADJUSTMENT "X 2 " '(16 1 128 1 5 0 1)
  SF-ADJUSTMENT "V 1 " '(16 1 64 1 5 0 1)
  SF-ADJUSTMENT "V 2 " '(16 1 64 1 5 0 1)
  SF-ADJUSTMENT "V 3 " '(16 1 64 1 5 0 1)
  SF-ADJUSTMENT "V 4 " '(16 1 64 1 5 0 1)
  SF-COLOR "Color 1 " '(255 255 255)
  SF-COLOR "Color 2 " '(128 128 128)
  SF-COLOR "Color 3 " '(0 0 0)
  SF-OPTION "Ribbon (Wmax=512px) " '("A Without" "B Ribbon small" "C Large ribbon")
  SF-TOGGLE "Save Pattern" FALSE
  SF-STRING "Pattern Name to save (DO NOT USE SPACES)" "3d_Motif_Geometrique"
)

(script-fu-menu-register "Motif_Geometrique_3D_samj"
  _"<Image>/Filters/Render/Pattern" )

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:13 pm  (#3) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16013
I was going to say it was Saulgoode that fixed it not myself.

Thanks Saulgoode. :)

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:14 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
thanks saulgoode

but it still does not reappear under filters


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:19 pm  (#5) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16013
Esper wrote:
thanks saulgoode

but it still does not reappear under filters

If you run it once it doesn't allow for reshow or repeat?

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:19 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
It should be under Filters > Render > Pattern

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:20 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
thats correct Rod


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:22 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16013
Esper wrote:
thats correct Rod


That is odd, it should have worked changing the menu structure in the code.
Have you tried refreshing scripts or just restarting gimp at all?

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:24 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
yes, both

i attach the edited script...mybe i made a mistake....


Attachments:
Motif_Geometrique.scm [20.16 KiB]
Downloaded 99 times
Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 2:56 pm  (#10) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16013
Esper wrote:
yes, both

i attach the edited script...mybe i made a mistake....


Looks like you have it all correctly coded to me. :)
I thought maybe the push-undo call had something to do with it but it didn't help.
Hopefully someone will come along soon and help you out.

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 4:28 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Try inserting an asterisk into the empty quotes that follow the date. GIMP apparently doesn't want to allow "repeats" of the image creation scripts.

(script-fu-register "Motif_Geometrique_3D_samj"
  _"3D Motif Geometrique..."
  "3D pattern made of 3 colours"
  "samj"
  "samj"
  "20130403"
  "*"
  SF-ADJUSTMENT "X 1 " '(16 1 128 1 5 0 1)
  :
  :
  :

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 4:40 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
it still doesnt work


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 5:19 pm  (#13) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Unlike the other scripts located under Filter->Renders->Pattern, this script renders a complete new image, rather than working off (filling) an existing image. That being the case, there is nothing to repeat.

The script works the same as the other pattern render scripts located under Create->New->Patterns. Moving it to another menu location doesn't change the script's functionality. To allow for repeat/re-show, the script would need to be modified to work on an existing image, like the other scripts located under Filter->Renders->Pattern.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 5:26 pm  (#14) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16013
GnuTux wrote:
Unlike the other scripts located under Filter->Renders->Pattern, this script renders a complete new image, rather than working off (filling) an existing image. That being the case, there is nothing to repeat.

The script works the same as the other pattern render scripts located under Create->New->Patterns. Moving it to another menu location doesn't change the script's functionality. The script would need to be modified to work on an existing image, like the other scripts located under Filter->Renders->Pattern, to allow for repeat/re-show.


I had a feeling it may have to do with being a new image. That makes sense. :)
Thanks Tux.

_________________
Image


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 5:28 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
GnuTux: i didnt expect the script's functionality to change
i just wanted it in a different location

saying there is nothing do repeat isnt true, because most of the time i need more than one go to find the right values
but i guess i understand what you mean


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 5:33 pm  (#16) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Well, I should have been more precise. I meant as far as GIMP is concerned, there is nothing to repeat. I understand that you need to run the script multiple times to try out various settings, in order to get the results you're after.

What you want can be done. The script doesn't have to do anything to an existing image. It just needs to be modified to follow the structure of the other scripts located under Filter->Renders->Pattern. I noticed that there are other problems with the script as well. It threw an undeclared variable (function name) error when I changed the ribbon option dropdown to B or C. :(

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 6:03 pm  (#17) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Erisian

you may use bimp to repeat the script

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 6:10 pm  (#18) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
GnuTux
Quote:
I noticed that there are other problems with the script as well. It threw an undeclared variable (function name) error when I changed the ribbon option dropdown to B or C.


For that something screwed up the script formatting :

Quote:
...error when I changed the ribbon option dropdown to B or C.


With the command broken in the middle by empty lines no surprise that doesn't work :

look Here

SF-COLOR "Color 2 " '(128 128 128)
SF-COLOR "Color 3 " '(0 0 0)
SF-OPTION "Ribbon (Wmax=512px) " '("A Without" "B

Ribbon small" "C Large ribbon")
SF-TOGGLE "Save Pattern" FALSE

...

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 6:22 pm  (#19) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Erisian you really risk to loose your time :

What you posted is pratically unusable as if the script was open or paste using a word editor (as MS Word )instead then a text editor (as notepad )


If you want edit it download again the script
if you want be sure to avoid similar formatting problem (even MS notepad may screw up script , seldom but may happen ) use notepad + http://notepad-plus-plus.org/download/ or similar source code editors

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: please help me customise this script (Motif_Geometrique_3D)
PostPosted: Sun Jul 14, 2013 6:25 pm  (#20) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
My version of the script is not broken there, PC. The script would still work, even with the line break (CRs) in that location. Although, it would make the dropdown look strange.

I'm also not noticing a lot of formatting issues like you are, just some extra white space between code sections.

I am getting this error message when selecting B or C from the dropdown:

Error: ( : 32710) eval: unbound variable: Fonction_Motif_Geometrique_1_3D_samj

Looks like some debugging is in order for this script too.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group