Search - User list
Full Version: How to use point attribute
Root » Houdini Learning Materials » How to use point attribute
Dalibor Kalna
Hi there,

My scene network is rather simple (Picture 1).
I would like to rotate cubes in Y axis according to grayscale value in image.

I have defined “greyscaleColor” in node “Attributte from Map” and its there,
I can see it in spreadsheet as point attribute. (Picture 2 and 3)

Now on “Copy” node I ahve defined stamp value rotateY (Picture 4) and I use
that on “Transform” node of cube (Picture 5).

It does not work, I do not know how to reference that “greyscaleColor” from “Attribute from Map” in “Copy” node. It says: “Bad reference…” Any help?
nimajneb
You need the point expression I believe. http://www.sidefx.com/docs/houdini13.0/expressions/point [sidefx.com]

So something like “point(<your_node_string>, $PT, <your_attrname_string>, 0).”
Dalibor Kalna
hi nimajneb,

thank you for your response. I have tried following expression in xform node:

points(“/obj/GEO/attribfrommap1”, $PT, “greyscaleColor”)*180

but it results in error:

Unable to evaluate expression (Bad data type for function or operation (/obj/GEO/xform1/ry)

When I apply that expression to “copy” node I get the same result.
Doodlez
The expression is called point(), not points() and you forgot to put ,0 (The attribute index, for a single float always 0) after your attribute name.
It should be: point(“/obj/GEO/attribfrommap1”, $PT, “greyscaleColor”,0)*180
danBode
To clarify, “points” is an expression that returns a string attribute, where “point” is an expression that returns a float and can be used to grab float or int attributes or part of a vector.
Dalibor Kalna
great! you guys rock! thank you very much, I will post the results soon.
anthonymcgrath
hey guys hope you dont mind me hijacking this thread too!

i decided to have a go at this as well - my understanding is that the luminance value from the image should pass through to the cube copies rotating them a certain amount… so in the white area they may be (for example) 90 degrees rotation and in black 0 degrees rotation.

not sure if i'm doing this right tho or if this is what i'm trying to achieve here?

attached scene file and simple greyscale gradient texture

ta
ant
anthonymcgrath
been trying to get this to work - followed instructions as described above but it doesn't work… all the cubes are just rotated the same amount and the bad parameter is printed out in the details of the copy1 node.
PradeepBarua
You are using point() expression to read attribute from grid. This way you don't have any relation with copy SOP. To get stamped attributes from copy you need to use stamp() expression function.
Since your attribute “lum” is in between 0 to 1. It's very small very to rotate so you need to fit() this to 0-90.

See attached file.
anthonymcgrath
ahhh okay am just having a look over this now.. im a bit confused on the syntax in the fit01 command but i can see the opinputpath is obtaining the information from the node plugged into the second input of the copy1 node.. in this case attribfrommap. The rest of the stuff in there i'm a bit lost with in all honesty hehe.. altho i can see the final two values are the newmin and newmax

thanks alot that does indeed seem to work a treat
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB