Photoshop Embedded Python Pipeline


#21

Thanks for the update!..still in “WAAAAANT” mode here :stuck_out_tongue:


#22

wow I would make my company pay for that!


#23

any update on this?


#24

Try as I might have not managed to make any headway on this. I’ll be leaving this company in a 8 weeks as the current project is coming to an end, so i fear the likelyhood of them open-sourcing this code is small at best.

I’d of course be happy to do a fresh job from scratch for anyone in the London area with a job going (or via remote desktop) :slight_smile:


#25

Aww, I had a small heart attack of joy when I saw that you had the most recent post in this thread. What are the odds of you selling said scratch job once it’s far enough along? It would definitely be an amazingly-useful tool in our belts :slight_smile:


#26

To be honest it relies to much on tricks and hackery to be something that is sellable if I made it from scratch. It would require in-house support, especially for new versions and much would depends on how great the changes are in photoshop between versions. The one for this place seems to work back to CS3, haven’t tried it further back than that.

I’ll have one last poke before I leave, and see what they say.

Cheers

Rob.


#27

would you be interested in sharing your knowledge for the good of tech-art?

:wink:


#28

Hey everyone, just been lurking on the forum for the last year or so.
Having learned a lot from everyone over here, i’ll post a small snippet that uses PyQt4 and win32 to communicate with Photoshop.

Now, i tested this with PS CS3, Py2.7 with PyQt4 and PyWin32-216 (all x64)

Hope this helps someone out, or maybe someone makes something even more useful with this and posts it as well.

cheers,

Sven

"""
OpenDialog

Shows a standard QFileDialog, and uses the accept method to grab the returned filename and open it in Photoshop using
PyWin32 and the VBScript interface.

@author: Sven Neve
@organization: House of Secrets
@contact: [email protected]__
"""

import sys
from win32com import client
from PyQt4.QtCore import Qt
from PyQt4.QtGui import  QFileDialog, QApplication

class OpenDialog(QFileDialog):
    def __init__(self, parent=None):
        super(OpenDialog, self).__init__(parent)
        self.initUI()

    def initUI(self):
        self.setNameFilter("Images (*.png *.tga *.jpg *.psd *.exr)")
        #make sure the open dialog is always on top
        flags = self.windowFlags()
        self.setWindowFlags(flags | Qt.WindowStaysOnTopHint )
        #show the dialog
        self.show()

    def accept(self):
        """
        see http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop_cs3_vbscript_ref.pdf
        for more information on how to use the vbscript/win32 com to communicate with Photoshop
        """
        psApp = client.Dispatch('Photoshop.Application')
        psApp.Load(self.selectedFiles()[0])
        self.done(0)

def main():
    app = QApplication(sys.argv)
    win = OpenDialog()
    app.exec_()
    
if __name__ == "__main__":
    main()

#29

Thank you, sir! I’ll have to set some time aside to study this :slight_smile:


#30

Steve, isn’t that just opening a Qt window from a regular python process and sending the result to photoshop via COM? That’s sort of not what the original discussion was about (useful sample code I guess but very different).


#31

Yes, the example is just that.

We’ve been looking at various ways to get stuff to work in Adobe software.
Adding custom menus is a no go, as extension plugins are not supported and there is no documentation on doing something like it (Adobe was very clear on this and their support was the usual arrogant douchebaggery we’re so accustomed to by now, it’s probably the only consistent thing about Adobe, but let’s not go there.)
Perforce managed to somehow add their own custom menus, but it probably was done in the usual hackery way Rob described, meaning an update will break your Adobe pipeline integration.

We’ll probably end up hacking it in using panels.


#32

No reason to hack, we did it way back in March because we noticed this thread looked stalled.

Frankly, it was not hard at all. Just a little API work for PS to get a python interpreter cranking.

I will have my lead post the project at BitBucket on Monday.

Hopefully someone else can do a few more passes on it and make it even more solid; it works for our purpose, but I only had a few days for those guys to iterate and get it running before moving onwards.

