def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
	#VC: place any general initialization code here
	rawTool = vizconnect.getRawToolDict()

	#VC: initialize a new tool
	_name = 'grabber'
	if vizconnect.isPendingInit('tool', _name, initFlag, initList):
		#VC: init which needs to happen before viz.go
		if initFlag&vizconnect.INIT_PREVIZGO:
			viz.setOption('viz.display.stencil',1)
	
		#VC: init the raw object
		if initFlag&vizconnect.INIT_RAW:
			#VC: initialization code needed by the parameters
			import tools
			from tools import grabber
			from tools import highlighter
			
			#VC: set some parameters
			usingPhysics = False
			highlightMode = tools.highlighter.MODE_OUTLINE
			placementMode = tools.placer.MODE_MID_AIR
			
			#VC: create the raw object
			rawTool[_name] = grabber.Grabber(usingPhysics=usingPhysics, usingSprings=usingPhysics, highlightMode=highlightMode, placementMode=placementMode, updatePriority=vizconnect.PRIORITY_ANIMATOR+3)
	
		#VC: init the mappings for the raw object
		if initFlag&vizconnect.INIT_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(tool):
					if rawInput['mouse_buttons'].getState()&viz.MOUSEBUTTON_LEFT:# make=Generic, model=Mouse Buttons, name=mouse_buttons, signal=Left Mouse Button
						tool.grabAndHold()
				rawTool[_name].setUpdateFunction(update)
	
		#VC: init the wrapper (DO NOT EDIT)
		if initFlag&vizconnect.INIT_WRAPPERS:
			vizconnect.addTool(rawTool[_name], _name, make='Virtual', model='Grabber')
	
		#VC: set the parent of the node
		if initFlag&vizconnect.INIT_PARENTS:
			vizconnect.getTool(_name).setParent(vizconnect.getAvatar('head_and_hand').getAttachmentPoint('r_hand'))

	#VC: return values can be modified here
	return None
