parameters: (fromNode, toNode)
docstring: Mainly used for snapping the pivot of a controller that is in a topnode GRP's space
function: def snapPivotWithZeroParent(fromNode, toNode):
  
      '''
  
      Mainly used for snapping the pivot of a controller that is in a topnode GRP's space
  
      '''
  
      #TODO: This won't work if there is more than one child
  
      try:
  
          parent = cmds.listRelatives(fromNode, parent=1)
  
  
  
          cmds.parent(fromNode, w=1)
  
          toNodeMx = cmds.xform(toNode, q=1, ws=1, m=1)
  
          cmds.xform(parent, m=toNodeMx, ws=1)
  
  
  
          toNodePivot = cmds.xform(toNode, ws=1, q=1, t=1)
  
          cmds.xform(fromNode, ws=1, a=1, piv=toNodePivot)
  
          cmds.parent(fromNode, parent)
  
          cmds.makeIdentity(fromNode, t=1, r=1, a=1)
  
      except Exception as e:
  
          print(traceback.format_exc())
function_tokens: def snapPivotWithZeroParent ( fromNode , toNode ) : #TODO: This won't work if there is more than one child try : parent = cmds . listRelatives ( fromNode , parent = 1 ) cmds . parent ( fromNode , w = 1 ) toNodeMx = cmds . xform ( toNode , q = 1 , ws = 1 , m = 1 ) cmds . xform ( parent , m = toNodeMx , ws = 1 ) toNodePivot = cmds . xform ( toNode , ws = 1 , q = 1 , t = 1 ) cmds . xform ( fromNode , ws = 1 , a = 1 , piv = toNodePivot ) cmds . parent ( fromNode , parent ) cmds . makeIdentity ( fromNode , t = 1 , r = 1 , a = 1 ) except Exception as e : print ( traceback . format_exc ( ) )