Can I utilize tk-framework-desktopserver to launch DCCs from my own scripts?

I’m looking for a clever way to launch a bootstrapped DCC from a script and wanted to try and send a command via websocket to SG Desktop via tk-framework-desktopserver. I cant find any documentation on how to do that, what the desktopserver is expecting to receive, etc.

5 Likes

Bumping this thread. Any Shotgun devs want to weigh in on this? Can I send commands to the tk-framework-desktopserver in a sg desktop session to launch dccs from my own scripts?

Hello and apologies for the delay!

Can you tell us more about your use case? Is this a custom webapp or some other kind of custom code?

We haven’t really designed tk-framework-desktopserver to be used in this way; it’s really only made to support Shotgun and Desktop, so what you’re suggesting isn’t really supported.

Having said that, if you’re just wanting to launch from a python script, you should be able to just bootstrap the tk-shell engine and use tk-multi-launchapp to launch your DCC. You can see an example of the code for bootstrapping and running an app here.

Again, if that doesn’t address what you’re after, it would be helpful to know more about your specific use case, so we can better point you in the right direction.

thanks!
-tannaz

1 Like

Yea, so for example we launch RV thru SG Desktop and we have some hooks that set env vars and other things. We would like to be able to launch RV from Deadline Monitor and have it run those same hooks, etc. We’d rather not have to bootstrap toolkit every time we want to launch because it takes a while to run the bootstrap. We were hoping to utilize the already running SG Desktop, much like Shotgun web app does, to run those commands for us.

1 Like

Hello! Unfortunately I don’t think that will work – it sounds like you’re wanting to use the tk-multi-launchapp and its before_app_launch hook, which would need more than just the websocket server / tk-framework-desktopserver to run. You’d still need a running Toolkit engine, so you’d still need to bootstrap.

Even if you were using the framework, it wouldn’t save you any time, as we are boostrapping the tk-shotgun engine every time we launch an app anyway.

So… short moral, you need a Toolkit engine running in order to run Toolkit apps and their hooks.

1 Like