# Python - How do I leave out an optional parameter in a class

**URL:** <https://forums.unrealengine.com/t/python-how-do-i-leave-out-an-optional-parameter-in-a-class/251855>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [September 21, 2021, 5:10am UTC](https://forums.unrealengine.com/t/python-how-do-i-leave-out-an-optional-parameter-in-a-class/251855 "2021-09-21T05:10:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![racks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@racks](https://forums.unrealengine.com/u/racks)\
**Post date:** [September 21, 2021, 5:10am UTC](https://forums.unrealengine.com/t/python-how-do-i-leave-out-an-optional-parameter-in-a-class/251855/1 "2021-09-21T05:10:23Z")

</div>

Im trying to use `create_mesh_section` class from [this](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/ProceduralMeshComponent.html) page in the unreal python docs.

I can provide every parameter for the class apart from the `vertex_colors` parameter but it says that it is optional.

When I run the code an error message appears saying it is required.

any fixes?

**Line of code:**

```auto
mesh.create_mesh_section(0, verts, triangles, normals, UV, tangents=tangents, create_collision=False)

```

**Error message:**

```auto
LogPython: Error: TypeError: create_mesh_section() required argument 'vertex_colors' (pos 6) not found

```

**Extract from docs about the class I’m using**

`create_mesh_section` (_section\_index_, _vertices_, _triangles_, _normals_, _uv0_, _vertex\_colors_, _tangents_, _create\_collision_ ) → [None](https://docs.python.org/2/library/constants.html#None)

Create/replace a section for this procedural mesh component. This function is deprecated for Blueprints because it uses the unsupported ‘Color’ type. Use new ‘Create Mesh Section’ function which uses LinearColor instead. deprecated: This function is deprecated for Blueprints because it uses the unsupported ‘Color’ type. Use new ‘Create Mesh Section’ function which uses LinearColor instead.

Parameters

- **section\_index** (_int32_) – Index of the section to create or replace.
- **vertices** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ [_Vector_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Vector.html#unreal.Vector)_)_) – Vertex buffer of all vertex positions to use for this mesh section.
- **triangles** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ _int32_ _)_) – Index buffer indicating which vertices make up each triangle. Length must be a multiple of 3.
- **normals** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ [_Vector_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Vector.html#unreal.Vector)_)_) – Optional array of normal vectors for each vertex. If supplied, must be same length as Vertices array.
- **uv0** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ [_Vector2D_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Vector2D.html#unreal.Vector2D)_)_) – Optional array of texture co-ordinates for each vertex. If supplied, must be same length as Vertices array.
- **vertex\_colors** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ [_Color_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Color.html#unreal.Color)_)_) – Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
- **tangents** ([_Array_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/Array.html#unreal.Array)_(_ [_ProcMeshTangent_](https://docs.unrealengine.com/4.26/en-US/PythonAPI/class/ProcMeshTangent.html#unreal.ProcMeshTangent)_)_) – Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
- **create\_collision** ([_bool_](https://docs.python.org/2/library/functions.html#bool)) – Indicates whether collision should be created for this section. This adds significant cost.

---

<div class="post-metadata">

**Author:** ![Zeblote](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zeblote](https://forums.unrealengine.com/u/Zeblote)\
**Post date:** [September 21, 2021, 7:29am UTC](https://forums.unrealengine.com/t/python-how-do-i-leave-out-an-optional-parameter-in-a-class/251855/2 "2021-09-21T07:29:09Z")

</div>

By optional they actually mean that you can pass an empty array, but the parameter itself is not optional due to the way the automatic python binding works.
