Search - User list
Full Version: Houdini not scanning HOUDINI_PACKAGE_DIR?
Root » Technical Discussion » Houdini not scanning HOUDINI_PACKAGE_DIR?
shareware
Hi -
part of my houdini.env looks like this:

LIBROOT = "Y:/Library/houdini/18.5"

HOUDINI_PACKAGE_DIR = "${LIBROOT}/packages"


However, it doesn't seem to pick up any packages installed there. I've been checking by typing any defined environment variables in the hscript textport. When placed in the $HOME package directory some things are picked up.

Another issue I'm having is that my package files don't appear to use variables properly. All of these lines will omit the variable part

"QLIB": "$LIBROOT/libs/qLib-master"

"QLIB": "${LIBROOT}/libs/qLib-master"

"QLIB": "$HOUDINI_PATH/libs/qLib-master"

However $HOUDINI_PACKAGE_PATH/... resolves fine.

What am I doing wrong?
mabelzile
houdini.env is processed after the packages. You need to set these variables in your environment (e.g. shell terminal) before starting Houdini.
shareware
Thanks very much, that works. Would be great if Houdini could scan the packages folder in all custom $HOUDINI_PATH locations automatically.
mabelzile
danvenn
Thanks very much, that works. Would be great if Houdini could scan the packages folder in all custom $HOUDINI_PATH locations automatically.

Do you mean scanning the folders that have been added to HOUDINI_PATH once all known package locations have been scanned ? If you want to inject extra package locations dynamically you can use the
package_path keyword. [www.sidefx.com]
shareware
mabelzile
Do you mean scanning the folders that have been added to HOUDINI_PATH once all known package locations have been scanned ?
That's right - I was initially assuming it would work that way as scripts and OTLs get automatically scanned from the new locations. But I suppose the package system is meant to replace editing the ENV file so I can see why it doesn't.

Good to know about the package_path method - so you basically create a new package json in the default packages directory which points Houdini in the right place. I'll try it out.

Thanks for your help.
evianaive
mabelzile
houdini.env is processed after the packages. You need to set these variables in your environment (e.g. shell terminal) before starting Houdini.
I create a hda&vex lib as a content only plugin for UE4. I was planning to use a generate a houdini.env file before HAPI_Initialize() and use this houdini.env file as parameter of HAPI_Initialize(). I thought I can set HOUDINI_PACKAGE_DIR in houdini.env. The package file will append HOUDINI_OTLSCAN_PATH, HOUDINI_VEX_PATH, HOUDINI_OCL_PATH.
As you have mentioned, however, it seems I can't do this because houdini.env is processed after the packages. So what should I do?


HAPI_Initialize( const HAPI_Session * session,
const HAPI_CookOptions * cook_options,
HAPI_Bool use_cooking_thread,
int cooking_thread_stack_size,
const char * houdini_environment_files,
const char * otl_search_path,
const char * dso_search_path,
const char * image_dso_search_path,
const char * audio_dso_search_path );

My package json file
{
"path": [
{
"value" : "$HOUDINI_PACKAGE_PATH/hda_module",
"method" : "append"
}
],
"env": [
{
"hdalib": "$HOUDINI_PACKAGE_PATH/hda_module"
},
{
"HOUDINI_OTLSCAN_PATH": {
"method": "append",
"value": [
"$hdalib/otls/Czx",
"$hdalib/otls/Lz",
"$hdalib/otls/Lyc",
"$hdalib/otls/Pb"
]
}
},
{
"PYTHONPATH": "$hdalib/python"
},
{
"HOUDINI_OCL_PATH": {
"method": "append",
"value": [
"$hdalib/ocl"
]
}
},
{
"HOUDINI_TOOLBAR_PATH":{
"method": "append",
"value": [
"$hdalib/toolbar"
]
}
}
]
}
mabelzile
HOUDINI_PACKAGE_PATH is set by HOUDINI automatically with the current package folder path being scanned allowing you to set env vars relative to a package location. You don't need to set it by yourself.

Your package seems fine, are you getting any errors when your lib is loaded ?
mabelzile
Houdini will scan the following directories on startup (if they exist) for package files:

$HOUDINI_USER_PREF_DIR/packages

$HFS/packages

$HSITE/houdinimajor.minor/packages (for example, $HSITE/houdini18.0/packages)

$HOUDINI_PACKAGE_DIR

Houdini will process the package files directly in the folders specified in HOUDINI_PACKAGE_DIR, do not add a packages directory under these folders.

$HSITE must be set to an existing directory before starting Houdini.

Like for HSITE, if you want to set HOUDINI_PACKAGE_DIR, you need to do it from a terminal or in the script used to launch Houdini.
evianaive
mabelzile
HOUDINI_PACKAGE_PATH is set by HOUDINI automatically with the current package folder path being scanned allowing you to set env vars relative to a package location. You don't need to set it by yourself.

Your package seems fine, are you getting any errors when your lib is loaded ?
The problem is I don't want to edit houdini.env and add packages in user/document/houdini18.5/packages/ because I have several version of libs. Each one corresponding to different Unreal project. For example, Project A use 1.0 version and Project B use 1.1 version.
The package file I want to load is UnrealPojectDir/Plugins/hdalib/Content/hdalib/packages/hda_module.json.
As a result, I have to generate a houdini.env file for each unreal project to load this package because houdini engine session only supported loading .env file when I initial session.
mabelzile
There is no way you can set a .env file to load packages, it doesn't work that way. Houdini engine should load packages on start up. To selectively set HOUDINI_PATH or any other env vars from a package you could try using one of these techniques listed in the doc:
https://www.sidefx.com/docs/houdini19.0/ref/plugins.html#package_techniques [www.sidefx.com]

Example:
$HOUDINI_USER_PREF_DIR/packages/hda_module.json
{
    "env": [
      {
        "PROJECT":
        [
            {
                "$SOME_LIB_VERSION == '1.0'": "$HOUDINI_USER_PREF_DIR/myproject_folder_A"
            },
            {
                "$SOME_LIB_VERSION == '1.1'": "$HOUDINI_USER_PREF_DIR/myproject_folder_B"
            }
        ]          
      }
    ],
    "path": "$PROJECT"
}
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB