How to use point attribute

   11410   9   2
User Avatar
Member
21 posts
Joined: 10月 2014
Offline
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?

Attachments:
test_02.png (29.2 KB)
test_03.png (32.6 KB)
test_01.png (65.2 KB)
test_04.png (27.5 KB)
test_05.png (14.6 KB)

thank you and best regards
dalibor
User Avatar
Member
32 posts
Joined: 7月 2005
Offline
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).”
-nimajneb
User Avatar
Member
21 posts
Joined: 10月 2014
Offline
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.
thank you and best regards
dalibor
User Avatar
Member
25 posts
Joined: 10月 2012
Offline
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
User Avatar
Member
50 posts
Joined: 2月 2009
Offline
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.
User Avatar
Member
21 posts
Joined: 10月 2014
Offline
great! you guys rock! thank you very much, I will post the results soon.
thank you and best regards
dalibor
User Avatar
Member
37 posts
Joined: 2月 2015
Offline
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

Attachments:
Greyscale.jpg (4.0 KB)
attribFromTextureMap_cubeRotate.hipnc (105.5 KB)

User Avatar
Member
37 posts
Joined: 2月 2015
Offline
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.
User Avatar
Member
443 posts
Joined: 9月 2012
Offline
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.

Attachments:
attribfromtexturemap_cuberotate_183.hipnc (105.1 KB)

User Avatar
Member
37 posts
Joined: 2月 2015
Offline
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
  • Quick Links