Not for Twinmotion. DO NOT expect it to work with Twinmotion.
Pre-Compiled for UE 4.23 .. 4.26.
Demo video: https://youtu.be/owcSTzs8p-8
If you have a code project just use this repo as submodule
git submodule add https://github.com/microdee/UE4-SpaceMouse.git Plugins/SpaceMouse
This plugin works with the HID device directly and doesn't use 3DxWare (official "drivers") SDK or its services (similar how Blender does it). However it has different requirements depending on your operating system:
<path-to-ue4>\Engine\Plugins\3DConnexion
before using this one.You can control any 3D editor viewport (Perspective or Ortho) currently in focus (user needs to click on it first).
Transition speed is controllable via the camera speed setting and the camera speed scalar of the viewport. Camera speed can be increased or decreased with configurable buttons on the spacemice. Multiple devices are supported however their data is merged together into a global context.
On default speeds (speed setting = 4) transition velocity is 1000 units/sec by default and rotation speed is 270°/sec by default. Rotation speed is not affected by camera speed settings. You can change these in the Editor Preferences -> Plugins -> SpaceMouse section.
With Button mappings one can remap some functionalities to SpaceMouse buttons.
Keyboard Shortcuts
Editor preferences (link provided) and bind your SpaceMouse buttons as you would bind a regular keyboard shortcut. Using the SECONDARY input binding form is recommended.There's a pre-defined default set of bindings you can activate by clicking on "Configure default button bindings".
Active in Background When false, only control the camera of UE4 while the editor is the foreground application.
Camera Behavior Sets the mode of controlling the viewport camera. All behavior controls the viewport camera.
Orbiting Moves/Rotates Object When true, SpaceMouse represents the Delta movement of "the object" in front of the camera (meaning axes are inverted)
Orbiting at Fixed Pivot Distance When enabled, sets a fixed distance for the orbiting mode in UE4 units (usually cm).
Orbiting Line Trace Length is the maximum possible radius of the orbiting behavior in UE4 units (usually cm).
Camera controls are slightly different when controlling an Orthographic viewport (Top/Bottom, Left/Right, Front/Rear). Rotation is disabled, and the SpaceMouse is used only to pan on the selected plane and zoom.
Ortho Zoom Speed An arbitrary multiplier of the Zoom speed while insdide an Orthographic viewport. Negative numbers reverse the direction of zooming.
OrthoPanningPlane Select the plane of the device (2 axes) which will control the panning motion inside an Orthographic viewport.
Axis mappings are conversions between the space of spacemice and the space of UE4. You can invert rotations and translations here by flipping the sign. The default values are my subjective preferences (as you can see in the coordinate system image above).
Rotation/Translation Curve are defining the 0..1 curvature from resting state to fully pushed/pulled state of the SpaceMouse puck. Dead-zone, clamping, exponent or other less useful transformations can be expressed with this. Default is 0..1 linear curve, which means no effect.
Display Debug Information prints HID data onto the viewport. You don't need to change Max Hid Read Operations Per Frame. Just ignore it.
Have any feedback or ideas? Go to Discussions!
UE4 forum (please prefer Github Discussions)
The structure of SpaceMouse preferences has changed significantly. Upon updating from prior versions (<= 1.1.x) you might need to re-configure the plugin. Don't worry though, the button binding UX has been improved significantly.
Upon updating from prior versions (<= 1.0.x pre-marketplace) please delete both HIDUE and SpaceMouse plugins from your Engine or Project plugins folder!
If for any reason you cannot use this plugin as a submodule and you want to make a pre-built release to be an engine plugin, then work with the official test project and see the build instructions there.
To make a pre-built release for Linux, read the Linux Build Guide.
3DConnexion claims to have Mac support for their official plugin now. In light of that Mac support is no longer persued and if you want to use your Space Mouse on Mac with Unreal Engine you should install their official plugin. This plugin keeps support for Windows and Linux (reportedly).