BakeMyScan - Open Source toolbox for asset optimization


(LeighAH) #42

I’ve thought about trying to translate it into a Python Blender add-on, and even started doing so, but the time involved in getting my head around the paper and then actually coding it up is quite substantial. Personally, as much as I’d like to contribute something like that to the community, the time involved is time I’d rather spend honing my modelling skills. The pool of people in the Blender community with the ability, time and will to do so is going to be very small.

The other option is to just compile the existing C++ code on the Github repository and build an add-on around that. But in the interest of fairness you’d need to do it for Windows, Linux and Mac.

(Loïc Norgeot) #43

Hello @LeighAH

I might be wrong, but I think that @Fatesailor was
just surprised that quadriflow was not available as a binary.
I think that I was not clear enough concerning the difficulty of compiling the source code.
And I might also be wrong here, but I don’t think that @Fatesailor was speaking in anyway about calling the c++ libraries functions from python, which would indeed be waaaay harder than just making the command line call.

By the way, I’ll give a link to this thread to the developers of quadriflow, and will try to have a talk with them to get a clear understanding of their “binary release” objectives: are they OK with me encouraging people to distribute those executables?
If they are not, I will make sure to make it clear, especially if they want to make research annoucements soon. They developed something really nice, and the hype around quadriflow seems so huge that I feel they must be the ones credited, not someone with just compiling skills :wink:
I would not want to create a. exe “black market”…

(kkar) #44

Building binaries on Linux is not that hard (checked their dependencies) but it is going to be a challange on WIndows for sure even if the user tries using something like Mingw. Althouhg it might be easy for the users who already compile Blender on Windows. Quadriflow seems to depend couple extra libs like Boost.

(eppo) #45


I wanted to say thanks for sharing this very exciting project of yours. Certainly will make being in Blender more comfortable.

PM-ed you concerning some technicalities and while being on the saw the last part concerning Sketchfab, FF and the rest.
Blender seems to have all the necessary python to do some work:

import shutil
import requests

my_url = ''
response = requests.get(my_url, stream=True)
with open('my_image.svg', 'wb') as file:
    shutil.copyfileobj(response.raw, file)
del response

which would put sample image next to the blender.exe itself (if one has a write access there). I believe any type of file can be saved like this.

All the best!

(Loïc Norgeot) #46

Edit: misundertanding… I actually messed up that answer. The scripts I implemented in the past allowed to download models from a collection by virtually clicking the correct buttons, which is very different than images for which yuo can have a direct link. But I will remove this from my code as this is a dirty-hack, and the Sketchfab Download API is there to help. When I first added them, I asked them if they were ok with me uploading those “dirty” scripts however, and they were fine with it. So no “I’m removing because complaints” involved here

Hi eppo!

Thank you very very much for your support!

Sharing is caring, and nothing can make me more happy at the time being than the kind of feedbacks guys like you are providing me.

Blender and python absolutely have all the tools to make things happen.
I am taking a little bit of distance right now to make my plans clear, and have voluntarily stayed away from the code.
The main idea being to define my main ideas, and to find a way to share them in a consistent way. I have around 100 of them, which can be implemented really fast, and which I think could keep on providing awesome value :wink: !

As you seem to be familiar with programming/compiling, you might have had a look in the source code: it is messy, it is hacky, but this is what I am good for and that allows me to be really confident about the future: I can implement new stuff fast, and that peculiar topic of get requests / interfacing web services / API / … is also lots of fun. And that’s the spirit I am in. Keep having fun :slight_smile:

So yeah, thank you for your ideas, and do not worry, I am keeping them warm somewhere !

(Pragma37) #47

I’m not sure if you have managed to compile quadriflow on windows. But in case you haven’t here it is.

quadriflow.exe (499.5 KB)
tbb.dll (184 KB)

The dll and the exe need to be on the same folder to work.

New quad auto-retopology algorithm
How to improve the mesh of an object?
(Loïc Norgeot) #48

Edit 2: Jingwei Huang just answered me. In short, he is more than happy with the initiative. So I can give you my “unconditionnal” thank you @pragma37 :smiley:
Edit 1: I just contacted the maintainers of Quadriflow, to let him know that the .exe are available here. Hope they will enjoy the project!

I am sure you will make a lot of users happy as hell @pragma37, thank you for providing the links!

I still haven’t been had feedbacks from Quadriflow developers, so I’ll update them right now on the fact that the executables are available here to get their thought.

One of my long-term goals is indeed to provide blender users free access to this kind of awesome academic tools, but I would feel way more comfortable if I could also have their “okay” for it.

By the way, do not hesitate to credit the software authors to make their work well-known (therefore improving their chances of creating other cool software under an Open Source license): they are called Jingwei Huang and Yichao Zhou, and you’ll find references at the bottom of the github README.

On a less “disclaimer” note, thank you x1000, that is very nice from you to contribute to the project that way! I’ll remember that :wink:

(bkjernisted) #49

