Requirements

Before you start the process please ensure that you have downloaded and installed Unreal Engine 4.25 and Visual Studio 2019.

Loading the demo Unreal project

  1. Clone the project, and enter the repounreal directory.

  2. Right-click the .uproject file and select Generate Visual Studio project files. This will build a Visual Studio solution in the same directory.

  3. Open the Visual Studio solution.

  4. Set the repounreal project as the start-up project, and Start Debugging. This will open the Editor with the debugger attached, which thereafter can be interacted with normally.

The project will have the demo account web configuration hardcoded in, when you are using your own account you can confirm the URL/API are correct in repounreal.cpp:

  • Confirm that these two string variables in the SampleGameModule called URL and apiKey have the correct values

It should match the details that were displayed in this section

Loading a model

The sample code registers two command console commands: 3drepoimport & 3drepoconvert.

  1. Open the console, press the Tilde ¬ key, or open the Output Log (Window > Developer Tools > Output Log)

  2. Make sure you have the model ids and revision ready. Refer to this section for more details

  3. Give the command: 3drepoimport [teamspace] [model id] [revision tag] . Where a revision tag is optional. For example,3drepoimport Repo3DDemo 01713310-2286-11eb-93c1-296aba26cc113drepoimport Repo3DDemo 011382b0-2286-11eb-93c1-296aba26cc11 r1

The model will be imported as a new Actor in the world.

The 3drepoimport command can be given at design-time (in Editor) or in-game (e.g. in Play-In-Editor mode).

Units

A couple of points on how units are applied to models in the plugin:

  • Scaling will be applied to take the model from the source units to the destination units of the Unreal engine

  • The units of the model in 3D Repo can be seen in the setting panel of the model

  • Unreal world units are in cm

  • The scale is applied to the Transform of the top level `ARepoSupermeshActor object

Packaging the Plugin

Use the Package... option in the Plugins dialog in the Editor to do this. By default, support for Mac is disabled via the WhitelistPlatforms property to allow building on a standalone PC. Configure remote-compilation to build for Mac.

The repounreal project (under Solution -> Games) has the plugin (under the Plugins folder), and project code (under the Source folder).

The plugin can be packaged and redistributed. The plugin is registered as a dependency in the project code's repounreal.Build.cs as it would be in any third-party project.

The code under Source demonstrates how to use the plugin. This is what would be replaced in a real application. The demonstration of the plugin's API is in ImportModel. The sample registers this method with the Console Manager under the command 3drepoimport.

Did this answer your question?