I have been trying to figure out a way to take an image file and copy its contents into the windows clipboard so i can paste it in photoshop.
Since I am using Maya I figured the only way to do this would be to use Python and the PIL module. I was able to get PIL working fine but I can’t figure out any way to get the data into the windows clipboard from Maya.
I read that there is a win32clipboard module so I tried to download and use that but Maya keeps saying it can’t find it.
At this point I’m kind of stumped does anyone have any advice?
I had to install Python 2.5 and then install the pyWin32 modules. After that I copied the entire contents of the site-packages folder over to Maya’s Pythong/site-packages folder and then made sure and rebooted Maya and I was able to use everything.
I’m pretty sure my confusion came from the fact that I didn’t restart Maya, or maybe it was something else. I tried so many things it was hard to keep track. It would be nice to know for sure whether or not you have to restart Maya to get modules to load correctly, it doesn’t seam like you would.
Hi there,
I too had stumbled across similar situation sometime back.But I couldnt get the win32 modules running.I dont know whether I followed the wrong procedure.Or is it because of the operating system.I am using windowsXP 64 bit here.
I’m not sure about Win64 because I was using Windows XP 32bit
What I believe was occurring is that the pyWin32 Installer does “something” special. I don’t know if it sets up an environment variable or modifies some files or what, but I wasn’t able to get anything working until after I ran that installer.
Essentially the steps are as follows:
[ol]
[li]Install Python 2.5 (same version as Maya)[/li][li]Install pyWin32 for python 2.5 using their installer[/li][li]Go to “C:\Python2.5\Lib\site-packages” and copy all of the win32 files out of that directory[/li][li]Paste all those files into your the site-packages folder in Maya’s Python directory[/li][/ol]
After all that you can uninstall python if you want. I tested that and it appeared to work.
All that said, I ended up going a different route in the end. Since the installation process was so horrible I decided to use py2exe to compile the entire thing down to a single exe I could then pass arguments to through Mel. Now all the user has to do is place the exe in the userScripts folder and then run the Mel script and everything works.
I don’t like using an exe nearly as much as I wold script but consider the functionality of the exe is very limited and the majority of the code is still in mel I’m willing to live with it.