Click or drag to resize
DigitalRuneMeshHelperSetMaterial Method
Sets the material for a submesh.

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public static void SetMaterial(
	this Submesh submesh,
	Material material
)

Parameters

submesh
Type: DigitalRune.GraphicsSubmesh
The submesh.
material
Type: DigitalRune.GraphicsMaterial
The new material.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Submesh. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionsubmesh or material is .
InvalidOperationException The Submesh is not yet part of a Mesh. Add the Submesh to the Submeshes collection of a Mesh before setting the material.
Remarks
The material can only be changed if the Submesh is part of a Mesh. When the material is changed, the Materials of the Mesh are automatically updated. (New materials are added. Unused materials are removed.)
See Also