Esempio n. 1
0
def purgeCGMAttrsFromObject(obj):
    """ 
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
    Delete all  'cgm' type user attributes on an object
    
    ARGUMENTS:
    moduleNull(string)
    
    RETURNS:
    infoNullDict(dict)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """
    userAttrsData = attributes.returnUserAttrsToList(obj)
    attrsToPurge = lists.returnMatchedIndexEntries(userAttrsData, 'cgm')
    if len(attrsToPurge):
        for attr in attrsToPurge:
            attributes.doDeleteAttr(obj, attr[0])
            guiFactory.warning("Deleted: '%s.%s'" % (obj, attr[0]))
        return True
    else:
        return False
Esempio n. 2
0
def purgeCGMAttrsFromObject(obj):
    """ 
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
    Delete all  'cgm' type user attributes on an object
    
    ARGUMENTS:
    moduleNull(string)
    
    RETURNS:
    infoNullDict(dict)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """
    userAttrsData = attributes.returnUserAttrsToList(obj)
    attrsToPurge = lists.returnMatchedIndexEntries(userAttrsData,'cgm')
    if len(attrsToPurge):
        for attr in attrsToPurge:
            attributes.doDeleteAttr(obj,attr[0]) 
            guiFactory.warning("Deleted: '%s.%s'"%(obj,attr[0]))
        return True
    else:
        return False
