Verge3D PzLib API — Materials

# Materials

#### getMaterialEditableColors(matName) → {Array.<string>}

Get the names of the color properties for the given material that don't require shader recompilation in order to apply changes after editing. For MeshNodeMaterial those are the names of RGB nodes.

##### Parameters:

Name | Type | Description
--- | --- | ---
`matName` | string | Material name.

##### Returns:

Editable color properties for the material.

Type
  Array.<string>

#### getMaterialEditableTextures(matName, collectSameNameMatsopt) → {Array.<v3d.Texture>}

Get editable textures from the given material. The material should be an instance of MeshNodeMaterial or MeshStandardMaterial.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`matName` | string |  |  | Material name.
`collectSameNameMats` | boolean | <optional> | false | Whether to collect textures from all materials with the same name or from the first material with that name found on the scene (default behavior).

##### Returns:

Array of editable textures for the material.

Type
  Array.<v3d.Texture>

#### getMaterialEditableValues(matName) → {Array.<string>}

Get the names of the scalar "value" properties for the given material that don't require shader recompilation in order to apply changes after editing. For MeshNodeMaterial those are the names of Value nodes.

##### Parameters:

Name | Type | Description
--- | --- | ---
`matName` | string | Material name.

##### Returns:

Editable scalar "value" properties for the material.

Type
  Array.<string>

#### getMaterialProfile() → {string}

Get what profile to use for newely created materials.

##### Returns:

Material profile: 'blender', 'max', or 'maya'

Type
  string

#### isMaterialNameUsed(name) → {boolean}

Check whether the given material name is used by materials on the current scene or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | Material name to check.

##### Returns:

Check result.

Type
  boolean

#### replaceMaterialEditableTexture(mat, oldTex, newTex)

Replace the specified texture on the given material with a new one. The material should be an instance of MeshNodeMaterial or MeshStandardMaterial.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mat` | v3d.MeshNodeMaterial | v3d.MeshStandardMaterial | Material.
`oldTex` | v3d.Texture | Old texture from the material to be replaced.
`newTex` | v3d.Texture | New texture to put onto the material.