-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualgimp.py
executable file
·72 lines (54 loc) · 1.52 KB
/
visualgimp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import path as pypath
from os import path
from inspect import getfile, currentframe
from gimpfu import *
from gimp import get_progname
#prog = path.basename(__file__) + path.sep + __file__ #gimp.get_progname()
#dir = path.split(prog)[0]
dir = path.dirname(path.abspath(getfile(currentframe())))
pypath.append(dir + path.sep + 'VisualGimp')
from VisualGimp import VisualGimp
# Method #1
# __import__('os').chdir('/home/DuangSUSE/Projects/VisualGimp/')
# from sys import path
# path.append('.')
# execfile('plugin.py')
# Method #2
# Copy visualgimp.py and VisualGimp to:
# GIMP 2.10: ~/.config/GIMP/2.10/plug-ins/
# GIMP 2.8: ~/.gimp-2.8/plug-ins/
def python_visualgimp(asy = False):
#VisualGimp.up()
v = VisualGimp(gimp)
v.check_layers()
v.main()
if asy:
v.gui.app_start()
else: # main script thread
v.gui.show()
v.gui.ui.mainloop()
# Python plugin registration
plug_name = "python_fu_visualgimp"
plug_desc = "Make pointer-based algorithm visualization with GIMP"
plug_desc_short = plug_desc
plug_auth = "duangsuse"
plug_year = '2019'
plug_copy = "Copyright (c) {} duangsuse, Licenced under the MIT License".format(plug_year)
plug_params = []#[(PF_BOOL, "async", "Run in async mode", False)]
plug_results = []
register(
plug_name,
plug_desc_short,
plug_desc,
plug_auth,
plug_copy,
plug_year,
"Run VisualGIMP",
"*",
plug_params,
plug_results,
python_visualgimp, menu='<Image>/Filters/Languages/Python-Fu')
#if '.' not in pypath:
main()