0
$\begingroup$

I'm trying to read inputs from an XBox 360 controller in Blender 2.8 however my scripting knowledge is limited.

I think I would have to install this python module/library/whatever the hell its called https://pypi.org/project/inputs/ but unfortunately I have no idea how to do that and every tutorial/instructions I read on the subject might as well be written in hieroglyphs. I understand "installing with pip" is a thing and I think 2.8 comes equipped with this tool but that doesn't mean much to me.

This doesn't seem like a difficult problem but installing python modules is above my head. If anyone could break the process down in layman's terms I would be eternally grateful or if there is another way of doing this that I'm not seeing please feel free to share.

The ultimate goal of this endeavor is to use the controller as an animator's tool, that is using the joysticks and buttons to perform actions in Blender. That part I'm confident I can wrap my head around it's just getting the actual inputs that's stumping me.

$\endgroup$
  • $\begingroup$ pip is a tool for an operating platform to install some package in a organized way. Those packages are provided by community in some repositories. Most of the python package dev will distribute their work in there for easy installing. And Blender use an individual python build contained in installed directory. While pip is not directly linked to that environment. So the links provide some method to achieve pip in python console. $\endgroup$ – Hikariztw Jul 11 at 0:03
  • $\begingroup$ @Hikariztw followed those links as closely as possible and still no luck. $\endgroup$ – WSNH Jul 11 at 3:35
0
$\begingroup$

Assuming your are using Windows Platform:

Open your python bundled in Blender to enter a Python interactive console.

enter image description here

Type down following code one by one line (#line can be ignored):

import subprocess
import sys
# enable pip
subprocess.call([sys.executable, "-m", "ensurepip"])
# upgrade pip to latest version
subprocess.call([sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
# install any package
subprocess.call([sys.executable, "-m", "pip", "install", "inputs"])

enter image description here

$\endgroup$
  • $\begingroup$ Thank you so very much! This worked like a charm. For future visitors (in case it's not glaringly obvious) in the last line you would replace "inputs" with the name of whatever package you're trying to install...in quotations of course. Mine just happened to be inputs. Just noting for the programming challenged like me. Thanks again @Hikariztw $\endgroup$ – WSNH Jul 11 at 21:17
  • $\begingroup$ Just about to warn you. These code, especially subprocess.call, is extremely dangerous command that call another python process, which can run arbitrary codes that might harm your system and file. Check the code carefully and run if you meet another code use these command $\endgroup$ – Hikariztw Jul 12 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.