Valent Posted August 1, 2018 Share Posted August 1, 2018 Hi, I'm here with another nooob question) I am trying to assign the value of a component of a custom vector attribute to a float and it doesn't work. Could you please explain to me what I am doing wrong? q1.hipnc Quote Link to comment Share on other sites More sharing options...
jamesr Posted August 3, 2018 Share Posted August 3, 2018 The problem is that you're mixing vex variables and attributes. The following code is incorrect (not really sure why it's not erroring out...) @Cd={0,0,0}; vector @a1={0,0,0}; // Here is your problem f@b=0; @Cd=fit01(relbbox(@P), 0.5,1); @a1=fit01(relbbox(@P), 1,0.5); instead of doing vector @a1 you want to declare the vector attribute as v@a1 Here's your file with the stuff fixed. I like to prefix the attributes with f, v, p, 4, etc all the time when I'm coding. You don't technically have to each time, and I don't think most people do, but it helps me avoid any confusion on the type especially in places where houdini is pickier about it, like in DOPs. I also added some spaces to make it a bit more readable . You may want to consider getting more descriptive with your attribute/variable names! q1_fix.hipnc Quote Link to comment Share on other sites More sharing options...
Valent Posted August 6, 2018 Author Share Posted August 6, 2018 Thanks for your answer, but I think it works just because you've put "unnecessary" prefix in the last wrangle. Try to remove "v"(because it was declared as a vector attribute in the previous wrangle) and you'll get the same error. Also if you put in the last wrangle something like v@a; it works as well. Quote Link to comment Share on other sites More sharing options...
jamesr Posted August 6, 2018 Share Posted August 6, 2018 Oh yeah I see that. I guess that sort of works, but I'd stay away from doing it that way since it's not really working as expected. You shouldn't actually need to put the v@ in the second wrangle in this case. 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.