Running Toolkit automatically at Nuke Startup


I am having a little trouble with the SGTK for Nuke. I have added code to our init.py to load shotgun. I have to specify the "default_work_area_path"

That is a project path, however how do I configure for multiple projects?

댓글 1개

  • 0
    Manne Öhrström

    Hello Michael!

    Sorry for the delay getting back to you and thanks for the great question!

    Toolkit is completely project specific. That means that each project has an fully independent configuration. When toolkit starts up, you tell it which project to work on, either by pointing it to an object in Shotgun or by passing it a file system path of some sort. Here are some documentation resources:

    Basically, when you initialize a Toolkit Core API instance, you also point it to a project configuration to use. This is where it will read all its settings from. So there needs to be some logic at application (e.g. Maya/Nuke) startup to determine which project configuration to load! This is typically done explicitly at launch; an artist right clicks a task in Shotgun and selects the Launch Nuke option. Alternatively, an artist uses the tank command in a shell and executes something like tank Shot ABC123 launch_nuke. Both of these approaches will use toolkit to launch your application, so you don't need to worry about any of the initialization details. However, if you want to set up toolkit so that it automatically starts up inside your init.py file for Nuke, you would need to somehow tell the startup code which project you are launching Nuke for! If you are using this approach, I would probably recommend using an environment variable to specify the path to the project prior to launching Nuke and this is then picked up inside your init.py script so that the right project can be initialized. 

    How does that sound?


댓글을 남기려면 로그인하세요.