Max, min value and number of unique values of an attribute?

   6640   3   1
User Avatar
Member
88 posts
Joined: March 2010
Offline
Hi

How can I determine minimum or maximum value of any sop attribute?

For example I have connectivity sop that creates some attributes on the primitives. I would like to figure out the min-maximum values of particular attribute.

I also would like to find out how many unique attributes there are in given Sop

thanks
User Avatar
Member
1912 posts
Joined: Nov. 2006
Offline
You can use the Attribute Promote SOP to get the min/max values of any attribute.

Getting the number of individual attribute values is trickier. Personally I'd do it using Python with the result of hou.Geometry.pointFloatAttribValues(). This gives you a list of all the attribute values, which you could then convert to a Python set and get the count of individual elements.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
88 posts
Joined: March 2010
Offline
graham, thanks for the quick follow up. I will give it a go.
User Avatar
Member
88 posts
Joined: March 2010
Offline
Att Promote Sop worked like charm, thanks for the tip again graham.

I will try the Python solution, but I am wondering if I could do it with Vop SoP as well?
  • Quick Links