Item
- Last UpdatedSep 05, 2024
- 7 minute read
The Item node is the base node for items. All its parameters are inherited by default from all its derived nodes.
Item-derived nodes are based on naming conventions. This means that several fields are automatically filled based on this naming convention.
-
You can override this convention, if needed, when defining the item.
-
You can override the active value when defining the node, or at runtime.
Platform support
This node is fully supported on XR-Windows platform.
It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Actions
Actions have replaced what was previously called action events in user interaction handling.
-
Each item action is made up of several elements, such as name, text, hotkey.
-
Every item can have both predefined actions based on the item characteristics and user actions defined by script code.
-
You can implement any kind of action on every item.
-
User-defined actions do not modify the item aspect and behavior. They can be used to register that the user has selected a certain action on a certain item.
-
An action can be assigned an avatar animation.
Grouping
You can group items together to create a complex group. To implement grouping, give the same group name to the selected items.
Moving and Parenting
Items are movable, since they inherit from NodeBaseMovable.
-
You change item space transformations and visibility.
-
You can define a hierarchy of item nodes and apply transformations to a parent node and they will be applied to its children too.
Custom coloring
For some item types, such as ItemLiquidLevel, ItemPushButton, or ItemAlarm you might want to customize item coloring by code, or by using the XR Studio without the need to instantiate a Material node.
For example, XR Instructor may need to represent items with correct coloring.
-
You can use the customColorMaterial parameter to define which material attribute to manage item node-based coloring using customColor.
-
If set to None, the item ignores the customColor parameter.
-
InstructorStation refers to customColor, in both cases.
Label Autogeneration
When the LabelViewerautoGenerate is set to true and Mode is set to label3D, the item can use the label automatic generation system.
Code example
Cannot be instantiated.
Item fields
These are the fields for Item node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > NodeBaseMovable > Item
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
_debug |
sbool |
Optional |
false |
When true, the item silhouette displays. This parameter should be used only during development to recognize an item inside a graphical context. |
|
actionable |
sbool |
Optional |
true |
When false, the item is selectable but the InteractionSelector raises a wrongAction event when trying to perform an action on the item. The item does not react to the action. |
|
actionPerformed |
sevent |
Optional |
Not set |
Raised when an action is executed over the item. Raised when action (action button) is performed on the item. |
|
active |
sbool |
Optional |
true |
Specifies whether the node is active. |
|
additionalMeshes |
mstring |
Optional |
Can be used to add one or multiple meshes to the item, so that they are highlighted and selectable as the main meshes. For example, additionalMeshes can be used to add the containing box to an instrument, or a flange to a valve. Additional meshes are not parented to the item, so when changing the transform of the item they will not be modified. |
|
|
avatarPickDistance |
sfloat |
Optional |
0 |
This parameter makes the item selectable from the specified distance, instead of InteractionSelector avatarPickDistance and highlight distance. This is useful for big items with inspection. If value is different than 0, the object is selectable from a different distance than the defined avatar selection distance. |
|
cmesh |
sstring |
Optional |
Auto-populated |
Automatically filled with recognized meshes. |
|
customColor |
svec4 |
optional |
Depends on item type |
When custom color material is set, can be used to change the color of the item or a part of it. Also used by XR Instructor. |
|
customColorMaterial |
sstring |
Optional |
When set to a color attribute of a material, enables you to use customColor on the item. |
|
|
displayValue |
sstring |
Optional |
@itemName.value@ |
Represents the formatting to present the item value. Each kind of item has a different default. You can also modify them at item node definition. |
|
displayName |
sstring |
Optional |
item.name |
The text string that describes the display value type, such as level, percentage, pressure. |
|
displayOverPostEffects |
sbool |
Optional |
false |
If set to true all the Item meshes get visualized over any Filler and Silhouette. |
|
generateLabelTexture |
sbool |
Optional |
true |
When set to false, the label texture is not overridden by the system. It supports old labeling with text manually set on the label. |
|
group |
sstring |
Optional |
No default |
Used to add the simple item into a complex item group. If no value is set, the item is not grouped. For more information about how to use groups, see Items grouping page. |
|
groupOrder |
sint |
Optional |
0 |
Used to order the item inside the group items sorting. Set to -1 to avoid the item handler to displaying inside IS even when the item is active. |
|
groupDisplay |
sbool |
Optional |
true |
Set to false to prevent the item state information being included in the grouped item InteractionViewer representation. |
|
highlightMesh |
sstring |
Optional |
Auto-populated |
Automatically filled with recognized meshes. |
|
highlightMeshShader |
sint |
Optional |
0 |
Currently not used. |
|
icon |
sstring |
Optional |
Depends on item type |
The icon shown in the display panel near displayName and displayValue. |
|
inspectionable |
sbool |
Read only |
false |
If an inspectmov_xxx mesh is found, the item is considered to be inspectionable. |
|
inspectFade |
sbool |
Read only |
true |
If no inspecmov_anim_xxx is provided, the inspection is made by a default fade behavior. |
|
inspect |
sbool |
Optional |
false |
Sets item inspectionable state. (0 not inspected-closed, 1 inspected-opened). Can be used to trigger inspection. |
|
inspectionTime |
sfloat |
Optional |
0.5 |
The time needed to perform inspection animation (both opening and closing). |
|
interactive |
sbool |
Optional |
true |
Specifies whether the node can be operated by user. |
|
item |
sstring |
Optional |
Auto-populated |
Automatically filled with node name. |
|
labelMesh |
sstring |
Optional |
Auto-populated |
Automatically filled with recognized meshes. |
|
labelNormal |
svec3 |
Optional |
0 0 0 |
Label normal vector. Currently not used. |
|
labelPosition |
svec3 |
Optional |
Scene coordinate |
Can be used to move a label from the original position. Works only when labelPositionOverride is set to true. |
|
labelPositionOverride |
sbool |
Optional |
false |
When set to true, the label is moved to labelPosition instead of original position. |
|
labelTextureBackground |
sstring |
Optional |
label_default.tga |
Texture used as background for the label. Every type of item has a different default, such as label_valve.tga for valves. If the type default is not found, the item default is used. |
|
labelTextureFont |
sstring |
Optional |
Arial,Bold,20 |
The font to use for text. The font name must be a system font. Only Bold and Regular parameters are accepted. |
|
labelTextureColor |
svec3 |
Optional |
1 1 1 |
Text color. The color is expressed in normalized (0-1) RGB (0 0 0 for black, 1 1 1 for white). |
|
labelTexturePosition |
svec2 |
Optional |
128 32 |
Position of the center of the text expressed in pixels, in reference to the top-left corner of the texture. |
|
labelVisible |
sbool |
Optional |
true |
Enables you to set up label visibility. |
|
overToItemOrientation |
svec2 |
Optional |
0 0 |
This parameter refers to Avatar overToItem parameter. It allows you to define the final camera orientation after jump. |
|
setActionableActions |
sstring |
Optional |
Not set |
Can be called at runtime to change the list of actionable actions. Use all, none, or a comma-separated list of action names. |
|
selectionMesh |
sstring |
Optional |
Auto-populated |
Automatically filled with recognized meshes. |
|
showItemWhenInactive |
sbool |
Optional |
false |
When set, displays item information label and silhouette (inactive color) if the object is not active. |
|
skipScreenSpaceCulling |
sbool |
Optional |
false |
If set to True, then tall the Item meshes are never culled. |
|
tags |
mstring |
Optional |
No default |
List of words to filter nodes in the Instructor Station. A good practice is to put at least the item type and the plant section. |
|
userActions |
mstring |
Optional |
Not set |
This parameter can be used, in node definition, to inject actions to an item. Pass in a comma-separated list of action names. |
|
zoom |
sbool |
Optional |
false |
Specifies whether the item supports automatic zoom. Currently not used. |
Action parameter
The attributes of the action parameter of an item can be accessed with the syntax:
item.action\[ACTION NAME]\[ATTRIBUTE NAME]
Note that when patching one of these fields, you need to use dots instead of back-slash characters:
<patch name="item" action.check.text="My Text" />
Also note that when resolving these type of fields at runtime, you need to double backslashes like in the following example since the back-slash is also used for character escape.
<setfield name="mySStringVar.value" value="[@item.action\\check\\text]" />
|
Attribute |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
actionOrder |
sint |
Optional |
-1 |
Enables you to manually define the position of the action in the item/group actions list. Check InteractionActionMenu for details about the sorting mechanism. |
|
active |
sbool |
Optional |
true |
Specifies whether the action is available |
|
actionable |
sbool |
Optional |
true |
When false, the action is selectable, but the InteractionSelector raises a wrongAction event when trying to perform it. |
|
anim |
sstring |
Optional |
None |
Specifies one default action to be associated to the execution of the action. |
|
hotkey |
senum |
Optional |
None |
Assigns a gamepad button as shortcut to action execution. Select None to have no hotkey. |
|
name |
sstring |
Mandatory |
Not set |
Identifies the action. |
|
state |
senum |
Read only |
Internally calculated |
Shows current action state as started, running, and stopped. When running, this is an internal state so it is never shown to the user. This state always shows started or stopped. |
|
text |
sstring |
Optional |
Not set |
The text assigned to the action. |