Jump to content

Invalid subscript for type: float.z


Recommended Posts

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 :D. You may want to consider getting more descriptive with your attribute/variable names!

 

 

 

q1_fix.hipnc

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...