I tried xView "OverlappedUVWFaces.Check" first, but the function will return all overlapped uvw faces throughout all map channels.Then I found that "Select Overlapped Polygons" button in the UVW editor works well, so I tried to use the function to get overlapped uvw faces, but it seems not work in my code. Can somebody please help me?
fn CheckOverlappedUVWInSecondUV geo=
(
local unwrapMod = geo.modifiers["Unwrap_UVW"]
local overlappingUVWFaces = #{}
local uvChannel = 2
if(classof (unwrapMod) == Unwrap_UVW and unwrapMod.getMapChannel() == UVChannel) then
(
unwrapMod.setMapChannel 2
unwrapMod.selectOverlappedFaces()
overlappingUVWFaces = unwrapMod.getSelectedFaces()
)
else
(
addModifier geo (Unwrap_UVW())
unwrapMod = geo.modifiers["Unwrap_UVW"]
unwrapMod.setMapChannel 2
unwrapMod.selectOverlappedFaces()
overlappingUVWFaces = unwrapMod.getSelectedFaces()
)
if overlappingUVWFaces.numberSet > 0 then
return false
else
return true
)
Solved! Go to Solution.
Solved by denisT.MaxDoctor. Go to Solution.
Solved by LayTiger. Go to Solution.
Solved by denisT.MaxDoctor. Go to Solution.
Do you need to check just a fact of overlapping, or do you need to know which particular faces are overlapped?
so you can use the xView and UVW_Mapping_Clear modifier(s) to temporarily clear unwanted channels.
of course, you can use a temp UVW_Unwrap modifier but it's the much heavier solution.
question #2: How big is your mesh? Large meshes can be critical for the xView
xView and UVW_Mapping_Clear modifier(s) actually works, thank you very much.
fn CheckOverlappedUVWInSecondUV geo=
(
addModifier geo (UVW_Mapping_Clear())
uvwClear = geo.modifiers["UVW_Mapping_Clear"]
uvwClear.mapID = 1
overlappingUVWFaces = #()
OverlappedUVWFaces.Check currentTime geo &overlappingUVWFaces
overlappingUVWFacesCount = overlappingUVWFaces.count
deleteModifier geo uvwClear
if(overlappingUVWFacesCount > 0) then
(
return false
)
return true
)
Give it a try, who knows... 😁
I believe it should work with 100K, but not in real time of course.
@LayTiger wrote:xView and UVW_Mapping_Clear modifier(s) actually works, thank you very much.
fn CheckOverlappedUVWInSecondUV geo=
(
addModifier geo (UVW_Mapping_Clear())
uvwClear = geo.modifiers["UVW_Mapping_Clear"]
uvwClear.mapID = 1
overlappingUVWFaces = #()
OverlappedUVWFaces.Check currentTime geo &overlappingUVWFaces
overlappingUVWFacesCount = overlappingUVWFaces.count
deleteModifier geo uvwClear
if(overlappingUVWFacesCount > 0) then
(
return false
)
return true
)
fn CheckOverlappedUVWInSecondUV geo excludeCh: =
(
uvwClear = undefined
if excludeCh != unsupplied do
(
uvwClear = UVW_Mapping_Clear mapid:excludeCh
addModifier geo uvwClear
)
overlappingUVWFaces = #()
OverlappedUVWFaces.Check currentTime geo &overlappingUVWFaces
if uvwClear != undefined do deleteModifier geo uvwClear
overlappingUVWFaces.count != 0
)
It's not an optimization really... yours is good too. Mine is more “mxs stylish”. 😉
Can't find what you're looking for? Ask the community or share your knowledge.