Jump to content
SteveNi

Channel expression referencing a toggle not working

Recommended Posts

Hi

In my scene I have a null node called "Precise_Clipping "where I edited the parameter interface and added a toggle called "precise_clip" then In the voxel size channel of a vdb node I have written the following:

 

if (ch("../Precise_Clipping/precise_clip") == 1)
{
    return 0.01;
}
else
{
    return 0.2;
}

The problem here is that it gives this error:

http://prntscr.com/cg15f2

Its not the first time I write expression in channel fields, and to me the syntax looks correct...so whats the error?

 

Thanks

Edited by SteveNi

Share this post


Link to post
Share on other sites

I think you have to enclose the whole lot in curly brackets for a multi line expression in a channel field. You can write it like this

{
float clip = 0.2;
clip = if(ch("../Precise_Clipping/precise_clip"), clip, 0.01);
return clip;
}

Edited by j00ey
typo in expression
  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, j00ey said:

I think you have to enclose the whole lot in curly brackets for a multi line expression in a channel field. You can write it like this

{
float clip = 0.2;
value = if(ch("../Precise_Clipping/precise_clip"), clip, 0.01);
return clip;
}

Oh Yea I forgot that...dumb me.

Thanks a lot for the reminder :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×