Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
2.7 kB
0
Indexable
Never
        def throatSackFollcileSetup(self):

            meshName = "mesh_m_low_sackPatch_001"

            sacCtrls = mc.ls("jnt_?_sack?_001")
            sacCtrls.append("jnt_m_sackBase_001")

            allFollicleGrp = mc.createNode("transform" , n = "grp_m_allSack_follicle_001" , p = "grp_m_sack_rig_grp" )

            for eachBladeJnt in sacCtrls:
                    bladeJntDecompName = dNamer.namerDecompose(eachBladeJnt)
                    partName           = bladeJntDecompName["p"]
                    bladeCtrl          = mrsControl.MrsControl(name= partName, side= bladeJntDecompName["s"])
                    bladeCtrl.renameControl(bladeJntDecompName["p"] , index =bladeJntDecompName["i"])
                    transform.matchPose(bladeCtrl.zero.nodeName(), eachBladeJnt)
                    offsetGrpA   = bladeCtrl.appendOffsetA()
                    ctrlName     = bladeCtrl.control.nodeName()
                    mc.connectAttr(ctrlName + ".translate" ,eachBladeJnt + ".translate")
                    mc.connectAttr(ctrlName + ".rotate" ,eachBladeJnt + ".rotate")

                    locName  = mc.spaceLocator(n = eachBladeJnt.replace("jnt_" , "loc_"))
                    mc.delete(mc.parentConstraint(ctrlName , locName[0]))
                    fol = follicleCreationOnMesh(meshName , locName[0] , "loc_" , "animHi_worldXF")
                    mc.parent(fol , allFollicleGrp)

                    mc.parentConstraint(fol , bladeCtrl.zero.nodeName() , mo =1)

                    mc.delete(locName)

            mc.parent("grp_m_sack_rig_grp" , "rig")

            #bs setup to follow ctrls
            mc.select("mesh_m_low_sackPatchBsA_001" , "mesh_m_low_sackPatch_001")
            mc.blendShape(n = "blendshape_m_low_sackPatch_001" , foc =1 )
            mc.blendShape("blendshape_m_low_sackPatch_001" , e = 1 , ib = 1 , t = ("mesh_m_low_sackPatch_001" , 0 , "mesh_m_low_sackPatchBsB_001" , 0.5) )

            reverseNode = mc.createNode("reverse", n="throatBlow_bs_rev")
            mc.connectAttr("ctrl_m_cogFk.throatBlowBlendshape", reverseNode + ".inputX")
            mc.connectAttr(reverseNode + ".outputX", "blendshape_m_low_sackPatch_001.mesh_m_low_sackPatchBsA_001")

            #sack Ctrl Grp
            sackGrp = mc.createNode("transform" , n = "grp_m_allSackCtrls_001" , p = "controls")
            mc.parent("?_sack*_zero" , sackGrp)
            mc.parent("sackBase_zero" , sackGrp)
            mc.connectAttr("ctrl_m_cogFk.throatBlowBlendshape" , sackGrp + ".v")

            mc.parentConstraint("fkNull_m_local" , "grp_m_allSackCtrls_001" , mo = 1 )
            mc.scaleConstraint("fkNull_m_local" , "grp_m_allSackCtrls_001" , mo = 1 )
Leave a Comment