0

Registration/ Python to Launch Snapshot in Maya

Hi Shotgun

I'm looking for the Python or MEL code to launch the Snapshot GUI?

To encourage my Lighting TD team to use the Shotgun Tank Snapshot function in Maya (2014) I would like to create a Snapshot shelf button and Hotkey.

Yes they can open it through the Shotgun pulldown menu but they are instead opting to hit "Save" :(

Cheers

John Roberts-Cox

2 comments

  • 0
    Avatar
    Alan Dann

    Hi John,

    You can do this with the following Python code:

    import maya.cmds as cmds 
    try: 
        import sgtk

        # get the current engine (e.g. tk-maya) 
        current_engine = sgtk.platform.current_engine() 
        if not current_engine: 
            cmds.error("Shotgun integration is not available!") 

        # find the current instance of the snapshot app: 
        snapshot_app = current_engine.apps.get("tk-multi-snapshot") 
        if not snapshot_app: 
            cmds.error("The Shotgun Snapshot app is not available!") 

        # call the public method on the app to show the snapshot dialog: 
        snapshot_app.show_snapshot_dlg() 
    except Exception, e: 
        cmds.error("Failed to launch Shotgun snapshot! - %s" % e) 

    Does that help?

    Thanks 
    Alan

  • 0
    Avatar
    Oliver Hilbert

    That worked great for me. Would be great to also get the code for a publish, load and file manager. Tried putting them together but didn't manage to figure it out.

Please sign in to leave a comment.