alicevision / Meshroom

3D Reconstruction Software
http://alicevision.org
Other
11.04k stars 1.07k forks source link

Automatic retopology node[request] #774

Open strike-digital opened 4 years ago

strike-digital commented 4 years ago

It would be good to have a node for automatic retopology as at the moment if you want good topology on a model you have to export it to an external program and then either bake the texture or import it back into meshroom for texturing.

I would suggest adding a node similar to the MeshDecimate node but that instead generates quad geometry on the mesh, much like the quadriflow remesher for blender or like that generated in the programme instant meshes: https://github.com/wjakob/instant-meshes

natowi commented 4 years ago

Take a look at https://github.com/natowi/meshroom_external_plugins, I started a draft for instant Meshes. Not perfect, but something to experiment with.

strike-digital commented 4 years ago

Wow, that's great! But I've read the installation guide here:https://github.com/natowi/meshroom_external_plugins/blob/master/README.md and I'm afraid it is quite hard to follow for me and I have got stuck on step 4. I have pasted the aliceVision and qtPlugins folders into (what I think) is the correct folder but I cannot find a file named meshroom.bat in the folder or even on my whole machine. Its probably that I have just misunderstood something but thanks for your help anyway!

natowi commented 4 years ago

https://github.com/natowi/meshroom_external_plugins/blob/master/Meshroom.bat

strike-digital commented 4 years ago

Ok, thanks, that was stupid of me. I have copied the plugin files into the meshroom\nodes\aliceVision folder. On the last step, I am a little lost. I have run meshroom.bat and nothing appears to happen on the surface, so I not sure what it means by "new software". Am I missing something obvious again? Thanks.

natowi commented 4 years ago

In this case Instant Meshes

strike-digital commented 4 years ago

ah, great, and how do I run this version of meshroom then? Sorry for all the stupid questions.

natowi commented 4 years ago

Rename the exe to alicevision_InstantMeshes and run the bat file. Note: at the moment only one parameter (smooth) is supported.

strike-digital commented 4 years ago

I must have done something wrong, as all this seems to do is open the command processor for a second and then stop

natowi commented 4 years ago

I will update the code and pre-compile the node so it can be copied in the official binary folder.

strike-digital commented 4 years ago

Thank you very much. Sorry to drive you to this though.

natowi commented 4 years ago

Ok this can be used with the precompiled Meshroom version: Place InstantMeshes.exe in Meshroom-2019.2.0\aliceVision\bin and rename it to alicevision_InstantMeshes.exe Place the precompiled InstantMeshes.pyc in this folder: Meshroom\lib\meshroom\nodes\aliceVision

quadrJPG

Implemented: smooth, crease, rosy, posy

strike-digital commented 4 years ago

That's great,Thanks!

natowi commented 4 years ago

djoerg improved the plugin to work with the Texturing node. Set Smoothing iterations to 0 when using quad mesh.

strike-digital commented 4 years ago

Woah, that's really cool, thanks!

TigerVersusT commented 4 years ago

oh, my teacher gives me the same task!

natowi commented 4 years ago

@TigerVersusT you are welcome to contribute and improve the plugin

fabiencastan commented 4 years ago

@natowi would be great to make a PR to intergrate it when it's ready.

TigerVersusT commented 4 years ago

@TigerVersusT you are welcome to contribute and improve the plugin

Hi,natowi! I'd like to do this, but I got some problem. Before seeing this issue, I have the following design: 1、wrap instant-meshes as a python module( been tested ) 2、import the module in app.py and export to Qt using code "self.engine.rootContext().setContextProperty("_retopology", retopo) " 3、add a button "retopology" after "stop" in main.qml and set "OnClicked" as call to _retopology.someFunction() after clicking the "retopology" button, it seems that the module is not called at all ( and then I tried to change the call to member function of reconstruction added by myself which is used to open and write to a file , still nothing happened). Could you please give me some suggestion about my design, or, if it possible about how to add a new node( sorry, I'm not fully understand of the code )

TigerVersusT commented 4 years ago

@TigerVersusT you are welcome to contribute and improve the plugin

oh, sorry for my last stupid question, I have found out the solution, by adding a thread and using @slot decorator

natowi commented 4 years ago

@TigerVersusT you can take a look at the latest version of the plugin https://github.com/natowi/meshroom_external_plugins/issues/2#issuecomment-595740223 and read the discussion there for details. The remaining problems are finding a way to repair self-intersections and nonmanifold faces.

TigerVersusT commented 4 years ago

@TigerVersusT you can take a look at the latest version of the plugin natowi/meshroom_external_plugins#2 (comment) and read the discussion there for details. The remaining problems are finding a way to repair self-intersections and nonmanifold faces.

I've read it, you are so capable! I'll learn and see whether I can help. And thank you for all your reply.