Good afternoon everyone!
I'm trying to make a quick exporter, but I'm having a bit of difficulty...
//Grab a list of everything selected
string $lsS[] = `ls -sl`;
//Loop through the list and export selected
for ($i = 0; $i < `size ($lsS)`; $i ++)
{
//Remove organization suffix
string $filename = ("/data/forUnity" + substituteAllString ($lsS(i), "_lo", "");
//Select object to be exported
select $i;
//Export FBX using required settings
file -op "groups=0;ptgroups=0;materials=0;smoothing=1;normals=1" -typ "FBX export" -es "$filename";
}
From my troubleshooting, I can tell that my issue begins just inside the for loop when I'm trying to concatenate the string array, which is an illegal operation. Is there any way I can convert the information from the string array into a regular string so I can concatenate it properly?
Replies
To access an array you need to do $arrayVar[$variable] you had it as $lsS(i). Another thing is when you select you are select a number instead of the object. Another thing is for -es flag you are not passing the variable $filename but the string $filename. Hope that helps. Sorry my mel is rusty