Isotropix Forums

Relative path to parent context?

Discuss about expressions in Clarisse

Relative path to parent context?

Unread postby bvz2000 » Tue Mar 19, 2019 2:30 am

I am trying to set up a relative path to a parent context.

For example:

get_double("../light_settings.intensity")

But apparently that does not work. Is there any way to use relative paths to go "up" by one or more contexts?
bvz2000
 
Posts: 428
Joined: Thu Nov 13, 2014 6:05 pm

Re: Relative path to parent context?

Unread postby dcourtois » Tue Mar 19, 2019 11:51 am

Hi,

This hasn't been implemented yet, but you can achieve the same thing using the `get_context` function. Here is how to do it:

Code: Select all
get_double(get_context(get_context()) + "/light_settings.intensity")


The inner`get_context` call (no parameter) returns the path to the context of the object owning the attribute the expression is bound on. The outer `get_context` call then returns the parent context.

Will probably add support for relative paths in the future, but for the moment, this is the way to go :)
User avatar
dcourtois
 
Posts: 130
Joined: Tue Jul 25, 2017 3:15 pm

Re: Relative path to parent context?

Unread postby bvz2000 » Tue Mar 19, 2019 6:11 pm

This looks like it will work just fine for us. Thanks!
bvz2000
 
Posts: 428
Joined: Thu Nov 13, 2014 6:05 pm


Return to Expressions