Gimp-Forum.net
Don't work procedures plug-in-displace, plug-in-bump-map - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Don't work procedures plug-in-displace, plug-in-bump-map (/Thread-Don-t-work-procedures-plug-in-displace-plug-in-bump-map)



Don't work procedures plug-in-displace, plug-in-bump-map - EvgCoder - 05-17-2020

Hello! I need your help!!!
I write little script for Gimp version 2.10.14, this script will an animation. It use some procedures so plug-in-displace, plug-in-bump-map but they don't work, i don't know why? I changed their signature, changed value in every param but without good result. Sad I want to get a result how i show in my attach file on picture
It code:
Code:
(define (script-fu-animtest
                           image
                           drawable
                           blur-radius
                           waviness)
 
 (let* (
         (orig-join-layer nil)
         (copy-join-layer nil)
         (displace-join-layer nil)
         (result-layer nil)
         (width (car (gimp-image-width image)))
         (height (car (gimp-image-height image)))
         (total-frames 1)
         (group nil)
         (name-group "Animation")
         (noise-layer nil)
         (xsize 12.1)
         (ysize 0.6)
       )

   (gimp-image-undo-group-start image)
   (set! orig-join-layer (car (gimp-image-flatten image)))
   (set! noise-layer (car (gimp-layer-copy orig-join-layer 1)))
   (set! copy-join-layer (car (gimp-layer-copy orig-join-layer 1)))
   (gimp-image-resize image (* width 1.2) (* height 1.2) (/ width 10) (/ height 10))
   (set! group (car (gimp-layer-group-new image)))
   (gimp-item-set-name group name-group)
   (gimp-image-insert-layer image group 0 0)
   (gimp-image-insert-layer image copy-join-layer group 0)
   (gimp-image-insert-layer image noise-layer group 0)
   (plug-in-solid-noise RUN-NONINTERACTIVE image noise-layer TRUE FALSE (realtime) 1 xsize ysize)
   (plug-in-gauss-rle 1 image noise-layer blur-radius 1 1)
   (gimp-drawable-brightness-contrast noise-layer 0 .5)
   (gimp-layer-resize-to-image-size copy-join-layer)
   (gimp-layer-resize-to-image-size noise-layer)
   (gimp-drawable-offset copy-join-layer FALSE OFFSET-TRANSPARENT (/ width 10) (/ height 10))
   (gimp-drawable-offset noise-layer FALSE OFFSET-TRANSPARENT (/ width 10) (/ height 10))

; while - here will animation - create frames

   ; (gimp-image-select-rectangle image CHANNEL-OP-REPLACE 0 0 (car (gimp-image-width image)) (car (gimp-image-height image)))
   (set! result-layer (car (gimp-layer-new-from-drawable copy-join-layer image)))
   (gimp-image-insert-layer image result-layer group 0)
   (plug-in-bump-map RUN-NONINTERACTIVE image result-layer
                     noise-layer
                     135
                     45
                     5
                     0 0 0 0
                     TRUE
                     FALSE
                     2)
   (plug-in-displace RUN-NONINTERACTIVE image
                           result-layer
                           123
                           -123
                           .6
                           .6
                           noise-layer
                           noise-layer
                           1)
   (gimp-image-remove-layer image orig-join-layer)
   (gimp-image-undo-group-end image)
   (gimp-displays-flush)

 )
)

(script-fu-register "script-fu-animtest"
                   "Animation Test"
                   "Animation Test"
                   "Author"
                   "Author"
                   "2020"
                   "RGB*, GRAY*"
                   SF-IMAGE    "Image"         0
                   SF-DRAWABLE "Layer to blur" 0
                   SF-VALUE    "Blur strength" "52"
                   SF-ADJUSTMENT "Waviness" '( -40 -500 500 1 1 0 1 ))

(script-fu-menu-register "script-fu-animtest"
                        "<Image>/Script-Fu/Tutorials")



RE: Don't work procedures plug-in-displace, plug-in-bump-map - EvgCoder - 05-17-2020

I understanded - it bug in current version program Gimp. Last update program don't have this problem. These two procedures work norm


RE: Don't work procedures plug-in-displace, plug-in-bump-map - Ofnuts - 05-17-2020

(05-17-2020, 06:29 PM)EvgCoder Wrote: I understanded - it bug in current version program Gimp. Last update program don't have this problem. These two procedures work norm

Not necessarily. But "don't work" is not very helpful. Any error messages?

Your filter above runs without error on my 2.10.14 (Linux):

[attachment=4399]



RE: Don't work procedures plug-in-displace, plug-in-bump-map - EvgCoder - 05-18-2020

(05-17-2020, 07:10 PM)Ofnuts Wrote:
(05-17-2020, 06:29 PM)EvgCoder Wrote: I understanded - it bug in current version program Gimp. Last update program don't have this problem. These two procedures work norm

Not necessarily. But "don't work" is not very helpful. Any error messages?

Your filter above runs without error on my 2.10.14 (Linux):

Hello) 
Sorry, i don't added in description about type my operation system, i have Windows 10. There don't work but any errors don't write, simple don't work.


RE: Don't work procedures plug-in-displace, plug-in-bump-map - Ofnuts - 05-18-2020

Seen https://www.gimp-forum.net/Thread-Debugging-python-fu-scripts-in-Windows ?