BakeMyScan - Open Source toolbox for asset optimization

texturing
add-ons
modeling

(Loïc Norgeot) #1

BakeMyScan is a 100% free, opensource, and powerful blender addon to optimize your models for Photogrammetry, 3D scanning, Sculpting, Game Engines, WebGL, VR, AR…

UPDATE (2018/11/14):

  • To keep things organized I started a “development log”, where I’ll share my thoughts and explain where I’m at with the project. You can visit it at bakemyscan.org/blog.
  • Thanks to @pragma37, we now have .exe files for Quadriflow here!
  • If you wish to support my “ideal”, you can buy the addon for 20$ on blendermarket.com, where 100% of my earnings are donated to the Blender Development Fund. This will help the development of Blender, and I’ll get a huge motivation boost by knowing that !

INTRODUCTION

Hello everyone :slight_smile: (and please forgive my verbosity, but I think it’s worth it!)

I am Loïc, a 27years old French blender/programming/sketchfab/python/surfing… enthusiast, and started developing 3D scan reprocessing scripts a few months back as a hobby while messing around on Sketchfab (visit my profile for lots of CC-attribution lowpoly assets!).

And as I have been enjoying free content and open-source software for quite a while now, I felt like time had come to give back to the community -> BakeMyScan!

A little “disclaimer” before getting started: It’s my first time releasing a code that will probably get lots of attention, and I am still setting up and learning the online “ecosystem” (Youtube channel, website, features roadmap, release scheme…) for BakeMyScan, so you might want to stay tuned in the next few days/weeks for video tutorials, “made with” examples, code fixes… And as I develop BakeMyScan as a hobby and - mainly - at night, I hope you’ll forgive me if I sometimes take time to reply and upload new stuff! But try the addon, and I’m sure sure you will forgive me :wink:

VIDEO

The presentation is far from optimal, but here is a quick and dirty video demo of the remeshing and baking features of BakeMyScan, made on an i7/16GB RAM/gtx1060 computer (a good one, but definitely not a beast!).

  • 42k triangles remeshed into 1500 with the “iterative” method 'one of the slowest provided!) in 2.7s
  • 4096px PBR textures baked into 512px textures in 4.8s.

DOWNLOAD

Just click the big red button on bakemyscan.org, or download the file BakeMyScan.zip from the latest release on github.

Then follow the instructions on this page to download and setup the external software.

Now, if you enjoyed BakeMyScan and can afford it, you could buy the addon for 20$ on blendermarket, where 100% of my earnings are redirected directly towards the Blender Development Fund. That is the best way to support my project, by letting me know I can help the community as well as the ones who put on the real work!

MAJOR FEATURES

  • Quadrilaterals remeshing:
    • UI interface for Instant Meshes (through command-line or graphical)
    • UI interface for Quadriflow (through command-line)
    • Custom method for quick internal quadrilateral retopology
  • Triangular remeshing:
    • UI interface for Meshlab’s Quadric Edge Collapse Decimation (through meshlabserver)
    • UI interface for MMGtools (classic or with weight-painted metrics)
    • Custom “iterative” method (Plenty of modifiers in sequence, but keeps lots of details)
    • Custom basic “Decimate” by specifying a number of faces instead of a ratio (more convenient!)
  • PBR workflow:
    • Load PBR materials from a local directory of texture sets such as found on Textures.com, freepbr.com
    • Painlessly mix PBR materials in the node editor by importing them as nodes
    • Easy PBR material setup from scratch
  • Bake your textures, and bake them FAST
    • Once materials are correctly setup, you’ll have “One button to bake them all”
    • Currently supports albedo, roughness, glossiness, emission, opacity, ambient occlusion
    • Also supports mixing and baking of geometric normals AND normal maps, all at once!
    • This model was remeshed in 2.8s and baked in 4.7s (42k tris & 4096px -> 1.5k triangles and 512px)
  • Batch process models from the command line thanks to python scripts calling BakeMyScan’s operators

