Пример #1
0
    def uiRadial_snap_build(self,parent,direction = None):
        """
        Radial menu for snap functionality
        """
        self.create_guiOptionVar('snapPivotMode', defaultValue = 0)

        _r = mUI.MelMenuItem(parent,subMenu = True,
                             en = self._b_sel,
                             l = 'Snap',
                             #c = lambda *a:buttonAction(tdToolsLib.doPointSnap()),
                             rp = direction)
        if not self._b_sel:
            return        
        #---------------------------------------------------------------------------
    
        mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'Point',
                        c = lambda *a:snap_action(self,'point'),
                        rp = 'NE')		            
        mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'Parent',
                        c = lambda *a:snap_action(self,'parent'),
                        rp = 'N')	
        mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'Orient',
                        c = lambda *a:snap_action(self,'orient'),
                        rp = 'E')	
        """mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'bbCenter',
                        ann = 'To the center of the bounding box',
                        c = lambda *a:snap_action(self,'boundingBox'),
                        rp = 'SE')	"""        
        mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'scalePivot',
                        c = lambda *a:snap_action(self,'scalePivot'),
                        rp = 'SE')	        
    
        mUI.MelMenuItem(_r,
                        en = self._b_sel_pair,
                        l = 'Surface',
                        c = lambda *a:self.button_action(tdToolsLib.doSnapClosestPointToSurface(False)),
                        rp = 'SW')
    
        mUI.MelMenuItem(_r,
                        en = self._b_sel,
                        l = 'RayCast',
                        #c = mUI.Callback(buttonAction,raySnap_start(_sel)),		            
                        c = lambda *a:self.button_action(raySnap_start(self._l_sel)),
                        rp = 'W')	
        
        #Settings....
        #======================================================================================
        _settings = mUI.MelMenuItem(_r,subMenu = True,
                                    en = True,
                                    l = 'Pivot Mode',
                                    rp = 'S')
        self._l_pivotModes = ['rotatePivot','scalePivot','boundingBox']
        _l_toBuild = [{'l':'rotatePivot',
                       'rp':'S',
                       'c':lambda *a:self.var_snapPivotMode.setValue(0)},
                      {'l':'scalePivot',
                       'rp':'SW',
                       'c':lambda *a:self.var_snapPivotMode.setValue(1)},
                      {'l':'boundingBox',
                       'rp':'SE',
                       'c':lambda *a:self.var_snapPivotMode.setValue(2)}]
        for i,m in enumerate(_l_toBuild):
            if i == self.var_snapPivotMode.value:
                m['l'] = m['l'] + '(Active)'
            mUI.MelMenuItem(_settings,
                            en = True,
                            l = m['l'],
                            #c=mUI.Callback(self.var_snapPivotMode.setValue,0),
                            c = m['c'],
                            rp = m['rp'])                
        
        """mUI.MelMenuItem(_settings,
                        en = True,
                        l = 'rotatePivot',
                        #c=mUI.Callback(self.var_snapPivotMode.setValue,0),
                        c = lambda *a:self.var_snapPivotMode.setValue(0),
                        rp = 'S')        
        mUI.MelMenuItem(_settings,
                        en = True,
                        l = 'scalePivot',
                        #c=mUI.Callback(self.var_snapPivotMode.setValue,1),                        
                        c = lambda *a:self.var_snapPivotMode.setValue(1),
                        rp = 'SW')          
        mUI.MelMenuItem(_settings,
                        en = True,
                        l = 'boundingBox',
                        c = lambda *a:self.var_snapPivotMode.setValue(2),
                        rp = 'SE')   """   
        """
Пример #2
0
    def createUI(self, parent):
        """
		Create the UI
		"""
        def buttonAction(command):
            """
			execute a command and let the menu know not do do the default button action but just kill the ui
			"""
            killUI()
            command
            mmActionOptionVar.set(1)

        self.LocinatorUpdateObjectsBufferOptionVar = OptionVarFactory(
            'cgmVar_LocinatorUpdateObjectsBuffer', defaultValue=[''])
        IsClickedOptionVar = OptionVarFactory('cgmVar_IsClicked', 'int')
        mmActionOptionVar = OptionVarFactory('cgmVar_mmAction', 'int')

        self.SnapModeOptionVar.update(
        )  #Check if another tool has changed this setting

        sel = search.selectCheck()
        selPair = search.checkSelectionLength(2)

        IsClickedOptionVar.set(1)

        mc.menu(parent, e=True, deleteAllItems=True)
        MelMenuItem(parent,
                    en=selPair,
                    l='Point Snap',
                    c=lambda *a: buttonAction(tdToolsLib.doPointSnap()),
                    rp='NW')
        MelMenuItem(parent,
                    en=selPair,
                    l='Parent Snap',
                    c=lambda *a: buttonAction(tdToolsLib.doParentSnap()),
                    rp='N')
        MelMenuItem(parent,
                    en=selPair,
                    l='Orient Snap',
                    c=lambda *a: buttonAction(tdToolsLib.doOrientSnap()),
                    rp='NE')

        MelMenuItem(parent,
                    en=selPair,
                    l='Surface Snap',
                    c=lambda *a: buttonAction(
                        tdToolsLib.doSnapClosestPointToSurface(False)),
                    rp='W')

        if self.LocinatorUpdateObjectsOptionVar.value:
            ShowMatch = False
            if self.LocinatorUpdateObjectsBufferOptionVar.value:
                ShowMatch = True
            MelMenuItem(parent,
                        en=ShowMatch,
                        l='Buffer Snap',
                        c=lambda *a: buttonAction(
                            locinatorLib.doUpdateLoc(self, True)),
                        rp='S')
        else:
            ShowMatch = search.matchObjectCheck()
            MelMenuItem(parent,
                        en=ShowMatch,
                        l='Match Snap',
                        c=lambda *a: buttonAction(
                            locinatorLib.doUpdateSelectedObjects(self)),
                        rp='S')

        MelMenuItem(
            parent,
            en=0,
            l='Mirror',
            c=lambda *a: buttonAction(locinatorLib.doUpdateObj(self, True)),
            rp='SW')

        MelMenuItemDiv(parent)
        MelMenuItem(parent,
                    l='Loc Me',
                    c=lambda *a: buttonAction(locinatorLib.doLocMe(self)))
        MelMenuItem(parent,
                    l='Tag Loc to Object',
                    en=selPair,
                    c=lambda *a: buttonAction(locinatorLib.doTagObjects(self)))
        # Update Mode
        UpdateMenu = MelMenuItem(parent, l='Update Mode', subMenu=True)
        UpdateMenuCollection = MelRadioMenuCollection()

        if self.LocinatorUpdateObjectsOptionVar.value == 0:
            slMode = True
            bufferMode = False
        else:
            slMode = False
            bufferMode = True

        UpdateMenuCollection.createButton(
            UpdateMenu,
            l='Selected',
            c=lambda *a: self.LocinatorUpdateObjectsOptionVar.set(0),
            rb=slMode)
        UpdateMenuCollection.createButton(
            UpdateMenu,
            l='Buffer',
            c=lambda *a: self.LocinatorUpdateObjectsOptionVar.set(1),
            rb=bufferMode)
        #>>>Match Mode
        self.MatchModeOptions = ['parent', 'point', 'orient']

        self.MatchModeCollection = MelRadioMenuCollection()
        self.MatchModeCollectionChoices = []

        MatchModeMenu = MelMenuItem(parent, l='Match Mode', subMenu=True)
        self.matchMode = self.SnapModeOptionVar.value
        for c, item in enumerate(self.MatchModeOptions):
            if self.matchMode == c:
                rbValue = True
            else:
                rbValue = False
            self.MatchModeCollectionChoices.append(
                self.MatchModeCollection.createButton(
                    MatchModeMenu,
                    label=item,
                    rb=rbValue,
                    command=Callback(self.SnapModeOptionVar.set, c)))
        #>>> Define
        DefineMenu = MelMenuItem(parent, l='Buffer', subMenu=True)
        MelMenuItem(DefineMenu,
                    l="Define",
                    c=lambda *a: locinatorLib.defineObjBuffer(
                        self.LocinatorUpdateObjectsBufferOptionVar))

        MelMenuItem(DefineMenu,
                    l="Add Selected",
                    c=lambda *a: locinatorLib.addSelectedToObjBuffer(
                        self.LocinatorUpdateObjectsBufferOptionVar))

        MelMenuItem(DefineMenu,
                    l="Remove Selected",
                    c=lambda *a: locinatorLib.removeSelectedFromObjBuffer(
                        self.LocinatorUpdateObjectsBufferOptionVar))

        MelMenuItemDiv(DefineMenu)
        MelMenuItem(DefineMenu,
                    l="Select Members",
                    c=lambda *a: locinatorLib.selectObjBufferMembers(
                        self.LocinatorUpdateObjectsBufferOptionVar))
        MelMenuItem(DefineMenu,
                    l="Clear",
                    c=lambda *a: locinatorLib.clearObjBuffer(
                        self.LocinatorUpdateObjectsBufferOptionVar))

        MelMenuItemDiv(parent)
        MelMenuItem(parent,
                    l='Locinator',
                    c=lambda *a: buttonAction(cgmToolbox.loadLocinator()))
        MelMenuItem(parent,
                    l='cgm.animTools',
                    c=lambda *a: buttonAction(cgmToolbox.loadAnimTools()))
        MelMenuItem(parent,
                    l='cgm.tdTools',
                    c=lambda *a: buttonAction(cgmToolbox.loadTDTools()))
        MelMenuItem(parent,
                    l='cgm.attrTools',
                    c=lambda *a: buttonAction(cgmToolbox.loadAttrTools()))

        MelMenuItemDiv(parent)
        MelMenuItem(parent,
                    l="Reset",
                    c=lambda *a: guiFactory.resetGuiInstanceOptionVars(
                        self.optionVars))
Пример #3
0
	def createUI(self,parent):
		"""
		Create the UI
		"""		
		def buttonAction(command):
			"""
			execute a command and let the menu know not do do the default button action but just kill the ui
			"""			
			killUI()
			command
			mmActionOptionVar.set(1)
		
		self.LocinatorUpdateObjectsBufferOptionVar = OptionVarFactory('cgmVar_LocinatorUpdateObjectsBuffer',defaultValue = [''])
		IsClickedOptionVar = OptionVarFactory('cgmVar_IsClicked', 'int')
		mmActionOptionVar = OptionVarFactory('cgmVar_mmAction', 'int')
		
		self.SnapModeOptionVar.update()#Check if another tool has changed this setting
		
		sel = search.selectCheck()
		selPair = search.checkSelectionLength(2)
		
		IsClickedOptionVar.set(1)
		
		mc.menu(parent,e = True, deleteAllItems = True)
		MelMenuItem(parent,
		            en = selPair,
		            l = 'Point Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doPointSnap()),
		            rp = 'NW')		            
		MelMenuItem(parent,
		            en = selPair,
		            l = 'Parent Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doParentSnap()),
		            rp = 'N')	
		MelMenuItem(parent,
		            en = selPair,
		            l = 'Orient Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doOrientSnap()),
		            rp = 'NE')	
		
		MelMenuItem(parent,
		            en = selPair,
		            l = 'Surface Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doSnapClosestPointToSurface(False)),
		            rp = 'W')
		
		if self.LocinatorUpdateObjectsOptionVar.value:
			ShowMatch = False
			if self.LocinatorUpdateObjectsBufferOptionVar.value:
				ShowMatch = True
			MelMenuItem(parent,
				        en = ShowMatch,
				        l = 'Buffer Snap',
				        c = lambda *a:buttonAction(locinatorLib.doUpdateLoc(self,True)),
				        rp = 'S')					
		else:
			ShowMatch = search.matchObjectCheck()			
			MelMenuItem(parent,
				        en = ShowMatch,
				        l = 'Match Snap',
				        c = lambda *a:buttonAction(locinatorLib.doUpdateSelectedObjects(self)),
				        rp = 'S')	
			
		
		MelMenuItem(parent,
		            en = 0,
		            l = 'Mirror',
		            c = lambda *a:buttonAction(locinatorLib.doUpdateObj(self,True)),
		            rp = 'SW')			
		
		MelMenuItemDiv(parent)
		MelMenuItem(parent,l = 'Loc Me',
	                c = lambda *a: buttonAction(locinatorLib.doLocMe(self)))
		MelMenuItem(parent, l = 'Tag Loc to Object',en = selPair,
	                c = lambda *a: buttonAction(locinatorLib.doTagObjects(self)))
		# Update Mode
		UpdateMenu = MelMenuItem(parent, l='Update Mode', subMenu=True)
		UpdateMenuCollection = MelRadioMenuCollection()

		if self.LocinatorUpdateObjectsOptionVar.value == 0:
			slMode = True
			bufferMode = False
		else:
			slMode = False
			bufferMode = True

		UpdateMenuCollection.createButton(UpdateMenu,l='Selected',
				                             c=lambda *a: self.LocinatorUpdateObjectsOptionVar.set(0),
				                             rb=slMode )
		UpdateMenuCollection.createButton(UpdateMenu,l='Buffer',
				                             c=lambda *a:self.LocinatorUpdateObjectsOptionVar.set(1),
				                             rb=bufferMode )
		#>>>Match Mode
		self.MatchModeOptions = ['parent','point','orient']
		
		self.MatchModeCollection = MelRadioMenuCollection()
		self.MatchModeCollectionChoices = []
					
		MatchModeMenu = MelMenuItem( parent, l='Match Mode', subMenu=True)
		self.matchMode = self.SnapModeOptionVar.value
		for c,item in enumerate(self.MatchModeOptions):
			if self.matchMode == c:
				rbValue = True
			else:
				rbValue = False
			self.MatchModeCollectionChoices.append(self.MatchModeCollection.createButton(MatchModeMenu,label=item,
			                                                                             rb = rbValue,
			                                                                             command = Callback(self.SnapModeOptionVar.set,c)))
		#>>> Define
		DefineMenu = MelMenuItem( parent, l='Buffer', subMenu=True)
		MelMenuItem( DefineMenu, l="Define",
		             c= lambda *a: locinatorLib.defineObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		MelMenuItem( DefineMenu, l="Add Selected",
		             c= lambda *a: locinatorLib.addSelectedToObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		MelMenuItem( DefineMenu, l="Remove Selected",
		             c= lambda *a: locinatorLib.removeSelectedFromObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		MelMenuItemDiv( DefineMenu )
		MelMenuItem( DefineMenu, l="Select Members",
				     c= lambda *a: locinatorLib.selectObjBufferMembers(self.LocinatorUpdateObjectsBufferOptionVar))
		MelMenuItem( DefineMenu, l="Clear",
		             c= lambda *a: locinatorLib.clearObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
				
		
		
		
		
		MelMenuItemDiv(parent)		
		MelMenuItem(parent, l = 'Locinator',
	                c = lambda *a: buttonAction(cgmToolbox.loadLocinator()))
		MelMenuItem(parent, l = 'cgm.animTools',
	                c = lambda *a: buttonAction(cgmToolbox.loadAnimTools()))
		MelMenuItem(parent, l = 'cgm.tdTools',
	                c = lambda *a: buttonAction(cgmToolbox.loadTDTools()))
		MelMenuItem(parent, l = 'cgm.attrTools',
	                c = lambda *a: buttonAction(cgmToolbox.loadAttrTools()))
		

		MelMenuItemDiv(parent)	
		MelMenuItem(parent, l="Reset",
	                 c=lambda *a: guiFactory.resetGuiInstanceOptionVars(self.optionVars))
Пример #4
0
	def createUI(self,parent):
		"""
		Create the UI
		"""		
		def buttonAction(command):
			"""
			execute a command and let the menu know not do do the default button action but just kill the ui
			"""			
			killUI()
			mmActionOptionVar.value = 1			
			command
			
		
		self.LocinatorUpdateObjectsBufferOptionVar = cgmMeta.cgmOptionVar('cgmVar_LocinatorUpdateObjectsBuffer',defaultValue = [''])
		IsClickedOptionVar = cgmMeta.cgmOptionVar('cgmVar_IsClicked', 'int')
		mmActionOptionVar = cgmMeta.cgmOptionVar('cgmVar_mmAction', 'int')
		
		self.SnapModeOptionVar.update()#Check if another tool has changed this setting
		
		_sel = mc.ls(sl=True)
		selPair = search.checkSelectionLength(2)
		_selecCheck = len(_sel)
		IsClickedOptionVar.value = 1
		
		mc.menu(parent,e = True, deleteAllItems = True)
		mUI.MelMenuItem(parent,
		            en = selPair,
		            l = 'Point Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doPointSnap()),
		            rp = 'NW')		            
		mUI.MelMenuItem(parent,
		            en = selPair,
		            l = 'Parent Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doParentSnap()),
		            rp = 'N')	
		mUI.MelMenuItem(parent,
		            en = selPair,
		            l = 'Orient Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doOrientSnap()),
		            rp = 'NE')	
		
		mUI.MelMenuItem(parent,
		            en = selPair,
		            l = 'Surface Snap',
		            c = lambda *a:buttonAction(tdToolsLib.doSnapClosestPointToSurface(False)),
		            rp = 'W')
		
		if self.LocinatorUpdateObjectsOptionVar.value:
			ShowMatch = False
			if self.LocinatorUpdateObjectsBufferOptionVar.value:
				ShowMatch = True
			mUI.MelMenuItem(parent,
				        en = ShowMatch,
				        l = 'Buffer Snap',
				        c = lambda *a:buttonAction(locinatorLib.doUpdateLoc(self,True)),
				        rp = 'S')					
		else:
			ShowMatch = search.matchObjectCheck()			
			mUI.MelMenuItem(parent,
				        en = ShowMatch,
				        l = 'Match Snap',
				        c = lambda *a:buttonAction(locinatorLib.doUpdateSelectedObjects(self)),
				        rp = 'S')	
			
		mUI.MelMenuItem(parent,
	                en = _selecCheck,
	                l = 'RayCast',
	                #c = mUI.Callback(buttonAction,raySnap_start(_sel)),		            
	                c = lambda *a:buttonAction(raySnap_start(_sel)),
	                rp = 'SW')				
		mUI.MelMenuItem(parent,
		            en = 0,
		            l = 'Mirror',
		            c = lambda *a:buttonAction(locinatorLib.doUpdateObj(self,True)),
		            rp = 'SE')			
		
		mUI.MelMenuItemDiv(parent)
		mUI.MelMenuItem(parent,l = 'Loc Me',
	                c = lambda *a: buttonAction(locinatorLib.doLocMe(self)))
		mUI.MelMenuItem(parent, l = 'Tag Loc to Object',en = selPair,
	                c = lambda *a: buttonAction(locinatorLib.doTagObjects(self)))
		# Update Mode
		UpdateMenu = mUI.MelMenuItem(parent, l='Update Mode', subMenu=True)
		UpdateMenuCollection = mUI.MelRadioMenuCollection()

		if self.LocinatorUpdateObjectsOptionVar.value == 0:
			slMode = True
			bufferMode = False
		else:
			slMode = False
			bufferMode = True

		UpdateMenuCollection.createButton(UpdateMenu,l='Selected',
				                             c=lambda *a: self.LocinatorUpdateObjectsOptionVar.setValue(0),
				                             rb=slMode )
		UpdateMenuCollection.createButton(UpdateMenu,l='Buffer',
				                             c=lambda *a:self.LocinatorUpdateObjectsOptionVar.setValue(1),
				                             rb=bufferMode )
		#>>>Match Mode
		self.MatchModeOptions = ['parent','point','orient']
		
		self.MatchModeCollection = mUI.MelRadioMenuCollection()
		self.MatchModeCollectionChoices = []
					
		MatchModeMenu = mUI.MelMenuItem( parent, l='Match Mode', subMenu=True)
		self.matchMode = self.SnapModeOptionVar.value
		for c,item in enumerate(self.MatchModeOptions):
			if self.matchMode == c:
				rbValue = True
			else:
				rbValue = False
			self.MatchModeCollectionChoices.append(self.MatchModeCollection.createButton(MatchModeMenu,label=item,
			                                                                             rb = rbValue,
			                                                                             command = mUI.Callback(self.SnapModeOptionVar.setValue,c)))
		#>>> Define
		DefineMenu = mUI.MelMenuItem( parent, l='Buffer', subMenu=True)
		mUI.MelMenuItem( DefineMenu, l="Define",
		             c= lambda *a: locinatorLib.defineObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		mUI.MelMenuItem( DefineMenu, l="Add Selected",
		             c= lambda *a: locinatorLib.addSelectedToObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		mUI.MelMenuItem( DefineMenu, l="Remove Selected",
		             c= lambda *a: locinatorLib.removeSelectedFromObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
		
		mUI.MelMenuItemDiv( DefineMenu )
		mUI.MelMenuItem( DefineMenu, l="Select Members",
				     c= lambda *a: locinatorLib.selectObjBufferMembers(self.LocinatorUpdateObjectsBufferOptionVar))
		mUI.MelMenuItem( DefineMenu, l="Clear",
		             c= lambda *a: locinatorLib.clearObjBuffer(self.LocinatorUpdateObjectsBufferOptionVar))
				
		try:#>>> Sym Axis....
			_str_section = 'Ray Cast menu'
		
			uiMenu_rayCast = mUI.MelMenuItem( parent, l='Ray Cast Mode', subMenu=True)
			var_RayCastMode = cgmMeta.cgmOptionVar('cgmVar_SnapMenuRayCastMode', defaultValue=0)
			
			self.uiRC_RayCast = mUI.MelRadioMenuCollection()
			self.uiOptions_RayCast = []		
			_v = var_RayCastMode.value
			_modes = cgmDrag._clickMesh_modes
			for i,item in enumerate(_modes):
				if i == _v:
					_rb = True
				else:_rb = False
				self.uiOptions_RayCast.append(self.uiRC_RayCast.createButton(uiMenu_rayCast,label=item,
				                                                             c = mUI.Callback(var_RayCastMode.setValue,i),
				                                                             rb = _rb))   
		except Exception,err:
			log.error("{0} failed to load. err: {1}".format(_str_section,err))		
Пример #5
0
    def createUI(self, parent):
        """
		Create the UI
		"""
        def buttonAction(command):
            """
			execute a command and let the menu know not do do the default button action but just kill the ui
			"""
            killUI()
            mmActionOptionVar.value = 1
            command

        self.LocinatorUpdateObjectsBufferOptionVar = cgmMeta.cgmOptionVar(
            'cgmVar_LocinatorUpdateObjectsBuffer', defaultValue=[''])
        IsClickedOptionVar = cgmMeta.cgmOptionVar('cgmVar_IsClicked', 'int')
        mmActionOptionVar = cgmMeta.cgmOptionVar('cgmVar_mmAction', 'int')

        self.SnapModeOptionVar.update(
        )  #Check if another tool has changed this setting

        _sel = mc.ls(sl=True)
        selPair = search.checkSelectionLength(2)
        _selecCheck = len(_sel)
        IsClickedOptionVar.value = 1

        mc.menu(parent, e=True, deleteAllItems=True)
        mUI.MelMenuItem(parent,
                        en=selPair,
                        l='Point Snap',
                        c=lambda *a: buttonAction(tdToolsLib.doPointSnap()),
                        rp='NW')
        mUI.MelMenuItem(parent,
                        en=selPair,
                        l='Parent Snap',
                        c=lambda *a: buttonAction(tdToolsLib.doParentSnap()),
                        rp='N')
        mUI.MelMenuItem(parent,
                        en=selPair,
                        l='Orient Snap',
                        c=lambda *a: buttonAction(tdToolsLib.doOrientSnap()),
                        rp='NE')

        mUI.MelMenuItem(parent,
                        en=selPair,
                        l='Surface Snap',
                        c=lambda *a: buttonAction(
                            tdToolsLib.doSnapClosestPointToSurface(False)),
                        rp='W')

        if self.LocinatorUpdateObjectsOptionVar.value:
            ShowMatch = False
            if self.LocinatorUpdateObjectsBufferOptionVar.value:
                ShowMatch = True
            mUI.MelMenuItem(parent,
                            en=ShowMatch,
                            l='Buffer Snap',
                            c=lambda *a: buttonAction(
                                locinatorLib.doUpdateLoc(self, True)),
                            rp='S')
        else:
            ShowMatch = search.matchObjectCheck()
            mUI.MelMenuItem(parent,
                            en=ShowMatch,
                            l='Match Snap',
                            c=lambda *a: buttonAction(
                                locinatorLib.doUpdateSelectedObjects(self)),
                            rp='S')

        mUI.MelMenuItem(
            parent,
            en=_selecCheck,
            l='RayCast',
            #c = mUI.Callback(buttonAction,raySnap_start(_sel)),
            c=lambda *a: buttonAction(raySnap_start(_sel)),
            rp='SW')
        mUI.MelMenuItem(
            parent,
            en=0,
            l='Mirror',
            c=lambda *a: buttonAction(locinatorLib.doUpdateObj(self, True)),
            rp='SE')

        mUI.MelMenuItemDiv(parent)
        mUI.MelMenuItem(parent,
                        l='Loc Me',
                        c=lambda *a: buttonAction(locinatorLib.doLocMe(self)))
        mUI.MelMenuItem(
            parent,
            l='Tag Loc to Object',
            en=selPair,
            c=lambda *a: buttonAction(locinatorLib.doTagObjects(self)))
        # Update Mode
        UpdateMenu = mUI.MelMenuItem(parent, l='Update Mode', subMenu=True)
        UpdateMenuCollection = mUI.MelRadioMenuCollection()

        if self.LocinatorUpdateObjectsOptionVar.value == 0:
            slMode = True
            bufferMode = False
        else:
            slMode = False
            bufferMode = True

        UpdateMenuCollection.createButton(
            UpdateMenu,
            l='Selected',
            c=lambda *a: self.LocinatorUpdateObjectsOptionVar.setValue(0),
            rb=slMode)
        UpdateMenuCollection.createButton(
            UpdateMenu,
            l='Buffer',
            c=lambda *a: self.LocinatorUpdateObjectsOptionVar.setValue(1),
            rb=bufferMode)
        #>>>Match Mode
        self.MatchModeOptions = ['parent', 'point', 'orient']

        self.MatchModeCollection = mUI.MelRadioMenuCollection()
        self.MatchModeCollectionChoices = []

        MatchModeMenu = mUI.MelMenuItem(parent, l='Match Mode', subMenu=True)
        self.matchMode = self.SnapModeOptionVar.value
        for c, item in enumerate(self.MatchModeOptions):
            if self.matchMode == c:
                rbValue = True
            else:
                rbValue = False
            self.MatchModeCollectionChoices.append(
                self.MatchModeCollection.createButton(
                    MatchModeMenu,
                    label=item,
                    rb=rbValue,
                    command=mUI.Callback(self.SnapModeOptionVar.setValue, c)))
        #>>> Define
        DefineMenu = mUI.MelMenuItem(parent, l='Buffer', subMenu=True)
        mUI.MelMenuItem(DefineMenu,
                        l="Define",
                        c=lambda *a: locinatorLib.defineObjBuffer(
                            self.LocinatorUpdateObjectsBufferOptionVar))

        mUI.MelMenuItem(DefineMenu,
                        l="Add Selected",
                        c=lambda *a: locinatorLib.addSelectedToObjBuffer(
                            self.LocinatorUpdateObjectsBufferOptionVar))

        mUI.MelMenuItem(DefineMenu,
                        l="Remove Selected",
                        c=lambda *a: locinatorLib.removeSelectedFromObjBuffer(
                            self.LocinatorUpdateObjectsBufferOptionVar))

        mUI.MelMenuItemDiv(DefineMenu)
        mUI.MelMenuItem(DefineMenu,
                        l="Select Members",
                        c=lambda *a: locinatorLib.selectObjBufferMembers(
                            self.LocinatorUpdateObjectsBufferOptionVar))
        mUI.MelMenuItem(DefineMenu,
                        l="Clear",
                        c=lambda *a: locinatorLib.clearObjBuffer(
                            self.LocinatorUpdateObjectsBufferOptionVar))

        try:  #>>> Sym Axis....
            _str_section = 'Ray Cast menu'

            uiMenu_rayCast = mUI.MelMenuItem(parent,
                                             l='Ray Cast Mode',
                                             subMenu=True)
            var_RayCastMode = cgmMeta.cgmOptionVar(
                'cgmVar_SnapMenuRayCastMode', defaultValue=0)

            self.uiRC_RayCast = mUI.MelRadioMenuCollection()
            self.uiOptions_RayCast = []
            _v = var_RayCastMode.value
            _modes = cgmDrag._clickMesh_modes
            for i, item in enumerate(_modes):
                if i == _v:
                    _rb = True
                else:
                    _rb = False
                self.uiOptions_RayCast.append(
                    self.uiRC_RayCast.createButton(
                        uiMenu_rayCast,
                        label=item,
                        c=mUI.Callback(var_RayCastMode.setValue, i),
                        rb=_rb))
        except Exception, err:
            log.error("{0} failed to load. err: {1}".format(_str_section, err))