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

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

```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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://black1277.gitbook.io/python-for-cinema4d/text/create_material.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
