wateryfield Posted July 14, 2014 Share Posted July 14, 2014 I stuck with a simple VEX question. I have to get the npoins of a geometry use attribute wrangle. int npoints(int input_number) really do well. but i was confused with the second expression. int npoints(string filename) Returns the number of points for all primitives in the geometry file. How to use it. Thanks. Quote Link to comment Share on other sites More sharing options...
magneto Posted July 14, 2014 Share Posted July 14, 2014 You can pass @OpInput1, etc. Quote Link to comment Share on other sites More sharing options...
ranxerox Posted July 14, 2014 Share Posted July 14, 2014 it for using the op: syntax. I've attached an example. -G Quote Link to comment Share on other sites More sharing options...
ranxerox Posted July 14, 2014 Share Posted July 14, 2014 yes or that. @OpInput1 is equivalent to `opinputpath(".",0)`. -G You can pass @OpInput1, etc. Quote Link to comment Share on other sites More sharing options...
Skybar Posted July 14, 2014 Share Posted July 14, 2014 i@mypoints = npoints(0); That creates an attribute with the value of how many points the first input to your wrangle has. To use the second input, npoints(1) and so on. Not sure if it works in a wrangle, but as a normal expression with the one that requires a string, you typically do: npoints("../sphere1") Quote Link to comment Share on other sites More sharing options...
ranxerox Posted July 14, 2014 Share Posted July 14, 2014 sorry the file didn't attach .. here it is. Relative references are supported now but you still need to use the "op" syntax. -G attribwrangle_npoints.hip 1 Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 14, 2014 Author Share Posted July 14, 2014 Guys. Thanks for all. i@np = npoints("op:/obj/geo1/OUT");the "op" syntax works well. Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 15, 2014 Author Share Posted July 15, 2014 sorry the file didn't attach .. here it is. Relative references are supported now but you still need to use the "op" syntax. -G Another question . How the addvariablename work? int s = npoints(@OpInput1); addvariablename("s", "S); or i@s = npoints(@OpInput1); addvariablename("s", "S"); seems not working at all. Quote Link to comment Share on other sites More sharing options...
anim Posted July 15, 2014 Share Posted July 15, 2014 it's the latter just note that addvariablename() function works only with point wrangle, not attriwrangle 1 Quote Link to comment Share on other sites More sharing options...
wateryfield Posted July 15, 2014 Author Share Posted July 15, 2014 it's the latter just note that addvariablename() function works only with point wrangle, not attriwrangle Thanks. working well. Is it any different between the point wrangle and attribute wrangle run over point. I don't get any useful information form help card. Quote Link to comment Share on other sites More sharing options...
ranxerox Posted July 15, 2014 Share Posted July 15, 2014 Thanks. working well. Is it any different between the point wrangle and attribute wrangle run over point. I don't get any useful information form help card. it can definitely be confusing.. Attribwrangle runs in CVex context, pointwrangle runs in SOP context see : http://www.sidefx.com/docs/houdini13.0/nodes/sop/attribwrangle the main difference is that in Attribwrangle you can add geometry (points, prims etC), which you can't in a point wrangle. Also the functions to access geometry are different as you've discovered. -G 1 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.