Search - User list
Full Version: Attribute Create
Root » Houdini Learning Materials » Attribute Create
stigolsen
Hi,

Im trying to understand attribute create sop and I have created one, named it, set the local variable to $TY<4 to catch the position of a box falling. I would like to color this box when the position is less than 4. How do I access this attribute in lets say the color sop or the point sop to color it?

Stig
goldfarb
if you MMB on the atribCreate node you'll see a new variable mapping

yourAtribName > YOURATRIBNAME

in your color/point SOP you'd use $YOURATRIBNAME
bonsak
Could you name your attribute “Cd” directly on the Attribute create and make i of type vector?

Cheers
Bonsak
stigolsen
Thanx!
I see no place in the point or color sop where I can insert the $myattributename. Where should I write it?
bonsak
In a point SOP set the Color dropdown to Add color and then insert $MYATTRIBUTE in one of the color vector value fields.

Cheers
Bonsak
stigolsen
In the add color I need to put my color. THe attribute create node has this local var $TY<4 and I want the color node or point sop to use this local var to color the object red when the position is less than 4.
bonsak
I would put “$TX<4” in the “Value” field of the Attribute Create node not in the “Local variable” field, then you can reference your'e attribute in your Point SOP.

Cheers
Bonsak
stigolsen
I got that, I just wondered where in the point or color sop to reference the expression as I cant put into on of the three RGB areas because its where I determines the colors.
bonsak
So this doesn't work? Or do you need to blend your new attribute with already existing color?

Cheers
Bonsak
stigolsen
Thanks for helping me.
I dont know why its not working, have a look at the attachment.

Stig
bonsak
Try to replace the point SOP with a new one. I have no idea why this works but it seems the old point SOP was looking for an attribute called “diffr”.

-b
stigolsen
Ive tried but it doesnt work.
I guess Im inserting the expression in the R field wrong or something.
bonsak
Your'e referencing your attribute with small letters “$ypos4” but its passed down the stream in capital letters “$YPOS4”. See the attachment.

When “Local Variable” on the Attribute Create is empty, the “Name” is capitalized. If you set “Local Variable” to some value, then that will become the name of the Attribute, exactly as you wrote it.

-b
stigolsen
What you say makes sense, but I think this is a bug in my system.
I have changed from capital letters, but I end up with a “red” node, and when MMB clicking on it it tells me that its unable to evaluate the expression and points to the diffr that you mentioned in an earlier post. I have tried to delete and add a new point sop but still.
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