C4 Engine
C4 Engine API Documentation

MaterialObject::FindAttribute

Defined in:  C4MaterialObjects.h
Returns an attribute having a specific type.
Prototype

Attribute *FindAttribute(AttributeType type, int32 index = 0) const;

Parameters
type The type of attribute to find.
index The index of the attribute of the given type to return.
Description
The FindAttribute function searches a material object's attribute list for attributes having the type specified by the type parameter and returns the n-th instance of any such attribute, where n is the zero-based index specified by the index parameter. (Specifying 0 for the index parameter causes the first matching attribute to be returned.) If no such attribute exists in the material object, then the return value is nullptr.
See Also

Attribute

MaterialObject::GetAttributeList

MaterialObject::GetFirstAttribute