Unsure of original author. Bryan Ewert helped with this script.
for ($obj in `ls -sl`){
string $shapes[]=getShapes($obj);
for ($shape in $shapes){
string $transform = `createNode transform -n ($shape+"_GEO")`;
print ("Unparenting shape: " + $shape + "");
parent -s -r $shape $transform;
}
}
//This code thanks to Bryan Ewert
proc string[] getShapes( string $xform )
{
string $shapes[];
$shapes[0] = $xform;
if ( "transform" == `nodeType $xform` )
// If given node is not a transform, assume it is a shape
// and pass it through
{
$shapes = `listRelatives -fullPath -shapes $xform`;
}
return $shapes;
}
Works great on CAD crapola.
--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/BYAPR07MB5861442386589DF193A657F1DD359%40BYAPR07MB5861.namprd07.prod.outlook.com.
If you study the code you’ll see the actionable part is simply making a transform node and piping the shape node into a new transform node.
Should do what you need without worrying yet about polys..?
string $transform = `createNode transform -n ($shape+"_GEO")`;
print ("Unparenting shape: " + $shape + "");
parent -s -r $shape $transform;
To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/BYAPR07MB58613C8EFBD6B93031A4FD1DDD359%40BYAPR07MB5861.namprd07.prod.outlook.com.