(define (script-fu-ignatov-icon1 bubbleiconSize gradient iconcolor) (let* ( (tenth (/ bubbleiconSize 10) ) (imgSize (+ bubbleiconSize (* tenth 2)) ) (theImage (car (gimp-image-new imgSize imgSize RGB) )) (layerkaima (car (gimp-layer-new theImage imgSize imgSize 0 "kaima" 100 NORMAL) ) ) (layerobvodka (car (gimp-layer-new theImage imgSize imgSize 0 "obvodka" 100 NORMAL) ) ) (layercenter (car (gimp-layer-new theImage imgSize imgSize 0 "center" 100 NORMAL) ) ) (layerokowki (car (gimp-layer-new theImage imgSize imgSize 0 "okowki" 100 OVERLAY) ) ) (layercentersmall (car (gimp-layer-new theImage imgSize imgSize 0 "center small" 100 NORMAL) ) ) (layershadow (car (gimp-layer-new theImage imgSize imgSize 0 "shadow" 100 NORMAL) ) ) ) ;Создание и чистка необходимых слоёв (gimp-context-push) (gimp-image-undo-disable theImage) (gimp-layer-add-alpha layerkaima ) (gimp-layer-add-alpha layerobvodka ) (gimp-layer-add-alpha layercenter ) (gimp-layer-add-alpha layershadow ) (gimp-layer-add-alpha layercentersmall ) (gimp-layer-add-alpha layerokowki) (gimp-image-add-layer theImage layerkaima 0) (gimp-image-add-layer theImage layerobvodka 0) (gimp-image-add-layer theImage layercenter 0) (gimp-image-add-layer theImage layershadow 0) (gimp-image-add-layer theImage layercentersmall 0) (gimp-image-add-layer theImage layerokowki 0) (gimp-selection-all theImage) (gimp-edit-clear layercentersmall) (gimp-edit-clear layerkaima) (gimp-edit-clear layerobvodka) (gimp-edit-clear layercenter) (gimp-edit-clear layerokowki) (gimp-edit-clear layershadow) (gimp-selection-none theImage) ;Рисование заготовки на двух слоях,заливка градиентом (gimp-ellipse-select theImage tenth tenth bubbleiconSize bubbleiconSize 2 1 1 2 ) (gimp-context-set-gradient gradient) (gimp-edit-blend layerkaima CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( - (/ imgSize 2) bubbleiconSize) ( / imgSize 2) ; x1 y1 ( + ( / imgSize 2) bubbleiconSize ) ; x2 ( / imgSize 2) ; y2 ) (gimp-selection-shrink theImage ( / tenth 10)) (gimp-edit-blend layerobvodka CUSTOM-MODE NORMAL-MODE GRADIENT-LINEAR ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( / imgSize 2) ( - ( / imgSize 2) bubbleiconSize) ; x1 y1 ( / imgSize 2) ; x2 ( + ( / imgSize 2) bubbleiconSize) ; y2 ) (gimp-selection-none theImage) ;выделение центральной части и вырезание из предыдущих слоёв (gimp-ellipse-select theImage ( + tenth ( / tenth 2 )) ( + tenth ( / tenth 2 )) ( - bubbleiconSize ( / tenth 1 )) ( - bubbleiconSize ( / tenth 1)) 2 1 0 0 ) (gimp-edit-clear layerkaima) (gimp-edit-clear layerobvodka) ; выбор цвета и заливка (gimp-context-set-foreground iconcolor) (gimp-edit-fill layercenter 0) ; создание нижнего блика (gimp-context-set-foreground "white") (gimp-context-set-gradient "Основной в прозрачный") (gimp-edit-blend layercenter CUSTOM-MODE NORMAL-MODE GRADIENT-RADIAL ; gradient type 100 ; opacity 0 ; offset REPEAT-NONE ; repeat FALSE ; reverse FALSE ; supersampling 0 0 ; FALSE ; dithering ( / imgSize 2) ( + ( / imgSize 2) ( / bubbleiconSize 2) ) ; x1 y1 ( / imgSize 2) ; x2 ( + ( / imgSize 2) ( / bubbleiconSize 8) ) ; y2 ) ; добавление тени (gimp-selection-none theImage) (gimp-ellipse-select theImage tenth tenth bubbleiconSize bubbleiconSize 2 1 1 20) (gimp-selection-invert theImage) (gimp-context-set-foreground "black") (gimp-edit-fill layerkaima 0) (gimp-selection-none theImage) (gimp-ellipse-select theImage tenth tenth bubbleiconSize bubbleiconSize 2 1 1 20) (gimp-selection-grow theImage ( / tenth 10)) (gimp-selection-invert theImage) (gimp-edit-clear layerkaima) (gimp-selection-none theImage) (gimp-ellipse-select theImage ( + tenth ( / tenth 2 )) ( + tenth ( / tenth 2 )) ( - bubbleiconSize ( / tenth 1 )) ( - bubbleiconSize ( / tenth 1)) 2 1 1 25 ) (gimp-selection-invert theImage) (gimp-context-set-foreground "black") (gimp-edit-fill layershadow 0) (gimp-selection-none theImage) (gimp-ellipse-select theImage ( + tenth ( / tenth 2 )) ( + tenth ( / tenth 2 )) ( - bubbleiconSize ( / tenth 1 )) ( - bubbleiconSize ( / tenth 1)) 2 1 1 25 ) (gimp-selection-grow theImage ( / tenth 10)) (gimp-selection-invert theImage) (gimp-edit-clear layershadow) (gimp-selection-none theImage) (gimp-ellipse-select theImage ( + tenth ( / tenth 1 )) ( + tenth ( / tenth 1 )) ( - bubbleiconSize ( / tenth 0.5 )) ( - bubbleiconSize ( / tenth 0.5)) 2 1 0 0 ) (gimp-context-set-foreground "white") (gimp-edit-fill layercentersmall 0) (gimp-layer-set-opacity layercentersmall 8) (gimp-selection-none theImage) (gimp-rect-select theImage tenth tenth ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 3.5) tenth ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 6.5) tenth ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 9) tenth ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage tenth ( * 4.5 tenth) ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 3.5) ( * 4.5 tenth) ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 6.5) ( * 4.5 tenth) ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-rect-select theImage (* tenth 9) ( * 4.5 tenth) ( * tenth 2) ( * tenth 3) 0 FALSE 0) (gimp-edit-fill layerokowki 0) (gimp-selection-none theImage) (plug-in-map-object RUN-NONINTERACTIVE theImage layerokowki ; mapping 1 ; viewpoint 0.5 0.5 2.0 ; object pos 0.5 0.5 0.635 ; first axis 1.0 0.0 0.0 ; 2nd axis 0.0 90 0.0 ; axis rotation 0.0 0.0 0.0 ; light (type, color) 0 '(255 255 255) ; light position -0.5 -0.5 2.0 ; light direction -1.0 -1.0 1.0 ; material (amb, diff, refl, spec, high) 0.3 1.0 0.5 0.0 27.0 ; antialias FALSE ; tile FALSE ; new image FALSE ; transparency 180 ; radius 0.25 ; unused parameters 1.0 1.0 1.0 1.0 -1 -1 -1 -1 -1 -1 -1 -1) (gimp-layer-set-opacity layerokowki 20) (gimp-selection-none theImage) (gimp-image-clean-all theImage) (gimp-image-undo-enable theImage) (gimp-display-new theImage) (gimp-context-pop) ) ) (script-fu-register "script-fu-ignatov-icon1" _"Кнопка с отражением..." "Создаёт кнопку с отражением" "ПРИВЕТ" "www.linformatika.ru" "Июнь 2010" "" SF-ADJUSTMENT "Размер кнопки (точек)" '(400 40 2000 1 10 0 1) SF-GRADIENT "Обводка кнопки" "Brushed Aluminium" SF-COLOR "Цвет кнопки" '(102 102 255) ) (script-fu-menu-register "script-fu-ignatov-icon1" _"/File/New/linformatika/Кнопки")