From ce10a660d19fc494e35f68ab84e899498c02eabe Mon Sep 17 00:00:00 2001 From: Mateus Elias Date: Sun, 26 May 2024 21:52:36 -0300 Subject: [PATCH] Improve Mesh class description - Bind MAX_MESH_SURFACES constant in RenderingServer::_bind_methods() - Add MAX_MESH_SURFACES constant to RenderingServer class documentation - Reference the constant RenderingServer.MAX_MESH_SURFACES in the description of Mesh class documentation --- doc/classes/Mesh.xml | 2 +- doc/classes/RenderingServer.xml | 3 +++ servers/rendering_server.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 966e8709401..6b5a50d97b9 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -4,7 +4,7 @@ A [Resource] that contains vertex array-based geometry. - Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. + Mesh is a type of [Resource] that contains vertex array-based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. The maximum number of surfaces per mesh is [constant RenderingServer.MAX_MESH_SURFACES]. https://godotengine.org/asset-library/asset/2742 diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 3ddc0d8f7b1..3c9f0fc7aff 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -4239,6 +4239,9 @@ The maximum number of directional lights that can be rendered at a given time in 2D. + + The maximum number of surfaces a mesh can have. + Array of 2-dimensional textures (see [Texture2DArray]). diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 5cfd8d3cd2b..7637d4e7da2 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2229,6 +2229,7 @@ void RenderingServer::_bind_methods() { BIND_CONSTANT(MAX_GLOW_LEVELS); BIND_CONSTANT(MAX_CURSORS); BIND_CONSTANT(MAX_2D_DIRECTIONAL_LIGHTS); + BIND_CONSTANT(MAX_MESH_SURFACES); /* TEXTURE */