Exemplo n.º 1
0
def findMeshMidPointFromObject(mesh,obj,axisToCheck = ['x','z'],
                               vector = False, maxDistance = 1000, maxIterations = 10,**kws):
    try:#findMeshMidPointFromObject
        _str_funcName = 'findMeshMidPointFromObject'
        log.debug(">>> %s >> "%_str_funcName + "="*75)             
        if len(mc.ls(mesh))>1:
            raise StandardError,"findMeshMidPointFromObject>>> More than one mesh named: %s"%mesh      
        if type(axisToCheck) not in [list,tuple]:axisToCheck=[axisToCheck]
        axis = ['x','y','z']
        for a in axisToCheck:
            if a not in axis:
                raise StandardError,"findMeshMidPointFromObject>>> Not a valid axis : %s not in ['x','y','z']"%axisToCheck
        l_lastPos = []
        loc = locators.locMeObjectStandAlone(obj)
        for i in range(maxIterations):
            l_positions = []
            for a in axisToCheck:
                log.debug("firing: %s"%a)
                d_posReturn = findMeshIntersectionFromObjectAxis(mesh, loc, axis = '%s+'%a,vector=vector,maxDistance = maxDistance)
                d_negReturn = findMeshIntersectionFromObjectAxis(mesh, loc, axis = '%s-'%a,vector=vector,maxDistance = maxDistance)

                if 'hit' in d_posReturn.keys() and d_negReturn.keys():
                    l_pos = [d_posReturn.get('hit'),d_negReturn.get('hit')]
                    pos = distance.returnAveragePointPosition(l_pos)          
                    l_positions.append(pos)
		else:
		    raise RuntimeError,"No hit deteted. Object isn't in the mesh"
            if len(l_positions) == 1:
                l_pos =  l_positions[0]
            else:
                l_pos =  distance.returnAveragePointPosition(l_positions)
            if l_lastPos:dif = cgmMath.mag( cgmMath.list_subtract(l_pos,l_lastPos) )
            else:dif = 'No last'
            log.debug("findMeshMidPointFromObject>>> Step : %s | dif: %s | last: %s | pos: %s "%(i,dif,l_lastPos,l_pos)) 					
            if l_lastPos and cgmMath.isVectorEquivalent(l_lastPos,l_pos,2):
                log.debug("findMeshMidPointFromObject>>> Match found step: %s"%(i))
                mc.delete(loc)
                return l_pos
            mc.move(l_pos[0],l_pos[1],l_pos[2],loc,ws=True)
            l_lastPos = l_pos#If we get to here, add the current
        mc.delete(loc)    
        return l_pos
    except StandardError,error:
        for kw in [mesh,obj,axisToCheck,vector,maxDistance,maxIterations]:
            log.debug("%s"%kw)  
	try:mc.delete(loc)
	except:pass
        raise StandardError, "%s >> error: %s"%(_str_funcName,error)
