Issues when reading a string array element in detail attribute using an expression

   5890   3   2
User Avatar
Member
29 posts
Joined: March 2015
Offline
Hi there!

I'm trying to read some elements stored in a detail attribute as a string array with a Houdini Expression, and it doesn't work.
So maybe I'm doing something wrong or there's a bug somewhere, but I would be glad to get some help with this

I've attached a simple scene where I create a string and string array detail attributes using an Attribute Wrangle.
s@object = "/obj/sphere1";
s[]@objects = {"/obj/sphere1"};
Then I try to read them in an Object Merge SOP with the corresponding Houdini Expressions: details() for the string attribute, and detailsmap() for the string array attribute.
It works fine with string:
`details("../attribwrangle1/", "object")`

but not with the string array:
`detailsmap("../attribwrangle1/", "objects", 0)`

Am I missing something here?

Thanks a lot!

Alex
Attachment Not Found

Attachments:
DetailAttrStringArray.hip (87.8 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
Could you submit an RFE [www.sidefx.com] (Request For Enhancement) for this?

With the HScript functions returning float, like detail, I think they've had support for float array attributes added, but the detailsfunction returning string doesn't have a parameter for the index, so it won't work for strings. detailsmap, along with primsmap, pointsmap, and vertexsmaplook like they are for the different purpose of looking at all of the unique strings in an attribute, (e.g. if 10000 points have string “foo” and 4000 have string “bar”, there'll be just the 2 unique strings, in a possibly-arbitrary order). There should probably be a function for looking up into string array attributes, though, maybe named something like detailsa.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
29 posts
Joined: March 2015
Offline
Thanks Neil for your quick answer, I've just submitted an RFE.
I confirm that float array work just fine.
I'll try to find a workaround meanwhile.

Alex
User Avatar
Member
15 posts
Joined: May 2021
Offline
Hi, I know this post is for 6 years ago, but did you find any function for looking up into string array attributes? or anything like the details function returning string with an index parameter?
  • Quick Links