Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script does not appears in Gimp3 filters
#1
Hi,

On macOS, this minimalist Python script for Gimp3 doesn't appear in Gimp3 Filters

I placed this script in Plugins and then made it executable.

Why?

Code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp
from gi.repository import GLib
import sys

def N_(message): return message
def _(message): return GLib.dgettext(None, message)

class MinimalTest (Gimp.PlugIn):
   def do_query_procedures(self):
       return [ "plug-in-minimal-test" ]

   def do_create_procedure(self, name):
       procedure = Gimp.ImageProcedure.new(self, name,
                                           Gimp.PDBProcType.PLUGIN,
                                           self.run, None)
       procedure.set_image_types("*")
       procedure.set_menu_label(_("Minimal Python 3 Test"))
       procedure.add_menu_path('<Image>/Filters/Development/My Minimal Tests/')
       procedure.set_documentation(_("A very minimal test for Python 3 plugins."),
                                   _("A very minimal test for Python 3 plugins."),
                                   name)
       procedure.set_attribution("Your Name", "Your Name", "2025")
       return procedure

   def run(self, procedure, run_mode, image, drawables, config, run_data):
       Gimp.message("Minimal Python 3 Test Loaded Successfully!")
       return procedure.new_return_values(Gimp.PDBStatusType.SUCCESS, GLib.Error())

Gimp.main(MinimalTest.get_type(), sys.argv)
Reply
#2
Zydelum: Hi! It's because of a bug in the code. Replace


Code:
Gimp.main(MinimalTest.get_type(), sys.argv)

with

Code:
Gimp.main(MinimalTest.__gtype__, sys.argv)

And it should work.
Reply
#3
(Yesterday, 01:56 AM)CmykStudent Wrote: Zydelum: Hi! It's because of a bug in the code. Replace


Code:
Gimp.main(MinimalTest.get_type(), sys.argv)

with

Code:
Gimp.main(MinimalTest.__gtype__, sys.argv)

And it should work.

thanks !
problem solved because also i have forgotten to place file.py in sub-folder with the same files's name
Reply


Forum Jump: