Jump to content

How to use len() ?


Recommended Posts

So here's a simple index array on which I try to get the lenght of in Attribute Wrangle. But it throws an error like it wants vectors, so I'm left wondering if this is the right function to use or the code is missing something.
Thanks.

EkjqLvu.png

Link to comment
Share on other sites

9 hours ago, sadhu said:

There is one more function called  arraylength that returns length of an array 

That one is deprecated now though, use len() instead, in the way dedeks put it.

the "i[]" prefix to @ is just a way to cast the attribute as an integer array.
the "Ambiguous Call" warning that you get basically tells you that you need to be more specific.

see this page:
http://www.sidefx.com/docs/houdini/vex/snippets

(about 1/3rd to halfway down the page)

Edited by acey195
  • Like 1
Link to comment
Share on other sites

Thanks guys, indeed when reading mestela's wiki I've noticed him saying he always forgets to initiate them and I didn't get it at the time, because I thought it only meant for new attributes, not custom ones which signature is not well established.

 

On 6/8/2017 at 9:08 AM, acey195 said:

see this page:
http://www.sidefx.com/docs/houdini/vex/snippets

(about 1/3rd to halfway down the page)

Cheers!


 

On 6/7/2017 at 7:57 PM, dedeks3000 said:

I must admit that houdini and arrays it's a big story.

Yeah I'm wondering if I'm going the right path with my approach. Also with the fact from what I can see, you have to go outside VOP or Attribute Wrangle to change the context of data (point, vertex, prim, detail) is a bit disheartening.

Edited by probiner
Link to comment
Share on other sites

  • 4 years later...

Old topic but.. I could never have figured this out.. I always thought that once an attribute type has been initiated we don’t need to specify it again so as to assign or modify that attribute later.. But I guess arrays are totally different!

 

Thanks

Edited by sush2911
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...