---
name: "getObjectMaterials"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "1.38"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/getObjectMaterials
revid: 370528
updated: 2025-01-01T23:24:06Z
---

# getObjectMaterials

*Command · Object Manipulation · Arma 3 v1.38*

Locality: arguments **global**

## Description

Gets all custom materials associated with the object.

## Syntax

### Syntax 1

```sqf
getObjectMaterials obj
```

**Parameters:**

- `obj`: [Object](../topics/Object.md)

**Returns:** [Array](../topics/Array.md) of [String](../topics/String.md)s - array of materials

### Syntax 2

*since Arma3 2.20*

```sqf
obj getObjectMaterials sels
```

**Parameters:**

- `obj`: [Object](../topics/Object.md) - entity
- `sels`: [Array](../topics/Array.md) - array of index(es) and/or selection(s). If array is empty [] - default object materials are returned (see example 3)

**Returns:** [Array](../topics/Array.md) of [String](../topics/String.md)s - array of materials in order of 'sels'. Non existing materials filled with [nil](../commands/nil.md)s.

## Examples

### Example 1

```sqf
_materials = getObjectMaterials car;
```

### Example 2

```sqf
player setObjectMaterial ["insignia", "A3\Structures_F\Data\Windows\window_set.rvmat"];
player getObjectMaterials ["insignia", 0, 1, player, "dskjhkjhsad"]; 
// ["a3\structures_f\data\windows\window_set.rvmat","","a3\structures_f\data\windows\window_set.rvmat",<null>,<null>]
```

### Example 3

```sqf
player setObjectMaterial [0, "a3\structures_f\data\windows\window_set.rvmat"];
getObjectMaterials player; // ["a3\structures_f\data\windows\window_set.rvmat",""]
player getObjectMaterials []; // ["",""]
```

## See also

[setObjectMaterial](../commands/setObjectMaterial.md) · [setObjectTextureGlobal](../commands/setObjectTextureGlobal.md) · [getObjectTextures](../commands/getObjectTextures.md) · [setObjectTexture](../commands/setObjectTexture.md) · [setObjectMaterialGlobal](../commands/setObjectMaterialGlobal.md)

<sub>Source: [BI Community Wiki — getObjectMaterials](https://community.bistudio.com/wiki/getObjectMaterials) (revision 370528).</sub>