Do you put the dll in the main quadriflow folder after you run the exe? Pragma 37 can you provide a screenshot of your folder setup? Thanks

(kkar) #50

Good job thanks

(kkar) #51


FR: It would be so nice if the path setting for the executables are saved with the addon.

Try this

Enable addon save your paths, use them with some meshes. Close Blender, reopen the paths are gone.

Enable addon, add the paths again. Save your user settings. Restart Blender, do some mesh edits. Open Addon settings, disable the addon. Restart Blender, the path settings are gone again.


(AFWS) #52

How did you manage to build for windows? I tried several times ,but got a error towards beginning.

(spiraloid) #53

This is awesome. I have something similiar in 3Dcoat for making one-click assets from dense meshes with vertex color. I ususally create them with zbrush, oculus medium, masterpiece VR or 3Dcoat and use my own automesher that decimates, unwraps and bakes the vertex color, tangent normals, curvature, cavitry, AO and height textures all at once. my one-click results looks like this (note the spike tips):

Any chance you’ll be adding support for similiar?

(dm me bay at spiraloid net and I’ll share a test mesh if you like)

(kkar) #54

Great work.

Also it would be nice to have support for point cloud remeshing from Meshlab, like poisson and marching cubes. I looked at the code, I think I can add this myself unless you want to keep all in your hands.

(Loïc Norgeot) #55

Awesome job, your models are really impressive!

I’ll contact you privately, but still reply here in order to let other know:

If your question is to ask for a “one-click”, then it is a mitigated yes. I plan to add such a magic button, but the idea with BakeMyScan is to let the choice to the user to use different tools depending on the situation, so under that “one-click” method, there will still be a lot of customization available. But the default should work for every case, and the UI will be intuitive. I have got all that planned for the next minor release actually :wink:

If your question concerns the support for vertex color, then it is a yes also. The material code I have set up already adds them, only it does not allow to transfer them for the simple reason that I did not have the use of it yet. I will also add this “basic” feature to the next minor release.

Now the two ideas above are really easy and quick to setup. For the curvature, I have no idea. But if this seems important, then yes, I’ll take that into account. Just at a lower priority…

I’ll get in touch with you!

(Loïc Norgeot) #56

Edit: concerning preferences

Hey @kkar

Adding such features is also quite easy as you have seen, however I won’t do it until a few weeks. Mainly for the reason that I did not work with point clouds in Blender yet, and need to try it.

Posson / marching cubes / Pivot ball … are amongst the features I will include in the code for sure, as they have a direct use for many people. At this point though, the integration of the scanning tools is not prepared, and there will be a little bit of delay before I start working on them.

Moreover, and you are right to ask, I won’t take in external code contributions until a little bit later. For pull requests, that will be 1-3 months I think. For suggestions like yours, which can be easily integrated, something like two weeks maybe three? I still have to create all the adequate code structures to make it really modular, and I will probably refactor everything just before opening it up. I can’t start doing that now, where would be the fun in it? :wink:

I will open the code, as the whole idea behind the project would not make sense otherwise, but I need to set up all the system around it, and talk with a lot of people in order to make sure that I manage to keep that project useful, relevant, “state-of-the-art”, innovative… and don’t just recreate Meshlab in blender by interfacing every script (and if you have looked at the code, I also need to implement better ways)

And concerning preferences, the first behaviour is normal behaviour to me, as you did not save the settings, well, settings won’t be saved!
The second one however is one I already planned to fix. Not for people disabling the addon, but for updates, which force users to reselect the paths…


(spiraloid) #57

Here’s my version of a similiar concept that I built in 3DCoat for making the assets for my 3D Graphic Novel “Nanite Fulcrum”. This is the way of the future for sure.

here’s a model I made tonight with it using oculus medium in VR. (started as a 30 million poly mesh with vertex color)

(Loïc Norgeot) #58

That work is truly nice looking bay! I’ve contacted you by DM by the way, let’s add to my previous message that I’d indeed like to try my method on a model of yours if you accept me sharing depending on the results I get.

I just won’t be able to do it soon, and I can’t tell you that I’ll even do it at all. But if I did my job correctly, I should get similar results quite fast, or at least know what I’ll have to adjust to achieve them :wink:

30 million polygons will be a bit too much for my middle-range computer though, and I don’t really know how the different software will react. That could be an interesting “hard test” indeed !

(Pragma37) #59

Just make sure both files are on the same folder, before you try to run the exe.

I did it some time ago, so I don’t rememeber the details. Setting up the dependecies took me most of the time. Then once cmake was happy I had to remove some compiler flags that msvc didn’t recognize and if I remember correctly there was some dumb code errors I had to fix to make it compile.

(kkar) #60

Just curious, which scripting did you use to achieve your solution in 3DCoat? Being a ZBrush user, not so happy about Zscript. I wonder if 3DCoat is more script friendly?

(uruburei) #61

Pragma 37 - I put both files in the master quadriflow folder Capturar1

. However when exect the .exe this error occurs.