Exemplo n.º 2
0
def locMeCenter(objList,forceBBCenter = False):
	"""
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Pass  an object into it and get a named locator with stored info for updating it

	ARGUMENTS:
	obj(string)

	RETURNS:
	name(string)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
	# make it
	nameBuffer = mc.spaceLocator()

	#store info
	attributes.storeInfo(nameBuffer[0],'cgmSource',(','.join(objList)),False)
	attributes.storeInfo(nameBuffer[0],'cgmLocMode','selectCenter',False)
	attributes.storeInfo(nameBuffer[0],'cgmName',(str('_to_'.join(objList))),False)
	attributes.storeInfo(nameBuffer[0],'cgmTypeModifier','midPoint',False)

	posList = []

	for obj in objList:
		if mc.objExists(obj) == True:
			objInfo = returnInfoForLoc(obj,forceBBCenter)
			posList.append(objInfo['position'])

	objTrans = distance.returnAveragePointPosition(posList)

	mc.move (objTrans[0],objTrans[1],objTrans[2], nameBuffer[0])

	#return ( NameFactory.doNameObject(nameBuffer[0]) )
	return cgmMeta.NameFactory(nameBuffer[0]).doNameObject()
 def findSurfaceMidPointFromObject(self):
     '''
     findSurfaceMidPointFromObject
     '''
     try:
         self._str_funcName = 'findSurfaceMidPointFromObject'
         log.debug(">>> %s >> "%self._str_funcName + "="*75)
         if len(mc.ls(surface))>1:
             raise StandardError,"findSurfaceMidPointFromObject>>> More than one surface named: %s"%surface
         if type(axisToCheck) not in [list,tuple]:axisToCheck=[axisToCheck]
         axis = ['x','y','z']
         for a in axisToCheck :
             if a not in axis:
                 raise StandardError,"findSurfaceMidPointFromObject>>> Not a valid axis : %s not in ['x','y','z']"%axisToCheck
         self.l_lastPos = []
         self.loc = locators.locMeObjectStandAlone(obj)
         for i in range(maxIterations):
             self.l_positions = []
             for a in axisToCheck:
                 log.debug("firing: %s"%a)
                 self.d_posReturn = findSurfaceIntersectionFromObjectAxis(surface, self.loc, axis = '%s+'%a,vector=vector,maxDistance = maxDistance) 
                 self.d_negReturn = findSurfaceIntersectionFromObjectAxis(surface, self.loc, axis = '%s-'%a,vector=vector,maxDistance = maxDistance) 
                 if 'hit' in self.d_posReturn.keys() and self.d_negReturn.keys():
                     self.l_pos = [self.d_posReturn.get('hit'),self.d_negReturn.get('hit')]
                     self.pos = distance.returnAveragePointPosition(self.l_pos)
                     self.l_positions.append(self.pos)
             if len(self.l_positions) == 1:
                 self.l_pos =  self.l_positions[0]
             else:
                 self.l_pos =  distance.returnAveragePointPosition(self.l_positions)
             if self.l_lastPos:self.dif = cgmMath.mag( cgmMath.list_subtract(self.l_pos,self.l_lastPos) )
             else:self.dif = 'No last'
             log.debug("findSurfaceMidPointFromObject>>> Step : %s | dif: %s | last: %s | pos: %s "%(i,self.dif,self.l_lastPos,self.l_pos))
             if self.l_lastPos and cgmMath.isVectorEquivalent(self.l_lastPos,self.l_pos,2):
                 log.debug("findSurfaceMidPointFromObject>>> Match found step: %s"%(i))
                 mc.delete(self.loc)
                 return self.l_pos 
             mc.move(self.l_pos[0],self.l_pos[1],self.l_pos[2],self.loc,ws=True)
             self.l_lastPos = self.l_pos#If we get to here, add the current    
         mc.delete(self.loc)    
         return self.l_pos
     except StandardError,error:
         raise StandardError, "error"
Exemplo n.º 4
0
def locMeEdgeLoop(polyEdge):
	"""
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Creates a locator from an edgeloop

	ARGUMENTS:
	polyEdge(string)

	RETURNS:
	locatorName(string)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
	# Get the loop
	if ':' in polyEdge:
		edges = mc.ls(polyEdge,flatten=True)
	elif ',' in polyEdge:
		edges = polyEdge
	else:
		edges = search.returnEdgeLoopFromEdge(polyEdge)

	mc.select(cl=True)
	mc.select(edges)

	mel.eval("PolySelectConvert 3")
	edgeVerts = mc.ls(sl=True,fl=True)
	postList = []
	for vert in edgeVerts:
		posList.append(mc.pointPosition(vert,w=True))
	objTrans = distance.returnAveragePointPosition(posList)
	mc.select(cl=True)

	# Make the loc
	locatorName = createLocFromObject(polyEdge)
	mc.move (objTrans[0],objTrans[1],objTrans[2], locatorName)

	# aim it
	posList = []
	for vtx in edgeVerts:
		posList.append( mc.pointPosition(vtx,w=True) )

	polyBuffer = geo.createPolyFromPosList(posList)

	constBuffer = mc.normalConstraint(polyBuffer,locatorName)
	mc.delete(constBuffer[0])
	mc.delete(polyBuffer)

	return locatorName
