[UV Packmaster] Efficient UV packing solution for Blender (C++ based, multithreaded)


(glukoz) #283

@kabu Good to hear :slight_smile: Note that UVPackmaster 2.0 will have all operators renamed so the conflict should not happen again.

@Zagupi Thank you very much for finding the cause of this issue! We will handle this specific case properly in the future releases :slight_smile:

(Aorta) #284

Seems like I have an issue installing it on the 2019.01.23 blender 2.80 build.

Love the addon btw.

(glukoz) #285

First sorry for the late response - I was out of office for a day.

The first thing I would try to solve this error is removing the add-on completely and then reinstalling it. Let me know whether it solved the issue.

(Aorta) #286

Well, that was of course the first thing that I tried, and it still didnt work. So, I tried the other versions of UV packmaster for 2.80 and non of them worked.

However, I decided to download the most recent blender build, and finally it worked. So, I have no idea what went wrong.

(esaavedra76) #287

hi glukoz,

if i purchase a license of UVPackmaster now (v1.9x), will i have to repurchase/update to UVPackmaster 2.0? thanks!


(glukoz) #288


Our policy is that if you already bought any version of UVPackmaster and want to get a more expensive version, you only have to pay the difference in prices. The same will apply to UVPackmaster 2, so basically you take no risk by buying the first release of the add-on.

Best regards

[EDIT] Btw, see the next post :wink:

(glukoz) #289

RELEASE 2.0.0 (Early Access Beta)

We are really proud to announce that the beta version of UVPackmaster 2 is finally available. This new major release comes with many improvements, some features were completely redesigned to increase performance and make the add-on more funcional. We hope that you will like the changes :slight_smile:

I will start from listing major improvements:

  • refactor of the multithreading algorithm used on CPU (we know that a lot of people was impressed by the speed of the original algorithm, but it wasn’t fast enough for us :wink: )
  • do you know why I explicitly mentioned “used on CPU” in the previous point? The reason is that CPU is not the only packing device supported by UVPackmaster 2. Now you can also use Cuda-enabled GPU to pack your islands
  • non-square packing workflow was redesigned in order to make it more convenient and funcional
  • significant part of the Python code was rewritten in order to mitigate performance bottlenecks

Every major improvement deserves a few more words of explanation, putting everything in a single post wouldn’t make much sense. In following days I will be publishing descriptions of every feature from the list.

Minor improvements:

  • the add-on interface in Blender was redesigned to be more functional
  • the ‘Iterations’ parameter was renamed to ‘Precision’ as this name is more meaningful. The parameter behavior didn’t change
  • Topology options were removed - now add-on always use every possible method to parse topology of UV islands
  • heuristic algorithm reports the area of the current best solution. The user can cancel heuristc search at any time and the current best solution will be applied to the UV map. If the ‘Heuristic Search Time’ is set to 0 the add-on will search for the optimal solution infinitely, until the operation is cancelled by the user.
  • benchmark data reporting
  • a bunch of other minor improvements and bug fixes for issues reported by users

Note that the list of improvements is not closed yet. We are still working on new features which will be added to the final release of UVPackmaster 2 :slight_smile:

Why beta version? The truth is that stability of UVPackmaster 2 is quite decent, we simply want to gather some feedback from the users - find out what you think about those changes. If you have any thoughts, suggestions - it is the best time to share it with us. After the final release is ready we won’t be so eager to introduce any bigger changes :slight_smile:

A few more notes:

  • by buying the early access version you will receive access to the official release of UVPackmaster 2 for free (when it is ready)
  • UVPackmaster 2 currently supports Windows 64-bit and Linux 64-bit platforms only. We will add support for Mac systems as soon as possible
  • UVPackmaster 2 is a separate add-on from Blender logic viewpoint - you can install it alongside with the first release of the add-on and both should work well
  • only the professional edition of the add-on is available for now, a more affordable edition with limited number of features will come soon
  • UVPackmaster 2 is available in two variants: for Blender 2.79 and Blender 2.80
  • UVPackmaster 2 product also contains the latest release of UVPackmaster PRO 1.91 in two variants (Blender 2.79 and Blender 2.80).

If you bought the first release of the add-on you only have to pay the difference between the UVPackmaster 2 price and the amount you already paid. Contact us at [email protected] and we will send you a discount code.

You can get UVPackmaster 2 at gumroad: https://gumroad.com/l/uvpackmaster2

[EDIT]: editing one of the notes as it could be misleading

(mem) #291

Wow! Version 2.0 is insanely fast! If I hadn’t seen the islands changing, I would have thought it wasn’t working :smile: And that’s before I found the option to run on the gpu.

One thing I noticed is that sometimes, without using heuristics, the first pack tends to cover more area than subsequent ones. That’s both for square and non-square aspect ratios (great idea with the tips button, explaining speed differences between wide versus tall). Once heuristics are enabled, the situation improves, although it depends on the time allocated.

