(define (script-fu-bubble bubbleSize gradient gauss) (let* ( (tenth (/ bubbleSize 10) ) (imgSize (+ bubbleSize (* tenth 2)) ) (theImage (car (gimp-image-new imgSize imgSize RGB) )) (layerbase (car (gimp-layer-new theImage imgSize imgSize 0 "bubble base" 100 NORMAL) ) ) (layerbasesmall (car (gimp-layer-new theImage imgSize imgSize 0 "bubble center" 100 NORMAL) ) ) (layerblik (car (gimp-layer-new theImage imgSize imgSize 0 "bubble blik" 100 NORMAL) ) ) (layersvet (car (gimp-layer-new theImage imgSize imgSize 0 "bubble light" 100 NORMAL) ) ) ) ;Создание и чистка необходимых слоёв (gimp-context-push) (gimp-image-undo-disable theImage) (gimp-layer-add-alpha layerbase ) (gimp-layer-add-alpha layerbasesmall ) (gimp-layer-add-alpha layerblik ) (gimp-layer-add-alpha layersvet ) (gimp-image-add-layer theImage layerbase 0) (gimp-image-add-layer theImage layerbasesmall 0) (gimp-image-add-layer theImage layerblik 0) (gimp-image-add-layer theImage layersvet 0) (gimp-selection-all theImage) (gimp-edit-clear layerbase) (gimp-edit-clear layerbasesmall) (gimp-edit-clear layerblik) (gimp-edit-clear layersvet) (gimp-selection-none theImage) ;Рисование заготовки на двух слоях,заливка градиентом (gimp-ellipse-select theImage tenth tenth bubbleSize bubbleSize 2 1 0 0 ) (gimp-context-set-gradient gradient) (gimp-edit-blend layerbase 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) bubbleSize) ; x1 y1 ( / imgSize 2) ; x2 ( + ( / imgSize 2) bubbleSize) ; y2 ) (gimp-edit-blend layerbasesmall 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) bubbleSize) ; x1 y1 ( / imgSize 2) ; x2 ( + ( / imgSize 2) bubbleSize) ; y2 ) (gimp-selection-none theImage) ;выделение и вырезка меньшей окружности на 2-м слое (gimp-ellipse-select theImage ( + tenth ( / tenth 8 )) ( + tenth ( / tenth 8 )) ( - bubbleSize ( / tenth 4 )) ( - bubbleSize ( / tenth 4)) 2 1 1 25 ) (gimp-edit-clear layerbasesmall) (gimp-layer-set-opacity layerbase 35) ;создание света и заливка (gimp-ellipse-select theImage ( / bubbleSize 4 ) tenth ( - ( / imgSize 1 ) ( / bubbleSize 2 )) ( / bubbleSize 2 ) 2 1 0 0 ) (gimp-context-set-foreground "white") (gimp-context-set-gradient "Основной в прозрачный") (gimp-edit-blend layerblik 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) bubbleSize) 10 ) ; x1 y1 ( / imgSize 2) ; x2 ( / imgSize 2) ; y2 ) (gimp-selection-none theImage) ;создание пятнышка света (gimp-ellipse-select theImage ( - ( / imgSize 2 ) ( * tenth 2 )) ( + tenth tenth ) ( / tenth 2 ) tenth 2 1 0 0 ) (gimp-edit-fill layersvet 2 ) (gimp-selection-none theImage) ;поворот слоя с пятнышком (gimp-drawable-transform-rotate layersvet 1.1 FALSE ( - ( / imgSize 2 ) ( * tenth 1 ) ) ( * 2.5 tenth ) 0 0 TRUE 1 0 ) ;размывание по Гауссу (if ( = gauss FALSE ) (print gauss) (begin (plug-in-gauss TRUE theImage layerbase 5 5 0) (plug-in-gauss TRUE theImage layerbasesmall 5 5 0) (plug-in-gauss TRUE theImage layerblik 5 5 0) (plug-in-gauss TRUE theImage layersvet 5 5 0) ) ) (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-bubble" _"Мыльный пузырик..." "Создаёт мыльный пузырь" "ПРИВЕТ" "www.linformatika.ru" "Май 2010" "" SF-ADJUSTMENT "Размер пузырика (точек)" '(400 40 2000 1 10 0 1) SF-GRADIENT "Заливка пузырика" "Full saturation spectrum CCW" SF-TOGGLE "Размывание по Гауссу" FALSE ) (script-fu-menu-register "script-fu-bubble" _"/File/New/linformatika")