An example of how to get gamepad and other device input (like MIDI maybe) and use it inside Blender.
On some devices like Mac you may need to give elevated permissions to Blender to allow for plugin to work.
- Download as a zip
- Open Blender
- Go to Edit > Preferences and go to the Addons tab on left.
- Click install button.
- Select the zip you downloaded.
- You can confirm it's installed by searching for "Gamepad" and seeing if it's checked off
- Turn on your controller before opening Blender.
- You can test if the gamepad is working by going to the 3D Viewport and expanding the side menu, there's a panel for the gamepad with a "Test Gamepad button".
- This button should vibrate the controller. If it's not vibrating it's not being detected.
- You can also see a list of detected gamepads here
If you're using a PlayStation controller on Windows, you'll need to use an app like DS4Windows to create an fake XInput profile. The
inputs
library uses XInput on Windows, which is the protocol for Xbox and other 3rd party controllers.
- Make sure your scene has a camera in it and set it as the active camera.
- In a 3D Viewport, click the Object menu item and select "Enable Gamepad Navigation".
Uses inputs
Python library to get gamepad input data across all platforms (Windows, Linux, and Mac).
We get access to the gamepad anywhere anytime, you can see an example of this in the test vibration function.
The gamepad input is synced to Blender using a "modal operator" class with a built-in timer that runs every 0.1
seconds. This not only syncs, but handles any other input-based logic (like moving the camera).
- inputs by @zeth