For a quick test regarding this (basically how I did it):

  1. In Blender 2.79, I added a Susan, ran smart uv project with 66 angle limit and 0.10 margin to help avoid any potential overlaps - initial area coverage = 0.304.
  2. In uvp’s options I changed the margin to 0.02 and precision to 800. Left every other setting at default and pressed pack. New coverage = 0.506
  3. Ran a few more packs: first - coverage = 0.56; second - coverage = 0.57; third - coverage = 0.58; fourth - coverage = 0.565; fifth - coverage = 0.57. So pretty much an average of 0.57
  4. Then I changed the rotation step to 15, as I figured this would improve the packing. First run - coverage = 0.54; second = 0.537; third, fourth, fifth, sixth = 0.537 - this seems to be the best solution it can find. One thing to note is that there’s an area at the top part of the uv perimeter that’s never filled, about 2-3 grid divisions from the top. I’m guessing this is due to the method of packing being sort of a physics sym of 2d shapes filling a 2d box and not having enough time to reshake and shrink the box to optimize the space. That’s where heuristics would come in. Just guessing that’s the case, I saw something similar to this in another thread.
  5. Changed rotation step back to 90. First run = 0.559; second = 0.56; third = 0.577; fourth = 0.579; fifth = 0.584. So back to previous results.
  6. Didn’t change any value, enabled heuristic and advanced heuristic. First run, set time to 10 - area = 0.579; second and third run, time set to 30 - area = 0.575.
  7. Changed rotation step to 15, left heuristic and advanced heuristic enabled, and time to 30. First run = 0.581; second = 0.584; third = 0.572. In all cases, the area at the top was now properly covered.
  8. Changed packing device to cuda, left everything else unchanged from previous run. First run = 0.584; second run = 0.589; third = 0.589.

Played with a generated 1024x512 texture and the pattern was pretty similar. The coverage values differed a bit, obviously, but the behavior was consistent with the batch above.

So it looks that leaving the rotation to 90 degrees is pretty efficient, both because it makes texture alignment easier and because it’s speedier. I’d have to run this on different models for something more conclusive, some hard surface stuff, perhaps, but overall, very promising results. I seems that heuristic is needed only when there are some visible errors, like the unoccupied area at the top. Apart from those cases, the default values work quite well and are very fast. This is testament to how much the speed and efficiency has improved from version 1.x. And stability seems to be rock solid.

Thanks and keep up the good work!

(glukoz) #292

Thank you for feedback and support :slight_smile:

First of all, when I follow your scenario (packing a smart unwrapped Suzanne UV map with the parameters you provided) I get much better coverage (more than 0.70) and whole UV unit square is equally filled by the packing (no bigger uncovered area is present). I am not sure why you see a different results. Is it possible for you to send us a blend file containing this specific UV map? What texture dimensions did you use in your original scenario? Maybe you had the ‘Post-Scale Disable’ option enabled? Note that enabling it is not recommended in most cases.

Regarding rotation step: changing this parameter might have different effect on packing result, depending on the UV map. For some UV maps decreasing it doesn’t improve packing outcome (as you observed it is the case for smart unwrapped Suzanne), but for others it will provide a better result, especially when heuristic search option is used at the same time :slight_smile:

(glukoz) #293

Also I would like to clarify a statement from my previous post:

  • by buying the early access version now you will receive access to all releases of UVPackmaster 2 in the future for free

Off-course it doesn’t mean that you must buy UVPackmaster2 specifically now if you want to get all future updates for free, otherwise you will have to pay every update… It is not how our update policy works :slight_smile:

Basically the update policy for UVPackmaster2 will be the same as it was for UVPackmaster1, so if you purchase UVPackmaster2 at any time (not necessarily now), you will receive all future updates for it for free.

(mem) #294

Hi, thanks for your reply. The only thing I forgot to mention is that I subdivided Suzanne once and applied the modifier. I didn’t save the file where I ran the previous test, but I made a new one and I’m attaching it here.

I also captured a video showcasing my test (btw, I’m constantly moving my mouse away from the “Pack” button because unless I move it, the button doesn’t respond to my first click after already pressing it - not a rant, just wanted to explain, in case people get annoyed by it :slight_smile:).
The empty top side is more prevalent with a 0.005 margin (starts happening at 0:47), but you can see it happening at 3:50 with a 0.02 margin as well (once enabling heuristic, it goes away). It seems to be tied to the rotation angle.

suzanne_packmaster2_test.zip (166.6 KB)


(glukoz) #295

Thank you very much for your help, I really appreciate that :slight_smile:

So it turns out that a smart unwrapped UV map of Suzanne with one subdivision level gives different results that Suzanne with no subdivision, indeed :slight_smile: Fortunately using a heuristics for a few seconds allows to get an optimal solution.

(mem) #296

