Got it, thanks. Element selection is bothering me now =) Your hint about it being slower than calculation was right and sent me on a journey of poking around with element detection and reorganizing the whole thing. Expanding to element is slow, but does wonders with low amount of shells, say we have million polys unwrapped…
Thank you. Some code here is a "placeholder", like moving elements. I need to move them to few different places and use "default" shift in this example just to have overall "weight" of calculations as close to what it will be in the end. Collecting elements in groups instead of moving each individually every iteration…
Doing a bunch of calculations on UV faces and script is pretty slow. Technically the calculations are very fast, it's changing selection and moving things inside a loop that is slow. I don't know the full application of your script, but this snippet I sped up with no loss of functionality. Before unwrap selected time:7909…
Okay, sometimes you have to select in a loop, but the main issue in your original post was the duplicate work. You can take advantage of subtracting bit arrays to avoid the duplicated work. Check out these two functions below. The first takes 11 seconds on a default teapot and the second takes 1/10th of a second. The only…