0

I'm trying to write a Blender script that uses joystick input to move the viewport while editing. I tried using Pygame and I've looked at Pyglet, but it looks like they both only work under Python 2.x, which isn't compatible with Blender, which uses 3.x. I keep looking for 3.x-compatible joystick libraries but haven't found any.

Blender already uses joystick input for the game engine, so how hard would it be to hook that up to the editor, instead? Or is there some other way to get joystick input in Python that's 3.x-friendly? For what it's worth, I'm running Ubuntu 12.04 and Blender 2.74RC2, with Python 3.4.2.

I'd appreciate any help I can get on this. Thanks for your time.

1 Answers1

0

I always use the Joystick inputs for the BGE. Anyway:

1)2to3.py Try to check if this library can accept Pygame and Pyglet code. I've never tried but it's a good start point.
Otherwise, if you can't work in this way since 2to3.py is really slow or 2to3.py can't translate the code, you can not do with Pyglet and Pygame what you try to achieve because, as you've said on your question, Blender was compiled for work with python 3.

2)Would not recommend it to you, you should recompile and build blender to work with python 2.

3)Use the built-in modules present in Blender

reference
https://docs.python.org/2/library/2to3.html
https://blender.stackexchange.com/questions/302/how-to-make-blender-use-python2-x

Community
  • 1
  • 1