Created
October 26, 2017 03:51
-
-
Save evitolins/884b462a34c9c9561cbf2e47e0ab9e4c to your computer and use it in GitHub Desktop.
Quickly select exportable items (joints and mesh belonging to skin clusters)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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