Esempio n. 3
0
def saveTemplateToModule(moduleNull):
    """ 
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
	* Save the new positional information from the template objects
	* Collect all names of objects for a delete list
	* If anything in the module doesn't belong there, un parent it, report it
		* like a template object parented to another obect

    ARGUMENTS:
    moduleNull(string)
    
    RETURNS:
    limbJoints(list)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Variables
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Get our base info
    """ module null data """
    moduleNullData = attributes.returnUserAttrsToDict(moduleNull)
    """ part name """
    partName = NameFactory.returnUniqueGeneratedName(moduleNull,
                                                     ignore='cgmType')
    partType = moduleNullData.get('cgmModuleType')
    direction = moduleNullData.get('cgmDirection')
    """ template null """
    templateNull = moduleNullData.get('templateNull')
    templateNullData = attributes.returnUserAttrsToDict(templateNull)
    """ template object nulls """
    templatePosObjectsInfoNull = returnInfoTypeNull(moduleNull,
                                                    'templatePosObjects')
    templatePosObjectsInfoData = attributes.returnUserAttrsToDict(
        templatePosObjectsInfoNull)
    templateControlObjectsNull = returnInfoTypeNull(moduleNull,
                                                    'templateControlObjects')
    templateControlObjectsData = attributes.returnUserAttrsToDict(
        templateControlObjectsNull)
    """ rig null """
    rigNull = moduleNullData.get('rigNull')
    """ Start objects stuff """
    templateStarterDataInfoNull = returnInfoTypeNull(moduleNull,
                                                     'templateStarterData')
    templateControlObjectsDataNull = returnInfoTypeNull(
        moduleNull, 'templateControlObjectsData')
    """ AutonameStuff """
    divider = NameFactory.returnCGMDivider()
    moduleRootBuffer = returnInfoNullObjects(moduleNull,
                                             'templatePosObjects',
                                             types='templateRoot')
    moduleRoot = moduleRootBuffer[0]
    templateObjects = []
    coreNamesArray = []
    #>>>TemplateInfo
    for key in templatePosObjectsInfoData.keys():
        if (mc.attributeQuery(key, node=templatePosObjectsInfoNull,
                              msg=True)) == True:
            templateObjects.append(templatePosObjectsInfoData[key])
        coreNamesArray.append(key)

    posTemplateObjects = []
    """ Get the positional template objects"""
    for obj in templateObjects:
        bufferList = obj.split(divider)
        if (typesDictionary.get('templateObject')) in bufferList:
            posTemplateObjects.append(obj)
    """ get our control template objects """
    controlTemplateObjects = []
    for key in templateControlObjectsData.keys():
        if (mc.attributeQuery(key, node=templateControlObjectsNull,
                              msg=True)) == True:
            controlTemplateObjects.append(templateControlObjectsData[key])
    """put objects in order of closeness to root"""
    posTemplateObjects = distance.returnDistanceSortedList(
        moduleRoot, posTemplateObjects)
    controlTemplateObjects = distance.returnDistanceSortedList(
        moduleRoot, controlTemplateObjects)
    curve = (templatePosObjectsInfoData['curve'])

    #>>> get our orientation helpers
    helperObjects = []
    for obj in posTemplateObjects:
        helperObjects.append(
            attributes.returnMessageObject(obj, 'orientHelper'))

    masterOrient = (attributes.returnMessageObject(moduleRoot, 'orientHelper'))

    print('%s%s' % (moduleNull, ' data acquired...'))
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Save Data
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Get the data
    """ pos objects """
    storageData = []
    for obj in posTemplateObjects:
        storageData.append(mc.xform(obj, q=True, ws=True, sp=True))
    """ orientation helpers """
    for obj in helperObjects:
        storageData.append(mc.xform(obj, q=True, os=True, ro=True))

    storageData.append(mc.xform(masterOrient, q=True, os=True, ro=True))
    print storageData
    """ template control objects data"""
    tempateControlObjectsStorageData = []
    for obj in controlTemplateObjects:
        print obj
        tempateControlObjectsStorageData.append(
            mc.xform(obj, q=True, ws=True, t=True))
        tempateControlObjectsStorageData.append(
            mc.xform(obj, q=True, os=True, ro=True))
        rootScale = (mc.xform(moduleRoot, q=True, relative=True, scale=True))
        objScaleBuffer = (mc.xform(obj, q=True, relative=True, scale=True))
        objScale = []
        cnt = 0
        for scale in objScaleBuffer:
            objScale.append(scale * rootScale[cnt])
            cnt += 1
        tempateControlObjectsStorageData.append(objScale)
    print tempateControlObjectsStorageData

    #>>> Store the data to the initial objects pos
    """ Get the attributes to store to"""
    initialObjectsTemplateDataBuffer = attributes.returnUserAttrsToList(
        templateStarterDataInfoNull)
    initialObjectsPosData = lists.removeMatchedIndexEntries(
        initialObjectsTemplateDataBuffer, 'cgm')
    """ store it"""
    cnt = 0
    for set in initialObjectsPosData:
        attrBuffer = set[0]
        xBuffer = (templateStarterDataInfoNull + '.' + attrBuffer + 'X')
        yBuffer = (templateStarterDataInfoNull + '.' + attrBuffer + 'Y')
        zBuffer = (templateStarterDataInfoNull + '.' + attrBuffer + 'Z')
        dataSet = storageData[cnt]
        mc.setAttr(xBuffer, dataSet[0])
        mc.setAttr(yBuffer, dataSet[1])
        mc.setAttr(zBuffer, dataSet[2])
        cnt += 1

    #>>> Store the data to the initial objects pos
    """ Get the attributes to store to"""
    templateControlObjectsDataNullBuffer = attributes.returnUserAttrsToList(
        templateControlObjectsDataNull)
    templateControlObjectsData = lists.removeMatchedIndexEntries(
        templateControlObjectsDataNullBuffer, 'cgm')
    """ store it"""
    cnt = 0
    for set in templateControlObjectsData:
        attrBuffer = set[0]
        xBuffer = (templateControlObjectsDataNull + '.' + attrBuffer + 'X')
        yBuffer = (templateControlObjectsDataNull + '.' + attrBuffer + 'Y')
        zBuffer = (templateControlObjectsDataNull + '.' + attrBuffer + 'Z')
        dataSet = tempateControlObjectsStorageData[cnt]
        mc.setAttr(xBuffer, dataSet[0])
        mc.setAttr(yBuffer, dataSet[1])
        mc.setAttr(zBuffer, dataSet[2])
        cnt += 1

    #>>>>>>need to add locking>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    print('%s%s' %
          (moduleNull,
           ' template object positional/rotational/scale data stored...'))
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Save skin joints to skin joints null
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Delete stuff
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """ Gather our objects"""
    toDeleteList = search.returnObjectsOwnedByModuleNull(templateNull)
    print toDeleteList

    for obj in toDeleteList:
        if mc.objExists(obj) == True:
            print('%s%s' % (obj, ' deleted...'))
            mc.delete(obj)

    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Change Tag
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    mc.setAttr((moduleNull + '.templateState'), 0)
    mc.setAttr((moduleNull + '.skeletonState'), 1)

    #add locking

    print('%s%s' % (moduleNull, ' done'))
    return 'done'
Esempio n. 4
0
def skeletonize(moduleNull, stiffIndex=0):
    """ 
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
    Basic limb skeletonizer
    
    ARGUMENTS:
    moduleNull(string)
    stiffIndex(int) - the index of the template objects you want to not have roll joints
                      For example, a value of -1 will let the chest portion of a spine 
                      segment be solid instead of having a roll segment. Default is '0'
                      which will put roll joints in every segment
    
    RETURNS:
    limbJoints(list)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>>Get our info
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    partName = NameFactory.returnUniqueGeneratedName(moduleNull,
                                                     ignore='cgmType')
    """ template null """
    templateNull = modules.returnTemplateNull(moduleNull)
    templateNullData = attributes.returnUserAttrsToDict(templateNull)
    """ template object nulls """
    templatePosObjectsInfoNull = modules.returnInfoTypeNull(
        moduleNull, 'templatePosObjects')
    templateControlObjectsNull = modules.returnInfoTypeNull(
        moduleNull, 'templateControlObjects')
    templatePosObjectsInfoData = attributes.returnUserAttrsToDict(
        templatePosObjectsInfoNull)
    templateControlObjectsData = attributes.returnUserAttrsToDict(
        templateControlObjectsNull)

    jointOrientation = modules.returnSettingsData('jointOrientation')
    moduleRootBuffer = modules.returnInfoNullObjects(moduleNull,
                                                     'templatePosObjects',
                                                     types='templateRoot')
    moduleRoot = moduleRootBuffer[0]
    stiffIndex = templateNullData.get('stiffIndex')
    rollJoints = templateNullData.get('rollJoints')
    """ AutonameStuff """
    divider = NameFactory.returnCGMDivider()
    skinJointsNull = modules.returnInfoTypeNull(moduleNull, 'skinJoints')

    templateObjects = []
    coreNamesArray = []

    #>>>TemplateInfo
    for key in templatePosObjectsInfoData.keys():
        if (mc.attributeQuery(key, node=templatePosObjectsInfoNull,
                              msg=True)) == True:
            templateObjects.append(templatePosObjectsInfoData[key])
        coreNamesArray.append(key)

    posTemplateObjects = []
    """ Get the positional template objects"""
    for obj in templateObjects:
        bufferList = obj.split(divider)
        if (typesDictionary.get('templateObject')) in bufferList:
            posTemplateObjects.append(obj + divider +
                                      typesDictionary.get('locator'))
    """put objects in order of closeness to root"""
    posTemplateObjects = distance.returnDistanceSortedList(
        moduleRoot, posTemplateObjects)
    curve = (templatePosObjectsInfoData['curve'])

    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Actually making the skeleton with consideration for roll joints and the stiffIndex!
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    if stiffIndex == 0:
        """ If no roll joints """
        limbJoints = joints.createJointsFromCurve(curve, partName, rollJoints)
    else:
        rolledJoints = joints.createJointsFromCurve(curve, partName,
                                                    rollJoints)
        if rollJoints == 0:
            limbJoints = rolledJoints
        else:
            if stiffIndex < 0:
                """ Get our to delete number in a rolledJoints[-4:] format"""
                #searchIndex = (int('%s%s' %('-',(rollJoints+1)))*abs(stiffIndex)-1)
                searchIndex = (int('%s%s' % ('-', (rollJoints + 1))) *
                               abs(stiffIndex))
                toDelete = rolledJoints[searchIndex:]
                """ delete out the roll joints we don't want"""
                mc.delete(toDelete[0])
                for name in toDelete:
                    rolledJoints.remove(name)
                """ make our stiff joints """
                jointPositions = []
                if abs(stiffIndex) == 1:
                    jointPositions.append(
                        distance.returnClosestUPosition(
                            posTemplateObjects[stiffIndex], curve))
                else:
                    for obj in posTemplateObjects[stiffIndex:]:
                        jointPositions.append(
                            distance.returnClosestUPosition(obj, curve))

                stiffJoints = joints.createJointsFromPosListName(
                    jointPositions, 'partName')
                """ connect em up """
                mc.parent(stiffJoints[0], rolledJoints[-1])
                limbJoints = []
                for joint in rolledJoints:
                    limbJoints.append(joint)
                for joint in stiffJoints:
                    limbJoints.append(joint)

            else:
                """ if it's not negative, it's positive...."""
                searchIndex = ((rollJoints + 1) * abs(stiffIndex))
                toDelete = rolledJoints[:searchIndex]
                toKeep = rolledJoints[searchIndex:]
                """ delete out the roll joints we don't want"""
                mc.parent(toKeep[0], world=True)
                mc.delete(toDelete[0])
                for name in toDelete:
                    rolledJoints.remove(name)
                """ make our stiff joints """
                jointPositions = []
                if abs(stiffIndex) == 1:
                    jointPositions.append(
                        distance.returnClosestUPosition(
                            posTemplateObjects[stiffIndex - 1], curve))
                else:
                    for obj in posTemplateObjects[:stiffIndex]:
                        jointPositions.append(
                            distance.returnClosestUPosition(obj, curve))

                stiffJoints = joints.createJointsFromPosListName(
                    jointPositions, 'partName')
                """ connect em up """
                mc.parent(rolledJoints[0], stiffJoints[-1])
                limbJoints = []
                for joint in stiffJoints:
                    limbJoints.append(joint)
                for joint in rolledJoints:
                    limbJoints.append(joint)

    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Naming
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """ 
    Copy naming information from template objects to the joints closest to them
    copy over a cgmNameModifier tag from the module first
    """
    attributes.copyUserAttrs(moduleNull,
                             limbJoints[0],
                             attrsToCopy=['cgmNameModifier'])
    """
    First we need to find our matches
    """
    for obj in posTemplateObjects:
        closestJoint = distance.returnClosestObject(obj, limbJoints)
        transferObj = attributes.returnMessageObject(obj, 'cgmName')
        """Then we copy it"""
        attributes.copyUserAttrs(
            transferObj,
            closestJoint,
            attrsToCopy=['cgmNameModifier', 'cgmDirection', 'cgmName'])

    limbJointsBuffer = NameFactory.doRenameHeir(limbJoints[0])
    limbJoints = []
    limbJoints.append(limbJointsBuffer[0])
    for joint in limbJointsBuffer[1]:
        limbJoints.append(joint)
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Orientation
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    limbJoints = orientSegment(limbJoints, posTemplateObjects,
                               jointOrientation)

    #>>> Set its radius and toggle axis visbility on
    #averageDistance = distance.returnAverageDistanceBetweenObjects (limbJoints)
    jointSize = (
        distance.returnDistanceBetweenObjects(limbJoints[0], limbJoints[-1]) /
        6)
    for jnt in limbJoints:
        mc.setAttr((jnt + '.radi'), jointSize * .2)
        #>>>>>>> TEMP
        joints.toggleJntLocalAxisDisplay(jnt)

    print 'to orientation'
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Storing data
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    skinJointsNull = modules.returnInfoTypeNull(moduleNull, 'skinJoints')
    skinJointsNullData = attributes.returnUserAttrsToList(skinJointsNull)
    existingSkinJoints = lists.removeMatchedIndexEntries(
        skinJointsNullData, 'cgm')
    print existingSkinJoints
    if len(existingSkinJoints) > 0:
        for entry in existingSkinJoints:
            attrBuffer = (skinJointsNull + '.' + entry[0])
            print attrBuffer
            attributes.doDeleteAttr(skinJointsNull, entry[0])

    for i in range(len(limbJoints)):
        buffer = ('%s%s' % ('joint_', i))
        attributes.storeInfo(skinJointsNull, buffer, limbJoints[i])

    return limbJoints
