""" This module was generated by Vizconnect. Version: 1.05 Generated on: 2021-05-14 15:17:16.317000 """ import viz import vizconnect ################################# # Parent configuration, if any ################################# def getParentConfiguration(): #VC: set the parent configuration _parent = '' #VC: return the parent configuration return _parent ################################# # Pre viz.go() Code ################################# def preVizGo(): return True ################################# # Pre-initialization Code ################################# def preInit(): """Add any code here which should be called after viz.go but before any initializations happen. Returned values can be obtained by calling getPreInitResult for this file's vizconnect.Configuration instance.""" return None ################################# # Group Code ################################# def initGroups(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawGroup = vizconnect.getRawGroupDict() #VC: return values can be modified here return None ################################# # Display Code ################################# def initDisplays(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawDisplay = vizconnect.getRawDisplayDict() #VC: return values can be modified here return None ################################# # Tracker Code ################################# def initTrackers(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawTracker = vizconnect.getRawTrackerDict() _name = 'head_tracker' if vizconnect.isPendingInit('tracker', _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: tracker = steamvr.getExtension().getHMDList()[index] except IndexError: viz.logWarn("** WARNING: Not able to connect to tracker at index {0}. It's likely that not enough trackers are connected.".format(index)) tracker = viz.addGroup() tracker.invalidTracker = True rawTracker[_name] = tracker #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addTracker(rawTracker[_name], _name, make='Valve', model='SteamVR HMD Tracker') #VC: init the offsets if initFlag&vizconnect.INIT_OFFSETS: _link = vizconnect.getTracker(_name).getLink() #VC: clear link offsets _link.reset(viz.RESET_OPERATORS) #VC: apply offsets _link.postScale([2, 1, 2]) #VC: set the name of the default vizconnect.setDefault('tracker', 'head_tracker') #VC: return values can be modified here return None ################################# # Input Code ################################# def initInputs(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawInput = vizconnect.getRawInputDict() #VC: return values can be modified here return None ################################# # Event Code ################################# def initEvents(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawEvent = vizconnect.getRawEventDict() #VC: return values can be modified here return None ################################# # Transport Code ################################# def initTransports(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawTransport = vizconnect.getRawTransportDict() #VC: initialize a new transport _name = 'main_transport' if vizconnect.isPendingInit('transport', _name, initFlag, initList): if initFlag&vizconnect.INIT_INDEPENDENT: initTrackers(vizconnect.INIT_INDEPENDENT, ['head_tracker']) #VC: init the raw object if initFlag&vizconnect.INIT_RAW: #VC: set some parameters orientationTracker = vizconnect.getTracker('head_tracker').getNode3d() debug = False acceleration = 10 maxSpeed = 11 rotationAcceleration = 60 maxRotationSpeed = 65 autoBreakingDragCoef = 0.1 dragCoef = 0.0001 rotationAutoBreakingDragCoef = 0.2 rotationDragCoef = 0.0001 usingPhysics = False parentedTracker = False transportationGroup = None #VC: create the raw object from transportation import wand_magic_carpet rawTransport[_name] = wand_magic_carpet.WandMagicCarpet( orientationTracker=orientationTracker, debug=debug, acceleration=acceleration, maxSpeed=maxSpeed, rotationAcceleration=rotationAcceleration, maxRotationSpeed=maxRotationSpeed, autoBreakingDragCoef=autoBreakingDragCoef, dragCoef=dragCoef, rotationAutoBreakingDragCoef=rotationAutoBreakingDragCoef, rotationDragCoef=rotationDragCoef, usingPhysics=usingPhysics, parentedTracker=parentedTracker, node=transportationGroup) #VC: init the wrapper (DO NOT EDIT) if initFlag&vizconnect.INIT_WRAPPERS: vizconnect.addTransport(rawTransport[_name], _name, make='Virtual', model='WandMagicCarpet') #VC: set the parent of the node if initFlag&vizconnect.INIT_PARENTS: vizconnect.getTransport(_name).setParent(vizconnect.getRoot()) #VC: set the pivot of the node if initFlag&vizconnect.INIT_PIVOTS: vizconnect.getTransport(_name).setPivot(vizconnect.getTracker('head_tracker').getNode3d()) #VC: set the name of the default vizconnect.setDefault('transport', 'main_transport') #VC: return values can be modified here return None ################################# # Tool Code ################################# def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawTool = vizconnect.getRawToolDict() #VC: return values can be modified here return None ################################# # Avatar Code ################################# def initAvatars(initFlag=vizconnect.INIT_INDEPENDENT, initList=None): #VC: place any general initialization code here rawAvatar = vizconnect.getRawAvatarDict() #VC: return values can be modified here return None ################################# # Application Settings ################################# def initSettings(): #VC: apply general application settings viz.mouse.setTrap(False) viz.mouse.setVisible(viz.MOUSE_AUTO_HIDE) vizconnect.setMouseTrapToggleKey('') #VC: return values can be modified here return None ################################# # Post-initialization Code ################################# def postInit(): """Add any code here which should be called after all of the initialization of this configuration is complete. Returned values can be obtained by calling getPostInitResult for this file's vizconnect.Configuration instance.""" return None ################################# # Stand alone configuration ################################# def initInterface(): #VC: start the interface vizconnect.interface.go(__file__, live=True, openBrowserWindow=True, startingInterface=vizconnect.interface.INTERFACE_STARTUP) #VC: return values can be modified here return None ############################################### if __name__ == "__main__": initInterface() viz.add('piazza.osgb') viz.add('piazza_animations.osgb')