Houdini package expressions not working

   451   4   2
User Avatar
Member
55 posts
Joined: 2月 2017
Offline
I am trying to use expressions for dynamic include/excludes in my package files but it does not seem to work if I try to compare with any self-set environment variables inside of the package file. Doing include expressions like "houdini_version == '20.5.410'" work, but changing that to "houdini_version == '$VAR_HOUDINI_VERSION'" (where var = "20.5.410") seems to return false or break and skip the package. How are these supposed to be used and why does this not work?

{
	"enable": true,
    "load_package_once": true,
	"process_order" : 1,
    "env": [
		{
			"SOME_VAR" : "20.5.410"
		},
        {
			"HOUDINI_OTLSCAN_PATH" : 
			[
				{
					"houdini_version == '$SOME_VAR'" : "/some/path",
					"method" : "append"
				}
			]
			
		},
]
}
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
User Avatar
Member
318 posts
Joined: 1月 2013
Offline
I think this is because a number is expected, not a string. But there is a problem here that the value is only read up to the first dot. So it only works for non-string comparisons.
Image Not Found
Edited by alexwheezy - 2024年12月5日 07:48:04

Attachments:
2024-12-05_15-35_1.png (28.5 KB)

User Avatar
Member
123 posts
Joined: 12月 2019
Offline
Robbert
it does not seem to work if I try to compare with any self-set environment variables inside of the package file

Self-set environment variables work well for setting a value, like :

{
"env": [
{
"MY_BROWSER_PATH" : "C:/Program Files/Google/Chrome/Application/chrome.exe"
},
{
"HOUDINI_EXTERNAL_HELP_BROWSER" : "$MY_BROWSER_PATH"
}
]
}

But they don't work for package expressions when set within the same package file, and have to be set prior to scanning this package file. You have to set SOME_VARin a previously loaded package file or in system environment variables before starting Houdini (and called with $prefix, without single quotes '') :

{
"env": [
{
"MY_BROWSER_PATH" : "C:/Program Files/Google/Chrome/Application/chrome.exe"
},
{
"HOUDINI_EXTERNAL_HELP_BROWSER" :
{
"houdini_version == $SOME_VAR " :"$MY_BROWSER_PATH"
}
}
]
}

alexwheezy
I think this is because a number is expected, not a string.

The expression syntaxe actually expects string values.
Edited by ObeidaZakzak - 2024年12月5日 10:04:45
Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
318 posts
Joined: 1月 2013
Offline
ObeidaZakzak
The expression syntaxe actually expects string values.
Yes, but the string "20.5.429" doesn't work as a variable for houdini_version. If you don't enclose the value in double quotes everything works.
Edited by alexwheezy - 2024年12月5日 10:14:29
User Avatar
Member
55 posts
Joined: 2月 2017
Offline
Got it working, thanks! Would be great to be able to use the env variables set IN the file (or in package files with a higher processing order) to evaluate expressions. But oh well, if this is how it is expected, so be it
Technical VFX artist @ Housemarque / Sony Interactive Entertainment
  • Quick Links