Esempio n. 5
0
def saveTemplateToModule(moduleNull):
    """ 
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    DESCRIPTION:
	* Save the new positional information from the template objects
	* Collect all names of objects for a delete list
	* If anything in the module doesn't belong there, un parent it, report it
		* like a template object parented to another obect

    ARGUMENTS:
    moduleNull(string)
    
    RETURNS:
    limbJoints(list)
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """  
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Variables
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Get our base info
    """ module null data """
    moduleNullData = attributes.returnUserAttrsToDict(moduleNull)
        
    """ part name """
    partName = NameFactory.returnUniqueGeneratedName(moduleNull, ignore = 'cgmType')
    partType = moduleNullData.get('cgmModuleType')
    direction = moduleNullData.get('cgmDirection')
    
    """ template null """
    templateNull = moduleNullData.get('templateNull')
    templateNullData = attributes.returnUserAttrsToDict(templateNull)
    
    """ template object nulls """
    templatePosObjectsInfoNull = returnInfoTypeNull(moduleNull,'templatePosObjects')
    templatePosObjectsInfoData = attributes.returnUserAttrsToDict (templatePosObjectsInfoNull)
    templateControlObjectsNull = returnInfoTypeNull(moduleNull,'templateControlObjects')
    templateControlObjectsData = attributes.returnUserAttrsToDict (templateControlObjectsNull)

    
    """ rig null """
    rigNull = moduleNullData.get('rigNull')
    
    """ Start objects stuff """
    templateStarterDataInfoNull = returnInfoTypeNull(moduleNull,'templateStarterData')
    templateControlObjectsDataNull = returnInfoTypeNull(moduleNull,'templateControlObjectsData')

    """ AutonameStuff """
    divider = NameFactory.returnCGMDivider()    
    moduleRootBuffer =  returnInfoNullObjects(moduleNull,'templatePosObjects',types='templateRoot')
    moduleRoot = moduleRootBuffer[0]
    templateObjects = []
    coreNamesArray = [] 
    #>>>TemplateInfo
    for key in templatePosObjectsInfoData.keys():
        if (mc.attributeQuery (key,node=templatePosObjectsInfoNull,msg=True)) == True:
            templateObjects.append (templatePosObjectsInfoData[key])
        coreNamesArray.append (key)
    
    posTemplateObjects = []
    """ Get the positional template objects"""
    for obj in templateObjects:
        bufferList = obj.split(divider)
        if (typesDictionary.get('templateObject')) in bufferList:
            posTemplateObjects.append(obj)
    """ get our control template objects """
    controlTemplateObjects=[]
    for key in templateControlObjectsData.keys():
        if (mc.attributeQuery (key,node=templateControlObjectsNull,msg=True)) == True:
            controlTemplateObjects.append (templateControlObjectsData[key])

    """put objects in order of closeness to root"""
    posTemplateObjects = distance.returnDistanceSortedList(moduleRoot,posTemplateObjects)
    controlTemplateObjects = distance.returnDistanceSortedList(moduleRoot,controlTemplateObjects)
    curve = (templatePosObjectsInfoData['curve'])
    
    #>>> get our orientation helpers
    helperObjects = []
    for obj in posTemplateObjects:
        helperObjects.append(attributes.returnMessageObject(obj,'orientHelper'))
        
    masterOrient = (attributes.returnMessageObject(moduleRoot,'orientHelper'))
    
    print ('%s%s'% (moduleNull,' data acquired...'))
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Save Data
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Get the data
    """ pos objects """
    storageData = []
    for obj in posTemplateObjects:
        storageData.append(mc.xform (obj, q=True, ws=True, sp=True))
    
    """ orientation helpers """
    for obj in helperObjects:
        storageData.append(mc.xform (obj,  q=True, os=True, ro=True))
        
    storageData.append(mc.xform (masterOrient, q=True, os=True, ro=True))
    print storageData
    """ template control objects data"""
    tempateControlObjectsStorageData = []
    for obj in controlTemplateObjects:
        print obj
        tempateControlObjectsStorageData.append(mc.xform (obj, q=True, ws=True, t=True))
        tempateControlObjectsStorageData.append(mc.xform (obj,  q=True, os=True, ro=True))
        rootScale = (mc.xform (moduleRoot, q=True, relative = True, scale=True))
        objScaleBuffer = (mc.xform (obj, q=True, relative = True, scale=True))
        objScale = []
        cnt = 0
        for scale in objScaleBuffer:
            objScale.append(scale*rootScale[cnt])
            cnt+=1
        tempateControlObjectsStorageData.append(objScale)
    print tempateControlObjectsStorageData

    #>>> Store the data to the initial objects pos
    """ Get the attributes to store to"""
    initialObjectsTemplateDataBuffer = attributes.returnUserAttrsToList(templateStarterDataInfoNull)
    initialObjectsPosData = lists.removeMatchedIndexEntries(initialObjectsTemplateDataBuffer,'cgm')

    """ store it"""
    cnt=0
    for set in initialObjectsPosData:
        attrBuffer = set[0]
        xBuffer = (templateStarterDataInfoNull+'.'+attrBuffer+'X')
        yBuffer = (templateStarterDataInfoNull+'.'+attrBuffer+'Y')
        zBuffer = (templateStarterDataInfoNull+'.'+attrBuffer+'Z')
        dataSet = storageData[cnt]
        mc.setAttr (xBuffer, dataSet[0])
        mc.setAttr (yBuffer, dataSet[1])
        mc.setAttr (zBuffer, dataSet[2])
        cnt+=1
        
    #>>> Store the data to the initial objects pos
    """ Get the attributes to store to"""
    templateControlObjectsDataNullBuffer = attributes.returnUserAttrsToList(templateControlObjectsDataNull)
    templateControlObjectsData = lists.removeMatchedIndexEntries(templateControlObjectsDataNullBuffer,'cgm')
    
    """ store it"""
    cnt=0
    for set in templateControlObjectsData:
        attrBuffer = set[0]
        xBuffer = (templateControlObjectsDataNull+'.'+attrBuffer+'X')
        yBuffer = (templateControlObjectsDataNull+'.'+attrBuffer+'Y')
        zBuffer = (templateControlObjectsDataNull+'.'+attrBuffer+'Z')
        dataSet = tempateControlObjectsStorageData[cnt]
        mc.setAttr (xBuffer, dataSet[0])
        mc.setAttr (yBuffer, dataSet[1])
        mc.setAttr (zBuffer, dataSet[2])
        cnt+=1 
        
    #>>>>>>need to add locking>>>>>>>>>>>>>>>>>>>>>>>>>>>>    
    print ('%s%s'% (moduleNull,' template object positional/rotational/scale data stored...'))
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Save skin joints to skin joints null
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Delete stuff
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    """ Gather our objects"""
    toDeleteList = search.returnObjectsOwnedByModuleNull(templateNull)
    print toDeleteList
    
    for obj in toDeleteList:
        if mc.objExists(obj) == True:
            print ('%s%s'% (obj,' deleted...'))
            mc.delete(obj)

    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>> Change Tag
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    mc.setAttr ((moduleNull+'.templateState'), 0)
    mc.setAttr ((moduleNull+'.skeletonState'), 1)
    
    #add locking
    
    print ('%s%s'% (moduleNull,' done'))
    return 'done'