If speed is your main issue, you could write it in C++.
On Friday, May 1, 2015 at 9:43:18 AM UTC-7, thirstydevil wrote: > > I do as Janos suggested, worked quite well and pretty fast. We had quite > heavy props from speed tree and it wasn't that bad > > def getMeshUVBounds(mapName, mesh): > mesh = pCore.PyNode(mesh) > uList, vList = mesh.getUVs(mapName) > if not uList: > uList = [0] > if not vList: > vList = [0] > return [[min(uList), min(vList)], [max(uList), max(vList)]] > > > def getMeshUVBoundsAsUDIM(mapName, mesh): > udimMap = range(1001, 1011) > bounds = getMeshUVBounds(mapName, mesh) > minU, maxV = int(math.trunc(bounds[0][0])), int(round(bounds[1][1] + 0.5)) > return udimMap[minU] + (10 * (maxV - 1)) > > > def isUDIMOverlappingBoundaries(mapName, mesh): > bounds = getMeshUVBounds(mapName, mesh) > if int(bounds[0][0]) == int(bounds[1][0]) and int(bounds[0][1]) == > int(bounds[1][1]): > return False > else: > return True > > > > On Friday, 1 May 2015 07:37:06 UTC+1, Chad_Fox wrote: >> >> Hey everyone, >> >> I've been brute force checking UV coords to determine what UDIMs any >> selected object(s) are using, but my simple python query for all UVs and >> checking each of their coords is painfully slow and in some cases unusable >> in scenes my team will be working with. >> >> Do any of you have any snippets of python / python api code that can >> efficiently return a large list of occupied UDIMs from selected object? >> >> Appreciate any help you may be able to offer, thanks! >> >> Chad >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2eb3c040-ca0c-4148-a1c9-e2e69e2eabe6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