MINOR FEATURES

  • unified importing options
  • pre-processing steps (remove sharps, clean normals, center object…) grouped together
  • quick unwrap button
  • HDRI previews (experimental)
  • Automatic export to nicely named model + textures
  • 6-axis aligned orthographic views…

ROADMAP

I’m still defining the roadmap for my future developments, and the ones below are just examples of what I’d like to aim for (and seriously think about implementing):

  • PBR materials thumbnails
  • Support for Eevee, Blender 2.8, and .gltf format (interfacing Sketchfab at the same time )
  • Directly preview and download HDRIs from HDRIhaven.com
  • UI interfaces with opensource photogrammetry software such as Colmap and OpenMVS
  • Create online libraries of library assets, browsable through a blend4web application (been there, done that), and allow direct import into blender.
  • Create a way for other people to manage such collaborative libraries of assets
    them in interface to online user-created libraries of lowpoly assets browsable through a Blend4Web application…

DEVELOPMENT

BakeMyScan is still “rough on the edges”, but I’m trying to get really serious about it, and much will come in the next weeks / months!

The code is hosted on github and licensed under GNU GPLP v3. It is also interfaced with Travis-CI to get automated tests on commits. At the moment, I did not create any code-documentation (I am better at hacking than software engineering!), but this could come.

I’ve decided to extensively rely on the “release” functionnality of github to frequently publish patches and upgrades ( latest version on this page ) and am disciplining myself to benefit from the github issues.

I’m also developing the main website for BakeMyScan ( bakemyscan.org ) from scratch, so bear with me for the design and feel as I am heavily experimenting at the moment!! I’ll probably make the sources available soon too!

And I’ll need your feedback, comments and github issues to first make BakeMyScan stupid-stable and optimized, and then keep on improving it!

STAY TUNED

EXAMPLE MODELS


Reprocessed from an original scan by Rigsters.


A collection of lowpoly skulls (1500 triangles each), reprocessed from the collection of UVic Libraries.


One of my first scans attempt: An old cavalry lead toy.


I mean… It’s a stick. Scanned with Colmap and OpenMVS.


Here is (approximately) what the provided remeshing options look like! The original model, Discobolus, is from SMK


That’s the original model (42k triangles and 4096px textures) used in the video, from scanboxyz


… and that is the reprocessed (a bit too much: 1500 triangles and 512px textures) version!


Auto-retopology tools compared
DynRemesh 2.0 -Quad-based remeshing/auto-retopology
(kkar) #2

Hey

Thanks for the release, this is definetely a great addition to Blender’s tool arsenal.

I have been testing the included features and one thing I am wondering is that do you have any plans for taking symmetry into consideration with the quad remesher? I realize this is a scan/printing heavy addon, but still meshes with proper symmetry will always be easier to handle than those without.

thanks


(tin2tin) #3

Great work Loïc, thank you for investing your time in this great gift for the community!


(Loïc Norgeot) #4

@tin2tin Thanks dude! And as I told you already, thanks for your previous feedback, you’re part of the reason I hope this will happen :wink:

@kkar Honestly, I had 0 plans until now. But given that you are totally right, I will probably start thinking about it!
If by “the quad remesher” you are refering to the internal “Dirty quads” one, then I might try to think about a hack by the end of the remeshing process such as a sequence of Cut in Half + Find verts on the cutting plane + Smooth them on the symetry plane + apply mirror back.
So it was not a plan, but might happen if I find a correct hacky solution!
I opened an issue on github for it: https://github.com/norgeotloic/BakeMyScan/issues/62


([email protected]) #5

I know you can take code from DynRemesh, rearrange & make it free because of the license , but that’s just not cool, especially without permission from the author… I never really understand why many think it’s ok.


(Alberto Gonzalez(afx)) #6

No worries… I hope it helps anyone out. It’s a great toolset for game dev. Good job :slightly_smiling_face:


(Loïc Norgeot) #7

Hi illumin, and thanks for your feedback.

