![]() Probably some type of graphics card thing- forgot to try it at work, have to try and remember to give it a go… Hey chad thanks for the tip, sadly the pil module didn’t seem to come with a setup.py file? it was a windows installer- also, anyone know what version of python ships with maya 2008? Not sure why this doesn’t work? Possibly something to do installing the module in my maya site-packages folder? I just copied and pasted it from my python25 directory- any help appreciated! ![]() grab function seems to work) Error: (0, ‘Error’) Traceback (most recent call last): File “”, line 1, in File “C:\Python25\Lib\site-packages\PIL\Image.py”, line 1405, in save save_handler(self, fp, filename) File “c:\python25\lib\site-packages\PIL\JpegImagePlugin.py”, line 409, in _save ImageFile._save(im, fp, ) File “C:\Python25\Lib\site-packages\PIL\ImageFile.py”, line 491, in _save s = e.encode_to_file(fh, bufsize) IOError: (0, ‘Error’) In maya however i get this error: (the module imports go with no error, and the. Hi, trying to set up a screenGrab function inside of maya using python, I’mm using the python imaging library to do it, the following code works fine as a standalone python script: which ( "xclip" ): args = else : msg = "wl-paste or xclip is required for abclipboard() on Linux" raise NotImplementedError ( msg ) fh, filepath = tempfile. which ( "wl-paste" ): args = elif shutil. DibImageFile ( data ) return None else : if shutil. import BmpImagePlugin return BmpImagePlugin. PngImageFile ( data ) elif fmt = "DIB" : from. import PngImagePlugin return PngImagePlugin. split ( " \0 " ) return files if isinstance ( data, bytes ): import io data = io. unpack_from ( "I", data ) if data != 0 : files = data. grabclipboard_win32 () if fmt = "file" : # CF_HDROP import struct o = struct. close ( fh ) commands = script = for command in commands : script = subprocess. platform = "darwin" : fh, filepath = tempfile. frombytes ( "RGB", size, data, "raw", "BGRX", size * 4, 1 ) if bbox : im = im. HAVE_XCB : msg = "Pillow was built without XCB support" raise OSError ( msg ) size, data = Image. close () return im_cropped return im # use xdisplay=None for default display on non-win32/macOS systems if not Image. ![]() unlink ( filepath ) if bbox : im_cropped = im. ![]() which ( "gnome-screenshot" ): fh, filepath = tempfile. crop (( left - x0, top - y0, right - x0, bottom - y0 )) return im elif shutil. frombytes ( "RGB", size, data, # RGB, 32-bit line padding, origin lower left corner "raw", "BGR", ( size * 3 3 )
0 Comments
Leave a Reply. |