0

Toolkit: using apps after install

Hi!

Just installed Shotgun Pipeline Toolkit for our project and it looks like everything is the right folders. I updated them all also.

I just can't see the 'Launch Maya/Other app' in Shotgun task actions menu. How can I visualize that commands?

How can I run Maya's Shotgun app? I try to follow these notes: https://support.shotgunsoftware.com/entries/95442657
b
ut still get the error '# Error: Shotgun: Could not import sgtk! Disabling for now: No module named tank # '

 

thanks,
Alessandro Ardolino
Sr TA @ Ghost Games / EA

6 comments

  • 1
    Avatar
    Alan Dann

    Hi Alessandro,

    First off, do you have the Shotgun Browser plug-in installed - Shotgun uses this to load the Toolkit actions for the various entities.  You can download the latest version from this page:

    https://github.com/shotgunsoftware/browser-plugin#installing-on-windows

    After installing you should then see the Toolkit actions appear in the menu for Assets, Tasks, etc.

    To load Shotgun from within Maya, those instructions are correct but I suspect you are setting the python path incorrectly - it should be set to the Python directory within your studio core install - e.g. <studio_install_root>/install/core/python.  You can also set this from within Maya by doing:

    import sys
    sys.path.append("<studio_install_root>/install/core/python")
    import sgtk

    which is a bit easier to debug than setting it in your PYTHONPATH env variable!

    Finally, you can also launch Maya with Toolkit from the command line - to do this, navigate to your project configuration from a command prompt and run:

    tank.bat Task 123 launch_maya

    where 123 is the id of a task on an asset in Shotgun.

    Let me know how you get on?

    Thanks

    Alan

  • 0
    Avatar
    Ardolino, Alessandro

    Hi Alan,

    I have the plugins installed for Chrome. I attach a screen of the JavaScript shell.

     

    About Maya, I can successfully import sgtk, but when I run this startup script:

    import os
    import maya.OpenMaya as OpenMaya
    import maya.cmds as cmds

    def bootstrap_tank():

    try:
    import tank
    except Exception, e:
    OpenMaya.MGlobal.displayError("Shotgun: Could not import sgtk! Disabling for now: %s" % e)
    return

    if not "TANK_ENGINE" in os.environ:
    OpenMaya.MGlobal.displayError("Shotgun: Missing required environment variable TANK_ENGINE.")
    return

    engine_name = os.environ.get("TANK_ENGINE")
    try:
    context = tank.context.deserialize(os.environ.get("TANK_CONTEXT"))
    except Exception, e:
    OpenMaya.MGlobal.displayError("Shotgun: Could not create context! Shotgun Pipeline Toolkit will be disabled. Details: %s" % e)
    return

    try:
    engine = tank.platform.start_engine(engine_name, context.tank, context)
    except Exception, e:
    OpenMaya.MGlobal.displayError("Shotgun: Could not start engine: %s" % e)
    return

    file_to_open = os.environ.get("TANK_FILE_TO_OPEN")
    if file_to_open:
    # finally open the file
    cmds.file(file_to_open, force=True, open=True)

    # clean up temp env vars
    for var in ["TANK_ENGINE", "TANK_CONTEXT", "TANK_FILE_TO_OPEN"]:
    if var in os.environ:
    del os.environ[var]


    cmds.evalDeferred("bootstrap_tank()")

     

     

    I got the error: "# Error: Shotgun: Missing required environment variable TANK_ENGINE. # "

    How should I set that variable?

     

    thanks,

    Alessandro

     

  • 1
    Avatar
    Alan Dann

    Hi Alessandro,

    First off, regarding the missing Action menus, it doesn't look like the project for the task in that screenshot has been set up with Toolkit.  To do this, you need to run:

    tank.bat setup_project

    from within your studio Toolkit installation and follow the instructions - please shout either through here or via our support email (toolkitsupport@shotgunsoftware.com) if you need more help with this.

    Once you've done that, you should find that the action menus appear and you can launch Maya, etc. from Shotgun.

    Next, regarding that script - it looks like that's the userSetup.py from the tk-multi-launchapp app.  This is intended to work with the app as that's where those environment variables are set up.  Rather than using that, I'd suggest taking a look at the much simpler example in the forum post you linked to as that does the bare minimum needed to launch Toolkit.

    That said, you may not need this once you have Toolkit set up for the project.

    Does that help?

    Thanks

    Alan

     

     

  • 0
    Avatar
    Alan Dann

    And I meant to include the link to the documentation for setting up a new project:

    https://support.shotgunsoftware.com/entries/95442748

    Thanks

    Alan

  • 0
    Avatar
    Ardolino, Alessandro

    Hi Alan,

    I already did the project setup following the guide, but no action menus.
    Since we use Shotgun by some time, might my problems be related to old configs?


  • 0
    Avatar
    Alan Dann

    Hi Alessandro,

    Hmm, this is odd - although the project has been set up with Toolkit, it doesn't seem to have been set up correctly - did anything error when you ran setup_project?

    Specifically, part of the project setup should create a Primary PipelineConfiguration entity that points to the Pipeline Configuration location on disk and it doesn't look like this entity has been created.  You can check by navigating to the page: Projects-><your project>->other->Pipeline Configurations.  

    Could you try running the project setup again (you'll need to specify the --force flag, e.g. tank.bat setup_project --force) and check to see if it reports any errors - if it does then please attach it to a private support ticket by emailing toolkitsupport@shotgunsoftware.com and I'll take a look.

    Note: If you've modified the configuration since setting up the project then make sure you back it up first as this will overwrite any previous configuration.

    If the project setup did fail for some reason then this might not be the only thing that's broken!  Let me know how you get on.

    Thanks

    Alan

Please sign in to leave a comment.