Jump to content
Sign in to follow this  
hoknamahn

Vex And Custom Image Planes...

Recommended Posts

Hey, guys!

I don't remember is it possible to add new image plane in VEX COP filter? For example, I want to pipe File COP with R, G, B, A planes to my VEX COP filter and get result with R, G, B, A, My_New_Pretty_Plane. The main idea is to generate multiple masks from Object IDs image plane (for color correction or something like that). It's the first question. The second question isn't related to COPs. Houdini doesn't allow to create dynamic interfaces like Maya can do with MEL. So maybe I can do the same things with Tcl/Tk? Never tried it before so I don't know. I just want to get my new generated Object IDs Masks and create one interface with multiple sliders (each slider for it's own mask).

Share this post


Link to post
Share on other sites

I imagine that there isn't such a VEX function since it's creating new data although I could be wrong. What about just creating an HDA (hence your custom sliders) which just uses a Color COP to add new planes? In the Image tab of the Color COP parameters, change the Add Plane "M" to None. In the Custom Planes parameter, you can just give it a string of new planes (separated by spaces) to add. You can either just promote the whole parameter or use a backtick expression to generate the plane names. Now if you need further processing in your HDA, you can add your VEX COP stuff to it.

Share this post


Link to post
Share on other sites
I imagine that there isn't such a VEX function since it's creating new data although I could be wrong. What about just creating an HDA (hence your custom sliders) which just uses a Color COP to add new planes? In the Image tab of the Color COP parameters, change the Add Plane "M" to None. In the Custom Planes parameter, you can just give it a string of new planes (separated by spaces)  to add. You can either just promote the whole parameter or use a backtick expression to generate the plane names. Now if you need further processing in your HDA, you can add your VEX COP stuff to it.

22007[/snapback]

Wow! Nice solution, Edward! :) Good idea. Thanks. What about bunch of sliders? (Each plane must have it's own slider) I think that I can't add sliders to HDA dynamically, right?

Share this post


Link to post
Share on other sites

That's a bit harder. Maybe you can just use spare parameters in the HDA. The opspare command has ability to list all the spare parameters of a node.

Share this post


Link to post
Share on other sites

You can also use an export parameter in VEX to create a new plane (though its name will be constant):

cop2
addluminance(export float lum = 0)
{
    lum = luminance(R,G,B);
}

This creates a plane named 'lum' and assigns it the luminance of R,G,B.

float = scalar float plane (1 channel);

int = scalar int plane;

vector = 3 channel float plane;

vector4 = 4 channel float plane

There's really no way to do this for a variable number of planes, though, as there's no way to create a variable list of export parameters in VEX (the UI is similarily limited).

Share this post


Link to post
Share on other sites

Any ideas how to detect automatically the number of IDs in the image plane? I can calculate the number of IDs in VEX but I see no ways how to export this to expressions or HScript. Maybe someone have an idea how to solve this (in any possible way)? :o For now I use semiautomatic mode where user set the number of IDs by hands. It's no good :huh:

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
Sign in to follow this  

×