I noticed ayon-core has Pillow in it’s pyproject.toml under:
Pillow = "9.5.0"
But I can’t seem to import it: from PIL import Image, ImageDraw, ImageFont
results in an Import Error.
Am I missing something about the architecture of AYON? Am I required to make a dependency package with Pillow in the pyproject.toml of my specific addon and for each addon that needs it?
As far as I know, when you create a depenency package, upload it to your server and assign it to your bundle. Then, once you run the launcher, the depenency is added to your running session.
As you have mentioned that Pillow actually exists. Then, when running the script in an AYON initialized environment, it should work. e.g. running the import code in AYON console.
Personally, to ease up my day to day dev work, I added the depenency package to my python search paths in VS code so that I don’t get warnings or errors in my code editor.
From AyonTray–>Admin–>Console
I can use “from PIL import Image”.
But from inside Blender (launched from Ayon’s Launcher), I cannot import PIL.
That’s perfect for my use (I want to avoid a conflict), but I would like to be sure :
is Ayon’s PIL module only available to the Launcher and Console, and not available for Blender ?
Pillow is a runtime dependency in ayon-core which if I’m not mistaken means it won’t be propagated to the DCC apps. these are type of modules that we create wrappers for them like opencolorio .