I’m running an event driven script that (among other things) publishes media to ShotGrid.
I set up an Engine using this code:
sgtk.set_authenticated_user(user)
mgr = sgtk.bootstrap.ToolkitManager(sg_user=user)mgr.plugin_id = “stuff”
mgr.pipeline_configuration = ‘otherstuff’engine = mgr.bootstrap_engine(“tk-shell”, entity=proj_hash)
This works as expected. However, the above code cannot be run until the event has actually happened and returned the values necessary to build proj_hash.
Once the event has occurred, however, the process may be called multiple times. When called again it throws an exception because it tries to launch a new Engine when one is already running.
I tried checking the condition of the engine using
engine = sgtk.platform.current_engine()
But this returns “None” in all cases (and I’m at a loss as to why)
Any suggestions, ideas, or solutions?