gimpfu

Plugins usually don't work, how do I debug?

扶醉桌前 提交于 2020-01-25 20:56:13
问题 I am trying to write a plugin that will create a bitmap font. However, this is very frustrating to learn... while I am not familiar with python, it is not that hard to pick up and have not had problems with it outside of GIMP. Copied some of the code from: https://github.com/sole/snippets/blob/master/gimp/generate_bitmap_font/sole_generate_bitmap_font.py and from http://gimpbook.com/scripting/ Does work: #!/usr/bin/env python # Hello World in GIMP Python from gimpfu import * def create_font

Where can I select my personal plugins in GIMP?

一世执手 提交于 2019-12-24 14:00:29
问题 I have been trying to run these sample scripts (specially helloworld.py and pytemplate.py ) to get the hang on using python code in GIMP. I'm specially interested in pytemplate.py which is intended to show how to do something over an existing image (hopefully, the current state of the image which has the focus) As far as I know, I have to place them in ~/.gimp-2.8/plug-ins/ (in my GIMP's personal folder) and give them run permissions ( chmod +x somescript.py ). The gimpfu.register() function

How do I output info to the console in a Gimp python script?

孤街醉人 提交于 2019-12-21 09:31:45
问题 I've just started learning about Gimp scripting using Python, and was wondering, how do I output text to the console? I am using version 2.7.5 on Windows 7. I tried the print function, but it does not write anything to the python-fu console or the dev console that launches with Gimp. Is there a function I should use to do this? or is this a problem with the 2.7.5 release? I found a few mentions of "gimp-message" but that seems to be a function used with Scheme (Script-fu) Thanks! (also posted

How do I output info to the console in a Gimp python script?

断了今生、忘了曾经 提交于 2019-12-21 09:30:14
问题 I've just started learning about Gimp scripting using Python, and was wondering, how do I output text to the console? I am using version 2.7.5 on Windows 7. I tried the print function, but it does not write anything to the python-fu console or the dev console that launches with Gimp. Is there a function I should use to do this? or is this a problem with the 2.7.5 release? I found a few mentions of "gimp-message" but that seems to be a function used with Scheme (Script-fu) Thanks! (also posted

Writing gimp plugins in python on windows- how do i debug? where is the output?

↘锁芯ラ 提交于 2019-12-20 09:53:17
问题 EDITED HEAVILY with some new information (and a bounty) I am trying to create a plug in in python for gimp. (on windows) this page http://gimpbook.com/scripting/notes.html suggests running it from the shell, or looking at ~/.xsession-errors neither work. I am able to run it from the cmd shell, as gimp-2.8.exe -c --verbose ## (as suggested by http://gimpchat.com/viewtopic.php?f=9&t=751 ) this causes the output from "pdb.gimp_message(...)" to go to a terminal. BUT !!! this only works when

Installing PyGIMP on Windows

泄露秘密 提交于 2019-12-12 12:04:42
问题 On the web, I can find various example on gimp scripting with python. http://www.jamesh.id.au/software/pygimp/ http://www.gimp.org/docs/python/pygimp.html We need to import the gimpfu module to get the examples to work. Where can we get the installer of PyGIMP on Windows? It seems the project is dead and the links are broken. 回答1: PyGIMP is part of GIMP (GNU Image Manipulation Program) and can only work in together with it. For Linux distributions it is often found in a different package -

Gimp: why can't I register this?

谁说胖子不能爱 提交于 2019-12-11 08:37:16
问题 I'm writing an add-on for Blender to sync it with Gimp and this script should be able to start from within Gimp, but I can't register it... Why? blender_gimp_sync.py: # -*- coding: utf-8 -*- #!/usr/bin/env python from gimpfu import * def blender_gimp_sync(): image_dir = "/home/antoni4040/Έγγραφα/Layout.png" image = gimp.pdb.gimp_file_load(image_dir, image_dir) gimp.Display(image) register( "python_fu_bgsync", "Blender-Gimp Sync", "Syncronize Gimp with Blender for texturing", "Antonis Karvelas

Blender: segmentation, fault core dumped?

故事扮演 提交于 2019-12-11 04:31:19
问题 Here is an add-on I'm trying to create: import bpy import os import sys import subprocess import time from threading import * class Repeat(Thread): def __init__(self,delay,function,*args,**kwargs): Thread.__init__(self) self.abort = Event() self.delay = delay self.args = args self.kwargs = kwargs self.function = function def stop(self): self.abort.set() def run(self): while not self.abort.isSet(): self.function(*self.args,**self.kwargs) self.abort.wait(self.delay) class ExportToGIMP(bpy.types

Gimp: python script not showing in menu

醉酒当歌 提交于 2019-12-10 02:39:14
问题 I followed this tutorial and this is what I have come up so far: #!/usr/bin/python # -*- coding: utf-8 -*- #http://www.ibm.com/developerworks/library/os-autogimp/ from gimpfu import* def plugin_main(timg, tdrawable, maxh=540, maxw=800): currentWidth = tdrawable.width currentHeight = tdrawable.height newWidth = currentWidth newHeight = currentHeight if (maxw < newWidth): newWidth = maxw newHeight = (float(currentHeight) / (float(currentWidth) / newWidth)) if (maxh < newHeight): newHeight =