Changing enviroment variable on the fly?

   3191   5   2
User Avatar
Member
74 posts
Joined:
Offline
Hi all,
is it possible to change few environment variable before starting a Houdini session?
I'm on windows 10 and tried to write a batch script to execute in Houdini Command Line Tool but without succeed!

I have 2 version of the Redshift render plugin (the normal one and a experimental version)and I want to decide by starting a Houdini session which one to load.

What I tried is starting Houdini from the command line with these batch script(one of two):
set HOUDINI_DSO_ERROR = 2
set PATH = “CRedshift/Redshift_v2_5/bin;$PATH”
set HOUDINI_PATH = “CRedshift/Redshift_v2_5/Plugins/Houdini/16.0.554;&”
houdini -indie

But Houdini don`t the PATH and HOUDINI_PATH variable to the session!
Is it possible doing this way?

Anyone has a solution for this problem?

Thanks in advance for your help.

Cheers,
Nico
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Moin, Nico,

without having tested it out, my assumption is that Houdini overrides your settings by reading its default configuration. So the most likely solution seems to be to have two config files that provide the different paths you need. The “Env-Config-File” (on Windows) sits in your user's documents / Houdini16.0 directory.

I hope this helps!

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
74 posts
Joined:
Offline
Hi Marc,
this is how I'm handling it now.
But it would be more elegant to do it with some scripts…
Someone on discord server mentioned I have to write a python file to execute Houdini and setting the env on the fly! But I have no clue how to do this.

Maybe someone has good solution - sesi?

Nico
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

I must have missed your question on Discord (it's so noisy there and sometimes quite crude that I tend to miss a lot, I guess) …
What you probably could do is use a shell script to rename one of the two “pre-made” configs before starting Houdini. No idea why you would want to do that using Python (which would mean firing up the interpreter just for one or two lines of code), but why not

If you aren't comfortable with shell scripting, I can scribble something as soon as I am back on my dev machine.

Marc
Edited by malbrecht - March 27, 2017 09:18:39
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
something like this?


BATCH FILE A

copy "C:\Users\<your_username>\Documents\houdini16.0\houdini_version_a.env" "C:\Users\<your_username>\Documents\houdini16.0\houdini.env"
"C:\Program Files\Side Effects Software\Houdini 16.0.607\bin\houdinifx.exe"

BATCH FILE B

copy "C:\Users\<your_username>\Documents\houdini16.0\houdini_version_b.env" "C:\Users\<your_username>\Documents\houdini16.0\houdini.env"
"C:\Program Files\Side Effects Software\Houdini 16.0.607\bin\houdinifx.exe"

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
74 posts
Joined:
Offline
Hi Marc,
great :-)
This works!!!

Thanks,
Nico
  • Quick Links