From 924f7c62615552f64d8ec38d7ccab1002dbb5a3e Mon Sep 17 00:00:00 2001 From: clayjohn Date: Wed, 10 Oct 2018 21:28:04 -0700 Subject: [PATCH] added descriptions to MeshDataTool doc (cherry picked from commit 596c36a9ac634b0e6b03074e08d74a62455ab3c0) --- doc/classes/MeshDataTool.xml | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml index 646f7f98181..30d541e3897 100644 --- a/doc/classes/MeshDataTool.xml +++ b/doc/classes/MeshDataTool.xml @@ -1,8 +1,22 @@ + Helper tool to access and edit [Mesh] data. + The MeshDataTool provides access to individual vertices in a [Mesh]. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges. + To use the MeshDataTool, load a mesh with [method create_from_surface]. When you are finished editing the data commit the data to a mesh with [method commit_to_surface]. + Below is an example of how the MeshDataTool may be used. + [codeblock] + var mdt = MeshDataTool.new() + mdt.create_from_surface(mesh, 0) + for i in range(mdt.get_vertex_count()): + var vertex = mdt.get_vertex(i) + ... + mdt.set_vertex(i, vertex) + mesh.surface_remove(0) + mdt.commit_to_surface(mesh) + [/codeblock] @@ -13,6 +27,7 @@ + Clears all data currently in MeshDataTool. @@ -21,6 +36,7 @@ + Adds a new surface to specified [Mesh] with edited data. @@ -31,12 +47,15 @@ + Uses specified surface of given [Mesh] to populate data for MeshDataTool. + Requires [Mesh] with primitive type [code]PRIMITIVE_TRIANGLES[/code]. + Returns the number of edges in this [Mesh]. @@ -45,6 +64,7 @@ + Returns array of faces that touch given edge. @@ -53,6 +73,7 @@ + Returns meta information assigned to given edge. @@ -63,12 +84,15 @@ + Returns index of specified vertex connected to given edge. + Vertex argument can only be 0 or 1 because edges are comprised of two vertices. + Returns the number of faces in this [Mesh]. @@ -79,6 +103,8 @@ + Returns specified edge associated with given face. + Edge argument must 2 or less becuase a face only has three edges. @@ -87,6 +113,7 @@ + Returns meta data associated with given face. @@ -95,6 +122,7 @@ + Calculates and returns face normal of given face. @@ -105,18 +133,23 @@ + Returns specified vertex of given face. + Vertex argument must be 2 or less becuase faces contain three vertices. + Returns format of [Mesh]. Format is an integer made up of [Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of [code]3[/code] becuase [code]ARRAY_FORMAT_VERTEX[/code] is [code]1[/code] and [code]ARRAY_FORMAT_NORMAL[/code] is [code]2[/code]. + For list of format flags see [ArrayMesh]. + Returns material assigned to the [Mesh]. @@ -125,6 +158,7 @@ + Returns the vertex at given index. @@ -133,6 +167,7 @@ + Returns the bones of the given vertex. @@ -141,12 +176,14 @@ + Returns the color of the given vertex. + Returns the total number of vertices in [Mesh]. @@ -155,6 +192,7 @@ + Returns array of edges that share given vertex. @@ -163,6 +201,7 @@ + Returns array of faces that share given vertex. @@ -171,6 +210,7 @@ + Returns meta data associated with given vertex. @@ -179,6 +219,7 @@ + Returns normal of given vertex. @@ -187,6 +228,7 @@ + Returns tangent of given vertex. @@ -195,6 +237,7 @@ + Returns UV of given vertex. @@ -203,6 +246,7 @@ + Returns UV2 of given vertex. @@ -211,6 +255,7 @@ + Returns bone weights of given vertex. @@ -221,6 +266,7 @@ + Sets the meta data of given edge. @@ -231,6 +277,7 @@ + Sets the meta data of given face. @@ -239,6 +286,7 @@ + Sets the material to be used by newly constructed [Mesh]. @@ -249,6 +297,7 @@ + Sets the position of given vertex. @@ -259,6 +308,7 @@ + Sets the bones of given vertex. @@ -269,6 +319,7 @@ + Sets the color of given vertex. @@ -279,6 +330,7 @@ + Sets the meta data associated with given vertex. @@ -289,6 +341,7 @@ + Sets the normal of given vertex. @@ -299,6 +352,7 @@ + Sets the tangent of given vertex. @@ -309,6 +363,7 @@ + Sets the UV of given vertex. @@ -319,6 +374,7 @@ + Sets the UV2 of given vertex. @@ -329,6 +385,7 @@ + Sets the bone weights of given vertex.