Just posting this to show off something we’ve been up to on our feature film pipeline, trying to get one of the core tools (photoshop) the artists use integrated as tightly as possible - Hopefully we will be releasing this as an open source plugin soon.
The way we have chosen to go about it was providing photoshop with an embedded python interpreter, that can execute python ‘in-process’.
The benefits of this have been exposing parts of the photoshop C api to python which can be used along side the COM scripting api.
The coolest bit has also been providing a menuing api to customise the menus (something Adobe dont seem to ever want to do), and a nice binding system to hook into any of photoshops core events and a few we have exposed ontop (eventMenu and other)
Unfortunatly photoshops events are all raised after the fact. eventClose for one is raised after the document is closed. No use if you want to prompt to save into your asset management system, so for many of these events we have exposed counterparts, eventClosing etc, which give you a chance to act on them or ignore.
Theres lots of other bits, but for now heres some pics of our stuff in action - PyQt4 is used for the guis.
Saving…
Menus…
Closing…
Loading…
…and a snippet of code to show you how easy it is to customise the menus
import MenuTools
def menuHandler(thisBinding,thisEvent,thisMenuItem):
if thisMenuItem.text() != "File": return
thisMenu = thisMenuItem.submenu()
bottomSplitter = MenuTools.MenuItem()
bottomSplitter.setType(MenuTools.SEPARATORMENUITEM)
savePlusItem = MenuTools.MenuItem()
savePlusItem.setType(MenuTools.TEXTMENUITEM)
savePlusItem.setText("Save Plus..")
savePlus = Binding()
savePlus.setExec("savePlus.py")
savePlusItem.addBinding(savePlus)
thisMenu.addItem(bottomSplitter,8)
thisMenu.addItem(savePlusItem,8)
UnregisterBinding(thisBinding)
menuHandlerBinding = Binding()
menuHandlerBinding.setEvent(Binding.eventMenu)
menuHandlerBinding.setExec(menuHandler)