plug-ins/script-fu/scripts/Makefile.am removed Sphere script. It's a nice
2008-04-09 Sven Neumann <sven@gimp.org> * plug-ins/script-fu/scripts/Makefile.am * plug-ins/script-fu/scripts/sphere.scm: removed Sphere script. It's a nice simple example but it has no real value. * plug-ins/script-fu/script-fu.c (script_fu_extension_init): removed "<Toolbox>/Xtns/Misc". svn path=/trunk/; revision=25424
This commit is contained in:

committed by
Sven Neumann

parent
e6b09b6141
commit
dc11be31bb
@ -1,3 +1,12 @@
|
|||||||
|
2008-04-09 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/script-fu/scripts/Makefile.am
|
||||||
|
* plug-ins/script-fu/scripts/sphere.scm: removed Sphere
|
||||||
|
script. It's a nice simple example but it has no real value.
|
||||||
|
|
||||||
|
* plug-ins/script-fu/script-fu.c (script_fu_extension_init):
|
||||||
|
removed "<Toolbox>/Xtns/Misc".
|
||||||
|
|
||||||
2008-04-09 Sven Neumann <sven@gimp.org>
|
2008-04-09 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/script-fu/script-fu-scripts.c (script_fu_add_script):
|
* plug-ins/script-fu/script-fu-scripts.c (script_fu_add_script):
|
||||||
|
@ -660,8 +660,7 @@ void
|
|||||||
script_fu_error_msg (const gchar *command,
|
script_fu_error_msg (const gchar *command,
|
||||||
const gchar *msg)
|
const gchar *msg)
|
||||||
{
|
{
|
||||||
g_message (_("Error while executing\n%s\n\n%s"),
|
g_message (_("Error while executing\n%s\n\n%s"), command, msg);
|
||||||
command, msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -307,8 +307,6 @@ script_fu_extension_init (void)
|
|||||||
N_("_Buttons"));
|
N_("_Buttons"));
|
||||||
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
||||||
N_("_Logos"));
|
N_("_Logos"));
|
||||||
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
|
||||||
N_("_Misc"));
|
|
||||||
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
|
||||||
N_("_Patterns"));
|
N_("_Patterns"));
|
||||||
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages/Script-Fu",
|
gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages/Script-Fu",
|
||||||
|
@ -88,7 +88,6 @@ scripts = \
|
|||||||
slide.scm \
|
slide.scm \
|
||||||
sota-chrome-logo.scm \
|
sota-chrome-logo.scm \
|
||||||
speed-text.scm \
|
speed-text.scm \
|
||||||
sphere.scm \
|
|
||||||
spinning-globe.scm \
|
spinning-globe.scm \
|
||||||
spyrogimp.scm \
|
spyrogimp.scm \
|
||||||
starburst-logo.scm \
|
starburst-logo.scm \
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
; Create a 3D sphere with optional shadow
|
|
||||||
; The sphere's principle color will be the foreground
|
|
||||||
; Parameters:
|
|
||||||
; bg-color: background color
|
|
||||||
; sphere-color: color of sphere
|
|
||||||
; radius: radius of the sphere in pixels
|
|
||||||
; light: angle of light source in degrees
|
|
||||||
; shadow: whather to create a shadow as well
|
|
||||||
|
|
||||||
(define (script-fu-sphere radius
|
|
||||||
light
|
|
||||||
shadow
|
|
||||||
bg-color
|
|
||||||
sphere-color)
|
|
||||||
(let* (
|
|
||||||
(width (* radius 3.75))
|
|
||||||
(height (* radius 2.5))
|
|
||||||
(img (car (gimp-image-new width height RGB)))
|
|
||||||
(drawable (car (gimp-layer-new img width height RGB-IMAGE
|
|
||||||
"Sphere Layer" 100 NORMAL-MODE)))
|
|
||||||
(radians (/ (* light *pi*) 180))
|
|
||||||
(cx (/ width 2))
|
|
||||||
(cy (/ height 2))
|
|
||||||
(light-x (+ cx (* radius (* 0.6 (cos radians)))))
|
|
||||||
(light-y (- cy (* radius (* 0.6 (sin radians)))))
|
|
||||||
(light-end-x (+ cx (* radius (cos (+ *pi* radians)))))
|
|
||||||
(light-end-y (- cy (* radius (sin (+ *pi* radians)))))
|
|
||||||
(offset (* radius 0.1))
|
|
||||||
)
|
|
||||||
|
|
||||||
(gimp-context-push)
|
|
||||||
|
|
||||||
(gimp-image-undo-disable img)
|
|
||||||
(gimp-image-add-layer img drawable 0)
|
|
||||||
(gimp-context-set-foreground sphere-color)
|
|
||||||
(gimp-context-set-background bg-color)
|
|
||||||
(gimp-edit-fill drawable BACKGROUND-FILL)
|
|
||||||
(gimp-context-set-background '(20 20 20))
|
|
||||||
(if (and
|
|
||||||
(or (and (>= light 45) (<= light 75))
|
|
||||||
(and (<= light 135) (>= light 105)))
|
|
||||||
(= shadow TRUE))
|
|
||||||
(let ((shadow-w (* (* radius 2.5) (cos (+ *pi* radians))))
|
|
||||||
(shadow-h (* radius 0.5))
|
|
||||||
(shadow-x cx)
|
|
||||||
(shadow-y (+ cy (* radius 0.65))))
|
|
||||||
(if (< shadow-w 0)
|
|
||||||
(begin (set! shadow-x (+ cx shadow-w))
|
|
||||||
(set! shadow-w (- shadow-w))))
|
|
||||||
|
|
||||||
(gimp-ellipse-select img shadow-x shadow-y shadow-w shadow-h
|
|
||||||
CHANNEL-OP-REPLACE TRUE TRUE 7.5)
|
|
||||||
(gimp-edit-bucket-fill drawable BG-BUCKET-FILL MULTIPLY-MODE 100 0 FALSE 0 0)))
|
|
||||||
|
|
||||||
(gimp-ellipse-select img (- cx radius) (- cy radius)
|
|
||||||
(* 2 radius) (* 2 radius) CHANNEL-OP-REPLACE TRUE FALSE 0)
|
|
||||||
|
|
||||||
(gimp-edit-blend drawable FG-BG-RGB-MODE NORMAL-MODE
|
|
||||||
GRADIENT-RADIAL 100 offset REPEAT-NONE FALSE
|
|
||||||
FALSE 0 0 TRUE
|
|
||||||
light-x light-y light-end-x light-end-y)
|
|
||||||
|
|
||||||
(gimp-selection-none img)
|
|
||||||
(gimp-image-undo-enable img)
|
|
||||||
(gimp-display-new img)
|
|
||||||
|
|
||||||
(gimp-context-pop)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(script-fu-register "script-fu-sphere"
|
|
||||||
_"_Sphere..."
|
|
||||||
_"Create a simple sphere with a drop shadow"
|
|
||||||
"Spencer Kimball"
|
|
||||||
"Spencer Kimball"
|
|
||||||
"1996"
|
|
||||||
""
|
|
||||||
SF-ADJUSTMENT _"Radius (pixels)" '(100 5 500 1 10 0 1)
|
|
||||||
SF-ADJUSTMENT _"Lighting (degrees)" '(45 0 360 1 10 0 0)
|
|
||||||
SF-TOGGLE _"Shadow" TRUE
|
|
||||||
SF-COLOR _"Background color" "white"
|
|
||||||
SF-COLOR _"Sphere color" "red"
|
|
||||||
)
|
|
||||||
|
|
||||||
(script-fu-menu-register "script-fu-sphere"
|
|
||||||
"<Toolbox>/Xtns/Misc")
|
|
@ -1,3 +1,7 @@
|
|||||||
|
2008-04-09 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* POTFILES.in: updated.
|
||||||
|
|
||||||
2008-04-08 Sven Neumann <sven@gimp.org>
|
2008-04-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* POTFILES.skip: updated.
|
* POTFILES.skip: updated.
|
||||||
|
@ -88,7 +88,6 @@ plug-ins/script-fu/scripts/selection-round.scm
|
|||||||
plug-ins/script-fu/scripts/slide.scm
|
plug-ins/script-fu/scripts/slide.scm
|
||||||
plug-ins/script-fu/scripts/sota-chrome-logo.scm
|
plug-ins/script-fu/scripts/sota-chrome-logo.scm
|
||||||
plug-ins/script-fu/scripts/speed-text.scm
|
plug-ins/script-fu/scripts/speed-text.scm
|
||||||
plug-ins/script-fu/scripts/sphere.scm
|
|
||||||
plug-ins/script-fu/scripts/spinning-globe.scm
|
plug-ins/script-fu/scripts/spinning-globe.scm
|
||||||
plug-ins/script-fu/scripts/spyrogimp.scm
|
plug-ins/script-fu/scripts/spyrogimp.scm
|
||||||
plug-ins/script-fu/scripts/starburst-logo.scm
|
plug-ins/script-fu/scripts/starburst-logo.scm
|
||||||
|
Reference in New Issue
Block a user