I would like calculate the min / max of a value inside of a parameter button callback script, like this one from the Attrib Remap Ql node.
I'd like the callback script to be relatively self contained and not need reference any detail attribute values in order to reduce node clutter.
Is the solution here just to iterate over all the total points in the geometry and then calculate values from that array? Or is there some more elegant solution / python function houdini provides for doing this? Nothing from the python docs is jumping out at me as a more elegant solution.
node = hom.node() # Access the geometry geometry = node.geometry() # Specify the attribute name attribute_name = 'your_attribute_name' # Replace with your attribute name # Get the attribute values based on the attribute type if geometry.findPointAttrib(attribute_name).dataType() == hou.attribData.Float: values = geometry.pointFloatAttribValues(attribute_name) elif geometry.findPointAttrib(attribute_name).dataType() == hou.attribData.Int: values = geometry.pointIntAttribValues(attribute_name) elif geometry.findPointAttrib(attribute_name).dataType() == hou.attribData.String: values = geometry.pointStringAttribValues(attribute_name) else: raise ValueError("Unsupported attribute type") # Print the attribute values for value in values: print(value)

