Slot/en: Difference between revisions

From Resonite Wiki
Updating to match new version of source page
Updating to match new version of source page
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>


See also: [[Type:Slot|Slot (Type)]]
Every object in Resonite exists as a '''Slot'''. Slots form ''hierarchies'', exist in 3D space via a ''transformation'', and contain ''[[Component|Components]]'' to add additional behavior.


<!--T:1-->
== Basic Properties ==
Every object in Resonite exists as a '''slot'''. A slot is a container for [[Component|Components]], which add additional behavior to slots. Every slot has a transformation (a translation, rotation, and scale) associated with it, which define its behavior and orientation in Resonite's 3D coordinate space. For example, a slot with a [[MeshRenderer_(Component)|MeshRenderer]] component will render a model, and scaling that slot will scale the rendered model.


<!--T:2-->
=== Hierarchy ===
Slots can be contained in other slots. A slot is a '''child''' if it is contained within another slot; that slot is its '''parent'''. A child slot's transformation is relative to its parent, so even though a child slot might specify no transformation, in global space it may be rotated or scaled because its parents are.  Thus, a child's transform is called "local".


<!--T:3-->
[[File:Example_Slot_Hierarchy.webp|thumb|300px|A simple slot hierarchy, as shown in the [[Scene Inspector|Scene Inspector]].|alt=A hierarchy of slots as shown in the Scene Inspector. The Example slot has three children, the first of which has another child itself.]]
Every world has a root slot under which everything else is placed. The resulting tree of slots is called the ''hierarchy''.


<!--T:4-->
A slot can contain zero or more slots, forming a '''hierarchy''' or "'''tree'''". A slot is a '''child''' if it is contained within another slot; that slot is its '''parent'''. The only slot without a parent is the '''root''' of the world, which contains all other slots.
Slots can be browsed through and examined in the [[Scene Inspector Dialog|Scene Inspector]].
 
This hierarchy is used for organization, transformation (see below), and many other features in [[Resonite]].
 
=== Transformation ===
 
Every slot can be '''transformed''' in 3D space: it can be translated (moved), rotated, and scaled. A child slot's transformation is relative to its parent, so even though a child slot might specify no transformation, in global space it may be rotated or scaled because its parents are. Thus, a child's transform is called "local".
 
=== Components ===
 
''Main article: [[Component|Component]]''
 
Slots contain '''components''', which provide almost all the functionality in Resonite. See the main article for details.
 
=== Fields ===
 
[[File:Scene_Inspector_Slot_Example.webp|thumb|400px|A slot's fields and available operations, as shown in the [[Scene Inspector|Scene Inspector]].|alt=Refer to caption.]]
 
Similar to [[Component]]s, slots have a number of fields that can be modified:
 
{{Table TypeFields
|Name|String|The name of the component, as shown in the scene inspector.
|Parent|Slot|A reference to the parent slot in the hierarchy.
|Tag|String|A string tag used for identifying slots in various systems.
|Active|Bool|A general-purpose field to "disable" this slot and its components. If a slot is deactivated, its children are deactivated too. Note that not all components and features respect this field.
|Persistent|Bool|Whether this slot will be saved, for example to the [[Inventory]]. If this is disabled, the slot and all its descendants will not be saved.
|Position|Float3|The position offset this slot has relative to its parent.
|Rotation|FloatQ|The rotation this slot has relative to its parent.
|Scale|Float3|The scale this slot has relative to its parent.
|OrderOffset|Long|Controls the sort order of this control relative to its siblings. Slots with a higher value are "after" sibling with a lower value. This controls the order both in the scene inspector, and in many of Resonite's internal processes.
}}
== Working With Slots ==
 
=== With the Scene Inspector ===
 
As a user, slots are primarily manipulated through the [[Scene Inspector|Scene Inspector]]. You can view, create, destroy and modify slots and their components.
 
=== With ProtoFlux ===
 
[[ProtoFlux]] has a set of nodes for working with the slot hierarchy, see [[:Category:ProtoFlux:Slots]] for a list.
 
=== Limitations ===
 
* There is no way to access to a Slot's components with ProtoFlux.<ref>{{CiteResoniteIssue|57|A way to use components on Protoflux}}</ref>
 
== References ==

Latest revision as of 14:50, 7 March 2024

Every object in Resonite exists as a Slot. Slots form hierarchies, exist in 3D space via a transformation, and contain Components to add additional behavior.

Basic Properties

Hierarchy

A hierarchy of slots as shown in the Scene Inspector. The Example slot has three children, the first of which has another child itself.
A simple slot hierarchy, as shown in the Scene Inspector.

A slot can contain zero or more slots, forming a hierarchy or "tree". A slot is a child if it is contained within another slot; that slot is its parent. The only slot without a parent is the root of the world, which contains all other slots.

This hierarchy is used for organization, transformation (see below), and many other features in Resonite.

Transformation

Every slot can be transformed in 3D space: it can be translated (moved), rotated, and scaled. A child slot's transformation is relative to its parent, so even though a child slot might specify no transformation, in global space it may be rotated or scaled because its parents are. Thus, a child's transform is called "local".

Components

Main article: Component

Slots contain components, which provide almost all the functionality in Resonite. See the main article for details.

Fields

Refer to caption.
A slot's fields and available operations, as shown in the Scene Inspector.

Similar to Components, slots have a number of fields that can be modified:

Fields
Name Type Description
Name String The name of the component, as shown in the scene inspector.
Parent Slot A reference to the parent slot in the hierarchy.
Tag String A string tag used for identifying slots in various systems.
Active Bool A general-purpose field to "disable" this slot and its components. If a slot is deactivated, its children are deactivated too. Note that not all components and features respect this field.
Persistent Bool Whether this slot will be saved, for example to the Inventory. If this is disabled, the slot and all its descendants will not be saved.
Position Float3 The position offset this slot has relative to its parent.
Rotation FloatQ The rotation this slot has relative to its parent.
Scale Float3 The scale this slot has relative to its parent.
OrderOffset Long Controls the sort order of this control relative to its siblings. Slots with a higher value are "after" sibling with a lower value. This controls the order both in the scene inspector, and in many of Resonite's internal processes.

Working With Slots

With the Scene Inspector

As a user, slots are primarily manipulated through the Scene Inspector. You can view, create, destroy and modify slots and their components.

With ProtoFlux

ProtoFlux has a set of nodes for working with the slot hierarchy, see Category:ProtoFlux:Slots for a list.

Limitations

  • There is no way to access to a Slot's components with ProtoFlux.[1]

References