Jump to content

Channel expression referencing a toggle not working


SteveNi

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
Link to comment
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
Link to comment
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

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...