export obj sequence in maya

//get names
string $select[] = `ls -sl`;
string $sceneN = `file -q -shn -sn`;
string $Loc = `file -q -loc`;
string $sceneN2 = `basenameEx($sceneN)`;

//string $SPath = substituteAllString($Loc, $sceneN, “”);
//string $SPath = “/bc/shows/THOR/JB/3910/user/work.heribertr/maya/scenes/”;

// set output path
string $SPath = `workspace -q -rd` + “data/”;

// get min max frames
int $start = `playbackOptions -q -min`;
int $end = `playbackOptions -q -max`;
int $frameR = $end-$start+1;

int $j;
$numInts = size($select);

// export obj
//————————————————–
for ($j=0; $j< $numInts ; $j++)
{
int $ctime = $start;
print (“\nexport”+$SPath+$select[$j]+”.####.obj\n”);
for ($i=0; $i< $frameR ; $i++)
{
currentTime $ctime;
string $objN = $SPath+$select[$j]+”.”+$ctime+”.obj”;
file -f -op “groupDAG=1;reversePolys=1;setGroups=0;ptgroups=1;materials=1;smoothing=1;normals=1;scaleDown=1;scale=1” -typ “OBJexport” -pr -es ($objN);
$ctime++;
}
}

Advertisements

2 thoughts on “export obj sequence in maya

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s