22. Importing a model
The AGX Dynamics for Unreal import feature is accessible from the AGX menu in the top Menu Bar and the File tab of the AGX Mode.
When importing an AGX Dynamics archive (.agx) or a URDF (.urdf) file into AGX Dynamics for Unreal, the result is a Blueprint containing the imported objects. A key point is that regardless of a model being imported from an AGX Dynamics archive or a URDF file, everything is translated to AGX Dynamics for Unreal Components and Assets and can be used in the same way.
The resulting Blueprint derives from a base Blueprint named
This base Blueprint should never be manually edited.
If edited, the
`Model Synchronization feature will not work properly.
Any edits should be done directly on the resulting Blueprint or instances of it.
See Synchronize model for more details.
22.1. Import settings
AGX > File > Import Model to Blueprint and then specifying a model to import, the following dialog appears.
Ignore disabled Trimeshes, any agxCollide::Trimesh that has collision disabled will not be imported.
Only its RenderData will be imported, if it exists.
This can be an efficient way to reduce the number of components imported for large models.
22.2. Synchronize model
It is possible to synchronize a previously imported Blueprint against the source file it was originally imported from.
This is useful for example when changes to the original source file has been made, but a complete, new, Import into AGX Dynamics for Unreal is not desired or appropriate.
Synchronize Model feature will attempt to update the Blueprint according to the selected source file but without removing user changes made in the Blueprint.
Data loss may occur during model synchronization. The algorithm will attempt to keep user changes untouched but it cannot be guaranteed. It is recommended to use a version control or backup system for your imported models.
There are two main ways to access the
Synchronize Model feature from the Unreal Editor:
Right click the Blueprint in the
Content Browserand select
Scripted Asset Actions > AGX Synchronize Model.
From within the Blueprint, select the
AGX Model SourceComponent and klick the
This feature requires the AGX Dynamics objects to have persistent UUID’s between writes to the source file. This works automatically when using models created in e.g. Algoryx Momentum. If the model is created in any other environment, for example a Python or C++ program, consistent UUIDs must be provided by that program.
Currently, the following Components are not supported by the
Synchronize Model featured and are always ignored:
22.3. Importing AGX Dynamics archives
The following screenshot shows an example scene with a wheel loader model.
When importing the example scene to a Blueprint the following is produced:
22.3.1. Wire and Track import limitation
For Wire and Track, the complete dynamic state of the model is not preserved when imported. For example, the velocities of each lumped node of a Wire will not be preserved during the import process, however the position of the nodes will be. The result of an import of any of these models will replicate the state of the original model as far as possible, but since the information about the dynamic state is not preserved, the resulting imported model can be considered to be at rest.
22.3.2. Models with no import support
The following models are not supported when importing from an AGX Dynamics archive (.agx):
22.3.3. What is imported and what isn’t
When importing an .agx file, only objects contained within that .agx file is imported, for example Rigid Bodies, Constraints, Materials, Wires etc. Global settings such as gravity, time step or solver settings are not imported and will be ignored.
22.4. Importing URDF models
AGX > File > Import Model to Blueprint the following dialog appears.
If a URDF file is selected and it contains any
filename paths, an additional
URDF Package section is shown.
The directory selected here corresponds to the
package:// part of any
filename path used in the URDF (.urdf) file and must match.
This is common when e.g. having mesh files that are used in the URDF model.
The figure below shows an example of this.
Once the import procedure is complete, a Blueprint containing the imported objects will appear and can be used as normal.
The URDF import feature in AGX Dynamics for Unreal supports the same features, and have the same limitations, as the Algoryx Dynamics URDF Reader except for a few things:
mimicfeature is not supported.
- Textures from mesh files such as e.g. collada (.dae) files are not supported.
22.5. Improving Blueprint editor performance
For very large models with several hundreds or even thousands of components, the Blueprint editor may be slow to react to user input.
One way to reduce the number of components of a Blueprint is to use the setting
Ignore disabled Trimeshes during the import process.
See Import settings for more information about import settings.
To improve context menu responstime in the Blueprint
Event Graph, it is recommended to de-activate the
Context Sensitive setting shown in the image below.