b-init / ImagePaste

A simple Blender addon to grab images from your clipboard and paste as a reference image in viewport or onto the image editor.
GNU General Public License v3.0
251 stars 9 forks source link

BUG: Error message - can't paste images on Mac OS #28

Closed mrberns closed 2 years ago

mrberns commented 2 years ago

Describe the bug

image This seems to be a Mac only bug as I also have access to a Windows server and the add-on works fine there.

The image copied to clipboard won't paste into Blender and it shows the above error message.

Here is a screenshot of the hardware and OS version that I'm using:

image

Step to reproduce

Launch Blender on Mac OS and paste any image using ctrl shift v.

It doesn't seem to matter which version of Blender, I happen to be on M1 Mac and using the ARM builds.

Relevant log output

No response

Expected behavior

Image should paste.

Platform

macOS

Platform version

Version 21.0.1

Blender version

3.0

williamchange commented 2 years ago

This is due to the x86 pasteboard module that's bundled in the add-on, which will work again by including the native .so from the pasteboard package on a M1 machine:

For the following I replaced the _native.cpython-39-darwin.so file from my M1 Mac and can confirm it works on 3.0 and the latest alpha - 3.1:

ImagePaste_1.8.0_M1.zip

For older Blender versions though the add-on should work without any modifications since it will support x86 modules(via Rosetta).

mrberns commented 2 years ago

Okay this works perfectly, thank you!

thanhph111 commented 2 years ago

@williamchange Do you think it's a good idea to push updates for a newer binary?

williamchange commented 2 years ago

@williamchange Do you think it's a good idea to push updates for a newer binary?

A better solution would be to implement checks for architecture/make a fat library but at this point it's probably good enough to make a separate release for M1 users. Older Blender builds(for Intel Macs) can still use the original add-on without any modifications.

b-init commented 2 years ago

Great! I think it'll be fine to release separate build for M1 users for now then, might be worth bundling the package with architecture check in later releases of imagepaste?

williamchange commented 2 years ago

Yeah, I will try to look into implementing it and open a PR when I have more time.

plufz commented 1 year ago

I tried the ImagePaste_1.8.0_M1.zip zip from this issue. I still get importerror "_native" when trying to paste on M1 with Blender 3.4. Should I make any changes to the zip for it to function, or has this stopped working again?

williamchange commented 1 year ago

@plufz It's because the latest Blender is using Python 3.10 so the relevant library has to be updated to use with the add-on, try the latest release here: https://github.com/b-init/ImagePaste/releases/latest

plufz commented 1 year ago

the latest release here: https://github.com/b-init/ImagePaste/releases/latest

Thank you @williamchange that one works for me too. 🙏