0 votes

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

in Engine by (79 points)

1 Answer

+1 vote
Best answer

1) These flags are combination of options from the Mesh.ARRAY_FORMAT_* enumeration: https://docs.godotengine.org/en/3.1/classes/class_mesh.html#enumerations
Its default value is Mesh.ARRAY_COMPRESS_DEFAULT.
Oddly enough, this isn't documented in SurfaceTool.

2)
a) Yes

b) Yes

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

by (29,120 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.