Packages expression syntax

   1211   3   1
User Avatar
Member
65 posts
Joined: March 2017
Offline
Hi guys,

I've been trying to get expressions in packages working, but I've come to a dead end.

Here is a snippet of what I'm trying to do :

{
    "env": [
            {
            "MYPROJECT_PATH": 
                [
                    { "$houdini_dev == '0'" : "/global/path" },
                    { "$houdini_dev == '1'" : "/dev/path" }
                ]
            },
            {
            "TOOLS_PATH": "/my/other/path"
            }
           ]
}

In my houdini.env, I have a houdini_dev variable that I want to use to switch between the global project and a local project.
But this doesn't seem to work.
If I check the environment variables in Python once Houdini is loaded, I can see my houdini_dev variable, as well as TOOLS_PATH but MYPROJECT_PATH is not there.

What am I doing wrong here ?

Thanks a lot,

Julien
VFX Supervisor @ MPC London
User Avatar
Staff
397 posts
Joined: Feb. 2018
Online
houdini.env is processed after all packages have been loaded by Houdini. Your env vars should be set outside your houdini.env directly in your environment before launching Houdini.
User Avatar
Member
65 posts
Joined: March 2017
Offline
I see, thanks!

One thing I tried though what to put that houdini_env in the package itself, it didn't work either …

Problem is, I can't put it in my env.csh, but that's a problem I'll have to solve somewhere else …
VFX Supervisor @ MPC London
User Avatar
Staff
397 posts
Joined: Feb. 2018
Online
Sorry, I'm not sure to understand “One thing I tried though what to put that houdini_env in the package itself, it didn't work either …”

You could also consider package_path for dynamic package settings. Here's an interesting video about packages and package_path in particular.

https://learncreategame.com/techart/houdini-environment-setup/ [learncreategame.com]
  • Quick Links