Isotropix Forums

Weirdness with file expressions and environment variables

Discuss about expressions in Clarisse

Weirdness with file expressions and environment variables

Unread postby briansilva » Mon Feb 24, 2020 4:40 pm

We've setup a few environment variables for locations on our filesystem, that we'd like to use to reference paths in Clarisse. But, we've been finding it very difficult to get them to evaluate correctly or predictably.

For example:
Code: Select all
$ENV_VAR/path/to/texture.tx


where $ENV_VAR's value is a UNC path, like \\server\share (we're on Windows).

If we simply enter the path above, it will usually force the attribute into an expression, but it won't resolve correctly (as seen in the Path Manager). My understanding was that it shouldn't need to be an expression if it just has an environment variable. If it's an expression, it would need to then be something like this, correct?

Code: Select all
join_path(ENV_VAR, "path/to/texture.tx")


But it would be much nicer to just leave it with $ENV_VAR at the head. We have been able to get this to work, so we're assuming it is supported?

After various attempts at un-setting the expression, editing it in the attribute, bringing up the expression editor, and browsing to the file before replacing the head with $ENV_VAR give different results, we haven't really been able to find a predictable method to set the path so it resolves as expected.

Any advice, or experience with something like this?
briansilva
 
Posts: 51
Joined: Mon Mar 25, 2019 12:43 pm

Re: Weirdness with file expressions and environment variable

Unread postby dboude » Mon Feb 24, 2020 6:07 pm

Hi,

Code: Select all
$ENV_VAR/path/to/texture.tx


is the correct way to go. (internally we use Seexpr to resolve variables, that's why it becomes an expression)

However, if you use this syntax it should be resolved. If not, could you explain how you get wrong/different results ?

Thank you

Cheers !
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1400
Joined: Mon Jul 03, 2017 10:51 am


Return to Expressions