Jump to content

Vex And Custom Image Planes...


hoknamahn

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

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

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

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

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

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