Sets a material id of a layer.
eOk if the operation completed successfully, or an appropriate error code otherwise.