Permanent Global Path variables?

   3699   11   2
User Avatar
Member
88 posts
Joined: 3月 2010
Offline
Hi

I am trying to set global(carried across sessions) for some project path. I added in the variables but that did not carry to next session. I also tried houdini.env file as described in the help, but that did not help me either.

On top of these I tried to modify $JOB, but again Houdini did not kep the value for the next session.

What is the general way to deal with permanant variables?

thanks
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
Permanent variables in Houdini for all sessions. You can use the 456.cmd or 456.py files to put them in. The 456 scripts get loaded each time Houdini is run.

123.cmd or 123.py are run on any new scene files.
There's at least one school like the old school!
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
This post is very very old. What is the process for setting permanent global variables in H19? It seems setting alias' still doesn't "stick" from session to session.
User Avatar
Member
7808 posts
Joined: 9月 2011
Online
Tobias Steiner
This post is very very old. What is the process for setting permanent global variables in H19? It seems setting alias' still doesn't "stick" from session to session.

Export them in the shell that is used to start Houdini.
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
jsmack
Tobias Steiner
This post is very very old. What is the process for setting permanent global variables in H19? It seems setting alias' still doesn't "stick" from session to session.

Export them in the shell that is used to start Houdini.


I sort of understand what you are saying. I'll be more clear and hopefully that will help in arriving at a more specific answer. So I'm writing a json file that sets basic variables like my home directory for projects. That's pretty simple enough so long as you use the predefined global variables Houdini recognizes.

I guess where I'm stuck since I've never tried it is how to create my own variable, eg "DATA" that always points to a network data drive and have that be read into the "variables" pane in the Aliases/Variables preferences for any project that gets created.

When you say, "export them in the shell", how is that done exactly? Lastly, can I do this right in my json file?

Example:

"env": [

{
"HOME": "H:/houdini_projects_home"
},

{
"DATA": "E:/Houdini_Data"
}

]

"Data" doesn't get created but "HOME" does get updated. Thank you for any clarifications. I appreciate the help.

Edit:

Just to further clarify, I am attempting to approach this using the example given in the Houdini help doc as shown below.

Create and reuse variables

{
"env" :
[
{
"BOB" : "$HOME/bob_tool"
},
{
"BOB_TEST" : "$BOB/test"
}
]
}
Edited by Tobias Steiner - 2021年10月29日 17:35:54
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
Update:

Before everyone assumes I'm a moron. I got some help from a colleague and verified that my json does in fact work. There's something wonky on my system that isn't resolving the user environment variables correctly. Working on tracking down the source of that problem.
Edited by Tobias Steiner - 2021年10月29日 18:50:53
User Avatar
Member
7808 posts
Joined: 9月 2011
Online
I guess I'm not following how the JSON file relates to global env vars. Are you creating a houdini package file?
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
Here's a question. Why would native houdini variables update when modified but user created variables be ignored in a json file? Further, why would the exact same json file work for one user but not another using win10 and H19 on different machines?
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
jsmack
I guess I'm not following how the JSON file relates to global env vars. Are you creating a houdini package file?


Yes I am. Verified the file works fine for another user but not me.
User Avatar
Member
7808 posts
Joined: 9月 2011
Online
Does your scene already contain a variable with that name? I believe scene variables take precedence over environment ones.
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
jsmack
Does your scene already contain a variable with that name? I believe scene variables take precedence over environment ones.

Good to know. In this case, these are brand new scenes from a fresh application launch. I think I have a suspect for the problem though. I'm working on it now. It may have something to do with the SSD drive being used for testing on my end. Going through a checklist this morning to validate. I'll post an update here later on.
Edited by Tobias Steiner - 2021年10月30日 09:45:16
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
UPDATE:

The source of the problem in this case was an SSD drive that was being referenced. For some reason everything worked fine when using a different drive entirely. I'll keep troubleshooting whatever the issues are with the SSD drive. I've posted my json content below for the benefit of anyone else wanting to know how to create portable and semi-permanent variables for your Houdini setup. This method has been validated to work fine.

{ "env": [ { "HOME": "H:/houdini_projects_home" }, { "DATA": "H:/tempssd/houdini_data" }, { "TEX": "H:/tempssd/tex" }, { "HOUDINI_AUTHOR": "Tobias_Steiner" }, { "USER": "Tobias" } ] }
  • Quick Links