konstantin magnus Posted May 1, 2018 Share Posted May 1, 2018 (edited) While trying to create a point attribute based on array values from second input, I was expecting this to work: v@Cd = v[]@opinput1_colors[@ptnum]; // only works on point 0 I also tried getcomp(), but it seems I am missing something. vector a = getcomp(v[]@opinput1_colors, @ptnum); // uses first array value on all points addpointattrib(0, "Cd", a); camera_to_screen.hiplc Edited May 1, 2018 by konstantin magnus Here is an simplified example Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted May 1, 2018 Share Posted May 1, 2018 im not familiar with @opinput1_"variable" syntax, but it seems like i points to the same pointnumber as itself. So since you only have one point i input number two, the only point that finds anything is point number one on your mesh. I dont know the endgoal here, but if you want to access the "colors" array on point 0 on all your points, you can write it like this. vector array[] = point(1,"colors",0); @Cd = array[@ptnum]; 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 1, 2018 Author Share Posted May 1, 2018 Thank you, yes, that was it! Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 2, 2018 Share Posted May 2, 2018 Hi Konstantin ! All your examples will be work after some adjustments. See hip and Accessing attributes on other inputs in help card https://www.sidefx.com/docs/houdini/vex/snippets.html camera_to_screen_01.hipnc 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 2, 2018 Author Share Posted May 2, 2018 Thank you Victor! I didnt even know "attribute to match" existed! Its also described in the attribwrangle: http://www.sidefx.com/docs/houdini/nodes/sop/attribwrangle.html Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 3, 2018 Share Posted May 3, 2018 Yes. I found for myself that the key F1 is most useful key when you learn some soft. And one tip, in case if you didn't know that yet. If you put cursor at function's name in wrangle and press F1 then pop-up Help Browser with help for this function. It works for expressions in Edit Expression window also. Very helpful sometimes. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 3, 2018 Author Share Posted May 3, 2018 Well, I usually read the documentation where needed. But I ignored the attribwrangle page thinking everything is done inside VEX code. I dont find the idea of setting "invisible" match attributes particularly elegant, either, as they dont show up in the code. But it seems to be the most straight forward way to access arrays fro other nodes in Houdini, so thank you again for the hint! 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.