Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quickly select exportable items (joints and mesh belonging to skin clusters)
proc string[] getTransform(string $shape[]) {
string $transform[];
for ($node in $shape) {
if ( "transform" != `nodeType $node` ) {
// If given node is already a transform, just pass on through
string $parents[] = `listRelatives -fullPath -parent $node`;
appendStringArray($transform, $parents, size($parents));
}
}
return $transform;
}
// Collect all skinClusters, their joints and influcenced geometry.
global proc selectExportables() {
string $skins[] = `ls -type skinCluster`;
string $influences[] = `skinCluster -q -inf $skins`;
string $geomShapes[] = `skinCluster -q -geometry $skins`;
string $geom[] = `getTransform($geomShapes)`;
select -clear;
select -add $influences;
select -add $geom;
}
selectExportables()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.