It is currently Thu Apr 18, 2024 1:32 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Sun Aug 23, 2015 6:47 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
jazzon wrote:
Original post updated with 2.6 version.


Thankyou :coolthup

I suppose the clue was in the error message :oops: :hehe


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Sun Aug 23, 2015 6:55 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Actually it was! I knew about the other command having a 'deprecated' tag, and you showing me the error told me just how new the command I used was! Thanks for the education ;)

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Sun Aug 23, 2015 7:05 am  (#13) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
Compare:
(define (script-fu-hide-all-layers image)
  (let*
    (
      (ct (- (car (gimp-image-get-layers image) ) 1) )
      (lst (cdr (gimp-image-get-layers image) ) )
      (array (car lst))
     )
     
     
  (while (> ct -1)
    (gimp-item-set-visible (aref array ct) 0)
    (set! ct (- ct 1))
  )
  (gimp-displays-flush)
)
)

to
def hide_all_layers(image):
    for layer in image.layers:
        layer.visible=False
    gimp.displays_flush()


But of course, this is fairly academic once you know about shift-click.

_________________
Image


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Sun Aug 23, 2015 7:07 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
LOL PYTHON! My favorite!

I was trying scheme just as a thought. Most of what I do is Python.

Actually, I am playing with one of yours right now...Slinky.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Mon Aug 24, 2015 1:45 am  (#15) 
Offline
GimpChat Member

Joined: Feb 28, 2014
Posts: 138
jazzon wrote:
Wallace: Thanks for the compliment. Actually it served two purposes now I think about it. I learned from it, and it is such a simple script that it can be a starting out point for others as it shows the four most basic things:
Variable assignment,
Looping,
defining a function,
and registering the script with GIMP.
(All right so it doesn't have conditionals...) :lol


Thanks for the template :). I did find the shift-click, but I've been meaning to try my hand at a script. I don't program in python yet, so having something clear as a guide is always nice :).

_________________
Margaret McGaffey Fisk
steampunk, fantasy, science fiction, and romance author
Tales to Tide You Over


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Mon Aug 24, 2015 5:14 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I believe the script "Layer Groups" http://registry.gimp.org/node/16563 (old but still functional), has these functions :) But it is always nice to see new script writers out there. SCM scripting can be very powerful.
My suggestion is to either ask someone here if the script has been written or check gimpscripts.com or the GIMP filter registry at http://.registry.gimp.org because chances are it has been written already. Good luck with Scheme!

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Mon Aug 24, 2015 8:18 am  (#17) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
Rod: Do you happen to know if Layer Groups works 'properly' with GIMP 2.8's new layer groups? I would hate to muck up one with the other.

And to answer your pressing question ... -c (If the perception of light is caused by photons hitting our eyes at a speed of c, then if they were moving away from our eyes at c [relative -c] they would have achieved the speed of dark!)

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Mon Aug 24, 2015 7:38 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Although I could not track down It's origin this may help

Attachment:
all-visible-or-all-invisible.scm [2.04 KiB]
Downloaded 81 times

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


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Tue Aug 25, 2015 5:40 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Quote:
Do you happen to know if Layer Groups works 'properly' with GIMP 2.8's new layer groups? I would hate to muck up one with the other.

It seems to work fine. You just need to define the group FOLDER name in the dialog that pops up.

Off Topic-
Dark is not moving at all. It is always there and the light only hides it from our observation. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Tue Aug 25, 2015 4:13 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4734
Rod wrote:
Dark is not moving at all. It is always there and the light only hides it from our observation. :)


Everyone knows that lightbulbs are just sucking dark. So dark must be moving.

_________________
Image


Top
 Post subject: Re: My Adventures in Scheme (Anyone for a laugh?)
PostPosted: Wed Aug 26, 2015 1:56 am  (#21) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
I think it runs from the light...ever watch it recede from the cars headlights?

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Erisian's MyPaint adventures

8

No new posts Attachment(s) Did something change in scheme in 2-10-20[Solved]

5

No new posts Attachment(s) Falling snow animated Scheme Script for Gimp

121



* Login  



Powered by phpBB3 © phpBB Group