def duplicateMesh(self): dupMesh = mc.duplicate(self.mesh, name='{}_temp'.format(self.mesh))[0] dupMesh_newName = NC.renameBasename( dupMesh, '{}PolyDelete'.format(NC.getBasename(self.mesh))) dupMesh = pm.rename(str(dupMesh_newName), dupMesh_newName.replace('_temp', '')) return dupMesh
def createPivotGrps(self, joint, name, forceConnection=True): toeRoll = adb.makeroot_func(joint, suff='ToeRoll', forceNameConvention=True) ballRoll = adb.makeroot_func(joint, suff='BallRoll', forceNameConvention=True) heelRoll = adb.makeroot_func(joint, suff='HeelRoll', forceNameConvention=True) Transform(heelRoll).pivotPoint = Transform( self.footHeel_joint).worldTrans Transform(ballRoll).pivotPoint = Transform( self.footBall_joint).worldTrans Transform(toeRoll).pivotPoint = Transform( self.footToes_joint).worldTrans if self.side == NC.RIGTH_SIDE_PREFIX: pm.makeIdentity(toeRoll, n=0, r=1, apply=True, pn=1) if forceConnection: ## connect Attributes pm.PyNode(self.Foot_MOD.metaData_GRP.heelRoll) >> heelRoll.rx pm.PyNode(self.Foot_MOD.metaData_GRP.ballRoll) >> ballRoll.rx pm.PyNode(self.Foot_MOD.metaData_GRP.toeRoll) >> toeRoll.rx pm.PyNode(self.Foot_MOD.metaData_GRP.heelSide) >> heelRoll.ry pm.PyNode(self.Foot_MOD.metaData_GRP.heelTwist) >> heelRoll.rz pm.PyNode(self.Foot_MOD.metaData_GRP.toeSide) >> toeRoll.ry self.nameStructure['Suffix'] = NC.MULTIPLY_DIVIDE_SUFFIX mult_node = pm.shadingNode( 'multiplyDivide', asUtility=1, n='{Side}__{Basename}_toeNegate__{Suffix}'.format( **self.nameStructure)) self.nameStructure['Suffix'] = NC.PLUS_MIN_AVER_SUFFIX pma_node = pm.shadingNode( 'plusMinusAverage', asUtility=1, n='{Side}__{Basename}_toeNegate__{Suffix}'.format( **self.nameStructure)) mult_node.input2X.set(-1) ballRoll.rx >> mult_node.input1X mult_node.outputX >> pma_node.input3D[0].input3Dx pm.PyNode(self.Foot_MOD.metaData_GRP.toeBend ) >> pma_node.input3D[1].input3Dx pma_node.output3Dx >> self.footBall_joint.rx footOffsetGrp = adb.makeroot_func(toeRoll, suff='Offset', forceNameConvention=True) NC.renameBasename(footOffsetGrp, name) return footOffsetGrp
def createFkReverseCTRLS(): self.REVERSE_MOD.getJoints = [] for joint in self.reverse_spine_chain_joints: rev_ctrl = Control.Control( name=joint.replace(NC.JOINT, NC.CTRL), shape=sl.sl[self.config['CONTROLS']['Spine_FK_Rev'] ['shape']], scale=self.config['CONTROLS']['Spine_FK_Rev']['scale'], matchTransforms=(False, 1, 0), color=('index', 20), ) self.REVERSE_MOD.getJoints.append(joint) pm.parent(rev_ctrl.control.getShape(), joint, relative=True, shape=True) pm.delete(rev_ctrl.control) pm.rename(joint, NC.getNameNoSuffix(joint)) adb.AutoSuffix([joint]) adb.lockAttr_func( joint, ['tx', 'ty', 'tz', 'sx', 'sy', 'sz', 'radius']) self.nameStructure['Suffix'] = NC.VISRULE shapes = [x.getShape() for x in self.reverse_spine_chain_joints] moduleBase.ModuleBase.setupVisRule( shapes, self.REVERSE_MOD.VISRULE_GRP, '{Side}__{Basename}_FK_Reverse_CTRL__{Suffix}'.format( **self.nameStructure), False) self.setupVisRule( self.reverse_spine_chain_joints, self.REVERSE_MOD.VISRULE_GRP, '{Side}__{Basename}_FK_Reverse_JNT__{Suffix}'.format( **self.nameStructure), False) return self.REVERSE_MOD.getJoints
def setup_VisibilityGRP(self): visGrp = adbAttr.NodeAttr([self.RIG.VISIBILITY_GRP]) visGrp.AddSeparator(self.RIG.VISIBILITY_GRP, 'Joints') visGrp.addAttr( '{Side}_{Basename}_Clavicule_JNT'.format(**self.nameStructure), True) visGrp.addAttr('{Side}_{Basename}_IK_JNT'.format(**self.nameStructure), False) visGrp.AddSeparator(self.RIG.VISIBILITY_GRP, 'Controls') visGrp.addAttr( '{Side}_{Basename}_Clavicule_CTRL'.format(**self.nameStructure), True) for attr in visGrp.allAttrs.keys(): for module in self.BUILD_MODULES: for grp in module.VISRULE_GRP.getChildren(): shortName = NC.getBasename(grp).split( '{Basename}_'.format(**self.nameStructure))[-1] if shortName.lower() in attr.lower(): try: pm.connectAttr( '{}.{}'.format(visGrp.subject, attr), '{}.vis'.format(grp)) except: pass
def setupVisRule(self, tansformList, parent, name=False, defaultValue=True): """ Edit : for setting up the visrule for Fk shapes ctrl Original one from ModuleBase """ if name: visRuleGrp = pm.group(n=name, em=1, parent=parent) else: visRuleGrp = pm.group(n='{}_{}__{}'.format( NC.getNameNoSuffix(tansformList[0]), NC.getSuffix(tansformList[0]), NC.VISRULE), em=1, parent=parent) visRuleGrp.v.set(0) visRuleAttr = adbAttr.NodeAttr([visRuleGrp]) visRuleAttr.addAttr('vis', 'enum', eName="2:0") self.nameStructure['Suffix'] = NC.ADDLINEAR_SUFFIX addDouble = pm.shadingNode( 'addDoubleLinear', asUtility=1, n='{Side}__{Basename}_visrule__{Suffix}'.format( **self.nameStructure)) self.nameStructure['Suffix'] = NC.REVERSE_SUFFIX reverse = pm.shadingNode( 'reverse', asUtility=1, n='{Side}__{Basename}_visrule__{Suffix}'.format( **self.nameStructure)) addDouble.input2.set(1) pm.connectAttr('{}.{}'.format(visRuleGrp, visRuleAttr.name), '{}.inputX'.format(reverse), f=1) pm.connectAttr('{}.outputX'.format(reverse), '{}.input1'.format(addDouble), f=1) for transform in tansformList: pm.connectAttr('{}.output'.format(addDouble), '{}.drawStyle'.format(transform)) adb.lockAttr_func( visRuleGrp, ['tx', 'ty', 'tz', 'rx', 'ry', 'rx', 'rz', 'sx', 'sy', 'sz', 'v']) return visRuleGrp, visRuleAttr.name
def build(self, GUIDES): """ """ super(LimbShoudler, self)._build() self.RIG = RigBase.RigBase(rigName=self.NAME) self.starter_Shoulder = GUIDES self.side = NC.getSideFromPosition(GUIDES[-1]) if self.side == 'L': self.col_main = indexColor[self.config["COLORS"]['L_col_main']] self.col_layer1 = indexColor[self.config["COLORS"]['L_col_layer1']] elif self.side == 'R': self.col_main = indexColor[self.config["COLORS"]['R_col_main']] self.col_layer1 = indexColor[self.config["COLORS"]['R_col_layer1']] self.nameStructure = { 'Side': self.side, 'Basename': 'Shoulder', 'Parts': [ 'Clavicule', 'Shoulder', 'Scapula', ], 'Suffix': '' } self.BUILD_MODULES = [] self.shoulder_MOD = None self.AUTO_CLAVICULE_MOD = None # ================= # BUILD self.shoulder_MOD = moduleBase.ModuleBase() self.BUILD_MODULES += [self.shoulder_MOD] self.shoulder_MOD._start( '{Side}__Shoulder'.format(**self.nameStructure), _metaDataNode='transform') pm.parent(self.shoulder_MOD.metaData_GRP, self.RIG.SETTINGS_GRP) pm.parent(self.shoulder_MOD.MOD_GRP, self.RIG.MODULES_GRP) self.createJoints() self.create_clavicule_ctrl() self.ikSetup() self.autoClavicule( arm_ik_joints=[ '{Side}__Arm_Ik_Shoulder__JNT'.format(**self.nameStructure), '{Side}__Arm_Ik_Elbow__JNT'.format(**self.nameStructure), '{Side}__Arm_Ik_Wrist__JNT'.format(**self.nameStructure) ], poleVector_ctl='{Side}__Arm_PoleVector__CTRL'.format( **self.nameStructure), arm_ik_offset_ctrl='{Side}__Arm_IK_offset__CTRL'.format( **self.nameStructure))
def createloc(sub=pm.selected()): """Creates locator at the Pivot of the object selected """ locs = [] for sel in sub: loc_align = pm.spaceLocator(n='{}_Distance__{}'.format( NC.getNameNoSuffix(sel), NC.LOC)) locs.append(loc_align) pm.matchTransform(loc_align, sel, rot=True, pos=True) pm.select(locs, add=True) return locs
def CreateCircles(): CurveColl = [] for joint in subject: myname = '{}'.format(joint) new_name = '{}{}__{}'.format(NC.getSideFromName(myname), NC.getBasename(myname), NC.CTRL) self._curve = pm.circle(nr=self.normalsCtrl, r=self._radius) pm.matchTransform(self._curve, joint, pos=1, rot=1) curveShape = pm.PyNode(self._curve[0]).getShape() CurveColl.extend(self._curve) tras = pm.xform(joint, ws=True, q=True, t=True) pivot = pm.xform(joint, ws=True, q=True, rp=True) pm.xform(self._curve, ws=True, t=tras, rp=pivot) pm.parent(curveShape, joint, r=True, s=True) pm.delete(self._curve) pm.rename(joint, new_name) pm.setAttr('{}.radius'.format(joint), keyable=False, channelBox=False) return (subject)
def build(self, GUIDES): """ # TODO : Add Bank System # TODO : Automate walking cycle """ super(LimbFoot, self)._build() self.RIG = RigBase.RigBase(rigName=self.NAME) self.starter_Foot = GUIDES self.side = NC.getSideFromPosition(GUIDES[0]) if self.side == 'L': self.col_main = indexColor[self.config["COLORS"]['L_col_main']] self.col_layer1 = indexColor[self.config["COLORS"]['L_col_layer1']] self.col_layer2 = indexColor[self.config["COLORS"]['L_col_layer2']] self.pol_vector_col = indexColor[self.config["COLORS"] ['L_col_poleVector']] elif self.side == 'R': self.col_main = indexColor[self.config["COLORS"]['R_col_main']] self.col_layer1 = indexColor[self.config["COLORS"]['R_col_layer1']] self.col_layer2 = indexColor[self.config["COLORS"]['R_col_layer2']] self.pol_vector_col = indexColor[self.config["COLORS"] ['R_col_poleVector']] self.nameStructure = { 'Side': self.side, 'Basename': 'Foot', 'Parts': ['Ankle', 'Ball', 'Toe', 'Heel'], 'Suffix': '' } self.BUILD_MODULES = [] # ================= # BUILD self.Foot_MOD = moduleBase.ModuleBase() self.BUILD_MODULES += [self.Foot_MOD] self.Foot_MOD._start('{Side}__Foot'.format(**self.nameStructure), _metaDataNode='transform') pm.parent(self.Foot_MOD.metaData_GRP, self.RIG.SETTINGS_GRP) pm.parent(self.Foot_MOD.MOD_GRP, self.RIG.MODULES_GRP) self.footGroupSetup() self.create_foot_ctrl()
def setup_VisibilityGRP(self): visGrp = adbAttr.NodeAttr([self.RIG.VISIBILITY_GRP]) visGrp.AddSeparator(self.RIG.VISIBILITY_GRP, 'Joints') visGrp.addAttr('{Side}_{Basename}_FK_JNT'.format(**self.nameStructure), self.config['VISRULES']['FK_Reg_JNT']) visGrp.addAttr( '{Side}_{Basename}_FK_Reverse_JNT'.format(**self.nameStructure), self.config['VISRULES']['FK_Rev_JNT']) visGrp.addAttr('{Side}_{Basename}_IK_JNT'.format(**self.nameStructure), self.config['VISRULES']['IK_JNT']) visGrp.addAttr( '{Side}_{Basename}_MACRO_JNT'.format(**self.nameStructure), self.config['VISRULES']['Macro_JNT']) visGrp.AddSeparator(self.RIG.VISIBILITY_GRP, 'Controls') visGrp.addAttr( '{Side}_{Basename}_FK_CTRL'.format(**self.nameStructure), self.config['VISRULES']['FK_Reg_CTRL']) visGrp.addAttr( '{Side}_{Basename}_FK_Reverse_CTRL'.format(**self.nameStructure), self.config['VISRULES']['FK_Rev_CTRL']) visGrp.addAttr( '{Side}_{Basename}_IK_CTRL'.format(**self.nameStructure), self.config['VISRULES']['IK_CTRL']) visGrp.addAttr( '{Side}_{Basename}_CHEST_CTRL'.format(**self.nameStructure), self.config['VISRULES']['Chest_CTRL']) visGrp.addAttr( '{Side}_{Basename}_HIPS_CTRL'.format(**self.nameStructure), self.config['VISRULES']['Hips_CTRL']) for attr in visGrp.allAttrs.keys(): for module in self.BUILD_MODULES: for grp in module.VISRULE_GRP.getChildren(): shortName = NC.getBasename(grp).split( '{Basename}_'.format(**self.nameStructure))[-1] if shortName.lower() in attr.lower(): try: pm.connectAttr( '{}.{}'.format(visGrp.subject, attr), '{}.vis'.format(grp)) except: pass
def setupVisRule(tansformList, parent, name=False, defaultValue=True): """ setup VisRule group for a tansform. Connect the tansform visibility to the visRule group Arguments: tansform {List} -- Control to connect parent {transform} -- parent of the VisRule group """ if name: visRuleGrp = pm.group(n=name, em=1, parent=parent) else: visRuleGrp = pm.group(n='{}_{}__{}'.format(NC.getNameNoSuffix(tansformList[0]), NC.getSuffix(tansformList[0]), NC.VISRULE), em=1, parent=parent) visRuleGrp.v.set(0) visRuleAttr = adbAttr.NodeAttr([visRuleGrp]) visRuleAttr.addAttr('vis', defaultValue) for transform in tansformList: pm.connectAttr('{}.{}'.format(visRuleGrp, visRuleAttr.name), '{}.v'.format(transform)) adb.lockAttr_func(visRuleGrp, ['tx', 'ty', 'tz', 'rx', 'ry', 'rx', 'rz', 'sx', 'sy', 'sz','v']) return visRuleGrp, visRuleAttr.name
def createFkRegularCTRLS(self): self.RESULT_MOD.getJoints = [] for joint in self.spine_chain_joints: ctrl = Control.Control( name=joint.replace(NC.JOINT, NC.CTRL), shape=sl.sl[self.config['CONTROLS']['Spine_FK_Reg']['shape']], scale=self.config['CONTROLS']['Spine_FK_Reg']['scale'], matchTransforms=(False, 1, 0), color=('index', 21)) for att in ['tx', 'ty', 'tz', 'sx', 'sy', 'sz', 'radius']: pm.PyNode(joint).setAttr(att, lock=True, channelBox=False, keyable=False) self.RESULT_MOD.getJoints.append(joint) pm.parent(ctrl.control.getShape(), joint, relative=True, shape=True) pm.delete(ctrl.control) pm.rename(joint, NC.getNameNoSuffix(joint)) adb.AutoSuffix([joint]) self.nameStructure['Suffix'] = NC.VISRULE shapes = [x.getShape() for x in self.spine_chain_joints] moduleBase.ModuleBase.setupVisRule( shapes, self.RESULT_MOD.VISRULE_GRP, '{Side}__{Basename}_FK_CTRL__{Suffix}'.format( **self.nameStructure), False) self.setupVisRule( self.spine_chain_joints, self.RESULT_MOD.VISRULE_GRP, '{Side}__{Basename}_FK_JNT__{Suffix}'.format(**self.nameStructure), False) return self.RESULT_MOD.getJoints
def add_folli(self, add_value, radius=0.2): """ add follicules to an already existing system @param add_value: (int) Number of follicules to add @param mesh: (str) Mesh having the follicules """ mesh = self.subject for index in xrange(add_value): mesh_shape = pm.PyNode(mesh).getShape() plugs = pm.listConnections(str(mesh_shape) + '.outMesh', d=True, sh=True) current_numb_foll = len( [x for x in plugs if x.type() == 'follicle']) oFoll = self.create_follicle(pm.PyNode(mesh), (current_numb_foll + 1), 1) pName = '{}{}'.format(NC.getSideFromName(mesh), NC.getBasename(mesh)) oRoot = [x for x in plugs if x.type() == 'follicle'][0].getParent().getParent() pm.rename( oFoll.getParent(), '{}_0{}__{}'.format(pName, current_numb_foll + 1, NC.FOLL_SUFFIX)) pm.rename(oFoll, '{}_{}__foll__Shape'.format(pName, current_numb_foll)) oGrp = pm.group(em=True, n='{}_0{}__{}'.format(pName, index, NC.GRP)) oGrp.setTranslation( oFoll.getParent().getTranslation(space='world'), space='world') oJoint = pm.joint(rad=radius) self.all_joints_list.append(oJoint) oJoint.setTranslation( oFoll.getParent().getTranslation(space='world'), space='world') # connect the UV params to the joint so you can move the follicle by selecting the joint directly. uParam = self.add_keyable_attribute(oJoint, 'double', 'u_param', oMin=-100, oMax=100, oDefault=0) vParam = self.add_keyable_attribute(oJoint, 'double', 'v_param', oMin=-100, oMax=100, oDefault=0) uParam.set(oFoll.getParent().u_param.get()) vParam.set(oFoll.getParent().v_param.get()) uParam.connect(oFoll.getParent().u_param) vParam.connect(oFoll.getParent().v_param) pm.rename(oJoint, '{}_0{}__{}'.format(pName, index, NC.JOINT)) pm.rename( oJoint.getParent(), '{}_0{}__{}'.format(pName, current_numb_foll + 1, NC.GRP)) pm.parent(oGrp, oFoll.getParent()) pm.parent(oFoll.getParent(), oRoot) oGrp.rx.set(0.0) oGrp.ry.set(0.0) oGrp.rz.set(0.0) Transform(oFoll.getTransform().getChildren( type='transform')[0]).matrixConstraint(oJoint, channels='trh', mo=True) pm.parent(oJoint, self.OUTPUT_GRP) pm.select(None)
def many_follicles(self, myObject, countU, countV, vDir='U'): self.countU = countU self.countV = countV self.vDir = vDir obj = self.subject pm.select(obj, r=True) pName = '{}{}'.format(NC.getSideFromName(obj), NC.getBasename(obj)) self._MODEL.getFolliGrp = pm.spaceLocator(n='{}{}_FOLLI_{}__{}'.format( NC.getSideFromName(obj), NC.getBasename(obj), NC.SYSTEM, NC.GRP)) pm.delete(self._MODEL.getFolliGrp.getShape()) currentFollNumber = 0 for i in range(countU): for j in range(countV): currentFollNumber += 1 pm.select(None) if countU == 1: uPos = 50.0 else: uPos = ( i / (countU - 1.00) ) * 100.0 # NOTE: I recently changed this to have a range of 0-10 if countV == 1: vPos = 50.0 else: vPos = ( j / (countV - 1.00) ) * 100.0 # NOTE: I recently changed this to have a range of 0-10 if vDir == 'U': oFoll = self.create_follicle(myObject, currentFollNumber, vPos, uPos) self._MODEL.getFollicules.append(oFoll) else: # reverse the direction of the follicles oFoll = self.create_follicle(myObject, currentFollNumber, uPos, vPos) self._MODEL.getFollicules.append(oFoll) pm.rename( oFoll.getParent(), '{}_0{}__{}'.format(pName, currentFollNumber, NC.FOLL_SUFFIX)) pm.rename( oFoll, '{}_{}__foll__Shape'.format(pName, currentFollNumber)) oGrp = pm.group(em=True, n='{}_0{}__{}'.format(pName, currentFollNumber, NC.GRP)) self._MODEL.getResetJoints.append(oGrp) oGrp.setTranslation( oFoll.getParent().getTranslation(space='world'), space='world') oJoint = pm.joint(n='{}_0{}__{}'.format( pName, currentFollNumber, NC.JOINT), rad=self.radius) self._MODEL.getJoints.append(oJoint) oJoint.setTranslation( oFoll.getParent().getTranslation(space='world'), space='world') pm.matchTransform(oJoint, oGrp, rot=1) # connect the UV params to the joint so you can move the follicle by selecting the joint directly. uParam = self.add_keyable_attribute(oJoint, 'double', 'u_param', oMin=-100, oMax=100, oDefault=0) vParam = self.add_keyable_attribute(oJoint, 'double', 'v_param', oMin=-100, oMax=100, oDefault=0) uParam.set(oFoll.getParent().u_param.get()) vParam.set(oFoll.getParent().v_param.get()) uParam.connect(oFoll.getParent().u_param) vParam.connect(oFoll.getParent().v_param) pm.parent(oGrp, oFoll.getParent()) pm.parent(oFoll.getParent(), self._MODEL.getFolliGrp) oGrp.rotate.set(0.0, 0.0, 0.0) pm.select(None) return self._MODEL.getFollicules
def maximumSetup(self): # DUPLICATED IK JOINT CHAIN self.ik_NonStretch_joint = [ pm.duplicate(joint, parentOnly=True)[0] for joint in self.ikJnts ] pm.parent(self.ik_NonStretch_joint[-1], self.ik_NonStretch_joint[-2]) pm.parent(self.ik_NonStretch_joint[-2], self.ik_NonStretch_joint[0]) [ pm.PyNode(jnt).rename('{}_NonStetch__{}'.format( NC.getNameNoSuffix(jnt), NC.JOINT)) for jnt in self.ik_NonStretch_joint ] nonStretch_IkHandle, nonStretch_IkHandle_effector = pm.ikHandle( n='{}_NonStetch__{}'.format(self.NAME, NC.IKHANDLE_SUFFIX), sj=self.ik_NonStretch_joint[0], ee=self.ik_NonStretch_joint[-1]) nonStretch_IkHandle.v.set(0) self.nonStretch_IkHandle = nonStretch_IkHandle adb.makeroot_func(self.nonStretch_IkHandle) pm.poleVectorConstraint(self.poleVector_ctrl, nonStretch_IkHandle, weight=1) adb.matrixConstraint(self.ik_ctrl, self.nonStretch_IkHandle.getParent()) self.setFinalHiearchy(RIG_GRP_LIST=[ self.nonStretch_IkHandle.getParent(), self.ik_NonStretch_joint[0] ]) # MAXIMUM NODES self.decompStart_node = pm.shadingNode('decomposeMatrix', asUtility=1, n='{}_startVec__{}'.format( self.NAME, NC.DECOMPOSEMAT_SUFFIX)) self.decompEnd_node = pm.shadingNode('decomposeMatrix', asUtility=1, n='{}_endVec__{}'.format( self.NAME, NC.DECOMPOSEMAT_SUFFIX)) self.md_max_node = pm.shadingNode('multiplyDivide', asUtility=1, n='{}_maxFactor__{}'.format( self.NAME, NC.MULTIPLY_DIVIDE_SUFFIX)) self.clam_node = pm.shadingNode('clamp', asUtility=1, n='{}_max__{}'.format( self.NAME, NC.CLAMP_SUFFIX)) self.initialVec_node = pm.shadingNode('plusMinusAverage', asUtility=1, n='{}_initalVec__{}'.format( self.NAME, NC.PLUS_MIN_AVER_SUFFIX)) self.initialVec_node.operation.set(2) self.addVec_node = pm.shadingNode('plusMinusAverage', asUtility=1, n='{}_addVect__{}'.format( self.NAME, NC.PLUS_MIN_AVER_SUFFIX)) self.maximumToggle_node = pm.shadingNode( 'blendColors', asUtility=1, n='{}_maximumToggle__{}'.format(self.NAME, NC.PLUS_MIN_AVER_SUFFIX)) # connections maximum system self.ik_NonStretch_joint[-1].worldMatrix[ 0] >> self.decompStart_node.inputMatrix self.ik_ctrl.worldMatrix[0] >> self.decompEnd_node.inputMatrix self.decompStart_node.outputTranslate >> self.md_max_node.input1 self.decompEnd_node.outputTranslate >> self.initialVec_node.input3D[0] self.decompStart_node.outputTranslate >> self.initialVec_node.input3D[1] self.initialVec_node.output3D >> self.addVec_node.input3D[0] self.decompStart_node.outputTranslate >> self.addVec_node.input3D[1] self.addVec_node.output3D >> self.clam_node.input self.md_max_node.output >> self.clam_node.max self.clam_node.output >> self.maximumToggle_node.color1 self.decompEnd_node.outputTranslate >> self.maximumToggle_node.color2 self.outputLoc = pm.spaceLocator( n='{}_Ouput__{}'.format(self.NAME, NC.LOC)) self.maximumToggle_node.output >> self.outputLoc.translate self.outputLoc.inheritsTransform.set(0) self.outputLoc.v.set(0) pm.parentConstraint(self.outputLoc, self.posLoc[1].getParent(), mo=1)