MaterialLibrary.CreateMaterial

Introduced

v5.1

Description

Creates and adds a Material to the material library. The newly created material is not attached to any object.

C# Syntax

Material MaterialLibrary.CreateMaterial( String presetName, String matName );

Scripting Syntax

oReturn = MaterialLibrary.CreateMaterial();

Return Value

Material

Examples

JScript Example

// Create a new material in the current material library

NewScene( null, false );

var scn = Application.ActiveProject.ActiveScene;

var matlib = scn.ActiveMaterialLibrary;

var newmat = matlib.CreateMaterial( "Phong", "MyPhong" );

Application.LogMessage( "My new phong material: " + newmat.Name );

// Expected result:

//INFO : My new phong material: MyPhong