Path: blob/master/modules/gltf/doc_classes/GLTFNode.xml
10279 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="GLTFNode" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3glTF node class.4</brief_description>5<description>6Represents a glTF node. glTF nodes may have names, transforms, children (other glTF nodes), and more specialized properties (represented by their own classes).7glTF 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].8</description>9<tutorials>10<link title="Runtime file loading and saving">$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html</link>11<link title="glTF scene and node spec">https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md"</link>12</tutorials>13<methods>14<method name="append_child_index">15<return type="void" />16<param index="0" name="child_index" type="int" />17<description>18Appends the given child node index to the [member children] array.19</description>20</method>21<method name="get_additional_data">22<return type="Variant" />23<param index="0" name="extension_name" type="StringName" />24<description>25Gets 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.26The 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].27</description>28</method>29<method name="get_scene_node_path">30<return type="NodePath" />31<param index="0" name="gltf_state" type="GLTFState" />32<param index="1" name="handle_skeletons" type="bool" default="true" />33<description>34Returns 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].35If [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].36</description>37</method>38<method name="set_additional_data">39<return type="void" />40<param index="0" name="extension_name" type="StringName" />41<param index="1" name="additional_data" type="Variant" />42<description>43Sets 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.44The 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.45</description>46</method>47</methods>48<members>49<member name="camera" type="int" setter="set_camera" getter="get_camera" default="-1">50If 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.51</member>52<member name="children" type="PackedInt32Array" setter="set_children" getter="get_children" default="PackedInt32Array()">53The indices of the child nodes in the [GLTFState]. If this glTF node has no children, this will be an empty array.54</member>55<member name="height" type="int" setter="set_height" getter="get_height" default="-1">56How 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.57</member>58<member name="light" type="int" setter="set_light" getter="get_light" default="-1">59If 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.60</member>61<member name="mesh" type="int" setter="set_mesh" getter="get_mesh" default="-1">62If 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.63</member>64<member name="original_name" type="String" setter="set_original_name" getter="get_original_name" default="""">65The original name of the node.66</member>67<member name="parent" type="int" setter="set_parent" getter="get_parent" default="-1">68The index of the parent node in the [GLTFState]. If -1, this node is a root node.69</member>70<member name="position" type="Vector3" setter="set_position" getter="get_position" default="Vector3(0, 0, 0)">71The position of the glTF node relative to its parent.72</member>73<member name="rotation" type="Quaternion" setter="set_rotation" getter="get_rotation" default="Quaternion(0, 0, 0, 1)">74The rotation of the glTF node relative to its parent.75</member>76<member name="scale" type="Vector3" setter="set_scale" getter="get_scale" default="Vector3(1, 1, 1)">77The scale of the glTF node relative to its parent.78</member>79<member name="skeleton" type="int" setter="set_skeleton" getter="get_skeleton" default="-1">80If 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.81</member>82<member name="skin" type="int" setter="set_skin" getter="get_skin" default="-1">83If 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.84</member>85<member name="visible" type="bool" setter="set_visible" getter="get_visible" default="true">86If [code]true[/code], the GLTF node is visible. If [code]false[/code], the GLTF node is not visible. This is translated to the [member Node3D.visible] property in the Godot scene, and is exported to [code]KHR_node_visibility[/code] when [code]false[/code].87</member>88<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)">89The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.90</member>91</members>92</class>939495