Version: 2022.3
LanguageEnglish
  • C#

Mesh.MeshData.GetVertexAttributeStream

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Declaration

public int GetVertexAttributeStream(Rendering.VertexAttribute attr);

Parameters

attr The vertex data attribute to check for.

Returns

int Stream index of the data attribute, or -1 if it is not present.

Description

Get the vertex buffer stream index of a specific vertex data attribute on this MeshData.

Meshes usually use a single vertex buffer stream, but it is possible to set up a vertex layout where attributes use different vertex buffers (see SetVertexBufferParams). When you use such a layout, use this function to query which vertex buffer stream a given attribute is part of.

Note that this function returns the index of the stream, without specifying where the attribute is within the stream. To identify the location of a given attribute in the stream, use GetVertexAttributeOffset.

Additional resources: GetVertexAttributeOffset, vertexBufferCount, GetVertexBufferStride, Mesh.GetVertexAttributeStream.