def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'keyboard' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object d = viz.add('directinput.dle') device = d.getKeyboardDevices()[index] rawInput[_name] = d.addKeyboard(device) #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Keyboard') #VC: initialize a new input _name = 'mouse_buttons' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: create the raw object rawInput[_name] = viz.mouse #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Mouse Buttons') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'r_hand_input' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: create the raw object rawInput[_name] = viz.mouse #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Mouse Buttons') #VC: initialize a new input _name = 'keyboard' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object d = viz.add('directinput.dle') device = d.getKeyboardDevices()[index] rawInput[_name] = d.addKeyboard(device) #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Keyboard') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'flystick' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters hostname = 'localhost' #VC: create the raw object from vizconnect.util.input import art_flystick sensor = art_flystick.ARTFlystickWrapper(hostname=hostname) rawInput[_name] = sensor #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='ART', model='Flystick') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'ppt_wand' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters hostname = '141.82.50.174' markerId = 3 #VC: create the raw object from vizconnect.util.input import viz_wand rawInput[_name] = viz_wand.Wand(hostname, markerId) #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='WorldViz', model='PPT Wand') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'flystick' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters hostname = '192.168.5.160' #VC: create the raw object from vizconnect.util.input import vrpn_joystick sensor = vrpn_joystick.VRPNJoystick(basename='DTrack', hostname=hostname) rawInput[_name] = sensor #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='ART', model='Flystick') #VC: initialize a new input _name = 'keyboard' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object d = viz.add('directinput.dle') device = d.getKeyboardDevices()[index] rawInput[_name] = d.addKeyboard(device) #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Keyboard') #VC: set the name of the default vizconnect.setDefault('input', 'flystick') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'flystick_analog' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters basename = 'DTrack' hostname = '192.168.0.10' #VC: create the raw object vrpn = viz.add('vrpn7.dle') sensor = vrpn.addAnalog(basename + '@' + hostname) rawInput[_name] = sensor #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='VRPN Analog') #VC: initialize a new input _name = 'flystick_buttons' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters basename = 'DTrack' hostname = '192.168.0.10' #VC: create the raw object vrpn = viz.add('vrpn7.dle') sensor = vrpn.addButton(basename + '@' + hostname) rawInput[_name] = sensor #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='VRPN Buttons') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'r_hand_input' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: create the raw object rawInput[_name] = viz.mouse #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Mouse Buttons') #VC: init the mappings for the wrapper if initFlag&vizconnect.INIT_WRAPPER_MAPPINGS: #VC: per frame mappings if initFlag&vizconnect.INIT_MAPPINGS_PER_FRAME: #VC: get the raw input dict so we have access to signals import vizact rawInput = vizconnect.getConfiguration().getRawDict('input') #VC: set the update function which checks for input signals def update(input): if rawInput['r_hand_input'].getState()&viz.MOUSEBUTTON_LEFT:# make=Generic, model=Mouse Buttons, name=r_hand_input, signal=Left Mouse Button input.setQuasimode('alt1') vizconnect.getInput(_name).setUpdateFunction(update) #VC: initialize a new input _name = 'keyboard' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object d = viz.add('directinput.dle') device = d.getKeyboardDevices()[index] rawInput[_name] = d.addKeyboard(device) #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Keyboard') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'r_hand_input' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: create the raw object import vizjoy rawInput[_name] = vizjoy.add() #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Joystick') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'joystick' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: create the raw object import vizjoy rawInput[_name] = vizjoy.add() #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Joystick') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'joystick' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: create the raw object import vizjoy rawInput[_name] = vizjoy.add() #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Joystick') #VC: init the mappings for the wrapper if initFlag & vizconnect.INIT_WRAPPER_MAPPINGS: #VC: on-state mappings if initFlag & vizconnect.INIT_MAPPINGS_ON_STATE: vizconnect.getInput(_name).setOnStateEventList([ vizconnect.onstate( lambda rawInput: rawInput['joystick'].isButtonDown(1), vizconnect.getInput(_name).setMode ), # make=Generic, model=Joystick, name=joystick, signal=Button 1 ]) #VC: set the name of the default vizconnect.setDefault('input', 'joystick') #VC: return values can be modified here return None
def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: initialize a new input _name = 'keyboard' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object d = viz.add('directinput.dle') device = d.getKeyboardDevices()[index] rawInput[_name] = d.addKeyboard(device) #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='Generic', model='Keyboard') #VC: initialize a new input _name = 'r_hand_input' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters index = 0 #VC: create the raw object import steamvr try: input = steamvr.getControllerList()[index] input._isValid = True except IndexError: viz.logWarn( "** WARNING: Not able to connect to a controller at index {0}. It's likely that not enough controllers are connected." .format(index)) input = viz.VizExtensionSensor(-1) input.isButtonDown = lambda e: False input.getTrackpad = lambda: [0, 0] input._isValid = False rawInput[_name] = input #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='HTC', model='Vive Controller') #VC: init the mappings for the wrapper if initFlag & vizconnect.INIT_WRAPPER_MAPPINGS: #VC: per frame mappings if initFlag & vizconnect.INIT_MAPPINGS_PER_FRAME: #VC: get the raw input dict so we have access to signals import vizact rawInput = vizconnect.getConfiguration().getRawDict('input') #VC: set the update function which checks for input signals def update(input): if rawInput['r_hand_input'].isButtonDown( 2 ): # make=HTC, model=Vive Controller, name=r_hand_input, signal=Button Trigger input.setQuasimode() vizconnect.getInput(_name).setUpdateFunction(update) #VC: initialize a new input _name = 'l_hand_input' if vizconnect.isPendingInit('input', _name, initFlag, initList): #VC: init the raw object if initFlag & vizconnect.INIT_RAW: #VC: set some parameters index = 1 #VC: create the raw object import steamvr try: input = steamvr.getControllerList()[index] input._isValid = True except IndexError: viz.logWarn( "** WARNING: Not able to connect to a controller at index {0}. It's likely that not enough controllers are connected." .format(index)) input = viz.VizExtensionSensor(-1) input.isButtonDown = lambda e: False input.getTrackpad = lambda: [0, 0] input._isValid = False rawInput[_name] = input #VC: init the wrapper (DO NOT EDIT) if initFlag & vizconnect.INIT_WRAPPERS: vizconnect.addInput(rawInput[_name], _name, make='HTC', model='Vive Controller') #VC: set the name of the default vizconnect.setDefault('input', 'r_hand_input') #VC: return values can be modified here return None