Create a ticket
Follow

Q100369: Managing Katana projects in multi-platform environments

SUMMARY

This article explains how Katana projects can be set up in a way that allows them to be portable across multiple operating systems. 

 

MORE INFORMATION

When sharing Katana projects across different machines, it is sometimes necessary to adjust the format of file paths for different operating systems or to account for different folder structures. 

To make a Katana project portable across multiple platforms, file paths should be set up so they are relative and not dependent on a system-specific folder structure. There are several options for how to do this:

  1. Relative file paths can be set up by using parameter expressions. For example, right-click on a filename parameter, choose 'Expression' as the Value Mode and enter something like the example below as the expression:

    project.dir + '/textures/testFile.png'

    project.dir will then be resolved to the directory of the Katana project file. Another valid syntax for this would be the following:

    path.join(project.dir, ‘/textures/testFile.png’)

    Please see the Katana Developer Guide for more information on Python Expressions.

  2. Alternatively, you can set an environment variable to point to the system specific root folder. To evaluate the variable in your parameter, there are two options:
    • Use a parameter expression like the following:

      getenv("OS_PATH", tmpDir) + '/example/file/path'
    • Some nodes like Alembic_In also support the use of environment variables in a constant value for a file path parameter, i.e. something like the example below:

      ${OS_PATH}/example/file/path

      NOTE: This is not supported for every node type, in this case please use the first option of evaluating the environment variable via an expression.

  3. Another option is to make use of relative file paths without using an expression: In this case you specify your file paths relative to the project directory, so simply as textures/testFile.png

    Then change the working directory for the environment you are launching Katana in.

    If you are launching Katana from the command line or use a bash or batch script, use the cd command to set the current directory to the root directory of your relative file paths. If you are using a Python script to launch Katana, set the root using the Python os.chdir command similar to the following:

    os.chdir(home + '/' + '/admin/katana_projects/' + example_project)

    For more information about how to set up a launcher script, please see the following articles:
    Q100242: Creating a Katana launcher script for Windows
    Q100272: Creating a Katana launcher script for Linux


If you have any further questions about this, please open a Support ticket and let us know the issue you are encountering and the troubleshooting steps you have taken so far.

For more information on how to open a Support ticket, please refer to the Q100064: Using the Support Portal article.

Was this article helpful?
/

We're sorry to hear that!

Please tell us why.
0 out of 1 found this helpful

Comments