Hi -
I made a script that gets the vertex points of a UV and checks to see if they or within the 0,0 1,1 coordinate system. The script flags any vertex position less than 0 or greater than 1.
I print the output to the script manager identifying which polygon number it is as well as if it's the a, b, c, or d UV vertex. I also print out the full data dictionary for that polygon.
I have one model that is getting flagged by my script for having a vertex less than zero. As I was digging through my script and looking at the model with the Structure Manager pulled up I found an interesting thing. Any vertex that has a V value of 1 in the structure manager is coming through uvTag.GetSlow(poly) as a scientific notation value of -1.1102230246251565e-16. I am not seeing the same issue if the U value is equal to 1.
I took a screen shot of the Structure manager laid next to the python console so you can see what I mean.
Any ideas on how I can program around this?
Thanks,
.del
############################
# check that UV is within bounds
#
uvTag = obj.GetTag(c4d.Tuvw)
polyCount = obj.GetPolygonCount()
polygons = obj.GetAllPolygons()
for poly in range(polyCount):
polygon = polygons[poly]
data = uvTag.GetSlow(poly)#returns a dictionary {a: Vector( u, v, w), b: Vector( u, v, w), c: Vector( u, v, w), d: Vector( u, v, w)}
#print("poly" + str(poly) + str(data))
for vertex in data:
if data[vertex][0] < 0 or data[vertex][0] > 1:
print(data[vertex][0])
if data[vertex][1] < 0 or data[vertex][1] > 1:
print(str(poly) +" " +vertex)
print(data[vertex][1])
print(data)
