AntoineSfx Posted August 10, 2018 Share Posted August 10, 2018 (edited) Using a Block Begin SOP / for loop, I'm trying to generate one font SOP which text is read from a string attribute set on each point I don't manage to get the syntax right for the text field It should be something like this: a reference to the node containing the string attribute, an attribute name, and an index, per Houdini documentation: point(surface_node, point_number, attribute, index) So I thought this should work: point("../pointwrangle1/", detail("../foreach_begin1_metadata1/","iteration",0), "letter",0) It doesn't reject it, but it doesn't return the text in string attribute "letter", but the integer value of iteration instead What's happening here ? odforce.text.hipnc Edited August 10, 2018 by AntoineSfx Quote Link to comment Share on other sites More sharing options...
ikoon Posted August 10, 2018 Share Posted August 10, 2018 To return a string value, use points() instead of point() http://www.sidefx.com/docs/houdini/expressions/points.html The same applies for detail() / details() and prim() / prims(). This should work, last argument (the index 0) is not used with points() points("../pointwrangle1/", detail("../foreach_begin1_metadata1/","iteration",0), "letter") Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted August 10, 2018 Author Share Posted August 10, 2018 Thanks. It's not clear from the documentation that strings and numbers are treated differently. Quote Link to comment Share on other sites More sharing options...
Noobini Posted August 10, 2018 Share Posted August 10, 2018 was just goofing around and found that if you change your font command to: points("../foreach_begin1", 0, "letter") it works too.....and even if you change the 0 to WHATEVER number...it still works coz...everytime it executes for a point there is only ONE point it's getting the "letter" from A bit more cryptic..but much shorter... Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted August 11, 2018 Author Share Posted August 11, 2018 11 minutes ago, Noobini said: was just goofing around and found that if you change your font command to: points("../foreach_begin1", 0, "letter") it works too.....and even if you change the 0 to WHATEVER number...it still works coz...everytime it executes for a point there is only ONE point it's getting the "letter" from A bit more cryptic..but much shorter... yes, no need to mess with nested function calls. I like it better because it seems to refer to .. the point being processed, whereas using the variable iteration kinda defeats the purpose of having an iterator.. Thanks for the trick, hoping it's no going to come haunt me later 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.