bnpr / Malt

Render framework for NPR.
https://malt3d.com
Other
952 stars 75 forks source link

Remove dpi arguments of blf.size() calls, which were causing exceptions frequently #537

Closed HEX-23 closed 7 months ago

HEX-23 commented 7 months ago

Blender's Python API got a breaking change: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API I guess you already know that, I saw some changes about it in some previous commits. But there are some other calls in MaltNodeUITools.py which are ignored, and are still causing exceptions.

Malt actually works fine without fixing this, but when I run blender from a terminal (so that I can get more info, like dependency cycle info, when things go wrong), the terminal will be literally flooded with useless exceptions complaining that "blf.size() takes 2 arguments but 3 were given", given that the exception raises from some rendering codes which are executed frequently.

Not sure what's the original intention of using dpi info here, but the texts displayed seem to have coherent and reasonable sizes on both 1920x1080 and 3840x2160 displays, after applying this change.

pragma37 commented 7 months ago

Thank you! I've cherry-picked your commit, since I had to merge it into the Releasea branch first. And I amended it to maintain the dpi usage. 58b77fb