From 1463fc889b65524794f2f7d9cf661aa673d58e06 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Mon, 20 Sep 2021 18:24:31 -0700 Subject: GLTF for game templates. Convert GLTF Document to use ImporterMeshInstance3D. Add a GLTFDocument extension list and an extension for converting the importer mesh instance 3d to mesh instance 3d. Use GLTF module when the editor tools are disabled. Modified the render server to be less restrictive on matching blend arrays and have more logging. Misc bugs with multimesh. Always index the meshes. --- doc/classes/EditorSceneImporterMesh.xml | 184 -------------------------- doc/classes/EditorSceneImporterMeshNode3D.xml | 17 --- doc/classes/ImporterMesh.xml | 184 ++++++++++++++++++++++++++ doc/classes/ImporterMeshInstance3D.xml | 17 +++ 4 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 doc/classes/EditorSceneImporterMesh.xml delete mode 100644 doc/classes/EditorSceneImporterMeshNode3D.xml create mode 100644 doc/classes/ImporterMesh.xml create mode 100644 doc/classes/ImporterMeshInstance3D.xml (limited to 'doc') diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml deleted file mode 100644 index 5d57a76d5f..0000000000 --- a/doc/classes/EditorSceneImporterMesh.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - A [Resource] that contains vertex array-based geometry during the import process. - - - EditorSceneImporterMesh is a type of [Resource] analogous to [ArrayMesh]. It 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. - - Unlike its runtime counterpart, [EditorSceneImporterMesh] contains mesh data before various import steps, such as lod and shadow mesh generation, have taken place. Modify surface data by calling [method clear], followed by [method add_surface] for each surface. - - - - - - - - - Adds name for a blend shape that will be added with [method add_surface]. Must be called before surface is added. - - - - - - - - - - - - - Creates a new surface, analogous to [method ArrayMesh.add_surface_from_arrays]. - Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface. - The [code]arrays[/code] argument is an array of arrays. See [enum Mesh.ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used. - - - - - - Removes all surfaces and blend shapes from this [EditorSceneImporterMesh]. - - - - - - Returns the number of blend shapes that the mesh holds. - - - - - - Returns the blend shape mode for this Mesh. - - - - - - - Returns the name of the blend shape at this index. - - - - - - Returns the size hint of this mesh for lightmap-unwrapping in UV-space. - - - - - - - Returns the mesh data represented by this [EditorSceneImporterMesh] as a usable [ArrayMesh]. - This method caches the returned mesh, and subsequent calls will return the cached data until [method clear] is called. - If not yet cached and [code]base_mesh[/code] is provided, [code]base_mesh[/code] will be used and mutated. - - - - - - - Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface. See [method add_surface]. - - - - - - - - Returns a single set of blend shape arrays for the requested blend shape index for a surface. - - - - - - Returns the amount of surfaces that the mesh holds. - - - - - - - Returns the format of the surface that the mesh holds. - - - - - - - Returns the amount of lods that the mesh holds on a given surface. - - - - - - - - Returns the index buffer of a lod for a surface. - - - - - - - - Returns the screen ratio which activates a lod for a surface. - - - - - - - Returns a [Material] in a given surface. Surface is rendered using this material. - - - - - - - Gets the name assigned to this surface. - - - - - - - Returns the primitive type of the requested surface (see [method add_surface]). - - - - - - - Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]. - - - - - - - Sets the size hint of this mesh for lightmap-unwrapping in UV-space. - - - - - - - - Sets a [Material] for a given surface. Surface will be rendered using this material. - - - - - - - - Sets a name for a given surface. - - - - - - - - diff --git a/doc/classes/EditorSceneImporterMeshNode3D.xml b/doc/classes/EditorSceneImporterMeshNode3D.xml deleted file mode 100644 index 848448110e..0000000000 --- a/doc/classes/EditorSceneImporterMeshNode3D.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml new file mode 100644 index 0000000000..ab344f908c --- /dev/null +++ b/doc/classes/ImporterMesh.xml @@ -0,0 +1,184 @@ + + + + A [Resource] that contains vertex array-based geometry during the import process. + + + ImporterMesh is a type of [Resource] analogous to [ArrayMesh]. It 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. + + Unlike its runtime counterpart, [ImporterMesh] contains mesh data before various import steps, such as lod and shadow mesh generation, have taken place. Modify surface data by calling [method clear], followed by [method add_surface] for each surface. + + + + + + + + + Adds name for a blend shape that will be added with [method add_surface]. Must be called before surface is added. + + + + + + + + + + + + + Creates a new surface, analogous to [method ArrayMesh.add_surface_from_arrays]. + Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface. + The [code]arrays[/code] argument is an array of arrays. See [enum Mesh.ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used. + + + + + + Removes all surfaces and blend shapes from this [ImporterMesh]. + + + + + + Returns the number of blend shapes that the mesh holds. + + + + + + Returns the blend shape mode for this Mesh. + + + + + + + Returns the name of the blend shape at this index. + + + + + + Returns the size hint of this mesh for lightmap-unwrapping in UV-space. + + + + + + + Returns the mesh data represented by this [ImporterMesh] as a usable [ArrayMesh]. + This method caches the returned mesh, and subsequent calls will return the cached data until [method clear] is called. + If not yet cached and [code]base_mesh[/code] is provided, [code]base_mesh[/code] will be used and mutated. + + + + + + + Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface. See [method add_surface]. + + + + + + + + Returns a single set of blend shape arrays for the requested blend shape index for a surface. + + + + + + Returns the amount of surfaces that the mesh holds. + + + + + + + Returns the format of the surface that the mesh holds. + + + + + + + Returns the amount of lods that the mesh holds on a given surface. + + + + + + + + Returns the index buffer of a lod for a surface. + + + + + + + + Returns the screen ratio which activates a lod for a surface. + + + + + + + Returns a [Material] in a given surface. Surface is rendered using this material. + + + + + + + Gets the name assigned to this surface. + + + + + + + Returns the primitive type of the requested surface (see [method add_surface]). + + + + + + + Sets the blend shape mode to one of [enum Mesh.BlendShapeMode]. + + + + + + + Sets the size hint of this mesh for lightmap-unwrapping in UV-space. + + + + + + + + Sets a [Material] for a given surface. Surface will be rendered using this material. + + + + + + + + Sets a name for a given surface. + + + + + + + + diff --git a/doc/classes/ImporterMeshInstance3D.xml b/doc/classes/ImporterMeshInstance3D.xml new file mode 100644 index 0000000000..6d572f543b --- /dev/null +++ b/doc/classes/ImporterMeshInstance3D.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3