Is there the way to find which the mesh is combined or not?
You can not, not really*, becauseĀ a mesh doesnt have to be combined inorder to qualify for separation. And a combined mesh may nolonger qualify for separation. See separate IS NOT THE OPPOSITE OF COMBINE!
Rather it depends on wether ro not theres independent shells that is parts that have no connections between them. Now that you can query that with "polyEvaluate -shell".
So if you ca live with a script that does what you attempted but doesn't do what you describe the use:
1
2
3
4
5
6
for ($item in ls -dag -type mesh){
int $shells[]=polyEvaluate -shell $item;
if ($shells[0]>1)
polySeparate $item;
}
- well under some special conditions you can, but that would defeat any sane purpose.