Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Unknown errors for hard and soft edge script

Unknown errors for hard and soft edge script

Anonymous
Not applicable
721 Views
0 Replies
Message 1 of 1

Unknown errors for hard and soft edge script

Anonymous
Not applicable

I found a script online that would change the edges of my model to hard and soft based on the angles of the normals. I've seen someone else use this and it works fine but on my computer, I get numerous errors. 

This is the script:
string $objList[] = ls -sl -o;
string $uvBorder[];
string $edgeUVs[];
string $finalBorder[];

for ($subObj in $objList) {
select -r $subObj;
polyNormalPerVertex -ufn true;
polySoftEdge -a 180 -ch 1 $subObj;
select -r $subObj.map["*"];

polySelectBorderShell 1;

$uvBorder = polyListComponentConversion -te -in;
$uvBorder = ls -fl $uvBorder;

clear( $finalBorder );

for( $curEdge in $uvBorder ) {
$edgeUVs = polyListComponentConversion -tuv $curEdge;
$edgeUVs = ls -fl $edgeUVs;

if( size( $edgeUVs ) > 2 ) {
$finalBorder[ size( $finalBorder ) ] = $curEdge;
}
}

polySoftEdge -a 0 -ch 1 $finalBorder;
}

select -r $objList;

And these are the errors:
// Error: string $objList[] = ls -sl -o;
//
// Error: Line 1.24: Invalid use of Maya object "ls". //
// Error: string $objList[] = ls -sl -o;
//
// Error: Line 1.28: Invalid use of Maya object "sl". //
// Error: string $objList[] = ls -sl -o;
//
// Error: Line 1.30: Invalid use of Maya object "o". //
// Error: $uvBorder = polyListComponentConversion -te -in;
//
// Error: Line 14.41: Invalid use of Maya object "polyListComponentConversion". //
// Error: $uvBorder = polyListComponentConversion -te -in;
//
// Error: Line 14.45: Invalid use of Maya object "te". //
// Error: $uvBorder = ls -fl $uvBorder;
//
// Error: Line 15.16: Invalid use of Maya object "ls". //
// Error: $uvBorder = ls -fl $uvBorder;
//
// Error: Line 15.28: Invalid use of Maya object "fl". //
// Error: $edgeUVs = polyListComponentConversion -tuv $curEdge;
//
// Error: Line 20.40: Invalid use of Maya object "polyListComponentConversion". //
// Error: $edgeUVs = polyListComponentConversion -tuv $curEdge;
//
// Error: Line 20.52: Invalid use of Maya object "tuv". //
// Error: $edgeUVs = ls -fl $edgeUVs;
//
// Error: Line 21.15: Invalid use of Maya object "ls". //
// Error: $edgeUVs = ls -fl $edgeUVs;
//
// Error: Line 21.26: Invalid use of Maya object "fl". //

I'm using a student edition of 2018 and have no idea what is wrong or how to fix it. 

0 Likes
722 Views
0 Replies
Replies (0)