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.

script to Query for number of reversed and Overlapping UVs

script to Query for number of reversed and Overlapping UVs

RichSuchy
Participant Participant
1,462 Views
6 Replies
Message 1 of 7

script to Query for number of reversed and Overlapping UVs

RichSuchy
Participant
Participant

Is there a queryable command that returns the number of overlapping and reversed UV's an object has. I want to write a check in script that parses a selection of models and prints a report about the selected models. Found two python scripts online but neither have propper syntax and don't do what I am looking to do.. The UV editor hud shows this information in the lower right corner so it seems it would be simple. Looking through the mel commands I came up dry.

0 Likes
Accepted solutions (2)
1,463 Views
6 Replies
Replies (6)
Message 2 of 7

malcolm_341
Collaborator
Collaborator
Accepted solution

For backfacing select your object in object mode

SelectUVMask;
SelectUVBackFacingComponents;

 

For overlapping

SelectFacetMask;
selectUVOverlappingComponents 1 0;

Message 3 of 7

RichSuchy
Participant
Participant
Thank you so much!
Message 4 of 7

RichSuchy
Participant
Participant

I tried to create a quick test of the Backfacing UV counter.

I might be missing something simple here but is there a reason this would not work. My array appears empty even though I purposely created bad UVs. The bad UVs are displayed after the command but not captured in my array.

SelectUVMask;
string $backFaceing[];
$backFaceing = `SelectUVBackFacingComponents`;
$strSize=size($backFaceing);
print $strSize;
clear $backFaceing;

 

$strSize returns 0

0 Likes
Message 5 of 7

malcolm_341
Collaborator
Collaborator
Accepted solution

It looks like defining the selection can't be done at the same time as creating the variable, you can do it like this to get the result you're after.

 

SelectUVMask;
SelectUVBackFacingComponents;
string $backFaceing[] = `ls -sl -fl`;
$strSize = size($backFaceing);
print $strSize;
clear $backFaceing;

Message 6 of 7

RichSuchy
Participant
Participant

I wish these commands had some documentation. Thanks a bunch, That is indeed a solution (slapping forehead for missing the obvious)

0 Likes
Message 7 of 7

malcolm_341
Collaborator
Collaborator

Yeah it would be nice if the mel reference had been updated in the last 10 years, it seems really out of date.