Thanks for re-popping this thread, otherwise I’d have forgotten.

I setup a placeholder for the project:

and will have it updated on Monday.

Cheers.


#33

[QUOTE=Amorano;13396]No reason to hack, we did it way back in March because we noticed this thread looked stalled.

Frankly, it was not hard at all. Just a little API work for PS to get a python interpreter cranking.

I will have my lead post the project at BitBucket on Monday.

Hopefully someone else can do a few more passes on it and make it even more solid; it works for our purpose, but I only had a few days for those guys to iterate and get it running before moving onwards.

Thanks for re-popping this thread, otherwise I’d have forgotten.

I setup a placeholder for the project:

and will have it updated on Monday.

Cheers.[/QUOTE]

Awesome, once it’s posted we’ll have go at it.

One thing, what is the minimum requirement (CS3, CS4 or CS5?)


#34

posted:

We originally built it for CS4, but recently the studio went to CS5.

However, we noticed the SDK is pretty much the same all the way back to CS(2)

So, it should technically build fine in anything in the last five years.

NOW, the bad news! =p

I did make a release config (for vs2010) just now, because we hardly run any plugins in release, which means, yes, the project setups are obviously not ideal as they are specific to the locations on our server.

Not that we hardcoded any paths, I make my team use relative wherever we can leverage it.

First thing I’d love to have done, or get done, is reorganize the project to build on Mac and Win for 2008/2010/XCode and CS3–>

Just need to sit there for a few hours and make all the pretty configs for it.

Other than that, we tested the debug and release for windows (32 bit) and the 64bit build for OSX, I cleaned a few things and pushed it all up.

By all means, any and all who want to contribute, have at it =)

Merry Holidays.


#35

best christmas ever.


#36

[QUOTE=Amorano;13435]posted:

We originally built it for CS4, but recently the studio went to CS5.

However, we noticed the SDK is pretty much the same all the way back to CS(2)

So, it should technically build fine in anything in the last five years.

NOW, the bad news! =p

I did make a release config (for vs2010) just now, because we hardly run any plugins in release, which means, yes, the project setups are obviously not ideal as they are specific to the locations on our server.

Not that we hardcoded any paths, I make my team use relative wherever we can leverage it.

First thing I’d love to have done, or get done, is reorganize the project to build on Mac and Win for 2008/2010/XCode and CS3–>

Just need to sit there for a few hours and make all the pretty configs for it.

Other than that, we tested the debug and release for windows (32 bit) and the 64bit build for OSX, I cleaned a few things and pushed it all up.

By all means, any and all who want to contribute, have at it =)

Merry Holidays.[/QUOTE]

We will see if can clean up and build the CS3 version with VS2008


#37

where is the license for this?


#38

I can throw one up if you’d like, just to ease any company concerns.

Much easier since we developed this outside of work, only our custom tweaks are proprietary =)

Which means I am leaning towards a BSD unless someone has a suggestion.

Tell me if this is permissive enough:

https://bitbucket.org/amorano/pyps/wiki/Home

Cheers.


#39

Let us know how that goes, I’ll be needing to get a CS3 build going myself.

Edit: So, we ended up getting a CS3 version built, it spit out a ‘listener.8li’ file. Having a hard time getting it to work, however; On one machine a ‘Run Python Script’ option is added to the automation menu, but won’t launch anything when clicked.


#40

[QUOTE=bryceclark;13456]Let us know how that goes, I’ll be needing to get a CS3 build going myself.

Edit: So, we ended up getting a CS3 version built, it spit out a ‘listener.8li’ file. Having a hard time getting it to work, however; On one machine a ‘Run Python Script’ option is added to the automation menu, but won’t launch anything when clicked.[/QUOTE]

Hi there. I helped on the project. If you built it straight from what was downloaded, then the pyInterpreter is importing an in house python module and calling functions from that module. That is why nothing is showing up.

Gotta edit the Listener.cpp file to make the interpreter do what you want.
Note-It is also currently hooked into Save/Open operations, but that can be edited.

HTH.