It is currently Sun Aug 02, 2026 8:52 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: How can one script interfere with another?
PostPosted: Mon Apr 30, 2012 10:02 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I installed a new script in my Gimp only to find it did not work properly untill I uninstalled another.

The script that interfered with my new script was 'incandescence +2.6.scm'and the new script was 'Frame it'.

_________________
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: How can one script interfere with another?
PostPosted: Mon Apr 30, 2012 11:01 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16145
Are these in Gimp-2.6.12 or 2.7 version Graechan?

_________________
Image


Top
 Post subject: Re: How can one script interfere with another?
PostPosted: Mon Apr 30, 2012 11:27 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Tried 2.6 2.7 and 2.8 with same result

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


Top
 Post subject: Re: How can one script interfere with another?
PostPosted: Tue May 01, 2012 1:07 am  (#4) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Yes, it's perfectly possible for scripts to interfere with each other, and it's only due to most script writers being careful that it doesn't happen more often.

All script-fu scripts share the same name-space, so if they both have a helper-procedure with the same name, then you end up with one of them trying to use an incorrect procedure.

Either post links to where you got both scripts from so we can examine them for you, or have a look inside both files yourself at all the define statements. You'll probably find that they both have an identically named procedure.

Kevin


Top
 Post subject: Re: How can one script interfere with another?
PostPosted: Tue May 01, 2012 2:10 am  (#5) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Kevin you were right on the money thankyou


in incandescence
(define (gen_bottom_array height length)
  (let* ((n_array (make-vector 24 'double)))
      (vector-set! n_array 0 0)                            ;; x0
       (vector-set! n_array 1 (/ (* height 90.66) 100))    ;; y0
       (vector-set! n_array 2 (/ (* length 7.16) 100))     ;; x1
       (vector-set! n_array 3 (/ (* height 87.33) 100))    ;; y1
       (vector-set! n_array 4 (/ (* length 26.33) 100))    ;; x2
       (vector-set! n_array 5 (/ (* height 74) 100))       ;; y2
       (vector-set! n_array 6 (/ (* length 39) 100))       ;; etc...
       (vector-set! n_array 7 (/ (* height 84.33) 100))
       (vector-set! n_array 8 (/ (* length 48.33) 100))
       (vector-set! n_array 9 (/ (* height 86.66) 100))
        (vector-set! n_array 10 (/ (* length 59.16) 100))
       (vector-set! n_array 11 (/ (* height 82.66) 100))
       (vector-set! n_array 12 (/ (* length 71.5) 100))
       (vector-set! n_array 13 (/ (* height 72.66) 100))
       (vector-set! n_array 14 (/ (* length 89.83) 100))
       (vector-set! n_array 15 (/ (* height 85.33) 100))
       (vector-set! n_array 16 length)
       (vector-set! n_array 17 (/ (* height 89.33) 100))
      (vector-set! n_array 18 length)
       (vector-set! n_array 19 height)
      (vector-set! n_array 20 0)
       (vector-set! n_array 21 height)
      (vector-set! n_array 22 0)
       (vector-set! n_array 23 (/ (* height 90.66) 100))
    n_array)
)
in Frame it
(define (gen_bottom_array xsize ysize owidth oheight width height)
  (let* ((n_array (cons-array 10 'double)))
    (aset n_array 0 0 )
    (aset n_array 1 height)
    (aset n_array 2 xsize)
    (aset n_array 3 (+ ysize oheight))
    (aset n_array 4 (+ xsize owidth))
    (aset n_array 5 (+ ysize oheight))
    (aset n_array 6 width)
    (aset n_array 7 height)
    (aset n_array 8 0 )
    (aset n_array 9 height)
    n_array)
)


In incandescence I changed (define (gen_bottom_array height length) to(define (incand_bottom_array height length)

All tested OK :tyspin I always learn quite a lot on this site

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


Top
 Post subject: Re: How can one script interfere with another?
PostPosted: Tue May 01, 2012 2:26 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
In Script-fu, vectors (arrays) can be created using the 'vector' keyword -- just as lists can be created with the 'list' keyword. Therefore, it is not necessary to 'vector-set!' or 'aset' elements one at a time when creating a vector.

(define (incand_bottom_array height length)
  (vector 0                           ;; x0
          (/ (* height 90.66) 100)    ;; y0
          (/ (* length 7.16) 100)     ;; x1
          (/ (* height 87.33) 100)    ;; y1
          (/ (* length 26.33) 100)    ;; x2
          (/ (* height 74) 100)       ;; y2
          (/ (* length 39) 100)       ;; etc...
          (/ (* height 84.33) 100)
          (/ (* length 48.33) 100)
          (/ (* height 86.66) 100)
          (/ (* length 59.16) 100)
          (/ (* height 82.66) 100)
          (/ (* length 71.5) 100)
          (/ (* height 72.66) 100)
          (/ (* length 89.83) 100)
          (/ (* height 85.33) 100)
          length
          (/ (* height 89.33) 100)
          length
          height
          0
          height
          0
          (/ (* height 90.66) 100) ))


You should also be aware that 'length' is a standard procedure of Scheme/Script-fu and while there is nothing wrong with you reassigning the symbol to have a different local meaning (as in the above), if you ever have to make use of its standard meaning in your local procedure, you will have to rename your variable. It might be better to avoid this potential hazard by using a variable name such as 'width' instead.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: How can one script interfere with another?
PostPosted: Tue May 01, 2012 2:55 am  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I renamed all occurances below in the actual script to 'incand_bottom_array' There was only 1

I don't write scripts using this method but ran across the prblem when testing a script I downloaded so for me it's a bit of a head scrather.

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


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group