Number of Joystick Axes

I appear to only be able to access 6 joystick axes using the joystick sensor set to All Axis Events, and using mySensor.axisValues[num] in my python code.

I can access numbers 0 to 5, then if I try to access 6 I get this error message:

“IndexError: list index out of range”

But my joystick has 8 available axes. I have varified that they are all working. Is there any way I can access them all in Blender?


What kind of a joystick is it?

With 2.49, the joy sensor had a limitation on axes removed (4 maximum). That said, sometimes some joystick axes are classified as “hats”.

Try mySensor.hatValues[num] as well.

They’re not showing up as hats either. My controller does have a hat, but its 8 axes are behaving like analog axes in the game controller properties (on Windows). Has anyone else reached a limit at 6 axes in Blender 2.49?

Did you try the ‘numAxis’ yet?

Maybe you should try also a ‘numButtons’ to see, if those axis are actually reported as buttons.

BTW I’m also curious, what kind of joystick you have.

numAxes returns 6.

Its actually a virtual controller (PPJoy), which I’m feeding accelerometer data. The fact that its virtual shouldn’t be a problem though, I can see all axes working correctly outside of blender.

Not sure if this is important information or not, but also the order of axes are messed up. So if I line up the numbers blender think my axes are into the order that they should be, it goes: 0, 1, 2, 5, missing, 3, 4, missing. I have no idea whats with that.

I’m coding a corss connection tool for the multiple controllers

It see my 3, 4 and 6- axes game controllers just fine.

Thats cool. But still my suspicion that there’s a limit of 6 stands.

Well, I can’t find the commit log right now where Campbell raised the limit on number of axes from 4 to 256 (or some other ridiculous number). But I know I read it, and that I bumped into the old 4-axes limit in 2.48.

(My X360 controller has 6 axes, which work fine in 2.49.)

So they are supposed to work - if they don’t, Campbell would probably like to know. Best way of getting his attention would be to make a test case with pure software so he can test it himself. A virtual joystick such as Joymap or GlovePIE would be aces - he’s on Linux, BTW.

Whilst its not impossible there is some bug in Joystick support, blender is just wrapping SDL, it does not do anything tricky as far as drivers go. so its normally just some confusion with how the device is supposed to work.

I find the best way to debug this stuff is to print the output of the device.
in a python script print cont.sensors[“joy”].axisValues, then adjust the axis and see how they are mapped.

Hate to sound snooty, but I did this before choosing to post about it on the forum.

I didn’t realize that blender is using SDL. I’ve also be working in the 2D game engine LOVE, which I beleive is built with SDL. And I have the exact same issue with that engine. Only 6 of my 8 axes appear, and they’re mapped in a perculiar order. Does anyone know how many joystick axes SDL supports?