What’s the best way of editing startup script environments for DCCs prior to launch from Shotgun Desktop? For example, if we wanted to update the NUKE_PATH variable with a custom init.py or MAYA_SCRIPT_PATH with a custom userSetup.py - which toolkit hook would be best to do this in?
This would be before_app_launch, configured on tk-multi-launchapp. Note that this is run for all engines, so you would have to switch on the engine name to call the necessary logic.
@mmoshev is correct. I just want to give you something to consider: If you are using a render farm, this forces you to bootstrap SGTK before every rendering. Personally I like the approach where you have some custom batch scripts that setup the environment and than launch the application. You can than simply use the same batch script in the Software Entities and the executable paths of your render farm.
Interesting! I never tested that out for Nuke. Atm we are bootstrapping SGTK on the farm for Nuke and it works fine, but your way is probably easier to setup. Thanks for the tipp.
We’re in the same boat as Fabian, since sgtk import throws an error, the job fails, but we’ve never tried ignoring this error and rendering anyway. This could save a bunch of hassle - we’ve considered transforming to normal Write nodes on submit, but it might not even be necessary.
As far as I know it’s not necessary for Nuke.
You can see in the code of the shotgun writenode it checks if nuke hassAtribute_sg_write_node_handler which on the farm, it won’t.
However transforming sgtk-mantra to normal mantra is needed for Houdini, luckily this is really quick in Houdini.