소스 검색

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
Mateus Elias 1 년 전
부모
커밋
ce10a660d1
3개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      doc/classes/Mesh.xml
  2. 3 0
      doc/classes/RenderingServer.xml
  3. 1 0
      servers/rendering_server.cpp

+ 1 - 1
doc/classes/Mesh.xml

@@ -4,7 +4,7 @@
 		A [Resource] that contains vertex array-based geometry.
 		A [Resource] that contains vertex array-based geometry.
 	</brief_description>
 	</brief_description>
 	<description>
 	<description>
-		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].
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>
 		<link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link>
 		<link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/2742</link>

+ 3 - 0
doc/classes/RenderingServer.xml

@@ -4239,6 +4239,9 @@
 		<constant name="MAX_2D_DIRECTIONAL_LIGHTS" value="8">
 		<constant name="MAX_2D_DIRECTIONAL_LIGHTS" value="8">
 			The maximum number of directional lights that can be rendered at a given time in 2D.
 			The maximum number of directional lights that can be rendered at a given time in 2D.
 		</constant>
 		</constant>
+		<constant name="MAX_MESH_SURFACES" value="256">
+			The maximum number of surfaces a mesh can have.
+		</constant>
 		<constant name="TEXTURE_LAYERED_2D_ARRAY" value="0" enum="TextureLayeredType">
 		<constant name="TEXTURE_LAYERED_2D_ARRAY" value="0" enum="TextureLayeredType">
 			Array of 2-dimensional textures (see [Texture2DArray]).
 			Array of 2-dimensional textures (see [Texture2DArray]).
 		</constant>
 		</constant>

+ 1 - 0
servers/rendering_server.cpp

@@ -2229,6 +2229,7 @@ void RenderingServer::_bind_methods() {
 	BIND_CONSTANT(MAX_GLOW_LEVELS);
 	BIND_CONSTANT(MAX_GLOW_LEVELS);
 	BIND_CONSTANT(MAX_CURSORS);
 	BIND_CONSTANT(MAX_CURSORS);
 	BIND_CONSTANT(MAX_2D_DIRECTIONAL_LIGHTS);
 	BIND_CONSTANT(MAX_2D_DIRECTIONAL_LIGHTS);
+	BIND_CONSTANT(MAX_MESH_SURFACES);
 
 
 	/* TEXTURE */
 	/* TEXTURE */