It is currently Sun Jul 21, 2024 6:24 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: A question for Saulgoode RESOLVED!
PostPosted: Mon May 30, 2011 6:57 pm  (#1) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I added some new logo scripts here: viewtopic.php?f=9&t=1858

Anyway, the one I have a question about is reflex-logo.scm.

If a user has their foreground color set to anything pastel or lighter in color, the resulting Edge layer ends up flat or blurred. Only when the user has the foreground color set to black or any dark color, does the Edge layer get the shiny displacement/bumped look.

Now, I set "gimp-context-set-default-colors" at the very top of this script, and it did, indeed set the default colors as I intended for it to, but it still mucked up the result of the Edge layer. I'm baffled.

How can I have the script, in a disassociated way, reset the color defaults and not effect the result of the Edge layer? I thought by placing the default procedure at the very top, would perform the same action as me setting them myself, before the script ran. But the results says otherwise.

Can you help?


Attachments:
reflex-logo.scm.zip [1.72 KiB]
Downloaded 93 times

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Last edited by mahvin on Mon May 30, 2011 9:16 pm, edited 1 time in total.
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: A question for Saulgoode
PostPosted: Mon May 30, 2011 7:53 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I'm still lost. I guess I need to see the light of what you're saying. If, at the very top of the script, the very first action is me setting global default colors (this is before the let* layer creation) how can this not work? It doesn't make sense to me.

Yikes, you're comment is gone.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:00 pm  (#3) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
I'm not Saulgooode, but the one thing that I have noticed is that the logo creation script creates the text layer in the let* statement. This happens before the script starts to run and the color will be the foreground color that is active when the script is called.
Two possible solutions:
  • Leave the layer creation in the let* statement and change the text layer color in the body of the script using the gimp-text-layer-set-color procedure.
  • Move the text layer creation statement into the body of the script after you change the foreground color.

edit:
The text layer is created here at the top of the final script:
(define (script-fu-reflex-logo text size font gradient displace merge)

  (let* (
      (image (car (gimp-image-new 256 256 RGB)))
      (bg-layer (car (gimp-layer-new image 256 256 RGBA-IMAGE "Background" 100 NORMAL-MODE)))
      (text-layer (car (gimp-text-fontname image -1 0 0 text 10 TRUE size PIXELS font))))


It's the last line in that snippet. Wish I could highlight it.

_________________
Image


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:19 pm  (#4) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
I changed the last script procedure to this:
(define (script-fu-reflex-logo text size font gradient displace merge)

  (let* (
      (image (car (gimp-image-new 256 256 RGB)))
      (bg-layer (car (gimp-layer-new image 256 256 RGBA-IMAGE "Background" 100 NORMAL-MODE)))
      (text-layer (car (gimp-text-fontname image -1 0 0 text 10 TRUE size PIXELS font))))

   (gimp-image-undo-disable image)

   (gimp-text-layer-set-color text-layer '(0 0 0))
    (gimp-drawable-set-name text-layer "Text")
   (gimp-image-resize image (car (gimp-drawable-width text-layer)) (car (gimp-drawable-height text-layer)) 0 0)       
   (apply-reflex-logo image text-layer gradient displace merge)

   (if (= merge FALSE)
      (begin
         (gimp-edit-fill text-layer WHITE-FILL)
         (gimp-drawable-set-name text-layer "Background")
      )
   )

   (gimp-image-undo-enable image)
   (gimp-display-new image)
  )
)

(script-fu-register "script-fu-reflex-logo"
        "<Image>/File/Create/Logos/Reflex..."
        "Reflex Logo"
        "Expression"
        "Free"
        "2006"
        ""
        SF-STRING      "Text"               "Reflex"
        SF-ADJUSTMENT  "Font size (pixels)" '(200 2 1000 1 10 0 1)
        SF-FONT        "Font"               "Cooper Black,"
        SF-GRADIENT    "Gradient"           "Horizon 2"
        SF-ADJUSTMENT  "Shift Amount"           '(10 1 20 1 10 0 0)
        SF-TOGGLE      "Save To A Layer"        FALSE
)



I set my foreground color to a very pale yellow and ran the File/Create/Logos/Reflex...
Attachment:
reflex.jpg
reflex.jpg [ 33.63 KiB | Viewed 2874 times ]

p.s. Changing the color in the "apply-reflex-logo" script at the start of the file is a little more complicated because the text layer has already been copied into a new layer, again called 'text-layer' so you'd have to change both layers.

_________________
Image


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:34 pm  (#5) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Thank you. It works beautifully. No need to open a dummy image nor worry about the fg color.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:42 pm  (#6) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I used the "gimp-context-set-foreground" procedure in this very place and it didn't work. Now I am curious as to why it didn't work. Shouldn't it have?

I will repost a new scm file for this on the other thread.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:46 pm  (#7) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
mahvin wrote:
I used the "gimp-context-set-foreground" procedure in this very place and it didn't work. Now I am curious as to why it didn't work. Shouldn't it have?

No, it shouldn't have worked. The text layer had already been created at that point, using the then current foreground color.
Once the layer is created, the only way I have found to change the text color is with the "gimp-text-layer-set-color" procedure.

edit:
To be more specific, the let* statement creates all the variables listed as it's arguments before the script body starts executing.

_________________
Image


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 8:59 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Ahhhh, I didn't know that. I always thought it was line by line. Interesting.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: A question for Saulgoode
PostPosted: Mon May 30, 2011 9:15 pm  (#9) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
BTW, THANK YOU BKH1914! Sorry I forgot to mention this earlier. :)

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: A question for Saulgoode RESOLVED!
PostPosted: Mon May 30, 2011 10:15 pm  (#10) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
You're welcome. :bow

_________________
Image


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Saulgoode...

15

No new posts PhotoComix and SaulGoode

13

No new posts Gimp Art Question

5

No new posts Stupid Question

9

No new posts GIMP Question

3



* Login  



Powered by phpBB3 © phpBB Group