Jump to content
catchyid

cannot read attribute value

Recommended Posts

Hi,

In "color" sop node, I am trying to set the color value to a point attribute "rd" that I've created in an upstream Attribute Wrangler node. The problem is I am always getting 0.0 instead of the actual value of attribute "rd", hence the final color is always black. I am not sure what I am doing wrong?! Plz, see attached.

 

 

cannot_read_attribute.png

Share this post


Link to post
Share on other sites

you could just write

@Cd = rand(@ptnum);

or use "Color Type" = "Random from Attribute" in "color1" node.

Edited by sasho78
  • Like 1

Share this post


Link to post
Share on other sites

Thanks :) I was just throwing an example, setting color values is not my goal, sorry if I was not clear. My problem is that in any node I cannot read previously attributes using @ operator, so in this example, I was trying to read previously defined attribute rd and copy it to @Cd in an expression, but it did not work, and I am not sure why?

Once more, thanks :)

Share this post


Link to post
Share on other sites

The problem is that not all nodes support those per point local variable.

From the help docs on the color node:

Quote

This is a Houdini Digital Asset and does not support local variables. To have different colors per element, see the other more advanced SOPs: Point, Primitive, Vertex.

So you just need to use a Point sop instead of the color sop.

Edited by MirrorSword
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×