BrendanParmer / NodeToPython

Convert Blender node groups to a Python add-on
MIT License
243 stars 23 forks source link

.window_manager.clipboard 65536 characters ? #93

Open jnschilling opened 8 months ago

jnschilling commented 8 months ago

Hello, Thanks for the addon and the efforts maintaining it. I noticed that the copy to clipboard using the addon is limited to 65536 characters (yes I handle very large geometry nodes). I didn't know and can't diagnostic the why of this limitation. BR, JN

BrendanParmer commented 8 months ago

Hi @jnschilling, sorry to hear you're having issues. This is a bit strange, and unfortunately I'm not able to reproduce this. The Blender clipboard is just a Python str, whose size (IIRC) should theoretically should be bound only by the amount of memory available to the interpreter. In script mode it first writes to a StringIO object before copying to the clipboard, but it seems like this should be able to handle more than 65536 characters.

What's your OS? If you could provide a test blend file, that would help me debug this, too.

As a workaround, you can try generating your node group in add-on mode, which writes directly to a file rather than an object in memory. From there you could copy the relevant node group code into your script