gnarlog Posted August 20, 2013 Share Posted August 20, 2013 Hi there, I'm fairly new to Houdini, and this may be common knowledge, but I couldn't find any reference to it, so here goes: If I have an attribCreate sop set to create a vector and I open the expression editor through one of the component fields, can I set the other components in that expression? Thanks a lot, Matt Quote Link to comment Share on other sites More sharing options...
gnarlog Posted September 10, 2013 Author Share Posted September 10, 2013 Now I usually just use vops when I run into this kind of problem, but I'd still like to know if this is possible? Is the question clear? Anyone? Thanks, Matt Quote Link to comment Share on other sites More sharing options...
mangi Posted September 10, 2013 Share Posted September 10, 2013 Hi Matt. Your question is not very clear ? Do you just want to copy the same value in the other fields ??? (past copied relative referance) can you give and example of what your are after. Cheers mangi Quote Link to comment Share on other sites More sharing options...
gnarlog Posted September 13, 2013 Author Share Posted September 13, 2013 Hi Mangi! Thanks for the response. So... Let me see if I can put this more clearly. I'm actually working on a scene right now where I'd like to be able to do what I'm talking about. I have a windforce node connected to a pyro sim. I want the wind to blow toward the camera, so I subtract a reference point from the camera position. I want that vector to be normalized. So it would be really handy to be able to open the expression editor in one of the velocity parameter fields and do something like: { vector windDir = (camPosX - refPosX, camPosY - refPosY, camPosZ - refPosZ,); vector windDirNorm = normalize(windX, windY, windZ); .... } And then assign the components of windDirNorm to the corresponding parameter fields. As far as I know, when you return whatever you've calculated, it applies exclusively to the parameter field that you opened the expression editor in. Of course, it's not really a big deal to use a vop sop to do that job, but it would certainly be nice to be able to specify a field in a vector parameter to assign the component results to from a vector calculation in an expression. Does that make any sense? Thanks a lot, Matt Quote Link to comment Share on other sites More sharing options...
gnarlog Posted September 13, 2013 Author Share Posted September 13, 2013 By the way, I feel compelled to say that after reviewing a number of threads in this forum, that I think it's quite remarkable how smart and helpful this group of people are. Very impressive group;) Quote Link to comment Share on other sites More sharing options...
old school Posted September 13, 2013 Share Posted September 13, 2013 Unfortunately this is an inherent limitation of SOP nodes: only one return type to match the parameter's type leading to repetition and overhead. POPs allow you to toggle some three component vectors in to a vector parameter type that never made it in to SOPs and again return type limited to the parameter containing the expression. Plus this is not threaded. We now have the Wrangle type operators if you want to work in SOPs without having to dive in to VOPs nor mess about with parameter expressions. You bypass all of that and work with attributes directly and it's all threaded.. If it is a point attribute you wish to modify, the Point Wrangle SOP is just awesome. Here's a shot at what you want to do with a Point Wrangle SOP: vector camPos = chv("/obj/cam1/t"); // use chv() to import a vector parametervector refPos = {1,0,1};v@windDir = camPos - refPos;@windDir = normalize(@windDir);[/CODE]Hope this helps. Quote Link to comment Share on other sites More sharing options...
gnarlog Posted September 14, 2013 Author Share Posted September 14, 2013 That is perfect! Exactly what I was looking for. Thank you! 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.