Return the centroid, potentially weighted by an attribute.
If the weight is a string, an attribute of that name is attempted to be accessed on the mesh. If an array is given that array is used as weights. A value of None returns just the centroid calculation.
Parameters
Name
Type
Description
Default
weight
str | np.ndarray | None
The weights to apply to the positions when calculating the centroid. Defaults to None.
None
Returns
Name
Type
Description
np.ndarray
A 3-component vector with the calculated centroid.
evaluate
BlenderObject.evaluate()
Return a version of the object with all modifiers applied.
Returns
Name
Type
Description
Object
A new Object that isn’t yet registered with the database
The name for the attribute. Will overwrite an already existing attribute.
required
atype
str or AttributeType or None
The attribute type to store the data as. Either string or selection from the AttributeTypes enum. None will attempt to infer the attribute type from the input array.
None
domain
str or DomainType
The domain to store the attribute on. Defaults to Domains.POINT.