Exemplo n.º 5
0
def locMeEdgeLoop(polyEdge):
    """
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Creates a locator from an edgeloop

	ARGUMENTS:
	polyEdge(string)

	RETURNS:
	locatorName(string)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
    # Get the loop
    if ':' in polyEdge:
        edges = mc.ls(polyEdge, flatten=True)
    elif ',' in polyEdge:
        edges = polyEdge
    else:
        edges = search.returnEdgeLoopFromEdge(polyEdge)

    mc.select(cl=True)
    mc.select(edges)

    mel.eval("PolySelectConvert 3")
    edgeVerts = mc.ls(sl=True, fl=True)
    postList = []
    for vert in edgeVerts:
        posList.append(mc.pointPosition(vert, w=True))
    objTrans = distance.returnAveragePointPosition(posList)
    mc.select(cl=True)

    # Make the loc
    locatorName = createLocFromObject(polyEdge)
    mc.move(objTrans[0], objTrans[1], objTrans[2], locatorName)

    # aim it
    posList = []
    for vtx in edgeVerts:
        posList.append(mc.pointPosition(vtx, w=True))

    polyBuffer = geo.createPolyFromPosList(posList)

    constBuffer = mc.normalConstraint(polyBuffer, locatorName)
    mc.delete(constBuffer[0])
    mc.delete(polyBuffer)

    return locatorName
Exemplo n.º 6
0
def locMeCenter(objList, forceBBCenter=False):
    """
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Pass  an object into it and get a named locator with stored info for updating it

	ARGUMENTS:
	obj(string)

	RETURNS:
	name(string)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
    # make it
    nameBuffer = mc.spaceLocator()

    #store info
    attributes.storeInfo(nameBuffer[0], 'cgmSource', (','.join(objList)),
                         False)
    attributes.storeInfo(nameBuffer[0], 'cgmLocMode', 'selectCenter', False)
    attributes.storeInfo(nameBuffer[0], 'cgmName', (str('_to_'.join(objList))),
                         False)
    attributes.storeInfo(nameBuffer[0], 'cgmTypeModifier', 'midPoint', False)

    posList = []

    for obj in objList:
        if mc.objExists(obj) == True:
            objInfo = returnInfoForLoc(obj, forceBBCenter)
            posList.append(objInfo['position'])

    objTrans = distance.returnAveragePointPosition(posList)

    mc.move(objTrans[0], objTrans[1], objTrans[2], nameBuffer[0])

    #return ( NameFactory.doNameObject(nameBuffer[0]) )
    return mc.rename(nameBuffer[0],
                     "{0}_midPoint_loc".format(str('_to_'.join(objList))))
    def updatePos(self, debugReport=False):
        """
        Get updated position data via shooting rays
        """
        if not self.meshList:
            return guiFactory.warning(
                "No mesh objects have been added to '%s'" % (self.name))

        buffer = screenToWorld(int(self.x),
                               int(self.y))  #get world point and vector!

        self.clickPos = buffer[0]  #Our world space click point
        self.clickVector = buffer[1]  #Camera vector
        self.posBuffer = []  #Clear our pos buffer

        for m in self.meshList:  #Get positions per mesh piece
            #First get the distance to try to check
            checkDistance = self.getDistanceToCheck(m)
            #print ("Checking distance of %s"%checkDistance)
            if m not in self.meshPosDict.keys():
                self.meshPosDict[m] = []
                self.meshUVDict[m] = []

            if mc.objExists(m):
                if self.mode == 'surface':
                    buffer = findMeshIntersection(m, self.clickPos,
                                                  self.clickVector,
                                                  checkDistance)
                    if buffer is not None:
                        hit = self.convertPosToLocalSpace(buffer['hit'])
                        self.posBuffer.append(hit)
                        self.startPoint = self.convertPosToLocalSpace(
                            buffer['source'])
                        self.meshPosDict[m].append(hit)
                        self.meshUVDict[m].append(buffer['uv'])
                else:
                    buffer = findMeshIntersections(m, self.clickPos,
                                                   self.clickVector,
                                                   checkDistance)
                    if buffer:
                        conversionBuffer = []
                        #Need to convert to local space
                        for hit in buffer['hits']:
                            conversionBuffer.append(
                                self.convertPosToLocalSpace(hit))

                        self.posBuffer.extend(conversionBuffer)
                        self.startPoint = self.convertPosToLocalSpace(
                            buffer['source'])

                        self.meshPosDict[m].extend(conversionBuffer)
                        self.meshUVDict[m].extend(buffer['uvs'])

        if not self.posBuffer:
            if debugReport: guiFactory.warning('No hits detected!')
            return

        if self.clampSetting and self.clampSetting < len(self.posBuffer):
            if debugReport:
                guiFactory.warning(
                    "Position buffer was clamped. Check settings if this was not desired."
                )
            self.posBuffer = distance.returnPositionDataDistanceSortedList(
                self.startPoint, self.posBuffer)
            self.posBuffer = self.posBuffer[:self.clampSetting]

        if self.mode == 'midPoint':
            self.posBuffer = [
                distance.returnAveragePointPosition(self.posBuffer)
            ]

        if self.posBuffer:  #Check for closest and just for hits
            if self.closestOnly and self.mode != 'intersections':
                buffer = distance.returnClosestPoint(self.startPoint,
                                                     self.posBuffer)
                self.posBuffer = [buffer]
        else:
            pass
        #guiFactory.warning("No hits detected")

        if self.createMode and self.posBuffer:  # Make our stuff
            #Delete the old stuff
            if self.createModeBuffer and not self.dragStoreMode:
                for o in self.createModeBuffer:
                    try:
                        mc.delete(o)
                    except:
                        pass
                self.createModeBuffer = []

            for pos in self.posBuffer:
                if len(pos) == 3:
                    baseScale = distance.returnMayaSpaceFromWorldSpace(10)
                    if self.createMode == 'joint':
                        nameBuffer = mc.joint(radius=1)
                        #attributes.doSetAttr(nameBuffer,'radius',1)

                        mc.select(cl=True)
                    else:
                        nameBuffer = mc.spaceLocator()[0]
                        for m in self.meshPosDict.keys(
                        ):  #check each mesh dictionary to see where it came from
                            if pos in self.meshPosDict[
                                    m]:  #if the mesh has a match
                                attributes.storeInfo(nameBuffer,
                                                     'cgmHitTarget', m)

                                attributes.doSetAttr(nameBuffer, 'localScaleX',
                                                     (self.meshArea * .025))
                                attributes.doSetAttr(nameBuffer, 'localScaleY',
                                                     (self.meshArea * .025))
                                attributes.doSetAttr(nameBuffer, 'localScaleZ',
                                                     (self.meshArea * .025))
                                break

                    mc.move(pos[0], pos[1], pos[2], nameBuffer)

                    self.createModeBuffer.append(nameBuffer)
                else:
                    if debugReport:
                        guiFactory.warning("'%s' isn't a valid position" % pos)

        if self.dragStoreMode:
            if self.posBuffer:
                for p in self.posBuffer:
                    self.returnList.append(p)

        mc.refresh()  #Update maya to make it interactive!
