emcjagger Posted February 7, 2007 Share Posted February 7, 2007 (edited) Hi folks, I'm trying to get an attribute (P) from primitives using UV coordinates in VEX code, much as one would with the primuv() expression. The prim_attribute function seems like it should fit the bill. The help shows usage like this: int prim_attribute(string filename; vector &adata; string att; int pn; float u; float v) I assumed that the "filename" could be a houdini operator. I tried directing it to the appropriate sop, but it only sort of sometimes worked for a smattering of the points, and always returned 0. Am I missing something? A related general question about attributes: is it generally quicker to add attrs in your own custom vex op, than in an AttribCreate sop? My tests so far seem to suggest so. I already have a way of doing the above using primuv() and a Point sop, but I figured it would be faster in a vex sop, especially since I'm setting P so I currently have to call primuv() 3 times (xyz). Finally, is there a way to get attrs mapped to variables (eg. myAttr -> MYATTR) when they're added in a vex op, the way they are with AttribCreate sops? And is there a way to get custom vex ops to recognize attribute variables in parameters the way other ops do ($PT, $TX, etc.)? Many thanks! Jeremy. Edited February 7, 2007 by emcjagger 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.