It is currently Mon Jul 22, 2024 6:30 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Am I even close
PostPosted: Mon Jun 27, 2011 12:41 am  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
I am trying to create an image with a pattern backgound and a text layer

(let* ( ;;(final-layer 0)
;;(text-layer 0)
(image (car (gimp-image-new 256 256 RGB)))
(gimp-context-push);; keep-settings in variables
(new-fg (gimp-context-set-foreground '(0 0 0)))
(text-layer (car (gimp-text-fontname image -1 0 0 text 20 TRUE font-size PIXELS font)))
;; know the dimensions of the image
(image-width (car (gimp-drawable-width text-layer)))
(image-height (car (gimp-drawable-height text-layer)))
(image-x (car (gimp-drawable-offsets text-layer)))
(image-y (cadr (gimp-drawable-offsets text-layer)))

;;create pattern layer
;;(pattern-layer(car (gimp-layer-new image image-width image-height RGB pattern-layer 100 0)
;;(gimp-edit-bucket-fill pattern-layer 2 0 100 0 0 0 0)

;; keep-settings in variables
;;(old-bg (car (gimp-context-get-background)))
;;(old-fg (car (gimp-context-get-foreground)))
;;(old-deg (car (gimp-context-get-gradient)))
;;(old-pat (car (gimp-context-get-pattern)))

(bottom-layer (car (gimp-layer-new-from-drawable drawable image))) ;;background layer
(shadow-layer (car (gimp-layer-new-from-drawable drawable image))) ;;text layer for drop shadow
(text-layer-bump (car (gimp-layer-new-from-drawable drawable image))) ;;text layer for bump map
)
(gimp-edit-bucket-fill bottom-layer 2 0 100 0 0 0 0)

I have changed my mind sometimes e.g.all the ;; used

The original let block
(let* (
(text-layer 0)
(final-layer 0)

;; save the old settings
(old-bg (car (gimp-context-get-background)))
(old-fg (car (gimp-context-get-foreground)))
(old-deg (car (gimp-context-get-gradient)))
(old-pat (car (gimp-context-get-pattern)))

;; get the image dimensions
(image-width (car (gimp-drawable-width drawable)))
(image-height (car (gimp-drawable-height drawable)))
(image-x (car (gimp-drawable-offsets drawable)))
(image-y (cadr (gimp-drawable-offsets drawable)))

(fond-layer (car (gimp-layer-new-from-drawable pattern image)))
(shadow-layer (car (gimp-layer-new-from-drawable drawable image)))
(text-layer-bump (car (gimp-layer-new-from-drawable drawable image))) ;; text bump-map
)
The script required the user to create an image with a pattern background layer and a text layer I am trying to do this within the script before I add other changes.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


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: Am I even close
PostPosted: Mon Jun 27, 2011 2:35 am  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Yes, you are close. The biggest problem in what you have so far is with the line:
Quote:
(gimp-context-push);; keep-settings in variables

because it is a procedure and it should not be in the binding block of your let* statement. Your code is, in effect, defining a new variable named 'gimp-context-push' which replaces the procedure (for the duration of the let*).

The following line:
Quote:
(new-fg (gimp-context-set-foreground '(0 0 0)))

is also somewhat unorthodox (though it is functionally OK). The 'gimp-context-set-foreground' procedure doesn't really return any useful value and there is no reason to keep it in a variable. You should just call the procedure after you've declared all of your variables (and after you've pushed the context).

The rest of your non-commented code is mostly satisfactory, however, the names of 'image-x', 'image-y', 'image-width', and 'image-height' seem a little confusing because they are actually the offsets and dimensions of the text layer (not the image). I am guessing that you eventually wish to resize your image to fit whatever text is created (for a particular font and size) -- so perhaps your choice of names is not so bad.

Also, it is unclear what the value of 'drawable' is when you call the procedure 'gimp-layer-new-from-drawable' to create your bottom, bump, and shadow layers, but I'd guess you intend the original to be your 'text-layer'. It should be noted that after creating each of these layers, it is necessary to add them to the image using 'gimp-image-add-layer'.

Also, you most likely should use 'gimp-drawable-fill' or 'gimp-edit-fill', rather than 'gimp-edit-bucket-fill' (especially since you don't appear to have a selection present).

Here is some sample code which may be useful.
(define (script-fu-graechan-text text color font font-size pattern)
  (let* ((image (car (gimp-image-new 256 256 RGB)))
         (text-layer (car (gimp-text-fontname image
                                              -1
                                              0
                                              0
                                              text
                                              20
                                              TRUE
                                              font-size
                                              PIXELS
                                              font )))
         (text-width (car (gimp-drawable-width text-layer)))
         (text-height (car (gimp-drawable-height text-layer)))
         (pattern-layer 0)
         )
    (gimp-context-push)
    (gimp-context-set-foreground color)
    (set! pattern-layer (car (gimp-layer-new image
                                             text-width
                                             text-height
                                             RGB-IMAGE
                                             "Pattern"
                                             100
                                             NORMAL-MODE )))
    (gimp-drawable-fill pattern-layer PATTERN-FILL)
    (gimp-image-add-layer image pattern-layer 1)
    (gimp-image-resize-to-layers image)
    (gimp-context-pop)
    (gimp-display-new image)
    )
  )
(script-fu-register "script-fu-graechan-text"
  "Graechan Pattern Text..."
  "Create an image with a text layer over a pattern layer"
  "Graechan"
  "Graechan"
  "June 2011"
  ""
  SF-STRING     "Text"               "Hello world!"
  SF-COLOR      "Text color"         '(0 0 0)
  SF-FONT       "Font"               "Sans Bold"
  SF-ADJUSTMENT "Font size (pixels)" '(22 6 200 1 1 0 1)
  SF-PATTERN    "Pattern"            "Pine"
  )
(script-fu-menu-register "script-fu-graechan-text"
  "<Image>/File/Create/Logos"
  )


Edited to correct misspelling of Graechan's name.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Jun 27, 2011 8:58 am, edited 2 times in total.

Top
 Post subject: Re: Am I even close
PostPosted: Mon Jun 27, 2011 5:56 am  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Thankyou Saulgoode It's definately a big help as I am new to this type of thing but I am persistant in trying to understand script-fu.
:gimp

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Am I even close
PostPosted: Tue Jun 28, 2011 3:09 am  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Saolgoode this I made the pattern layer in your script RGBA but something strips THE ALPHA channel when it finishes.?

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Am I even close
PostPosted: Tue Jun 28, 2011 6:31 am  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Could you post your code, please?

(wrapped in code tags)
Attachment:
codetags.png
codetags.png [ 17.41 KiB | Viewed 3389 times ]


Also (just to be sure), which version of GIMP are you using?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Am I even close
PostPosted: Tue Jun 28, 2011 8:27 am  (#6) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
It appears that the pattern layer is being created without an alpha channel.
Try changing the "RGB-IMAGE" to "RGBA-IMAGE".

_________________
Image


Top
 Post subject: Re: Am I even close
PostPosted: Wed Jun 29, 2011 12:25 am  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Saulgoode here is the original code it requires an image with a text layer selected and a pattern layer with alpha channel.
;;
;; ---------------------------------------------------------
;; *                        
;; *                Script-Fu CHISELED
;; *                        
;; ---------------------------------------------------------
;; creative commons licence
;; http://creativecommons.org/licenses/by-nc-sa/2.0/fr/




(define (apply-abcdugimp-chiseled   image
                           drawable
                           type
                           pattern
                           intensite
                           azimut
                           profondeur
                           conserv)

   (let* (
         (text-layer 0)
         (final-layer 0)
         
         ;; conserver paramètres des outils dans des variables
         (old-bg (car (gimp-context-get-background)))
         (old-fg (car (gimp-context-get-foreground)))
         (old-deg (car (gimp-context-get-gradient)))
         (old-pat (car (gimp-context-get-pattern)))
         
         ;; connaitre les dimensions de l'image
         (image-width (car (gimp-drawable-width drawable)))
         (image-height (car (gimp-drawable-height drawable)))
         (image-x (car (gimp-drawable-offsets drawable)))
         (image-y (cadr (gimp-drawable-offsets drawable)))

         (fond-layer (car (gimp-layer-new-from-drawable pattern image)))
         (shadow-layer (car (gimp-layer-new-from-drawable drawable image)))
         (text-layer-bump (car (gimp-layer-new-from-drawable drawable image))) ;; bump servant a faire le repoussage
      )
      
      (gimp-drawable-set-visible fond-layer TRUE)
      (gimp-drawable-set-visible shadow-layer TRUE)
      (gimp-drawable-set-visible text-layer-bump TRUE)
      
      ;; add layer
      (gimp-image-add-layer image fond-layer -1)
      (gimp-image-add-layer image shadow-layer -1)
      (gimp-drawable-set-name shadow-layer "chiseled-ombre")
      (gimp-image-add-layer image text-layer-bump -1)
      (gimp-drawable-set-name text-layer-bump "chiseled-bosselage")
            
   
      ;; copie du fond pour recevoir le texte gravé
      (set! text-layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "chiseled-texte" 100 NORMAL)))
      (gimp-image-add-layer image text-layer -1)
      (gimp-layer-set-offsets text-layer image-x image-y)
      (gimp-rect-select image image-x image-y image-width image-height REPLACE FALSE 0)
      (gimp-edit-copy fond-layer)
      (gimp-selection-none image)
      (gimp-floating-sel-anchor (car (gimp-edit-paste text-layer 0))) ;; colle et ancre la selection flottante
      
      ;; flou sur le calque de l'ombre
      (plug-in-gauss-iir2 RUN-NONINTERACTIVE image shadow-layer 5 5)
      
      ;; deplacer l'ombre en x et y
      (gimp-layer-translate shadow-layer 3 3)
      
      ;; sélectionner couleurs PP et AR
      (gimp-context-set-foreground '(255 255 255))
      (gimp-context-set-background '(0 0 0))
      
      ;; remplir le calque de texte avec un dégradé en forme angulaire
      (gimp-layer-set-preserve-trans text-layer-bump TRUE)
      (if (= type 0) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (if (= type 1) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-SPHERICAL 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (if (= type 2) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (gimp-layer-set-preserve-trans text-layer-bump FALSE)
      
      ;; repoussage d'après une carte
      (plug-in-bump-map RUN-NONINTERACTIVE image text-layer text-layer-bump azimut 50 profondeur 0 0 0 0 TRUE FALSE LINEAR)
      
      ;; supprimer le fond dans text-layer
      (gimp-selection-layer-alpha text-layer-bump)
      (gimp-selection-invert image)
      (gimp-edit-clear text-layer)
      (gimp-selection-none image)
      
      ;; eclairage par niveaux
      (if (> intensite 0)
         (begin
            (if (= intensite 1) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 1.3 0 255))
            (if (= intensite 2) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 1.7 0 255))
            (if (= intensite 3) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 2.2 0 255))
            (if (= intensite 4) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 0.7 0 255))
         )
      )
      
      ;; fusion des calques et arrière plan transparent
      (gimp-drawable-set-visible text-layer-bump FALSE)
      (if (= conserv FALSE)
         (begin
            (gimp-image-remove-layer image text-layer-bump)
            (gimp-drawable-set-name fond-layer "Effet chiseled")
            (gimp-image-merge-down image shadow-layer EXPAND-AS-NECESSARY)
            (gimp-image-merge-down image text-layer EXPAND-AS-NECESSARY)
         )
      )
      
      ;; rétablir les paramétres des outils
      (gimp-context-set-background old-bg)
      (gimp-context-set-foreground old-fg)
      (gimp-context-set-gradient old-deg)
      (gimp-context-set-pattern old-pat)
   )

)



;; ------------------------
;; script pour <image>
;; ------------------------

(define (script-fu-abcdugimp-chiseled   image
                              drawable
                              type
                              pattern
                              intensite
                              azimut
                              profondeur
                              conserv)
        
      (let* (
            (var-select (car (gimp-selection-is-empty image)))
            (canal 0)
         )
         
         (gimp-image-undo-group-start image)

         (if (= var-select TRUE) ;; test si il y a selection
            (begin ;; aucune selection n'a été faite
            )
            (begin ;; une selection a ete faite
               (set! canal (car (gimp-selection-save image))) ;; canal stockant la selection originelle de l'utilisateur
            )
         )
         
         (gimp-selection-none image)

         (apply-abcdugimp-chiseled image drawable type pattern intensite azimut profondeur conserv)
             
         (if (= var-select TRUE) ;; test si il y AVAIT selection
            (begin ;; aucune selection n'avait été faite
            )
            (begin ;; une selection avait été faite (remettre la selection de l'utilisateur)
               (gimp-selection-load canal) ;; mask de canal vers selection
               (gimp-image-remove-channel image canal) ;; supprimer le mask de canal
            )
         )

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

(script-fu-register "script-fu-abcdugimp-chiseled"
      "Chiseled 1.2"
      "Un effet de cisèlement avec une texture."
      "Michel Douez"
      "abcdugimp.free.fr - creative commons licence"
      "26/03/2008"
      "RGBA"
        SF-IMAGE      "Image" 0
        SF-DRAWABLE   "Drawable" 0
      SF-OPTION "Type de relief" '("Angulaire" "Arrondi" "Concave")
      SF-LAYER "Calque de motif" 0
      SF-OPTION "Intensité d'éclairage" '("Pas d'éclairage" "Faible" "Moyen" "Fort" "Sombre")
      SF-ADJUSTMENT "Azimut (repoussage)" '(135 0 360 1 10 0 0)
      SF-ADJUSTMENT "Profondeur (repoussage)" '(10 3 65 1 10 0 0)
      SF-TOGGLE "Conserver les calques" FALSE
)

(script-fu-menu-register "script-fu-abcdugimp-chiseled" "<Image>/Filters/abcdugimp.free.fr/Alpha vers Rendu")




These are the changes I have made so far ,my primary aim was to create the text and the background with the script and not seperatly first but it's the scripts need to initially have the text layer selected that I think is the problem

;;
;; ---------------------------------------------------------
;; *                        
;; *                Script-Fu CHISELED
;; *                        
;; ---------------------------------------------------------
;; creative commons licence
;; http://creativecommons.org/licenses/by-nc-sa/2.0/fr/




(define (apply-Graechan-chiseled text
                                      font
                                      font-size
                      type
                      pattern
                      intensite
                      azimut
                      profondeur
                      conserv)

   (let* (    (image (car (gimp-image-new 256 256 RGB)))
                   (text-layer (car (gimp-text-fontname image -1 0 0 text 20 TRUE font-size PIXELS font)))
         ;; know the dimensions of the image
         (image-width (car (gimp-drawable-width text-layer)))
         (image-height (car (gimp-drawable-height text-layer)))
         (image-x (car (gimp-drawable-offsets text-layer)))
         (image-y (cadr (gimp-drawable-offsets text-layer)))
                (pattern-layer (car (gimp-layer-new image image-width image-height RGB-IMAGE "Pattern" 100 NORMAL-MODE)))
                (bottom-layer 0)
                (shadow-layer 0)
         (text-layer-bump 0)
                (final-layer 0)
                                                 
                ;;(bottom-layer (car (gimp-layer-new-from-drawable pattern-layer image))) ;;background layer
         ;;(shadow-layer (car (gimp-layer-new-from-drawable text-layer image))) ;;text layer for drop shadow
         ;;(text-layer-bump (car (gimp-layer-new-from-drawable text-layer image))) ;;text layer for bump map
      )
           (gimp-context-push);; keep-settings in variables
           ;;(new-fg (gimp-context-set-foreground '(0 0 0)))
           ;;(new-bg (gimp-context-set-background '(255 255 255)))
           ;;(set! pattern-layer (car (gimp-layer-new image text-width text-height RGBA-IMAGE "Pattern" 100 NORMAL-MODE)))
    (gimp-drawable-fill pattern-layer PATTERN-FILL)
    (gimp-image-add-layer image pattern-layer 1)
    (gimp-image-resize-to-layers image)
    (gimp-layer-add-alpha pattern)
           
           (set! bottom-layer (car (gimp-layer-new-from-drawable pattern-layer image))) ;;background layer
           ;;(set! bottom-layer (car (gimp-layer-new image image-width image-height RGB-IMAGE "Pattern" 100 NORMAL-MODE )))
           (set! shadow-layer (car (gimp-layer-new-from-drawable text-layer image))) ;;text layer for drop shadow
           ;;(set! shadow-layer (car (gimp-layer-new image image-width image-height RGB-IMAGE "shadow" 100 NORMAL-MODE )))
           (set! text-layer-bump (car (gimp-layer-new-from-drawable text-layer image))) ;;text layer for bump map                       
           ;;(set! bump-layer (car (gimp-layer-new image image-width image-height RGB-IMAGE "bump" 100 NORMAL-MODE )))                   
      
           ;;(gimp-drawable-fill bottom-layer PATTERN-FILL)           


           (gimp-drawable-set-visible bottom-layer TRUE)
      (gimp-drawable-set-visible shadow-layer TRUE)
      (gimp-drawable-set-visible text-layer-bump TRUE)
      
      ;; add layer
      (gimp-image-add-layer image bottom-layer -1)
      (gimp-image-add-layer image shadow-layer -1)
      (gimp-drawable-set-name shadow-layer "chiseled-ombre")
      (gimp-image-add-layer image text-layer-bump -1)
      (gimp-drawable-set-name text-layer-bump "chiseled-bosselage")
            
   
      ;; copie du fond pour recevoir le texte gravé
      (set! text-layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "chiseled-texte" 100 NORMAL)))
      (gimp-image-add-layer image text-layer -1)
      (gimp-layer-set-offsets text-layer image-x image-y)
      (gimp-rect-select image image-x image-y image-width image-height REPLACE FALSE 0)
      (gimp-edit-copy bottom-layer)
      (gimp-selection-none image)
      (gimp-floating-sel-anchor (car (gimp-edit-paste text-layer 0))) ;; colle et ancre la selection flottante
      
      ;; flou sur le calque de l'ombre
      (plug-in-gauss-iir2 RUN-NONINTERACTIVE image shadow-layer 5 5)
      
      ;; deplacer l'ombre en x et y
      (gimp-layer-translate shadow-layer 3 3)
      
      ;; sélectionner couleurs PP et AR
      (gimp-context-set-foreground '(255 255 255))
      (gimp-context-set-background '(0 0 0))
      
      ;; remplir le calque de texte avec un dégradé en forme angulaire
      (gimp-layer-set-preserve-trans text-layer-bump TRUE)
      (if (= type 0) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (if (= type 1) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-SPHERICAL 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (if (= type 2) (gimp-edit-blend text-layer-bump FG-BG-RGB-MODE NORMAL-MODE GRADIENT-SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE FALSE 3 0.20 TRUE 0 0 image-width image-height))
      (gimp-layer-set-preserve-trans text-layer-bump FALSE)
      
      ;; repoussage d'après une carte
      (plug-in-bump-map RUN-NONINTERACTIVE image text-layer text-layer-bump azimut 50 profondeur 0 0 0 0 TRUE FALSE LINEAR)
      
      ;; supprimer le fond dans text-layer
      (gimp-selection-layer-alpha text-layer-bump)
      (gimp-selection-invert image)
      (gimp-edit-clear text-layer)
      (gimp-selection-none image)
      
      ;; eclairage par niveaux
      (if (> intensite 0)
         (begin
            (if (= intensite 1) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 1.3 0 255))
            (if (= intensite 2) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 1.7 0 255))
            (if (= intensite 3) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 2.2 0 255))
            (if (= intensite 4) (gimp-levels text-layer HISTOGRAM-VALUE 0 255 0.7 0 255))
         )
      )
      
      ;; fusion des calques et arrière plan transparent
      (gimp-drawable-set-visible text-layer-bump FALSE)
      (if (= conserv FALSE)
         (begin
            (gimp-image-remove-layer image text-layer-bump)
            (gimp-drawable-set-name bottom-layer "Effect chiseled")
            (gimp-image-merge-down image shadow-layer EXPAND-AS-NECESSARY)
            (gimp-image-merge-down image text-layer EXPAND-AS-NECESSARY)
         )
      )
      
      ;; return the settings back to the begining
      ;;(gimp-context-set-background old-bg)
      ;;(gimp-context-set-foreground old-fg)
      ;;(gimp-context-set-gradient old-deg)
      ;;(gimp-context-set-pattern old-pat)
          (gimp-context-pop)
   )

)



;; ------------------------
;; script pour <image>
;; ------------------------

(define (script-fu-Graechan-chiseled   image
                              drawable
                              type
                              pattern
                              intensite
                              azimut
                              profondeur
                              conserv)
        
      (let* (
            (var-select (car (gimp-selection-is-empty image)))
            (canal 0)
         )
         
         (gimp-image-undo-group-start image)

         (if (= var-select TRUE) ;; test if there is selection
            (begin ;; no selection was made
            )
            (begin ;; a selection was made
               (set! canal (car (gimp-selection-save image))) ;; channel storing the user's original selection            
               )
              )
         
         (gimp-selection-none image)

         (apply-Graechan-chiseled image drawable type pattern intensite azimut profondeur conserv)
             
         (if (= var-select TRUE) ;; test if there was selection
            (begin ;; no selection was made
            )
            (begin ;; a selection was made(return the user selection)
               (gimp-selection-load canal) ;; channel mask to selection
               (gimp-image-remove-channel image canal) ;; remove the mask channel
            )
         )

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

(script-fu-register "script-fu-Graechan-chiseled"
      "Chiseled 1.2"
      "Un effet de cisèlement avec une texture."
      "Graechan"
      "creative commons licence"
      "26/03/2008"
      ""
        ;;SF-IMAGE      "Image" 0
        ;;SF-DRAWABLE   "Drawable" 0
               SF-STRING     "Text"                "The Gimp"
          SF-FONT       "Font"                "Cooper Heavy"
          SF-ADJUSTMENT "Font size (pixels)"  '(150 2 1000 1 10 0 1)
      SF-OPTION "Type of relief" '("Angulaire" "Arrondi" "Concave")
      SF-PATTERN "Pattern" "Pink Marble"
      SF-OPTION "Intensité d'éclairage" '("Pas d'éclairage" "Faible" "Moyen" "Fort" "Sombre")
      SF-ADJUSTMENT "Azimut (repoussage)" '(135 0 360 1 10 0 0)
      SF-ADJUSTMENT "Profondeur (repoussage)" '(10 3 65 1 10 0 0)
      SF-TOGGLE "Conserver les calques" FALSE
)

(script-fu-menu-register "script-fu-Graechan-chiseled" "<Image>/Temp")



I nearly forgot wndows 7 gimp 2.6.11,
and this is the error I get when I run it

Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Thu Jun 30, 2011 12:22 am, edited 1 time in total.

Top
 Post subject: Re: Am I even close
PostPosted: Wed Jun 29, 2011 5:50 am  (#8) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
The script you posted is supposed to be complete ?

i ask because at the beginning i can't see the first block (that starting with "define" containing the definition of the variables) and at the end i can't see the last (the "register" section )

_________________
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: Am I even close
PostPosted: Wed Jun 29, 2011 6:45 am  (#9) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
So is this from that "incandescence" script with which you were battling earlier? If so, I suggest it would be easier to re-write that script from scratch than attempting to track down all of its peccadillos.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Am I even close
PostPosted: Thu Jun 30, 2011 12:58 am  (#10) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Saulgoode its a different sript I am using this time, I have amended my previous posting to show the entire scripts this time.
I hope you and photocomix find this more usefull as the error points towards the section at the end that was left out(maybe something to do with the original requirement of having the the text layer selected before running script-fu but i can't work it out).

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Am I even close
PostPosted: Thu Jun 30, 2011 1:53 pm  (#11) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Quote:
I hope you and photocomix


i really can't help for debug script fu,...well except to note that the define and the registration block seems MIA

But would be as pretend to be a mechanic only because i am able to guess why your car didn't move anymore even if the engine roar..and that by noticing that somebody stolen all the 4 wheels :hehe

_________________
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: Am I even close
PostPosted: Thu Jun 30, 2011 6:09 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The cause of that particular error is that you've commented out the two lines containing SF-IMAGE and SF-DRAWABLE in your 'script-fu-register' procedure, yet those two parameters are expected by the procedure you've defined and are registering ("script-fu-Graechan-chiseled').

I am quite willing to help you with your travails, however, at the moment I am struggling with some computer problems and thus I may be slow to respond.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Am I even close
PostPosted: Fri Jul 01, 2011 3:48 am  (#13) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Image

Every light at the end of the tunnel so far has been a !TRAIN WRECK!.But I'm still trying.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group