Hi there,
I have an HDA that I am trying to configure as a Houdini package so I can include executables for OpenImageIO and OpenColorIO with it. However, users might already have OCIO configured as their system variable. I can ofcourse set OCIO in the packages .json configuration, but I would like to skip that option is $OCIO is already configured by the user. How do I check in the package .json if a system variable already exists? As far as I understand the 'recommends' and 'required' keywords do not handle this case.
Cheers!
System variable check for package .json files
993 2 0- Robbert
- Member
- 53 posts
- Joined: Feb. 2017
- Offline
- mabelzile
- Staff
- 411 posts
- Joined: Feb. 2018
- Offline
You could try using the default variable syntax: ${VAR-DEFAULT}
If VAR is already set, it expands to its current value. If not, VAR expands to the DEFAULT value.
https://www.sidefx.com/docs/houdini19.0/ref/plugins.html#def_var_syntax [www.sidefx.com]
If VAR is already set, it expands to its current value. If not, VAR expands to the DEFAULT value.
https://www.sidefx.com/docs/houdini19.0/ref/plugins.html#def_var_syntax [www.sidefx.com]
- cocoa
- Member
- 1 posts
- Joined: Nov. 2015
- Online
mabelzile
You could try using the default variable syntax: ${VAR-DEFAULT}
If VAR is already set, it expands to its current value. If not, VAR expands to the DEFAULT value.
https://www.sidefx.com/docs/houdini19.0/ref/plugins.html#def_var_syntax [www.sidefx.com]
Great, I'll give that a try. I must have read over this, but didn't really get the current explanation. It would be nice if the example included a variable that is already set so that is shows a case where it does not take the 'DEFAULT' side of the equation. Thanks for the fast help though!
-
- Quick Links