I have a 3DConnexion SpaceNavigator. It works very well for moving the viewport. Is there a way for it to place an object in the scene?
Is this something that can be accomplished via an addon? I am new to Blender, I'm delighted that the NDOF works out of the box, but I expect to be able to place objects using it. Would be much more intuitive than using a mouse.
So far I have setup a ViewOperator template and I can see that moving the 3D mouse yields a NDOF_MOTION event
def modal(self, context, event):
v3d = context.space_data
rv3d = v3d.region_3d
if event.type == 'NDOF_MOTION':
print(event)
blender console when moving the 3d mouse: <bpy_struct, Event at 0x000001B72D13B5F8>
I can see how I might write a script to move an object given the motion event. The problem is I can not find any way to get data from the event. I am expecting some translation/rotation vectors but those properties don't seem to exist on the Event object.
I believe the c implementation to move the viewport is here: ndof_orbit_zoom_invoke() in https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_view3d/view3d_edit.c
const wmNDOFMotionData *ndof = event->customdata;
There is no customdata
on the event when it gets to my python script.
Which makes sense because there is no mention of any relevant data in rna_def_event()
here: https://developer.blender.org/diffusion/B/browse/master/source/blender/makesrna/intern/rna_wm.c