Modifica di uno script

Domandate qui se non riuscite ad installare i filtri o gli script, oppure se avete problemi legati alla creazione e modifica dei filtri. Qui si pongono le domande più tecniche.
Rispondi
oeta
Utente avanzato
Utente avanzato
Messaggi:32
Iscritto il:dom 19 apr 2009, 14:36
Località:reggio emilia e ravenna
Modifica di uno script

Messaggio da oeta » dom 6 dic 2015, 17:09

Ciao a tutti,
come da oggetto, mi servirebbe modificare uno script.
Lo script è "fluttering.scm" che potete vedere a questo indirizzo:
http://pudemo.altervista.org/Parcheggio ... g_flag.scm
Esso genera una animazione tipo "sventolio di bandiera" di cui avrei bisogno, ma a partire da una immagine che è, non una bandiera ma, una striscia con delle scritte.
Il problema è che, lo script mi genera sul lato sinistro l'asta della bandiera, cosa che io non vorrei.
Vorrei che mi generasse il movimento ma senza aggiungere l'asta.
Quali potrebbero essere le istruzioni da inibire nello script, per ottenere questo risultato?
Spero che possiate aiutarmi, comunque grazie in anticipo.

Avatar utente
Lazza
Amministratore
Amministratore
Messaggi:5254
Iscritto il:dom 5 set 2004, 13:06
Località:Italia
Contatta:

Re: Modifica di uno script

Messaggio da Lazza » mar 5 gen 2016, 13:44

Premetto che non conosco benissimo il linguaggio degli script-fu, però ad occhio vedo alla riga 127:

Codice: Seleziona tutto

;---draw the mast layer---
    (define mastlayer (car (gimp-layer-new image width height 1 "mast" 100 0)))
    (gimp-layer-add-alpha mastlayer)
    (gimp-drawable-fill mastlayer 3)
    (gimp-image-add-layer image mastlayer 0)

    (gimp-context-set-foreground mastcolorl)
    (gimp-context-set-background mastcolorr)

    (define (gen-mast-array borderx bordery width height mastlef mastrig)
      (let*
        ((mastarray (cons-array 10 'double)))
        (aset mastarray 0 mastlef)
        (aset mastarray 1 (* bordery 0.5))
        (aset mastarray 2 mastrig)
        (aset mastarray 3 (* bordery 0.5))
        (aset mastarray 4 mastrig)
        (aset mastarray 5 height)
        (aset mastarray 6 mastlef)
        (aset mastarray 7 height )
        (aset mastarray 8 mastlef)
        (aset mastarray 9 (* bordery 0.5))
        mastarray
      )
    )

    (define mastsel (gen-mast-array borderx bordery width height mastlef mastrig))
    (gimp-free-select image
                      10
                      mastsel
                      CHANNEL-OP-REPLACE
                      0
                      0
                      0.0)
    (if (>= mthickness 10)
      (gimp-edit-blend
        mastlayer FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR
        100 0 REPEAT-NONE FALSE FALSE
        0 0 FALSE
        mastlef (/ height 2) mastrig (/ height 2)
      )
    )
    (gimp-selection-none image)
E alla riga 242:

Codice: Seleziona tutto

      ;---add the mast---
      (define mastcopy (car (gimp-layer-copy mastlayer 1)))
      (gimp-image-add-layer image mastcopy -1)
      (gimp-image-merge-down image mastcopy 1)

      (set! layerindex (+ layerindex 1))
    )
Tra l'altro pare che ci sia un parametro per regolare lo spessore dell'asta:

Codice: Seleziona tutto

SF-ADJUSTMENT "Thickness of the mast"              '(60 5 100 1 10 0 1)
Potresti anche provare a mettere quello a 0 e magari ti risolve già il problema. :)

Rispondi