> For the complete documentation index, see [llms.txt](https://black1277.gitbook.io/python-for-cinema4d/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black1277.gitbook.io/python-for-cinema4d/text/create_material.md).

# Как создать и применить к объекту материал

Сначала, создадим сферу и поместим её на сцену:

```Python
  sphere = c4d.BaseObject(c4d.Osphere)
  doc.InsertObject(sphere)
```

Создадим базовый материал и дадим ему имя:

```Python
  mat = c4d.Material(c4d.Mbase)
  mat.SetName('red')
```

Другие типы материалов можно найти в [документации](https://developers.maxon.net/docs/py/23_110/types/materials.html), (Mbanji,Mfog,Mmaterial,Mterrain и др.)

Установим цвет красный и отключим слой отражений:

```Python
  mat[c4d.MATERIAL_COLOR_COLOR] = c4d.Vector(1,0,0)
  mat[c4d.MATERIAL_USE_REFLECTION] = False
```

Чтобы настроить другие параметры материала сверяйтесь с [документацией](https://developers.maxon.net/docs/py/23_110/classic_resource/material/mmaterial.html) Методы объекта `c4d.Material` на странице [документации](https://developers.maxon.net/docs/py/23_110/modules/c4d/C4DAtom/GeListNode/BaseList2D/BaseMaterial/Material/index.html)

Поместим созданный материал в сцену:

```Python
  doc.InsertMaterial(mat)
```

Создадим на сфере тег текстуры и присвоим ему созданный материал:

```Python
  tag = sphere.MakeTag(c4d.Ttexture)
  tag[c4d.TEXTURETAG_MATERIAL] = mat
  c4d.EventAdd() # обновим сцену
```

Другие параметры тега текстуры в [документации](https://developers.maxon.net/docs/py/23_110/classic_resource/tag/ttexture.html)
