Transfer Ncloth Presets To Multiple Objects

Anybody know how to transfer nCloth presets to multiple objects in a single selection?

Thanks,

Wolfy

well the only way i figured out was to write a little script.... this has the name of the preset you wanna use hardcoded into it, so change it to whatever name you wanna use and select the nCloth nodes in the outliner and run it

// select as many nCloth nodes as you want, run this script to apply a preset to them

// change the name of the preset to whichever you want in the script below

// this by default fully replaces the settings with the named preset

{

int $size, $n;

string $sel[] = listRelatives -s;

$size = size($sel);

for($n=0; $n<$size; $n++){

applyPresetToNode $sel[$n] "" "" "dentedMetal_panel" 1;

}

}

I know this is an ancient post, but since there seemed to be so little out there about this and since the above code didn't work for me (and caused me quite a headache because MEL sucks, not to mention it's just retarded that you can't apply a preset to more than one object through the UI), I figured I'd post my solution for the next poor soul, in Python, because MEL syntax wasn't making any sense.

import maya.cmds as mc
import maya.mel as mel
 
def applyClothPreset(name, blendVal=1):
    nCloths = mc.ls(sl=True, type="transform")
 
    for n in nCloths:
        nClothShapes = mc.listRelatives(n, shapes=True)
        for s in nClothShapes:
            print "%s|%s %s %4.1f" % (n, s, name, blendVal)
            mel.eval("applyAttrPreset %s|%s \"C:/Program Files/Autodesk/Maya2014/presets/attrPresets/nCloth/%s.mel\" %4.1f" % (n, s, name, blendVal))
 
applyClothPreset("solidRubber")
applyClothPreset("waterBalloon", 0.3)

Obviously this only works for built-in presets... modify path accordingly.
 

#lock u and v before apply
import maya.cmds as mc
import maya.mel as mel

def applyFolliclePreset(name, blendVal=1):
nCloths = mc.ls(sl=True, type=“transform”)

for n in nCloths:
    nClothShapes = mc.listRelatives(n, shapes=True)
    for s in nClothShapes:
        print "%s|%s %s %4.1f" % (n, s, name, blendVal)
        mel.eval("applyAttrPreset %s|%s \"C:/Users/reza_cg/Documents/maya/2017/presets/attrPresets/follicle/%s.mel\" %4.1f" % (n, s, name, blendVal))

applyFolliclePreset(“My_Preset”)