Yesterday, 01:01 AM
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?
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)