Example #2
0
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
	#VC: place any general initialization code here
	rawTool = vizconnect.getRawToolDict()

	#VC: initialize a new tool
	_name = 'grabber'
	if vizconnect.isPendingInit('tool', _name, initFlag, initList):
		#VC: init which needs to happen before viz.go
		if initFlag&vizconnect.INIT_PREVIZGO:
			viz.setOption('viz.display.stencil',1)
	
		#VC: init the raw object
		if initFlag&vizconnect.INIT_RAW:
			#VC: initialization code needed by the parameters
			import tools
			from tools import grabber
			from tools import highlighter
			
			#VC: set some parameters
			usingPhysics = False
			highlightMode = tools.highlighter.MODE_OUTLINE
			placementMode = tools.placer.MODE_MID_AIR
			
			#VC: create the raw object
			rawTool[_name] = grabber.Grabber(usingPhysics=usingPhysics, usingSprings=usingPhysics, highlightMode=highlightMode, placementMode=placementMode, updatePriority=vizconnect.PRIORITY_ANIMATOR+3)
	
		#VC: init the mappings for the raw object
		if initFlag&vizconnect.INIT_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(tool):
					if rawInput['r_hand_input'].getState()&viz.MOUSEBUTTON_LEFT:# make=Generic, model=Mouse Buttons, name=r_hand_input, signal=Left Mouse Button
						tool.grabAndHold()
				rawTool[_name].setUpdateFunction(update)
	
		#VC: init the wrapper (DO NOT EDIT)
		if initFlag&vizconnect.INIT_WRAPPERS:
			vizconnect.addTool(rawTool[_name], _name, make='Virtual', model='Grabber')
	
		#VC: set the parent of the node
		if initFlag&vizconnect.INIT_PARENTS:
			vizconnect.getTool(_name).setParent(vizconnect.getAvatar('main_avatar').getAttachmentPoint('r_hand'))

	#VC: return values can be modified here
	return None
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
    #VC: place any general initialization code here
    rawTool = vizconnect.getRawToolDict()

    #VC: initialize a new tool
    _name = 'grabber'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init which needs to happen before viz.go
        if initFlag & vizconnect.INIT_PREVIZGO:
            viz.setOption('viz.display.stencil', 1)

        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: initialization code needed by the parameters
            import tools
            from tools import grabber
            from tools import highlighter

            #VC: set some parameters
            usingPhysics = True
            highlightMode = tools.highlighter.MODE_OUTLINE
            placementMode = tools.placer.MODE_MID_AIR

            #VC: create the raw object
            rawTool[_name] = grabber.Grabber(
                usingPhysics=usingPhysics,
                usingSprings=usingPhysics,
                highlightMode=highlightMode,
                placementMode=placementMode,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Grabber')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('main_avatar').getAttachmentPoint(
                    'r_hand'))

    #VC: return values can be modified here
    return None
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
    #VC: place any general initialization code here
    rawTool = vizconnect.getRawToolDict()

    #VC: initialize a new tool
    _name = 'proxy'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: create the raw object
            from tools import proxy
            rawTool[_name] = proxy.Proxy()

        #VC: init the mappings for the raw object
        if initFlag & vizconnect.INIT_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(tool):
                    if rawInput['flystick_buttons'].isButtonDown(
                            0
                    ):  # make=Generic, model=VRPN Buttons, name=flystick_buttons, signal=Button 0
                        tool.action1()

                rawTool[_name].setUpdateFunction(update)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Proxy')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('head_and_hand').getAttachmentPoint(
                    'r_hand'))

    #VC: return values can be modified here
    return None
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
	#VC: place any general initialization code here
	rawTool = vizconnect.getRawToolDict()

	#VC: initialize a new tool
	_name = 'proxy'
	if vizconnect.isPendingInit('tool', _name, initFlag, initList):
		#VC: init the raw object
		if initFlag&vizconnect.INIT_RAW:
			#VC: create the raw object
			from tools import proxy
			rawTool[_name] = proxy.Proxy()
	
		#VC: init the mappings for the raw object
		if initFlag&vizconnect.INIT_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(tool):
					if rawInput['r_hand_input'].getState()&viz.MOUSEBUTTON_LEFT:# make=Generic, model=Mouse Buttons, name=r_hand_input, signal=Left Mouse Button
						tool.action1()
					if rawInput['r_hand_input'].getState()&viz.MOUSEBUTTON_RIGHT:# make=Generic, model=Mouse Buttons, name=r_hand_input, signal=Right Mouse Button
						tool.action2()
					if rawInput['r_hand_input'].getState()&viz.MOUSEBUTTON_MIDDLE:# make=Generic, model=Mouse Buttons, name=r_hand_input, signal=Middle Mouse Button
						tool.action3()
				rawTool[_name].setUpdateFunction(update)
	
		#VC: init the wrapper (DO NOT EDIT)
		if initFlag&vizconnect.INIT_WRAPPERS:
			vizconnect.addTool(rawTool[_name], _name, make='Virtual', model='Proxy')
	
		#VC: set the parent of the node
		if initFlag&vizconnect.INIT_PARENTS:
			vizconnect.getTool(_name).setParent(vizconnect.getAvatar('main_avatar').getAttachmentPoint('r_hand'))

	#VC: set the name of the default
	vizconnect.setDefault('tool', 'proxy')

	#VC: return values can be modified here
	return None
