probiner Posted June 7, 2017 Share Posted June 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
dedeks3000 Posted June 7, 2017 Share Posted June 7, 2017 just write i@size =len(i[]@parm); I must admit that houdini and arrays it's a big story. 2 Quote Link to comment Share on other sites More sharing options...
sadhu Posted June 7, 2017 Share Posted June 7, 2017 There is one more function called arraylength that returns length of an array Quote Link to comment Share on other sites More sharing options...
acey195 Posted June 8, 2017 Share Posted June 8, 2017 (edited) 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 June 8, 2017 by acey195 1 Quote Link to comment Share on other sites More sharing options...
probiner Posted June 9, 2017 Author Share Posted June 9, 2017 (edited) 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 June 9, 2017 by probiner Quote Link to comment Share on other sites More sharing options...
sush2911 Posted December 17, 2021 Share Posted December 17, 2021 (edited) 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 December 17, 2021 by sush2911 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.