:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/VisualInstance3D.xml. .. _class_VisualInstance3D: VisualInstance3D ================ **Inherits:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`Decal`, :ref:`FogVolume`, :ref:`GeometryInstance3D`, :ref:`GPUParticlesAttractor3D`, :ref:`GPUParticlesCollision3D`, :ref:`Light3D`, :ref:`LightmapGI`, :ref:`ReflectionProbe`, :ref:`RootMotionView`, :ref:`VisibleOnScreenNotifier3D`, :ref:`VoxelGI` Parent of all visual 3D nodes. .. rst-class:: classref-introduction-group Description ----------- The **VisualInstance3D** is used to connect a resource to a visual representation. All visual 3D nodes inherit from the **VisualInstance3D**. In general, you should not access the **VisualInstance3D** properties directly as they are accessed and managed by the nodes that inherit from **VisualInstance3D**. **VisualInstance3D** is the node representation of the :ref:`RenderingServer` instance. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------+-----------------------------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`layers` | ``1`` | +---------------------------+-----------------------------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`sorting_offset` | ``0.0`` | +---------------------------+-----------------------------------------------------------------------------------------+----------+ | :ref:`bool` | :ref:`sorting_use_aabb_center` | ``true`` | +---------------------------+-----------------------------------------------------------------------------------------+----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`_get_aabb` **(** **)** |virtual| |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AABB` | :ref:`get_aabb` **(** **)** |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_base` **(** **)** |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_instance` **(** **)** |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_layer_mask_value` **(** :ref:`int` layer_number **)** |const| | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_base` **(** :ref:`RID` base **)** | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_layer_mask_value` **(** :ref:`int` layer_number, :ref:`bool` value **)** | +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_VisualInstance3D_property_layers: .. rst-class:: classref-property :ref:`int` **layers** = ``1`` .. rst-class:: classref-property-setget - void **set_layer_mask** **(** :ref:`int` value **)** - :ref:`int` **get_layer_mask** **(** **)** The render layer(s) this **VisualInstance3D** is drawn on. This object will only be visible for :ref:`Camera3D`\ s whose cull mask includes the render object this **VisualInstance3D** is set to. For :ref:`Light3D`\ s, this can be used to control which **VisualInstance3D**\ s are affected by a specific light. For :ref:`GPUParticles3D`, this can be used to control which particles are effected by a specific attractor. For :ref:`Decal`\ s, this can be used to control which **VisualInstance3D**\ s are affected by a specific decal. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_property_sorting_offset: .. rst-class:: classref-property :ref:`float` **sorting_offset** = ``0.0`` .. rst-class:: classref-property-setget - void **set_sorting_offset** **(** :ref:`float` value **)** - :ref:`float` **get_sorting_offset** **(** **)** The sorting offset used by this **VisualInstance3D**. Adjusting it to a higher value will make the **VisualInstance3D** reliably draw on top of other **VisualInstance3D**\ s that are otherwise positioned at the same spot. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_property_sorting_use_aabb_center: .. rst-class:: classref-property :ref:`bool` **sorting_use_aabb_center** = ``true`` .. rst-class:: classref-property-setget - void **set_sorting_use_aabb_center** **(** :ref:`bool` value **)** - :ref:`bool` **is_sorting_use_aabb_center** **(** **)** If ``true``, the object is sorted based on the :ref:`AABB` center. The object will be sorted based on the global position otherwise. The :ref:`AABB` center based sorting is generally more accurate for 3D models. The position based sorting instead allows to better control the drawing order when working with :ref:`GPUParticles3D` and :ref:`CPUParticles3D`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_VisualInstance3D_method__get_aabb: .. rst-class:: classref-method :ref:`AABB` **_get_aabb** **(** **)** |virtual| |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_get_aabb: .. rst-class:: classref-method :ref:`AABB` **get_aabb** **(** **)** |const| Returns the :ref:`AABB` (also known as the bounding box) for this **VisualInstance3D**. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_get_base: .. rst-class:: classref-method :ref:`RID` **get_base** **(** **)** |const| Returns the RID of the resource associated with this **VisualInstance3D**. For example, if the Node is a :ref:`MeshInstance3D`, this will return the RID of the associated :ref:`Mesh`. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_get_instance: .. rst-class:: classref-method :ref:`RID` **get_instance** **(** **)** |const| Returns the RID of this instance. This RID is the same as the RID returned by :ref:`RenderingServer.instance_create`. This RID is needed if you want to call :ref:`RenderingServer` functions directly on this **VisualInstance3D**. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_get_layer_mask_value: .. rst-class:: classref-method :ref:`bool` **get_layer_mask_value** **(** :ref:`int` layer_number **)** |const| Returns whether or not the specified layer of the :ref:`layers` is enabled, given a ``layer_number`` between 1 and 20. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_set_base: .. rst-class:: classref-method void **set_base** **(** :ref:`RID` base **)** Sets the resource that is instantiated by this **VisualInstance3D**, which changes how the engine handles the **VisualInstance3D** under the hood. Equivalent to :ref:`RenderingServer.instance_set_base`. .. rst-class:: classref-item-separator ---- .. _class_VisualInstance3D_method_set_layer_mask_value: .. rst-class:: classref-method void **set_layer_mask_value** **(** :ref:`int` layer_number, :ref:`bool` value **)** Based on ``value``, enables or disables the specified layer in the :ref:`layers`, given a ``layer_number`` between 1 and 20. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`