Exemplo n.º 8
0
    def updatePos(self,debugReport = False):
        """
        Get updated position data via shooting rays
        """
        if not self.meshList:
            return guiFactory.warning("No mesh objects have been added to '%s'"%(self.name))
        
        buffer =  screenToWorld(int(self.x),int(self.y))#get world point and vector!
                
        self.clickPos = buffer[0] #Our world space click point
        self.clickVector = buffer[1] #Camera vector
        self.posBuffer = []#Clear our pos buffer
        
        for m in self.meshList:#Get positions per mesh piece
            #First get the distance to try to check
            checkDistance = self.getDistanceToCheck(m)
            #print ("Checking distance of %s"%checkDistance)
            if m not in self.meshPosDict.keys():
                self.meshPosDict[m] = []
                self.meshUVDict[m] = []
                
            if mc.objExists(m):
                if self.mode == 'surface':
                    buffer = findMeshIntersection(m, self.clickPos , self.clickVector, checkDistance)                
                    if buffer is not None:
                        hit = self.convertPosToLocalSpace( buffer['hit'] )
                        self.posBuffer.append(hit)  
                        self.startPoint = self.convertPosToLocalSpace( buffer['source'] )
                        self.meshPosDict[m].append(hit)
                        self.meshUVDict[m].append(buffer['uv'])
                else:
                    buffer = findMeshIntersections(m, self.clickPos , self.clickVector , checkDistance)                                    
                    if buffer:
                        conversionBuffer = []
                        #Need to convert to local space
                        for hit in buffer['hits']:
                            conversionBuffer.append(self.convertPosToLocalSpace( hit ))
                             
                        self.posBuffer.extend(conversionBuffer)
                        self.startPoint = self.convertPosToLocalSpace( buffer['source'] )
                        
                        self.meshPosDict[m].extend(conversionBuffer)
                        self.meshUVDict[m].extend(buffer['uvs'])
                        
                        
        if not self.posBuffer:
            if debugReport:guiFactory.warning('No hits detected!')
            return
        
        if self.clampSetting and self.clampSetting < len(self.posBuffer):
            if debugReport:guiFactory.warning("Position buffer was clamped. Check settings if this was not desired.")
            self.posBuffer = distance.returnPositionDataDistanceSortedList(self.startPoint,self.posBuffer)
            self.posBuffer = self.posBuffer[:self.clampSetting]
            
        if self.mode == 'midPoint':                
            self.posBuffer = [distance.returnAveragePointPosition(self.posBuffer)]

        if self.posBuffer: #Check for closest and just for hits
            if self.closestOnly and self.mode != 'intersections':
                buffer = distance.returnClosestPoint(self.startPoint,self.posBuffer)
                self.posBuffer = [buffer]               
        else:pass
            #guiFactory.warning("No hits detected")
            
        if self.createMode and self.posBuffer: # Make our stuff
            #Delete the old stuff
            if self.createModeBuffer and not self.dragStoreMode:
                for o in self.createModeBuffer:
                    try:mc.delete(o)
                    except:pass
                self.createModeBuffer = []
            
            for pos in self.posBuffer:
                if len(pos) == 3:
                    baseScale = distance.returnMayaSpaceFromWorldSpace(10)
                    if self.createMode == 'joint':
                        nameBuffer = mc.joint(radius = 1)
                        #attributes.doSetAttr(nameBuffer,'radius',1)
                        
                        mc.select(cl=True)
                    else:
                        nameBuffer = mc.spaceLocator()[0]
                        for m in self.meshPosDict.keys():#check each mesh dictionary to see where it came from
                            if pos in self.meshPosDict[m]:#if the mesh has a match
                                attributes.storeInfo(nameBuffer,'cgmHitTarget',m)
                                
                                attributes.doSetAttr(nameBuffer,'localScaleX',(self.meshArea*.025))
                                attributes.doSetAttr(nameBuffer,'localScaleY',(self.meshArea*.025))
                                attributes.doSetAttr(nameBuffer,'localScaleZ',(self.meshArea*.025))
                                break                              
                        
                    mc.move (pos[0],pos[1],pos[2], nameBuffer)
                    
                    self.createModeBuffer.append(nameBuffer)
                else:
                    if debugReport:guiFactory.warning("'%s' isn't a valid position"%pos)
        
        if self.dragStoreMode:
            if self.posBuffer:
                for p in self.posBuffer:
                    self.returnList.append(p)  
               
        mc.refresh()#Update maya to make it interactive!
