Mwx
- Last UpdatedOct 22, 2025
- 3 minute read
The Mwx node is used to load a MWX file into memory.
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.
The metadata field is supported on Windows only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Guidelines
-
An MWX must be declared as part of a Context.
-
Only MWX nodes that belong to active Context nodes can be displayed.
-
An MWX that is part of a Global context can always be displayed.
Sectors
Sectors represents a way to show or hide the content of one or more MWX nodes with two major benefits:
-
Performance is highly improved, due to not having to individually read all the sector's included MWX content.
-
The visibility state of individual MWX content is preserved.
Assign an MWX to a Sector node
-
Set its Sector attribute to the selected sector name.
MWX and mesh visibility
It's important to notice that setting the visible field of the MWX is equivalent to individually setting the visibility field of each mesh element inside the MWX. Mesh visibility can also be managed by Mesh or Layer3D nodes.
Note: Changing the visibility state of a mesh by using two or more different node instances can lead to inconsistent situations as the last value set will prevail.
When the user needs to hide MWX content at runtime, the better approach is to use the Sector method.
Code example
This is a code example for the Mwx node.
<Mwx name="uno" file="sample.mwx"/>
Position
The MWX node must be inside a context node, such as Context or Global.
MWX fields
These are the fields for Mwx node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > Mwx
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
contains |
mstring |
Optional |
Not set |
Checks whether there are one or more objects inside the files that contain one of the passed string in their name. If the check for one string fails, an exception is raised. It can used to check MWX file consistency. |
|
file |
sstring |
Mandatory |
Not set |
The MWX file name. File must contain .mwx extension. |
|
loadedInEngine |
sbool |
Read only |
false |
This field is set to true when loading in engine is complete and to false when geometry is unloaded from the engine. It can be useful when dynamic loading geometries to avoid performing operations on the Mwx before loading is complete. Note that this field is supported on XR-WIN only. |
|
replace |
dstring |
Optional |
Not set |
Use this dictionary to rename the scene objects contained inside the MWX file. Ensure that this means renaming the scene object names, not the logic nodes. |
|
sector |
sstring |
Optional |
The name of the sector to which the MWX node is assigned. |
|
|
visible |
sbool |
Optional |
true |
Can be used to hide/show the whole MWX content. The visibility state of several scene objects and nodes cannot be restored to original value when doing hide and show again. |