Yeah, I noticed. I was intuitively expecting that the added geometry would make the uvs better for packing, but it seems that’s not the case.
A bit off topic, but interesting - one thing I noticed is that the smart projection algorithm seems to have changed for blender 2.8. The shells look different between 2.79 and 2.80. And it’s not a case of randomness, as the algorithm seems to be very deterministic - running smart project with the same parameters on Suzanne gives the same result every time in each version, the only difference is between Blender versions.

Anyway, thanks again for the addon! With the added functionality in Blender 2.8 of being able to edit multiple objects at once, this is great for creating optimal atlases and optimal packing of uvs in general.

(Frank) #297

Bought the 2.80.0 beta, thanks for the update. :slight_smile:

(glukoz) #298

You welcome :slight_smile: Thank you for your support - it helps us make this software better!

(Frank) #299

This is my favorite addon, Love it. Stoked to use it Blender 2.80.0

(glukoz) #300

It’s time for the first episode of UVPackmaster2 new feature series :wink:

UVPACKMASTER 2.0 NEW FEATURES, EPISODE 1: Refactor of the CPU packing algorithm

In UVPackmaster2 we introduced general improvements of the CPU packing algorithm which resulted of approx. 20% better per-core performance. But the biggest performance boost in the new version comes from the changes made in multi-threading handling.

The most straightforward approch to multithreading in UV packing is to use ‘single orientation’-‘single thread’ scheme. In such implementation a single thread is searching for a place for a single orientation of a UV island. This scheme is used by almost every UV packer out there, it was also used in UVPackmaster1.

Such approach is easy to implement, but it has a major drawback. Imagine you have a 16-core CPU in your system. In order to use 100% processing power of your CPU you have to consider at least 16 orientations for every island (i.e. set ‘Rotation Step’ to a very small value). But for most UV maps processing so many orientations is not necessary - it simply won’t improve the final packing result. Quite often rotation step set to 90 (i.e. 4 orientations for every island) is enough to get an optimal packing. So you decide to decrease the number of orientations from 16 to 4. But with the simple multi-threading approach you won’t get any performance benefits from that - your 16-core CPU will only use 4 cores during packing and the overall packing time will be the same.

That is the reason why we decided to redesign the multi-threading algorithm in UVPackmaster2. It is much more sophisticated now - it uses all cores in your system no matter what packing parameters are.

Off-course a bunch of numbers is worth a thousand words so we did a simple benchmark:

CPU: Ryzen 2700, 8 cores

Rotation step: 90 (4 orientations per island)
Packing result:

Packing time:
UVPackmaster 1.91: 86 ms.
UVPackmaster 2.0: 33 ms.

As you can see UVPackmaster2 is more than 2 times faster than UVPackmaster1 - and it is expected as UVPackmaster1 used 4-cores only out of 8 cores available :slight_smile:

But do not assume that you must have a multi-core CPU in order to benefit from multi-threading redesign. Note that for UV maps containing a huge number of small islands you can even disable rotation completely and still you will get an optimal solution. So even if your CPU has 2 cores only UVPackmaster2 will pack such UV map approx. 2 times faster than UVPackmaster1. See the example:

CPU: i5-2450M, 2 cores

Rotation step disabled
Packing result:

Packing time:
UVPackmaster 1.91: 562 ms.
UVPackmaster 2.0: 209 ms.

As you can see results are as expected.

Now the funny thing: if you look at the very first post in this thread, the post in which I announced the very early release of UVPackmaster1, you will find there exactly the same UV map as the one above. In the post I wrote that it took about 21 seconds for UVPackmaster1 to pack this UV map. UVPackmaster2 only needs 209 ms. to pack it. Both tests done on the same laptop, the same processor: i5-2450M. It shows how much this software evolved during last half of the year :slight_smile:

(MmAaXx) #301

just bought the pro version of the addon but I get this error:
I’m using blender 2.8 today build

Traceback (most recent call last):
File “C:\Users\masspuli\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\uv_packmaster\operator.py”, line 370, in invoke
return self.execute(context)
File “C:\Users\masspuli\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\uv_packmaster\operator.py”, line 256, in execute
self.p_context = PackContext(context, objs)
File “C:\Users\masspuli\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\uv_packmaster\utils.py”, line 125, in init
bm = bmesh.from_edit_mesh(obj.data)
TypeError: expected ‘Mesh’ type found ‘NoneType’ instead

location: :-1

any idea?

(glukoz) #302


You are using version 1.91, right? :slight_smile: Probably one of the objects you selected is not of the mesh type (light, empty, etc). We will release a quick update for version 1.91 which will fix this issue (and a few others) soon :slight_smile:

P.S. Note that this issue is already fixed in UVPackmaster 2.0.

(Michael Knubben) #303

Great news about the speed increases!

I was wondering though:

Does 2.0 have the option to set rotation step to values above 90 (particularly 180)?