From 9e6f0ee9c794a78557d49a2b7cdb43d4ac045c6d Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 22 Feb 2023 16:41:13 -0600 Subject: Document GLTFNode and some of GLTFState (cherry picked from commit 2cc22fb964a94cdb031dd95f473812eef274c903) --- modules/gltf/doc_classes/GLTFNode.xml | 13 +++++++++++++ modules/gltf/doc_classes/GLTFState.xml | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'modules/gltf/doc_classes') diff --git a/modules/gltf/doc_classes/GLTFNode.xml b/modules/gltf/doc_classes/GLTFNode.xml index f3b3e61501..b9223bfdfa 100644 --- a/modules/gltf/doc_classes/GLTFNode.xml +++ b/modules/gltf/doc_classes/GLTFNode.xml @@ -5,6 +5,7 @@ Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and more specialized properties (represented by their own classes). + GLTF nodes generally exist inside of [GLTFState] which represents all data of a GLTF file. Most of GLTFNode's properties are indices of other data in the GLTF file. You can extend a GLTF node with additional properties by using [method get_additional_data] and [method set_additional_data]. https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md" @@ -30,28 +31,40 @@ + If this GLTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes the camera's properties. If -1, this node is not a camera. + The indices of the children nodes in the [GLTFState]. If this GLTF node has no children, this will be an empty array. + How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated. + If this GLTF node is a light, the index of the [GLTFLight] in the [GLTFState] that describes the light's properties. If -1, this node is not a light. + If this GLTF node is a mesh, the index of the [GLTFMesh] in the [GLTFState] that describes the mesh's properties. If -1, this node is not a mesh. + The index of the parent node in the [GLTFState]. If -1, this node is a root node. + The position of the GLTF node relative to its parent. + The rotation of the GLTF node relative to its parent. + The scale of the GLTF node relative to its parent. + If this GLTF node has a skeleton, the index of the [GLTFSkeleton] in the [GLTFState] that describes the skeleton's properties. If -1, this node does not have a skeleton. + If this GLTF node has a skin, the index of the [GLTFSkin] in the [GLTFState] that describes the skin's properties. If -1, this node does not have a skin. + The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. diff --git a/modules/gltf/doc_classes/GLTFState.xml b/modules/gltf/doc_classes/GLTFState.xml index 33b92f37c8..7a46fb8dfc 100644 --- a/modules/gltf/doc_classes/GLTFState.xml +++ b/modules/gltf/doc_classes/GLTFState.xml @@ -1,8 +1,11 @@ + Represents all data of a GLTF file. + Contains all nodes and resources of a GLTF file. This is used by [GLTFDocument] as data storage, which allows [GLTFDocument] and all [GLTFDocumentExtension] classes to remain stateless. + GLTFState can be populated by [GLTFDocument] reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a GLTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by [GLTFDocumentExtension] classes. This allows for custom data to be stored in the GLTF file or for custom data to be converted to/from Godot nodes. @@ -32,17 +35,20 @@ + Returns the [AnimationPlayer] node with the given index. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations. + Returns the number of [AnimationPlayer] nodes in this [GLTFState]. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations. + Returns an array of all [GLTFAnimation]s in the GLTF file. When importing, these will be generated as animations in an [AnimationPlayer] node. When exporting, these will be generated from Godot [AnimationPlayer] nodes. @@ -53,6 +59,7 @@ + Returns an array of all [GLTFCamera]s in the GLTF file. These are the cameras that the [member GLTFNode.camera] index refers to. @@ -68,6 +75,7 @@ + Returns an array of all [GLTFLight]s in the GLTF file. These are the lights that the [member GLTFNode.light] index refers to. @@ -78,27 +86,32 @@ + Returns an array of all [GLTFMesh]es in the GLTF file. These are the meshes that the [member GLTFNode.mesh] index refers to. + Returns an array of all [GLTFNode]s in the GLTF file. These are the nodes that [member GLTFNode.children] and [member root_nodes] refer to. This includes nodes that may not be generated in the Godot scene, or nodes that may generate multiple Godot scene nodes. + Returns the Godot scene node that corresponds to the same index as the [GLTFNode] it was generated from. Not every [GLTFNode] will have a scene node generated, and not every generated scene node will have a corresponding [GLTFNode]. + Returns an array of all [GLTFSkeleton]s in the GLTF file. These are the skeletons that the [member GLTFNode.skeleton] index refers to. + Returns an array of all [GLTFSkin]s in the GLTF file. These are the skins that the [member GLTFNode.skin] index refers to. @@ -115,11 +128,13 @@ + Returns an array of unique animation names. This is only used during the import process. + Returns an array of unique node names. This is used in both the import process and export process. @@ -141,6 +156,7 @@ + Sets the [GLTFAnimation]s in the state. When importing, these will be generated as animations in an [AnimationPlayer] node. When exporting, these will be generated from Godot [AnimationPlayer] nodes. @@ -153,6 +169,7 @@ + Sets the [GLTFCamera]s in the state. These are the cameras that the [member GLTFNode.camera] index refers to. @@ -171,6 +188,7 @@ + Sets the [GLTFLight]s in the state. These are the lights that the [member GLTFNode.light] index refers to. @@ -183,24 +201,28 @@ + Sets the [GLTFMesh]es in the state. These are the meshes that the [member GLTFNode.mesh] index refers to. + Sets the [GLTFNode]s in the state. These are the nodes that [member GLTFNode.children] and [member root_nodes] refer to. Some of the nodes set here may not be generated in the Godot scene, or may generate multiple Godot scene nodes. + Sets the [GLTFSkeleton]s in the state. These are the skeletons that the [member GLTFNode.skeleton] index refers to. + Sets the [GLTFSkin]s in the state. These are the skins that the [member GLTFNode.skin] index refers to. @@ -220,12 +242,14 @@ + Sets the unique animation names in the state. This is only used during the import process. + Sets the unique node names in the state. This is used in both the import process and export process. @@ -245,8 +269,10 @@ + The root nodes of the GLTF file. Typically, a GLTF file will only have one scene, and therefore one root node. However, a GLTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene. + The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the GLTF file. -- cgit v1.2.3