Q100369: How to create Katana projects for a seamless multi-platform pipeline

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. Below are a few options that you can use:
 

Using Parameter Expressions

Relative file paths can be set up by creating expressions for certain parameters. For example, right-click on a filename parameter, choose 'Expression' as the Value Mode and enter something like the following example 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.
 

Setting an Environment Variable 

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:

  1. Use a parameter expression like the following: getenv("OS_PATH", tmpDir) + '/example/file/path'
  2. Some nodes, like the Alembic_In node, also support the use of environment variables in a constant value for a file path parameter, for example:
    ${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.

Changing the Working Directory

Another option is to make use of relative file paths without using an expression, allowing you to specify your file paths relative to the project directory, such as textures/testFile.png.

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

If you launch 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)

 

Further Reading

For more information about how to set up a launcher script, please see the following articles:
Q100242: How to Launch Katana With Third-party Renderer Plugins Using a Launcher Script For Windows
Q100272: How to Launch Katana With Third-party Renderer Plugins Using a Launcher Script For Linux
 

If you are encountering any issues with the information contained in this article, then 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 Q100064: How to raise a support ticket.

    We're sorry to hear that

    Please tell us why