Developer postOriginal post (opens in a new tab)

Bug Fix Release: Handle materials with slightly different colors but same HTML name

Bug Fix Release: Handle materials with slightly different colors but same HTML name

There was a bug in MMVR's automatic material naming code. Internally (and in the generated MTL file) we name materials based on the HTML color value. For example, if you edit a MTL file with a text editor, you'll see something like this:


newmtl Material_#E600FF00
Ka 1 1 1
Kd 0.9019608 0 1
Ks 0.5 0.5 0.5
Tf 1 1 1
Ke 0 0 0
Ns 96.07843
Ni 1
d 1
illum 2

In the above example, "Material_#E600FF00" is the material name. "#E600FF00" is the HTML color value in this case. We were running into issues where materials with slightly different colors would have the same HTML color value. For example:


Kd 0.9019608 0 1

and


Kd 0.9019607 0 1

both generate the same HTML color value #E600FF00.

In order to make MMVR more robust, this second color value will now generate a numerically ascending material name: "Material_#E600FF00_2"

We also fixed an issue with the alignment tool delete button a few days ago and rolled a release to fix the issue but didn't post an announcement. Consider this the announcement for that fix.