Is it even necessary to do it that way? It’s weird that Draft doesn’t already have similar functionality.
The real question here:
I can’t import Draft in my event plugin. When I synchronize script that is importing Draft I get this
2023-09-16 21:32:26: Event plugin 'AutoDraftPlugin' could not be loaded from the repository because: Error executing event plugin script "P:\DeadlineRepository10\events\AutoDraftPlugin\AutoDraftPlugin.py": ModuleNotFoundError : No module named 'Draft' (Deadline.Events.DeadlineEventPluginException)
When I’m importing Draft from here:
C:\Program Files\Thinkbox\Deadline10\bin\python3 I can do it.
I’ve set env variables MAGICK_CONFIGURE_PATH and PYTHONPATH to P:\DeadlineRepository10\draft3\Windows\64bit
When I manually create Draft job by RMB>scripts… everything works fine.
I’m pretty new to all of this and to Python as well. Any help will be highly appreciated!
One reason it may not import is if the event is running in Python2 mode. The libraries are built to target very specific versions of Python (3.7 and 2.7) any other major.minor like Python 3.10 will fail to import the library.