Fabiomussarela
10-23-2006, 09:15 PM
Hi everyone, Iīm trying to do an UVW overlap check script.
This script will check if an object have faces over faces in the uvw unwrap modifier.
Iīm trying in a scene with 3 objs, a ground box and 2 teapots, one teapot have a decent uvw map with no overlapping, and the other 2 objs have the default max mapping that has overlapping faces.
My code works very well if I run it in just one object selected. but when I create a loop to try over selections it returns that all objetcs have no overlap :sad:.
Global xOverlapObjArray = #()
fn xOverlapObj xObj=
(
addModifier xObj (Unwrap_UVW())
xObj.Unwrap_Uvw.selectOverlappedFaces()
xOverlapFacesArray = #()
xOverlapFacesArray = (xObj.Unwrap_Uvw.getSelectedFaces() as array)
If xOverlapFacesArray.count > 1 then append xOverlapObjArray xObj else print (xObj.name as string + " has no Overlap")
DeleteModifier xObj 1
)
The script should put the objs that have overlap faces in the "xOverlapObjArray" and the ones that havenīt it will just print out the obj names.
If I use this function with just one obj selected, it works fine.
But.....
when I try this:
for o in selection do
(
xOverlapObj o
)
it returns that all objects in the selection have no overlap.
am I doing something wrong?? I hope someone could help me out :)
Thanks a lot in advance.
This script will check if an object have faces over faces in the uvw unwrap modifier.
Iīm trying in a scene with 3 objs, a ground box and 2 teapots, one teapot have a decent uvw map with no overlapping, and the other 2 objs have the default max mapping that has overlapping faces.
My code works very well if I run it in just one object selected. but when I create a loop to try over selections it returns that all objetcs have no overlap :sad:.
Global xOverlapObjArray = #()
fn xOverlapObj xObj=
(
addModifier xObj (Unwrap_UVW())
xObj.Unwrap_Uvw.selectOverlappedFaces()
xOverlapFacesArray = #()
xOverlapFacesArray = (xObj.Unwrap_Uvw.getSelectedFaces() as array)
If xOverlapFacesArray.count > 1 then append xOverlapObjArray xObj else print (xObj.name as string + " has no Overlap")
DeleteModifier xObj 1
)
The script should put the objs that have overlap faces in the "xOverlapObjArray" and the ones that havenīt it will just print out the obj names.
If I use this function with just one obj selected, it works fine.
But.....
when I try this:
for o in selection do
(
xOverlapObj o
)
it returns that all objects in the selection have no overlap.
am I doing something wrong?? I hope someone could help me out :)
Thanks a lot in advance.
