Integrate G'mic as a menu in Gimp ?

Thanks a lot to both of you,

I was trying to figure this out by myself and was stuck in my script-fu attempt since few days but your python script helped me to find out what was wrong on mine, thank you very much.

The python one works nicely, thanks a lot for this ( and i will have to check the gimpscripter link, might serve in the future too :slight_smile: )

Here is my script-fu version :

;; Gmic_In_Main_Menu.scm
;; Simple script to integrate a shortcut calling G'mic-QT on the main menu of Gimp.
;; Seems like it needs to be clicked twice to be triggered tho.
;; Based on the example found here : https://github.com/dtschump/gmic/blob/master/src/gmic_in_script.scm
;; By Yalba @ pixls.us forum - December 2018.

(define   (Gmic_In_Main_Menu image drawable)

  ;; Start undo group.
  (gimp-image-undo-group-start image)

  (let* (
         (copy-layer (car (gimp-layer-copy drawable TRUE)))
         )

    (plug-in-gmic-qt 0 image drawable 1 2 "")

    )

  ;; Flush display.
  (gimp-displays-flush)

  ;; End undo group.
  (gimp-image-undo-group-end image)
  )

  ;;Registering
(script-fu-register "Gmic_In_Main_Menu"
                    _"<Image>/G'MIC-QT..."
                    "Shortcut to call G'MIC from Gimp main menu...  
     ! Might need to be clicked twice to trigger it... ! "
                    "Yalba @ Pixls.us Forum"
                    "Yalba @ Pixls.us Forum"
                    "December 2018"
                    "*"
                    SF-IMAGE    "Image"     0
                    SF-DRAWABLE "Drawable"  0
                    )

Seems like it does the job, this said placed like this directly on the main menu it needs to be clicked twice to be triggered, if placed on a submenu like in your python script it works directly, not sure why, same thing happens if i modify the python script :

"<Image>/G'MIC/G'MIC QT...",

by
"<Image>/G'MIC QT...",
Modified like this it will need 2 clicks to launch Gmic. :thinking:

Anyways it’s good enough like this for both the python or script-fu, result :

Now that i figured out this i might create in the future a few more script-fu scripts executing directly some of the gmic commands i use the most :stuck_out_tongue:

Script to put in AppData\Roaming\GIMP\2.10\scripts\ ( for windows that is )
Gmic_In_Main_Menu.scm (1.2 KB)

Thank you very much for the help :slight_smile: