Get commands called when using SG Integration UI

Hi,
I’d like to customize Maya UI so that I can call Shotgun Save, Shotgun Open, Shotgun Load, Shotgun Breakdown, etc from my UI… I don’t want to modify or customize those app, just launch them.

After searching in /install, I think I probably should use app.py in \install\app_store\tk-multi-workfiles2\v0.11.12\python\tk_multi_workfiles, but I’m going to need a bit of help.

In app.py, it seems “File Save…” calls _tk_multi_workfiles.WorkFiles.show_file_save_dlg() from the superClass superClass sgtk.platform.Application, such as:

app = sgtk.platform.Application()
_tk_multi_workfiles = app.import_module("tk_multi_workfiles")
_tk_multi_workfiles.WorkFiles.show_file_save_dlg() >>>>> This should call the UI for Save Action

But I need six arguments for sgtk.platform.Application() and help() is pretty vague about what to call here.

Do you know what arguments need to be given sor that I can use show_file_open_dlg and show_file_save_dlg ?

Do you know how I can call Loader?

Thanks

3 Likes

Hey Ben

If just launching the app via code is what you are after then you can do the following:

import sgtk
engine = sgtk.platform.current_engine()

print engine.commands

engine.commands["File Open..."]["callback"]()
engine.commands['File Save...']["callback"]()
engine.commands['Load...']["callback"]()

Best
Phil

3 Likes

Awesome, thanks Philip!

2 Likes