def initWrappers():

	# get all of the raw items from vizconnect
	rawGroup = vizconnect.getRawGroupDict()
	rawInput = vizconnect.getRawInputDict()
	rawDisplay = vizconnect.getRawDisplayDict()
	rawTracker = vizconnect.getRawTrackerDict()
	rawTransport = vizconnect.getRawTransportDict()
	rawEvent = vizconnect.getRawEventDict()
	rawTool = vizconnect.getRawToolDict()
	rawAvatar = vizconnect.getRawAvatarDict()
	rawAnimator = vizconnect.getRawAnimatorDict()

	# below are listed the wrapped group objects

	# below are listed the wrapped display objects
	vizconnect.addDisplay(rawDisplay['zsight_60'], 'zsight_60', '', 'Sensics', 'zSight 60')

	# below are listed the wrapped tracker objects
	vizconnect.addTracker(rawTracker['ppt_Rhead'], 'ppt_Rhead', 'ppt', 'WorldViz', 'PPT')
	vizconnect.addTracker(rawTracker['optical_heading'], 'optical_heading', '', 'Virtual', 'Optical Heading')
	vizconnect.addTracker(rawTracker['ppt_hand'], 'ppt_hand', 'ppt', 'WorldViz', 'PPT')
	vizconnect.addTracker(rawTracker['osv3_sensor_bus'], 'osv3_sensor_bus', '', 'Inertial Labs', 'OSv3 (Sensor Bus)')
	vizconnect.addTracker(rawTracker['ppt_Lhead'], 'ppt_Lhead', 'ppt', 'WorldViz', 'PPT')

	# below are listed the wrapped input objects

	# below are listed the wrapped event objects

	# below are listed the wrapped transport objects

	# below are listed the wrapped tool objects

	# below are listed the wrapped avatar objects


	return True
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
    #VC: place any general initialization code here
    rawTool = vizconnect.getRawToolDict()

    #VC: initialize a new tool
    _name = 'grabber'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init which needs to happen before viz.go
        if initFlag & vizconnect.INIT_PREVIZGO:
            viz.setOption('viz.display.stencil', 1)

        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: initialization code needed by the parameters
            import tools
            from tools import grabber
            from tools import highlighter

            #VC: set some parameters
            usingPhysics = True
            highlightMode = tools.highlighter.MODE_OUTLINE
            placementMode = tools.placer.MODE_MID_AIR

            #VC: create the raw object
            rawTool[_name] = grabber.Grabber(
                usingPhysics=usingPhysics,
                usingSprings=usingPhysics,
                highlightMode=highlightMode,
                placementMode=placementMode,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3)

        #VC: init the mappings for the raw object
        if initFlag & vizconnect.INIT_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(tool):
                    if rawInput['flystick'].isButtonDown(
                            0
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 0
                        tool.grabAndHold()

                rawTool[_name].setUpdateFunction(update)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Grabber')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('head_and_hand').getAttachmentPoint(
                    'r_hand'))

    #VC: initialize a new tool
    _name = 'laser_pointer'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: set some parameters
            displayDistance = True

            #VC: create the raw object
            from tools import laser_pointer
            rawTool[_name] = laser_pointer.LaserPointer(
                displayDistance=displayDistance,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3)

        #VC: init the mappings for the raw object
        if initFlag & vizconnect.INIT_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(tool):
                    if rawInput['flystick'].isButtonDown(
                            5
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 5
                        tool.shoot()

                rawTool[_name].setUpdateFunction(update)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Laser Pointer')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('head_and_hand').getAttachmentPoint(
                    'r_hand'))

    #VC: set the name of the default
    vizconnect.setDefault('tool', 'grabber')

    #VC: return values can be modified here
    return None
