add_face_data

Mesh.add_face_data(name, attr, data, default=None)[source]

Add face data.

The data object has to allow access to face data using index notation. The data block as a whole can be accessed via self.name and the value data[f] as f.attr.

Parameters:
  • name (str) – Name of the data block.

  • attr (str) – Name of face attribute.

  • data (list or dict or ndarray) – Data object.

  • default (object, optional) – Immutable default face attribute value.

Raises:

ValueError – If a data block of the same name already exists.

Note

See add_vertex_data() for an example.