Bandu Posted December 3, 2008 Share Posted December 3, 2008 Hi guys, I'm doing a VEX SOP Geometry Operator and I'm wondering if there is a way to define my own Local Variables like $CEX $CEY $CEZ for example. I want to be able to use them in my Parameter node if possible. In detail, I needed different type of Scale Operator I wrote and it works fine. I need to compute my geometry center in order to work it properly. The only way I found is to type my previous transformation in Parameter node ( if the geometry is transformed ) and use this values inside VEX. In Houdini Transform Operator I can type $CEX, $CEY, $CEZ to get the center of the object ( origin for scale ) or any values I like. Now I need the same Local Variables for my Operator ( even $XMAX... $BBX... ) so it will compute them automatically inside my own Operator as soon as I write them in my parameter dialog. Thanks, Bandu Quote Link to comment Share on other sites More sharing options...
aracid Posted December 4, 2008 Share Posted December 4, 2008 hey What about using the bounding box VOP, and using an average VOP between min and max, use that as your centre ? thats like using a centroid expression and passing those values into the vop context. does this help? Quote Link to comment Share on other sites More sharing options...
Bandu Posted December 4, 2008 Author Share Posted December 4, 2008 this method calculate always the center point, I want to use $XMAX, $BBX and all other variables and expressions using this variables, like is standard Houdini transfer node. At the same point it will allow me to create my own local variables if I only knew how to declare them. Thanks anyway! Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted December 4, 2008 Share Posted December 4, 2008 this method calculate always the center point, I want to use $XMAX, $BBX and all other variables and expressions using this variables, like is standard Houdini transfer node. At the same point it will allow me to create my own local variables if I only knew how to declare them. I think the only way to expose these as local variables is to write the OP using the HDK. VEX can create attributes and map them to variable names, but those would only be available further down the chain, not in the OP itself. Quote Link to comment Share on other sites More sharing options...
leo grabau Posted March 29, 2016 Share Posted March 29, 2016 One way that I found how to get that is1. Create a box oriented to your input geo 2. To create an attribute called BBX which their value is $BBX (or the axis of your choice) then in Attri VOP use a bind and call this last attribute 3. Use a multiply between "Cd" and "BBX", add a ramp to remap the color information 4. Voila, even if your geometry moves the ramp follows it, very usefulll to grade emitters or points or whatever you need. Hope it help you out.Regards! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.