Parameter Expression to return value of a string attribute

   5768   5   2
User Avatar
Member
130 posts
Joined: June 2016
Offline
Hi Guys,
I am having a detail attribute called “myAttr” which is a string type with value “myString”
I want this value in the text parameter of a font node.
so that I can query an attribute from the geometry and display that as text in viewport

Below is the expression I used in text field to get the value of “myAttr”.

`detail("../mynode","r",0)`

But this is not working can someone help me to make this work.

It is working for other type of attributes such as floats and integers.
but not working for string attribute.

Thanks in advance.
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Moin,

I may be completely confused … why would you want to read the attribute named “r” (as in your example) if the attribute you want to read is named “myAttr”? Shouldn't “r” be “myAttr”?

That said - have you checked that the path is correct?

Have you tried using “details” instead? (http://www.sidefx.com/docs/houdini/expressions/details.html [www.sidefx.com] )

I hope any of this is of any help anyway (any overhanging any are due to Easter)

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
130 posts
Joined: June 2016
Offline
Hey Marc,
Thanks a lot for the reply!


Sorry! My bad, I had tested with attribute “r” and just copy pasted the code, and totally forgot to edit that.
`detail("../mynode","myAttr",0)`

But anyway you have already solved my problem.

The “details()” function is working nicely.

I tried the same with point attributes,
point() is not working but points() is working

Now I have few queries,
why there is two functions detail() and details()
why detail() and point() function doesn't seems to work for string attribute?

Thanks a lot for the help
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

I have long given up trying to understand any “why” when it comes to Houdini “internals”. There seem to be at least three or four different philosophies at work (why anyone would want to have THREE completely different “languages” inside one and the same application for scripting purpose is beyond my horizon for example).

My guess (and it's only a guess, really) is that for historical or philosophical or religious reasons strings are handled differently in Houdini's core compared to vectors (“vectors” in a programming sense of the word), so that *maybe* “point(…,0)” would return the first character in a string, where it's supposed to return the first string POINTER in a vector of strings (that could have a size of 1).
Therefore “the powers that are” introduced additional functions (point*s* etc) to cater for strings, instead of doing an overload that handles strings and e.g. floats the same way.

Again, that's shooting blindly in the dark without knowing the weapon. If it *works* for you one way or another, roll with it :-)


Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
146 posts
Joined: Jan. 2018
Offline
OMG, point() vs points() is really a trap... I've lost some time wondering why point() was not working for my strings... thanks we have the forum because documentation on point() doesn't specify it doesn't work with strings!
User Avatar
Member
3 posts
Joined: April 2021
Offline
This thread helped me figure out what I was missing so I wanted to share. I was trying to make a version of polysplit with the edge offset exposed as a parameter. It's very useful for making edge loops.

Attachments:
EdgeLoops.hiplc (157.7 KB)

  • Quick Links