Exemplo n.º 9
0
def returnInfoForLoc(obj,forceBBCenter = False):
	"""
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Return info to create or update a locator.

	ARGUMENTS:
	obj(string)

	RETURNS:
	locInfo(dict)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
	"""pass  an object into it and get locator placed at the pivots - matching translation, rotation and rotation order"""
	rotationOrderDictionary = {'xyz':0,'yzx':1 ,'zxy':2 ,'xzy':3 ,'yxz':4,'zyx':5,'none':6}

	"""get stuff to transfer"""
	objType = search.returnObjectType(obj)

	# vertex
	if objType == 'polyVertex':
		objTrans = mc.pointPosition(obj,w=True)
	elif objType == 'polyEdge':
		mc.select(cl=True)
		mc.select(obj)
		mel.eval("PolySelectConvert 3")
		edgeVerts = mc.ls(sl=True,fl=True)
		posList = []
		for vert in edgeVerts:
			posList.append(mc.pointPosition(vert,w=True))
		objTrans = distance.returnAveragePointPosition(posList)
		mc.select(cl=True)
	elif objType == 'polyFace':
		mc.select(cl=True)
		mc.select(obj)
		mel.eval("PolySelectConvert 3")
		edgeVerts = mc.ls(sl=True,fl=True)
		posList = []
		for vert in edgeVerts:
			posList.append(mc.pointPosition(vert,w=True))
		objTrans = distance.returnAveragePointPosition(posList)
		mc.select(cl=True)
	elif objType in ['surfaceCV','curveCV','editPoint','nurbsUV','curvePoint']:
		mc.select(cl=True)
		objTrans = mc.pointPosition (obj,w=True)
	else:
		if forceBBCenter == True:
			objTrans = distance.returnCenterPivotPosition(obj)
		else:
			objTrans = mc.xform (obj, q=True, ws=True, sp=True)

	objRot = mc.xform (obj, q=True, ws=True, ro=True)
	objRoo = mc.xform (obj, q=True, roo=True )

	"""get rotation order"""
	correctRo = rotationOrderDictionary[objRoo]


	locInfo = {}
	locInfo['createdFrom']=obj
	locInfo['objectType']=objType
	locInfo['position']=objTrans
	locInfo['rotation']=objRot
	locInfo['rotationOrder']=correctRo


	return locInfo
Exemplo n.º 10
0
                            self.d_meshUV[m].extend(buffer['uvs'])                            
                        self.startPoint = self.convertPosToLocalSpace( buffer['source'] )



        if not self._posBuffer:
            log.warning('No hits detected!')
            return

        if self.b_clampSetting and self.b_clampSetting < len(self._posBuffer):
            log.warning("Position buffer was clamped. Check settings if this was not desired.")
            self._posBuffer = distance.returnPositionDataDistanceSortedList(self.startPoint,self._posBuffer)
            self._posBuffer = self._posBuffer[:self.b_clampSetting]

        if self.mode == 'midPoint':                
            self._posBuffer = [distance.returnAveragePointPosition(self._posBuffer)]

        if self._posBuffer: #Check for closest and just for hits
            if self.b_closestOnly and self.mode != 'intersections':
                buffer = distance.returnClosestPoint(self.startPoint,self._posBuffer)
                self._posBuffer = [buffer]                 
        else:pass
            #log.warning("No hits detected")

        #>>> Make our stuff ======================================================
        if self._createMode and self._posBuffer: # Make our stuff
            #Delete the old stuff
            if self._createModeBuffer and not self.b_dragStoreMode:
                for o in self._createModeBuffer:
                    try:mc.delete(o)
                    except:pass
Exemplo n.º 11
0
def returnInfoForLoc(obj, forceBBCenter=False):
    """
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	DESCRIPTION:
	Return info to create or update a locator.

	ARGUMENTS:
	obj(string)

	RETURNS:
	locInfo(dict)
	>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
	"""
    """pass  an object into it and get locator placed at the pivots - matching translation, rotation and rotation order"""
    rotationOrderDictionary = {
        'xyz': 0,
        'yzx': 1,
        'zxy': 2,
        'xzy': 3,
        'yxz': 4,
        'zyx': 5,
        'none': 6
    }
    """get stuff to transfer"""
    objType = search.returnObjectType(obj)

    # vertex
    if objType == 'polyVertex':
        objTrans = mc.pointPosition(obj, w=True)
    elif objType == 'polyEdge':
        mc.select(cl=True)
        mc.select(obj)
        mel.eval("PolySelectConvert 3")
        edgeVerts = mc.ls(sl=True, fl=True)
        posList = []
        for vert in edgeVerts:
            posList.append(mc.pointPosition(vert, w=True))
        objTrans = distance.returnAveragePointPosition(posList)
        mc.select(cl=True)
    elif objType == 'polyFace':
        mc.select(cl=True)
        mc.select(obj)
        mel.eval("PolySelectConvert 3")
        edgeVerts = mc.ls(sl=True, fl=True)
        posList = []
        for vert in edgeVerts:
            posList.append(mc.pointPosition(vert, w=True))
        objTrans = distance.returnAveragePointPosition(posList)
        mc.select(cl=True)
    elif objType in [
            'surfaceCV', 'curveCV', 'editPoint', 'nurbsUV', 'curvePoint'
    ]:
        mc.select(cl=True)
        objTrans = mc.pointPosition(obj, w=True)
    else:
        if forceBBCenter == True:
            objTrans = distance.returnCenterPivotPosition(obj)
        else:
            objTrans = mc.xform(obj, q=True, ws=True, sp=True)

    objRot = mc.xform(obj, q=True, ws=True, ro=True)
    objRoo = mc.xform(obj, q=True, roo=True)
    """get rotation order"""
    correctRo = rotationOrderDictionary[objRoo]

    locInfo = {}
    locInfo['createdFrom'] = obj
    locInfo['objectType'] = objType
    locInfo['position'] = objTrans
    locInfo['rotation'] = objRot
    locInfo['rotationOrder'] = correctRo

    return locInfo