

def redoIt(self):
    self.__dgModify = OM.MDGModifier()
    if (not self.__isEditUsed):
        self.__shoulderConstraintNodeArg = OM.MObject(self.__dgModify.createNode(AM_ShoulderConstraintNode.kPluginNodeId))
        self.__shoulderConstraintNodeFn.setObject(self.__shoulderConstraintNodeArg)
        fn = OM.MFnDagNode(self.__constrainedObjectArg)
        plug.__dgModify.renameNode(self.__shoulderConstraintNodeArg, ('%s_shoulderConstraint' % fn.name()))
    if (len(self.__shoulderConstraintNodeName) > 0):
        self.__dgModify.renameNode(self.__shoulderConstraintNodeArg, self.__shoulderConstraintNodeName)
    self.__dgModify.doIt()
    plug = OM.MPlug()
    if self.__constrainedObjectArg.isValid():
        self.__dgModify.commandToExecute(('connectAttr -f %s.%s %s.rotate' % (self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kRotateAttrName, self.__constrainedObjectArg.partialPathName())))
        self.__dgModify.commandToExecute(('connectAttr -f %s.rotateOrder %s.%s' % (self.__constrainedObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kRotateOrderAttrName)))
        self.__dgModify.commandToExecute(('connectAttr -f %s.parentInverseMatrix %s.%s' % (self.__constrainedObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kParentInvMatrixAttrName)))
    if self.__shoulderObjectArg.isValid():
        self.__dgModify.commandToExecute(('connectAttr -f %s.worldMatrix %s.%s' % (self.__shoulderObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kShoulderObjectAttrName)))
        if (not self.__shoulderObjectArg.hasFn(OM.MFn.kJoint)):
            self.__dgModify.commandToExecute(('connectAttr -f %s.rotatePivot %s.%s' % (self.__shoulderObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kShoulderRotatePivotAttrName)))
    if self.__spineObjectArg.isValid():
        self.__dgModify.commandToExecute(('connectAttr -f %s.worldMatrix %s.%s' % (self.__spineObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kSpineObjectAttrName)))
        if (not self.__spineObjectArg.hasFn(OM.MFn.kJoint)):
            self.__dgModify.commandToExecute(('connectAttr -f %s.rotatePivot %s.%s' % (self.__spineObjectArg.partialPathName(), self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kSpineRotatePivotAttrName)))
    if (self.__raisedAngleArg is not None):
        plug = self.__shoulderConstraintNodeFn.findPlug(AM_ShoulderConstraintNode.kRaisedAngleAttrName, True)
        if (not plug.isConnected()):
            self.__dgModify.commandToExecute(('setAttr %s.%s %s' % (self.__shoulderConstraintNodeFn.name(), AM_ShoulderConstraintNode.kRaisedAngleAttrName, self.__raisedAngleArg)))
    vectorArgs = {
        self.__shoulderAimAxisArg: AM_ShoulderConstraintNode.kShoulderAimAttrName,
        self.__shoulderFrontAxisArg: AM_ShoulderConstraintNode.kShoulderFrontAttrName,
        self.__spineAimAxisArg: AM_ShoulderConstraintNode.kSpineAimAttrName,
        self.__spineFrontAxisArg: AM_ShoulderConstraintNode.kSpineFrontAttrName,
    }
    for vArg in vectorArgs:
        if (not vArg):
            continue
        plug = self.__shoulderConstraintNodeFn.findPlug(vectorArgs[vArg], True)
        if (not plug.isConnected()):
            self.__dgModify.commandToExecute(('setAttr %s.%s %s %s %s' % (self.__shoulderConstraintNodeFn.name(), vectorArgs[vArg], vArg.x, vArg.y, vArg.z)))
    if (not self.__isEditUsed):
        self.__dgModify.commandToExecute(('select %s' % self.__shoulderConstraintNodeFn.name()))
    self.__dgModify.doIt()
    self.setResult(self.__shoulderConstraintNodeFn.name())

dataset/ETHPy150Open CountZer0/PipelineConstructionSet/maya/plugins/2014/win64/AM_ShoulderConstraint.py AM_ShoulderConstraintCmd.redoIt/VarMisuse@72/125 `self`->`plug`