I understand your concern about me ripping someone’s else code and innovative algorithms, but I did not.

It can probably seem like I ripped code from DynRemesh as BakeMyScan provides the same basic kind of remeshing method, but I can assure you that it was most definitely not. I did not, ever, have a look at DynRemesh source code.

It definitely got “inspired” by the DynRemesh video though, and people in the thread mentionned a “three steps trick”, which I tried to implement, and actually managed to have working fine. Some people called it a “classic” trick, and it seemed that the method is globally well known.

Concerning giving credit: based on your assumption that I’m trying to benefit from the GPL licensing scheme, I am not. So to me, this is not a good enough reason to give credit.

You can check the source code as you wish, and if you want, you and everyone else could actually tell me some of your cool sequence of modifiers and operations to remesh objects, and I’m pretty confident that I could try to create shortcuts to most of them in a 30 minute time window…

A concern was raised above about symetry: I thought about a succession of sequences while waking up, and if I manage to implement them correctly, I’ll be able to release it really soon. I don’t know if DynRemesh has a support for symetry but if it does, should I forbid myself to try to implement it based on @kkar suggestion and a honest try from me?

Also, I’ve read somewhere that they wanted to “implement” Quadriflow’s algorithm and hired someone to do so. F**k, I’ve interfaced it also… If they actually “integrate” Quadriflow into blender, that would be really awesome and they’ll have a buy from me. But I’m pretty sure this is a really difficult task… An addon on the blendermarket actually seems to implement a really-integrated system, and it sure looks like a great addon!

