0

Folder creation with Shotgun Desktop

Hi support team

What would be the best way to add the option to create the Project folders right after the installation of a project?

Currently right after the the toolkit project setup process the only folders that show up where the project resides is the tank folder.

Prior to Shotgun Desktop after installing a project we used to type the command  ">tank Project XYZ folders" to get the rest of the folders. How would we add this option to the Shotgun Desktop UI so it shows up at the end of each the project setup?

All the best 

Bruno

 

 

3 comments

  • 0
    Avatar
    Permanently deleted user

    Hello!

    In each configuration template and each configuration, there is a file called after_project_create.py (see here). This is executed as the last step in the project setup process and would make it possible to do various maintenance tasks. Try adding this to your after project file:

    def create(sg, project_id, log, **kwargs):
        """
        Insert post-project code here
        """
        import sgtk
        tk = sgtk.sgtk_from_entity("Project", project_id)
        tk.create_filesystem_structure("Project", project_id)
    
    

    Before setting up a new project, make sure your config template has got the modified file, then try to run setup. Either you can do this by modifying a after project setup file in one of your existing projects and then creating a new project using that old project as a base. Alternatively, download one of our configs from github, modify it locally and then use that modified version as your template.

    Hopefully that should create folders automatically after the project has been created!

    Any problems, let us know!
    Manne

  • 0
    Avatar
    Bruno Guerreiro

    Thank you Manne!

     

    This worked perfectly! You guys rock :)

     

    All the best

    Bruno

  • 0
    Avatar
    Permanently deleted user

    Sweet! Glad we could help!

Please sign in to leave a comment.