Environment File ¶
You can set up your environment for the plug-in by using a file named unity_houdini.env
in your Unity project. This is not necessary for the plug-in to function by default, but it is recommended for instances where the project uses assets from outside the Assets/ folder, or uses assets with external subassets.
The environment file unity_houdini.env
is in fact same as the traditional houdini.env
file, but supports some features specific to the Unity plug-in. Also, you can use the same .env file for the plug-in as for your other Houdini projects. One key difference is that it is required to keep the .env file under the Unity project’s Assets/ folder. This requirement is due to the plug-in storing the path to the .env file as a relative path. Storing absolute path will cause issues for multi-platform projects (e.g. macOS paths vs. Windows paths). If the project is under source control, it is recommended to NOT commit the unity_houdini.env
file (and ignore it from source control), but rather keep local version of it as part of the project.
Note
You can change the file name and relative path of the unity_houdini.env
file from the Plugin Settings window. This also displays the path mappings found in the .env file.
The .env file is automatically loaded when Unity starts. It can be reloaded by pressing the reload button next to the file path field.
Environment Mapped Paths ¶
Path mapped key-value pairs can be set in the .env file. This allows to use assets from outside the project Assets/ folder, in a team environment, and especially in a multi-platform environment.
The path key must start with the HEU_ENVPATH_
prefix, and must be declared in the following format:
HEU_ENVPATH_\<CUSTOM_KEY 1\>=\<Path to folder\> HEU_ENVPATH_\<CUSTOM_KEY 2\>=\<Path to folder\>
Examples:
HEU_ENVPATH_COMMON_HDAS=C:\\Dev\\Houdini\\CommonAssets HEU_ENVPATH_PROJECT_AWESOME=C:\\Projects\\Awesome\\HDAs
Now when the plug-in loads an asset from these directories, the asset file path will be stored as:
C:\\Dev\\Houdini\\CommonAssets\\basic_tree.hda -> $HEU_ENVPATH_COMMON_HDAS/basic_tree.hda C:\\Projects\\Awesome\\HDAs\\Environment\\awesome_tree.hda -> $HEU_ENVPATH_COMMON_HDAS/Environment/awesome_tree.hda
As shown, it handles subfolders as well.
An artist on macOS might have the following mapping instead:
HEU_ENVPATH_PROJECT_AWESOME=/Users/artist/work/Projects/Awesome/HDAs
Then the stored path to an asset would be:
/Users/artist/work/Projects/Awesome/HDAs/Environment/awesome_tree.hda -> $HEU_ENVPATH_COMMON_HDAS/Environment/awesome_tree.hda