Attribute Create

   3353   13   1
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
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
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
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
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Could you name your attribute “Cd” directly on the Attribute create and make i of type vector?

Cheers
Bonsak

Attachments:
Cd.png (26.9 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
Thanx!
I see no place in the point or color sop where I can insert the $myattributename. Where should I write it?
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
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
http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
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.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
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
http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
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.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
So this doesn't work? Or do you need to blend your new attribute with already existing color?

Cheers
Bonsak

Attachments:
stig.hip.zip (8.3 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
Thanks for helping me.
I dont know why its not working, have a look at the attachment.

Stig

Attachments:
stig_v2.hipnc (261.7 KB)

User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
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
http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
Ive tried but it doesnt work.
I guess Im inserting the expression in the R field wrong or something.
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
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

Attachments:
stig_v3_191.hipnc.zip (38.6 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
80 posts
Joined: Aug. 2013
Offline
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.
  • Quick Links