Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
674 B
3
Indexable
Never
//Exports every blend shape target of the specified node as an obj. Careful with the directory.

$projPath = "N:/spermageddon/feature/asset/char/";

$char = "brainJack";

$exportPath = "/shapes/dev/obj/";

$bsNode = "head_bs";



string $blendshapes[] = `listAttr -m -st "weight" $bsNode`;

$listSize = size($blendshapes);



for ($i=0; $i<$listSize; ++$i)

{

    select p_head;

    setAttr ($bsNode+"."+$blendshapes[$i]) 1;

    file -force -options "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($projPath + $char + $exportPath + $blendshapes[$i]+".obj");

    setAttr ($bsNode+"."+$blendshapes[$i]) 0;

}