Space Pilot support in Python VTK

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
okapi
Posts: 3
Joined: Tue Mar 11, 2014 7:03 am

Space Pilot support in Python VTK

Post by okapi » Tue Mar 11, 2014 7:19 am

Hello

I have tried to get my SpacePilot to work in Pythons (Python 2.7.6 |Anaconda 1.9.1 (64-bit)) VTK. The device is funktioning perfectly with other programms, the operating System is windows 7

I found the following Information, and started trying, without success_

http://www.vtk.org/Wiki/VTK/3DConnexion_Devices_Support

The print GetUseTDX produces a True but other than that, there is no positiv result. The lines that are commented out produce errors

Can anybody please give me some advice

Thank you for your help

Code: Select all

       # Render Window
        self.renderWindow = vtk.vtkRenderWindow()
        self.renderWindow.AddRenderer(renderer)
        
        # Interactor
        self.renderWindowInteractor = vtk.vtkRenderWindowInteractor()
        print(self.renderWindowInteractor.SetUseTDx(True))
        print(self.renderWindowInteractor.GetUseTDx())
        #self.renderWindowInteractor.UseTDx()
        #self.renderWindowInteractor.AddObserver('TDxMotionEvent')
        self.renderWindowInteractor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
        self.renderWindowInteractor.SetRenderWindow(self.renderWindow)
        
        # Begin Interaction
        self.renderWindow.Render()
        self.renderWindowInteractor.Start()

jwick
Moderator
Moderator
Posts: 2803
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space Pilot support in Python VTK

Post by jwick » Wed Mar 12, 2014 2:53 am

Is this your code?
Going on that wiki it provides some samples that I assume the original developers created. Do those work?

Usually when programs have problems, it is because the window it said it wanted to receive messages, doesn't have a message loop.

You can turn logging on in the driver to see what window gets registered and where the device messages are being sent.
Use 3DxWare 10 for your development ("SpaceNavigator driver" on our web site).

okapi
Posts: 3
Joined: Tue Mar 11, 2014 7:03 am

Re: Space Pilot support in Python VTK

Post by okapi » Wed Mar 12, 2014 3:56 am

That is my code. It works nicely with the normal mouse (turning and so on), so the window must have a message loop of some kind?
I have added all the lines with TDx in them to add 3dmouse support


That wiki supplies C-code sniplets. I have got no idea weather they would work. I tryed to translate it to Python, but I it did not see any effekt. I have not found any other Information in Python...

I will try 3DxWare, and post the results.

Post Reply