Jump to content

How to reference the result of a variable in parameter fields?


Recommended Posts

Hi,

It seems like this is changed in 12.5 where if you use a variable inside a parameter, you can't see the result using the value mode. For example if you have something like this:

vn17Pxz.png

The results will look like this:

j2wuGBM.png

So in other parameters if I refer to these parameters, they all end up as 0 as well. What's the current way to deal with these now?

I could use the variables directly in the actual parameters but that makes expressions much longer and harder to read and maintain, since this is a simplified example.

Or should I be using expressions instead, i.e. point, prim, vertex, etc? Are they immune to this problem?

Thanks :)

Link to comment
Share on other sites

It was a bug in the older versions that you could reference to Variables. It feels a bit strange over here but you should always use expressions if you want their values to be viewed or referenced.

if you try a ch("../) you'll see it will not work either.

  • Like 1
Link to comment
Share on other sites

Thanks I thought you would reply :)

Is there a way to know which variables would work and which ones wouldn't? Because variables like $PT, $PR, etc can't be replaced with expressions AFAIK. When I referenced parameters that contained $PT, $PR, etc, those worked. I assume they made an exception for these since there is no expression to get the current point, primitive, etc?

I will have to be more careful from now on then, because I noticed some of my tools weren't working.

Also how feasible it is to automatically replace these variables with the appropriate expression behind the scenes? Unless I am missing something this should work right?

Link to comment
Share on other sites

Is there a way to know which variables would work and which ones wouldn't? Because variables like $PT, $PR, etc can't be replaced with expressions AFAIK. When I referenced parameters that contained $PT, $PR, etc, those worked. I assume they made an exception for these since there is no expression to get the current point, primitive, etc.

True but it is especially in those cases that showing a value or making a channel reference would not really work. E.g using $PT what value should be shown in the parameter in this case, unless you have one point?

I don't know if you could change it automatically. In principle you could try to make a python dump of the graphs and then in a text editor replace the variables automatically perhaps?

  • Like 1
Link to comment
Share on other sites

Thanks, sorry I meant it was working not in the sense of showing the values but working correctly. For example referencing the parameter that has $NPT will fail, unless you replace it with npoints(). For $PT, you don't have to do anything.

As for automatic changing, I meant SESI doing it behind the scenes before cooking without actually changing the variables typed :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...