On this matter, and in the same source file, I’ve implemented a base class to easily add a command line interface to any standalone tool. Check it if you are curious, it’s the new useful “BaseRemesher” class (not in 1.0.1 but on this file in the repo https://github.com/norgeotloic/BakeMyScan/blob/master/src/op_REMESHERS.py).

Should I give credit to Cycles PBR Bakery because I implemented a system which aims to do the same thing? I think not.

So yeah, I did not rip any code from anyone on DynRemesh matter, just did my two cents of playing around…

Sorry if the text below sounds pretentious or assuming too many stuff, but I can assure you that my process is totally honest, and I won’t go publish bad reviews on DynRemesh or spam its thread just because I implemented something similar for free and in a short amount of time.

Any feedback or comments on similar issues are more than welcome, as this is definitely a tricky subject when releasing something for free… Also, any tricks for other cool methods (sequences of operations) will be welcomed, and I’ll consider integrating them in the addon if I manage to do so (You could even create pull request to add you own, but I’d have to be sure that its an original work too)!

“Thank you” for your comment still, although it makes me a little bit uncomfortable :neutral_face:


(Thenewone) #8

what code? it just puts the meshes thru the already included tools inside of Blender.
there is nothing new included inside of the 100 lines of code which Albertofox has combined there.


(Loïc Norgeot) #9

Sorry @Albertofx for not including you in the previous reply (I tried to keep my discourse consistent), and maybe being a little bit too harsh about your work…

Except if you try to refactor or resell some of my code - in which case I’ll definitely “spam” threads to let people know that free alternatives are available - I won’t give you bad publicity anywhere or try to be advertise BakeMyScan as the “DynRemesh” killer, and I can promise you that I definitely did not steal code from you for that matter.

Sorry if this might undercut your plan though… But definitely, there is no code-ripping, bad feelings or dishonest backward engineering involved. That’s just the magic of releasing open-source addons… But you probably know the deal!

I still hope you’ll manage to provide great features and keep on improving your product to be able to have a really original one!!


DynRemesh 2.0 -Quad-based remeshing/auto-retopology
(Loïc Norgeot) #10

I am also replying to you in the same bunch, tfor the purpose of making myself a defender of @Albertofx work here. He implemented something which seems to be really useful and popular for many. Isn’t that great by itself?

There is definitely some code involved, although it looks like DynRemesh one is just a really simple one (once again, assuming from reactions from other people, not from having seen it myself!).

The “iterative” method I provide for instance works really fine, but it is just a sequence of blender operators too! Is it not some code?

I repeat, if anyone has any cool sequence of operators in mind (or links to external tutorials), I’d love to try to implement some of them into BakeMyScan. Any cool trick related to remeshing/retopology really!

That’s the good side of opensource :slight_smile:


(Alberto Gonzalez(afx)) #11

No worries!

Many tools use existing code within Blender & that’s across many of the add-ons sold on Blender Market. They all start with “import bpy”, that doesn’t mean anyone got ripped off :grinning:

Anyway, Keep up the good work :+1:


(Alberto Gonzalez(afx)) #12

Btw, do you know the necessary steps to get quadriflow working on a Windows OS? I can’t seem to build with cmake.


(Spirou4D) #13

Bonjour Loïc, tu es français je suppose? Si oui je te félicite dans notre langue: ton travail est époustouflant et bluffant, super utile pour Sketchfab! Chapeau bas Maestro. Je code et je mesure la quantité de travail d’un tel addon! A+


(Loïc Norgeot) #14

Just to let you know I’ve made some tests at lunch, It will definitely work in a “simple” version :slight_smile:

I’ll try to integrate this feature and try to make a 1.0.2 release with changes tonight if I have time!


(Loïc Norgeot) #15

Hi again!

Sadly, nope :frowning:, I tried to compile it too but failed miserably on Windows as I’m not really familiar with this OS for “advanced” compiling (I’m more of a linux guy).

However, I know that a guy has released some builds on his gumroad for 10$, but that will be up to you to look for the thread, I wont incite people to spend that on opensource binary files, given the fact that according to this issue, the developers of Quadriflow plan on releasing builds soon… Smash those +1 !

If anyone has skills to compile and links to the builds however, I’m sure you would make lots of people happy by sharing them !


(Loïc Norgeot) #16

Hello Spirou4D!

Bien vu :wink: Ca se ressent tant que ça dans mon “accent” numérique ? :smile:

Merci pour tes encouragements, et n’hésite pas à suivre régulièrement les news, je vais non seulement ajouter des fonctions, mais il est pas impossible - dépendant de la popularité du projet - que je mette aussi en place un addon destiné à regrouper le plus de petits (ou plus gros) “shortcuts” faciles à implémenter pour nous autres python addicts, mais qui demandent un traitement manuel super long sinon…

Pourquoi pas en intégrant au max les pull requests, tests unitaires, et avec des guidelines ultra claires sur comment rajouter de nouveaux scripts. Je viens de songer à ça, ça existe peut être déjà, mais si ce n’est pas le cas, il y aura surement de quoi faire à ce niveau ci: un max de scripts catégorisés dans une énorme boite à outils, gratuite et opensource… A voir :wink: !

Merci en tout cas pour tes encouragements!


(Tosky) #17

Win7 64 user here, I’v tried BakeMyScan a little but it produce errors and no mesh result when remeshing with MMGS or MeshLab (quadriflow dont work as already confirmed, while InstantMeshes works fine). On a Blender 2.79 official build, the .exe paths should be ok I guess?


(Loïc Norgeot) #18

Hi Tosky, and thanks for your feedback!

What seems obvious is that your paths are relative paths: they do not start by C:\Users… but with //.\.\…

I’m pretty sure this is the root of your problem.

Could you confirm me that this can be fixed by unchecking the checkbox “Relative Path”, located under the “Accept” panel in the left side of the file selector when you select an executable?

All your paths should then start with C:\, meaning they will be absolute ones, and I think solving the issue you face.

If this fixes your issue, I’ll force a conversion to absolute paths in the addon, and add this modification to the next minor release (probably tonight).
Otherwise, I’ll create an issue on github and try working on this!


(Tosky) #19

It worked!
So yep, unckecking the “relative path” was the solution. :slight_smile:


(kkar) #20

What is your evidence for accusing of this person with plagiarism?