Skip to content

Instantly share code, notes, and snippets.

@evitolins
Created October 26, 2017 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evitolins/884b462a34c9c9561cbf2e47e0ab9e4c to your computer and use it in GitHub Desktop.
Save evitolins/884b462a34c9c9561cbf2e47e0ab9e4c to your computer and use it in GitHub Desktop.
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