Questions about SurfaceTool and ArrayMesh

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By player0815

hi,

i have some questions about the SurfaceTool and ArrayMesh:

1) What is the parameter flags intended for:
ArrayMesh commit ( ArrayMesh existing=null, int flags=97280 )

2)
a) Do I understand correctly that every surface in the ArrayMesh has an index and hang behind each other like a train?

b) So the surface tool commit the latest “wagon” on the back of the train, right?

c) And when deleting a surface (int surface_get_format ( int surf_idx ) const) by its index number, each following wagons move forward for 1 wagon/slot?

thx for answering :slight_smile:

:bust_in_silhouette: Reply From: Zylann
  1. These flags are combination of options from the Mesh.ARRAY_FORMAT_* enumeration: Mesh — Godot Engine (3.1) documentation in English
    Its default value is Mesh.ARRAY_COMPRESS_DEFAULT.
    Oddly enough, this isn’t documented in SurfaceTool.

a) Yes

b) Yes

c) Yes https://github.com/godotengine/godot/blob/3418f76a9eab9f496e5b26310bd3bc1125b8119b/scene/resources/mesh.cpp#L934