创建 GIMP 界面插件 [英] Creating GIMP interface plugins

查看:65
本文介绍了创建 GIMP 界面插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上我正在寻找一种用 Python 编写 GIMP 插件的方法,该插件将创建一些额外的用户界面元素,并允许我在 GIMP 的基础上添加一些功能.

So basically I'm looking for a way to write a GIMP plugin in Python that would create some additional user interface elements and allow me to add some functionality on top of what the GIMP has.

问题是:

  • 这甚至可能吗?

  • Is this even possible?

如果是,那么最好在哪里寻找指南?(或者也许我会推荐阅读哪些源文件,或者也许有人可以指出我可以使用的一个很好的示例插件)

If yes then where is it best to look for a guide? (or perhaps which source files would I be recomended to read upon, or maybe somebody could point me to a good example plugin I could get use of)

为了让您更好地了解我需要的是我想要创建一个自定义的类似工具的插件,一个路径编辑器,它将能够在编辑视口中显示它们并在其他窗口中列出.我欢迎任何有关该主题的提示.

To let you get a better glimpse of what I need is I want create a custom tool-like plugin, a path editor, that would be able to display them in the editing viewport and list in and additional window. I welcome even any tips on the topic.

推荐答案

所以 -可以用 Python、C、Scheme 和其他一些支持不同级别的语言为 GIMP 创建插件,因为没有人维护它们的绑定.

So - It is possible to create plug-ins for GIMP in Python, C, Scheme and some other languages with varying levels of support, as no one maintains the binds for them.

然而,这些插件仅与 GIMP 交互,仅通过 GIMP 的wire"协议交换数据并向 GIMP 发出命令——GIMP 插件不可能在 Python 或其他方式中创建额外的 UIGIMP 中的元素,而是它们在自己的窗口上自己创建的内容.

However, these plug-ins interact with GIMP only exchanging data and issuing commands to GIMP through a GIMP-only "wire" protocol - it is not possible for a GIMP plug-in, in Python or otherwise, to create additional UI elements in GIMP but what they create by themselves on their own windows.

此外,无法从插件本身的 GIMP 用户界面接收事件.直到今天,需要用户在图像上输入的插件的解决方法是在插件窗口上绘制图像预览(GIMP 2.8 附带的某些插件会这样做) - 或者,例如,要求用户创建一个特定的路径,使用路径节点作为可以从插件中检索的标记.

Also, it is not possible to receive events from GIMP's UI on the plug-in itself. Up to today, the workaround for plug-ins that need user input on the image itself is to draw an image preview on the plug-in window (which some plug-ins that ship with GIMP 2.8 do) - or, for example, to ask the user to create an specific Path, using the path nodes as markers that can be retrieved from the plug-in.

由于此限制,无法创建自定义工具或路径编辑器.但是,您可以在 GIMP 的主代码本身中执行这些操作,并为项目提出补丁 - 但是,您必须使用 C + gobject.

Due to this constraints, it is not possible to create a custom tool or path editor. You can however do these things in GIMP's main code itself and propose a patch to the project - but them, you have to use C + gobject.

这篇关于创建 GIMP 界面插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