- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey folks, I'm new to Mel here so please excuse the beginner question. I'm writing a simple script to run polySeparate on the user's actively selected shells (returned from polyEvaluate).
What I'm stuck on is that I'm not able to get the -sss argument to accept a list, it seems to need an explicit index (or an explicit int more accurately). Looking at the output of the command executed manually, it adds a separate -sss flag for each selected shell, and each argument is a separate int. Since I want to run this command on all of $shells[], entering them separately obviously won't work. I haven't found a solution to this so far in the documentation, but I may be looking in the wrong way.
The following script will return an error, but if I replace $shells[] with $shells[0] it executes correctly, though not as I intend.
// Separate selected shells
{
int $shells[];
$shells = `polyEvaluate -as`;
string $a[];
$a = `polySeparate -sss $shells[] Bone_1_Start_Mesh`;
print($a);
}Thanks in advance for any help!
P.S. Bone_1_Start_Mesh is just a test object, but will be replaced with a variable.
Solved! Go to Solution.