Jump to content

Snippet VOP in VOP COP2 Filter


j00ey

Recommended Posts

I am banging my head on the wall trying to get something that I thought would be very straightforward to work.

 

I just want to remap the luminance of an image in COPS to then use that value for multiplying against some noise. I have a ramp on the snippet . I'm piping R G and B into the VOP from the globals and my code so far is this :

 

vector rgb = set(R,G, B);
vector hsv = rgbtohsv(rgb);
float lum = hsv[2];
lum=chramp("lumremap",lum);
R=lum;
 
It seems the chramp function doesn't want to work as whatever value I put in there instead of lum, it still returns 0. I haven't used the snippet VOP before though I am familiar with wrangles and so on. Anyone know what's wrong here?
 
Thanks
Edited by j00ey
Link to comment
Share on other sites

hmmm... ch("parm") doesn't seem to work either. Is this another COPs bug or am I missing something?

 

From the help files for Snippet VOP :

 

You can use the VEX function ch to evaluate parameters. The path is relative to this node (ch("parm") will evaluate the parameter parm on this node). This evaluation will be done at the current time.

Edited by j00ey
Link to comment
Share on other sites

Great! Thanks so much for the help, never occurred to me to try that.

 

Is that just a COPs thing? I've never come across that syntax in wrangles... or is it snippet VOP specific and if so, why does for instance rgbtohsv work without backticks and ch doesn't?

 

Thanks again 

Link to comment
Share on other sites

Great! Thanks so much for the help, never occurred to me to try that.

 

Is that just a COPs thing? I've never come across that syntax in wrangles... or is it snippet VOP specific and if so, why does for instance rgbtohsv work without backticks and ch doesn't?

 

Thanks again 

 

maybe just ask the real houdini it's maybe just magic. :-)

 

i think rgbtohsv is a VEX function the ch("") reads the value from the parameter interface so i'ts not a VEX function.

when you want to use a parameter just RMB copy Parameter and paste (RMB -> Paest Copied Re...) the Parameter in the Text field that should work always. 

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