Example #8
0
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
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
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
    #VC: place any general initialization code here
    rawTool = vizconnect.getRawToolDict()

    #VC: initialize a new tool
    _name = 'proxy'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: create the raw object
            from tools import proxy
            rawTool[_name] = proxy.Proxy()

        #VC: init the mappings for the raw object
        if initFlag & vizconnect.INIT_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(tool):
                    if rawInput['flystick'].isButtonDown(
                            0
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 0
                        tool.action1()
                    if rawInput['flystick'].isButtonDown(
                            1
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 1
                        tool.action2()
                    if rawInput['flystick'].isButtonDown(
                            2
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 2
                        tool.action3()
                    if rawInput['flystick'].isButtonDown(
                            3
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 3
                        tool.action4()
                    if rawInput['flystick'].isButtonDown(
                            4
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 4
                        tool.action5()
                    if rawInput['flystick'].isButtonDown(
                            5
                    ):  # make=ART, model=Flystick, name=flystick, signal=Button 5
                        tool.action()

                rawTool[_name].setUpdateFunction(update)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Proxy')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('head_and_hand').getAttachmentPoint(
                    'r_hand'))

    #VC: initialize a new tool
    _name = 'laser_pointer'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: initialization code needed by the parameters
            import tools.laser_pointer

            #VC: set some parameters
            displayDistance = True
            showEndNode = True
            distanceMetric = tools.laser_pointer.DISTANCE_METERS

            #VC: create the raw object
            endNode = None if showEndNode else viz.addGroup()
            rawTool[_name] = tools.laser_pointer.LaserPointer(
                displayDistance=displayDistance,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3,
                endNode=endNode,
                distanceMetric=distanceMetric)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Laser Pointer')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getAvatar('head_and_hand').getAttachmentPoint(
                    'l_hand'))

    #VC: set the name of the default
    vizconnect.setDefault('tool', 'proxy')

    #VC: return values can be modified here
    return None
Example #11
0
def initTools(initFlag=vizconnect.INIT_INDEPENDENT, initList=None):
    #VC: place any general initialization code here
    rawTool = vizconnect.getRawToolDict()

    #VC: initialize a new tool
    _name = 'grabber'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init which needs to happen before viz.go
        if initFlag & vizconnect.INIT_PREVIZGO:
            viz.setOption('viz.display.stencil', 1)

        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: initialization code needed by the parameters
            import tools
            from tools import grabber
            from tools import highlighter

            #VC: set some parameters
            usingPhysics = False
            highlightMode = tools.highlighter.MODE_OUTLINE
            placementMode = tools.placer.MODE_MID_AIR

            #VC: create the raw object
            rawTool[_name] = grabber.Grabber(
                usingPhysics=usingPhysics,
                usingSprings=usingPhysics,
                highlightMode=highlightMode,
                placementMode=placementMode,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3)

        #VC: init the mappings for the raw object
        if initFlag & vizconnect.INIT_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(tool):
                #if rawInput['joystick'].isInMode('super') and rawInput['joystick'].isButtonDown(4):# make=Generic, model=Joystick, name=joystick, signal=Button 4
                #tool.grab()
                #rawTool[_name].setUpdateFunction(update)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Grabber')

        #VC: set the parent of the node
        if initFlag & vizconnect.INIT_PARENTS:
            vizconnect.getTool(_name).setParent(
                vizconnect.getTracker('ppt_rhand'))

    #VC: initialize a new tool
    _name = 'grabber2'
    if vizconnect.isPendingInit('tool', _name, initFlag, initList):
        #VC: init which needs to happen before viz.go
        if initFlag & vizconnect.INIT_PREVIZGO:
            viz.setOption('viz.display.stencil', 1)

        #VC: init the raw object
        if initFlag & vizconnect.INIT_RAW:
            #VC: initialization code needed by the parameters
            import tools
            from tools import grabber
            from tools import highlighter

            #VC: set some parameters
            usingPhysics = True
            highlightMode = tools.highlighter.MODE_OUTLINE
            placementMode = tools.placer.MODE_MID_AIR

            #VC: create the raw object
            rawTool[_name] = grabber.Grabber(
                usingPhysics=usingPhysics,
                usingSprings=usingPhysics,
                highlightMode=highlightMode,
                placementMode=placementMode,
                updatePriority=vizconnect.PRIORITY_ANIMATOR + 3)

        #VC: init the wrapper (DO NOT EDIT)
        if initFlag & vizconnect.INIT_WRAPPERS:
            vizconnect.addTool(rawTool[_name],
                               _name,
                               make='Virtual',
                               model='Grabber')

    #VC: set the name of the default
    vizconnect.setDefault('tool', 'grabber')

    #VC: return values can be modified here
    return None