gerardocastellanos Posted December 13, 2019 Share Posted December 13, 2019 Hi everybody I want to use the "detail" function as an expression in a node parameter to read a vector component. detail("../sourceData","color.r",0) but it does not work. I tried "color.0", same result when I use just "color", it reads something, an average could be, anyway I just want to read one component of a vector value. how can I do that? thanks you. Quote Link to comment Share on other sites More sharing options...
ikoon Posted December 13, 2019 Share Posted December 13, 2019 (edited) Hi Gerardo, you should read the whole vector and then get its component. Also, if the "../sourceData" is meant to be path to a node, then it is wrong. You should not use relative path to specify the geometry. Here are the methods: https://www.sidefx.com/docs/houdini/io/op_syntax.html Or here, read my post: Then, after you fix your path ... here are two methods to get the indexed component: vector color = detail(0, "color", 0); @color_r = color[0]; // first method @color_r = getcomp(color,0); // second method Edited December 13, 2019 by ikoon Quote Link to comment Share on other sites More sharing options...
gerardocastellanos Posted December 13, 2019 Author Share Posted December 13, 2019 24 minutes ago, ikoon said: vector color = detail(0, "color", 0); @color_r = color[0]; // first method @color_r = getcomp(color,0); // second method Thanks a lot for your answer but I am working in a parameter of a node, I can not write multiple lines code. and I am using relative paths because it is a asset, and I want to re-use it in others places and scenes. thanks you again Quote Link to comment Share on other sites More sharing options...
ikoon Posted December 13, 2019 Share Posted December 13, 2019 Hi, in the title of the topic, you defined it as a VEX. If you are typing into a parm, then you are using probably a Hscript Expression Language, not VEX (it could be python as well). I assume that you have an Expression and this should work: detail("../sourceData","color",0) The detail() expression has different syntax then detail() vex function, and the third argument is attrib_index (or in other words, third argument is 0 for color[0], 1 is for color[1] etc.) https://www.sidefx.com/docs/houdini/expressions/detail.html What I wrote in previous post is related to VEX detail(), not Hscript Expression detail(). Quote Link to comment Share on other sites More sharing options...
gerardocastellanos Posted December 13, 2019 Author Share Posted December 13, 2019 opps.. my mistake, I tough it was vex... really thanks you a lot for your support. Quote Link to comment Share on other sites More sharing options...
ikoon Posted December 13, 2019 Share Posted December 13, 2019 No problem. I hope that it works fine now. I also want to add one thing. You can write multiple lines of code even in the parm, like this (start with RMB on the parm). Or hit Alt+E, when editing the parm: Quote Link to comment Share on other sites More sharing options...
gerardocastellanos Posted December 16, 2019 Author Share Posted December 16, 2019 (edited) great!.. thanks for your help Edited December 16, 2019 by gerardocastellanos 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.