| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="GLTFNode" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> |
| 3 | <brief_description> |
| 4 | glTF node class. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | Represents a glTF node. glTF nodes may have names, transforms, children (other glTF nodes), and more specialized properties (represented by their own classes). |
| 8 | 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]. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link> |
| 12 | <link title="glTF scene and node spec">https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md"</link> |
| 13 | </tutorials> |
| 14 | <methods> |
| 15 | <method name="append_child_index"> |
| 16 | <return type="void" /> |
| 17 | <param index="0" name="child_index" type="int" /> |
| 18 | <description> |
| 19 | Appends the given child node index to the [member children] array. |
| 20 | </description> |
| 21 | </method> |
| 22 | <method name="get_additional_data"> |
| 23 | <return type="Variant" /> |
| 24 | <param index="0" name="extension_name" type="StringName" /> |
| 25 | <description> |
| 26 | Gets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. |
| 27 | The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is [code]null[/code]. |
| 28 | </description> |
| 29 | </method> |
| 30 | <method name="get_scene_node_path"> |
| 31 | <return type="NodePath" /> |
| 32 | <param index="0" name="gltf_state" type="GLTFState" /> |
| 33 | <param index="1" name="handle_skeletons" type="bool" default="true" /> |
| 34 | <description> |
| 35 | Returns the [NodePath] that this GLTF node will have in the Godot scene tree after being imported. This is useful when importing glTF object model pointers with [GLTFObjectModelProperty], for handling extensions such as [code]KHR_animation_pointer[/code] or [code]KHR_interactivity[/code]. |
| 36 | If [param handle_skeletons] is [code]true[/code], paths to skeleton bone glTF nodes will be resolved properly. For example, a path that would be [code]^"A/B/C/Bone1/Bone2/Bone3"[/code] if [code]false[/code] will become [code]^"A/B/C/Skeleton3D:Bone3"[/code]. |
| 37 | </description> |
| 38 | </method> |
| 39 | <method name="set_additional_data"> |
| 40 | <return type="void" /> |
| 41 | <param index="0" name="extension_name" type="StringName" /> |
| 42 | <param index="1" name="additional_data" type="Variant" /> |
| 43 | <description> |
| 44 | Sets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. |
| 45 | The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. |
| 46 | </description> |
| 47 | </method> |
| 48 | </methods> |
| 49 | <members> |
| 50 | <member name="camera" type="int" setter="set_camera" getter="get_camera" default="-1"> |
| 51 | If this glTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes the camera's properties. If [code]-1[/code], this node is not a camera. |
| 52 | </member> |
| 53 | <member name="children" type="PackedInt32Array" setter="set_children" getter="get_children" default="PackedInt32Array()"> |
| 54 | The indices of the child nodes in the [GLTFState]. If this glTF node has no children, this will be an empty array. |
| 55 | </member> |
| 56 | <member name="height" type="int" setter="set_height" getter="get_height" default="-1"> |
| 57 | 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. |
| 58 | </member> |
| 59 | <member name="light" type="int" setter="set_light" getter="get_light" default="-1"> |
| 60 | 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. |
| 61 | </member> |
| 62 | <member name="mesh" type="int" setter="set_mesh" getter="get_mesh" default="-1"> |
| 63 | 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. |
| 64 | </member> |
| 65 | <member name="original_name" type="String" setter="set_original_name" getter="get_original_name" default=""""> |
| 66 | The original name of the node. |
| 67 | </member> |
| 68 | <member name="parent" type="int" setter="set_parent" getter="get_parent" default="-1"> |
| 69 | The index of the parent node in the [GLTFState]. If -1, this node is a root node. |
| 70 | </member> |
| 71 | <member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)"> |
| 72 | The position of the glTF node relative to its parent. |
| 73 | </member> |
| 74 | <member name="rotation" type="Quaternion" setter="set_rotation" getter="get_rotation" default="Quaternion(0, 0, 0, 1)"> |
| 75 | The rotation of the glTF node relative to its parent. |
| 76 | </member> |
| 77 | <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)"> |
| 78 | The scale of the glTF node relative to its parent. |
| 79 | </member> |
| 80 | <member name="skeleton" type="int" setter="set_skeleton" getter="get_skeleton" default="-1"> |
| 81 | 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. |
| 82 | </member> |
| 83 | <member name="skin" type="int" setter="set_skin" getter="get_skin" default="-1"> |
| 84 | 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. |
| 85 | </member> |
| 86 | <member name="visible" type="bool" setter="set_visible" getter="get_visible" default="true"> |
| 87 | If [code]true[/code], the GLTF node is visible. If [code]false[/code], the GLTF node is not visible. This is converted to the [member Node3D.visible] property in the Godot scene, and is exported to [code]KHR_node_visibility[/code] when [code]false[/code]. |
| 88 | </member> |
| 89 | <member name="xform" type="Transform3D" setter="set_xform" getter="get_xform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> |
| 90 | The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. |
| 91 | </member> |
| 92 | </members> |
| 93 | </class> |