Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to project textures after re-topology? #236

Closed
Karl1206 opened this issue Sep 5, 2018 · 15 comments · Fixed by alicevision/AliceVision#520
Closed

Not possible to project textures after re-topology? #236

Karl1206 opened this issue Sep 5, 2018 · 15 comments · Fixed by alicevision/AliceVision#520
Labels

Comments

@Karl1206
Copy link

Karl1206 commented Sep 5, 2018

After the mesh filtering stage, I stopped the process to UV unwrap the mesh myself instead of it being done automatically. To do that though I didn't want to work with 1.3 million tris so I reduced the mesh quite a bit as I didn't need that much detail in the base mesh but I still wanted to bake it on a normal map after. After I reduced my poly count and unwrapped my mesh it is failing on the texture stage. What would the best workflow be if it isn't possible to reduce the mesh before texturing but you still want to use your own UV's

@yann-lty
Copy link
Member

yann-lty commented Sep 6, 2018

It is possible to reproject textures after re-topology and custom unwrap. The only constraint is to NOT modify scale/orientation of the model, in order to stay in the same 3D space as the original reconstruction.
To retexture a user mesh, your need to remove the connection arriving on Texturing node's inputMesh (right click connection > Remove) and write the path to your mesh in the attribute editor. If you have custom UVs, they will be taken into account. (optional) You can also set Padding to 0 and check Fill Holes instead if you want to completely fill texture's blank space with plausible values.
You can also duplicate the original Texturing node (right click > Duplicate) and make changes on this copy.
It should look like this:
image
If this is what you already tried, could you paste the log of the Texturing node that failed?

@Karl1206
Copy link
Author

Karl1206 commented Sep 6, 2018

Thanks for the answer Yann, I tried what you showed but have the same issue, Heres a screenshot of my node setup and a copy paste of the log for my texturing node.
image

Program called with the following parameters:

  • angleHardThreshold = 90
  • bestScoreThreshold = 0
  • downscale = Unknown Type "unsigned int"
  • fillHoles = 1
  • flipNormals = 0
  • forceVisibleByAllVertices = 0
  • ini = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/PrepareDenseScene/324987b4f2a99b079107a9b9e5a37cbea6385133/mvs.ini"
  • inputDenseReconstruction = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/Meshing/c9270fabc50f5661a50508d86398bd25b3ce5962/denseReconstruction.bin"
  • inputMesh = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshRetopo.obj"
  • maxNbImagesForFusion = 3
  • output = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/Texturing/8ebea764ca4d3a18987ef76506fc77760d150148"
  • outputTextureFileType = "png"
  • padding = Unknown Type "unsigned int"
  • textureSide = Unknown Type "unsigned int"
  • unwrapMethod = "Basic"
  • verboseLevel = "info"
  • visibilityRemappingMethod = "PullPush"

[11:45:18.129262][info] Found 1 image dimension(s):
[11:45:18.129262][info] - [3984x2988]
[11:45:18.153246][info] Overall maximum dimension: [3984x2988]
[11:45:18.419058][info] Loading mesh from obj file: C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshRetopo.obj
[11:45:18.429050][info] - # vertices: 2386
- # normals: 4726
- # uv coordinates: 2573
- # triangles: 0
[11:45:18.459029][info] Mesh loaded:
- #points: 2386
- # triangles: 0

I did the mesh retopo in Blender and exported as a Wavefront .obj but it seems Meshroom can't see the TRIS? I tried to import the model back into Blender and it looked fine.

@yann-lty
Copy link
Member

yann-lty commented Sep 6, 2018

Indeed, the mesh is not loaded properly. Could you share your obj file so we can debug this?

@Karl1206
Copy link
Author

Karl1206 commented Sep 6, 2018

@Karl1206
Copy link
Author

Karl1206 commented Sep 6, 2018

Have you had a chance to have a look? I'm kinda stuck haha.

@cubedparadox
Copy link

I'm also having this issue, with the same error in the logs when I provide my own mesh (no triangles loaded).

@Hazzy155 Hazzy155 mentioned this issue Oct 17, 2018
@R0adRunn3r
Copy link

Thanks for the answer Yann, I tried what you showed but have the same issue, Heres a screenshot of my node setup and a copy paste of the log for my texturing node.
image

Program called with the following parameters:

  • angleHardThreshold = 90
  • bestScoreThreshold = 0
  • downscale = Unknown Type "unsigned int"
  • fillHoles = 1
  • flipNormals = 0
  • forceVisibleByAllVertices = 0
  • ini = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/PrepareDenseScene/324987b4f2a99b079107a9b9e5a37cbea6385133/mvs.ini"
  • inputDenseReconstruction = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/Meshing/c9270fabc50f5661a50508d86398bd25b3ce5962/denseReconstruction.bin"
  • inputMesh = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshRetopo.obj"
  • maxNbImagesForFusion = 3
  • output = "C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshroomCache/Texturing/8ebea764ca4d3a18987ef76506fc77760d150148"
  • outputTextureFileType = "png"
  • padding = Unknown Type "unsigned int"
  • textureSide = Unknown Type "unsigned int"
  • unwrapMethod = "Basic"
  • verboseLevel = "info"
  • visibilityRemappingMethod = "PullPush"

[11:45:18.129262][info] Found 1 image dimension(s):
[11:45:18.129262][info] - [3984x2988]
[11:45:18.153246][info] Overall maximum dimension: [3984x2988]
[11:45:18.419058][info] Loading mesh from obj file: C:/Users/Karl/Desktop/Photogrammetry Test/Rock 1/MeshRetopo.obj
[11:45:18.429050][info] - # vertices: 2386

  • normals: 4726

  • uv coordinates: 2573

  • triangles: 0

[11:45:18.459029][info] Mesh loaded:

  • #points: 2386
  • triangles: 0

I did the mesh retopo in Blender and exported as a Wavefront .obj but it seems Meshroom can't see the TRIS? I tried to import the model back into Blender and it looked fine.

same problem here :( any solutions?

@yann-lty
Copy link
Member

Sorry for the delay; there was a bug in the OBJ loading code that prevented meshes with normals to be correctly loaded. This will be fixed in the next release. In the meantime, could you retry this with a version of your mesh without normals?

@alanboucek
Copy link

I've run into this problem as well- glad I checked this before opening another ticket

when you are able to do an update, can you document any limitations to the kinds of .obj files which can be handled? I'm processing meshes with InstantMeshes, then either Houdini or Maya.

@AravindChandradoss
Copy link

Quick question!
Was this issue fixed? I got the same error today.
I generated the mesh from LIDAR data and converted the mesh to obj. I also manually fixed the origin, scale, and orientation of the generated mesh (as same that of mesh in MeshroomCache .obj file using blender). but, I got the following error.

Program called with the following parameters:
 * angleHardThreshold = 90
 * bestScoreThreshold = 0
 * downscale =  Unknown Type "j"
 * fillHoles = 1
 * flipNormals = 0
 * forceVisibleByAllVertices = 0
 * imagesFolder = "/home/autoware/Downloads/Meshroom-2019.1.0/MeshroomCache/PrepareDenseScene/8bea58339cd5b2f363c533ed36a42f23caf8c8c1"
 * input = "/home/autoware/Downloads/Meshroom-2019.1.0/MeshroomCache/StructureFromMotion/00cfea07b358278afa8e85bc2b44fb2e0bc4f64c/sfm.abc"
 * inputDenseReconstruction = "/home/autoware/Downloads/Meshroom-2019.1.0/MeshroomCache/Meshing/8f24201005e359bb7b0d56eee1539a4536b58af0/denseReconstruction.bin"
 * inputMesh = "/home/autoware/Aravind/MeshLabProject/COSI_Origin.obj"
 * maxNbImagesForFusion = 3
 * output = "/home/autoware/Downloads/Meshroom-2019.1.0/MeshroomCache/Texturing/2c4d1972320ef5093baed158497df45a48426899"
 * outputTextureFileType = "png"
 * padding =  Unknown Type "j"
 * textureSide =  Unknown Type "j"
 * unwrapMethod = "Basic"
 * verboseLevel = "info"
 * visibilityRemappingMethod = "PullPush"

[12:41:32.579021][info] Found 1 image dimension(s): 
[12:41:32.579146][info] 	- [3840x2160]
[12:41:33.058535][info] Overall maximum dimension: [3840x2160]
[12:41:34.079976][info] Loading mesh from obj file: /home/autoware/Aravind/MeshLabProject/COSI_Origin.obj
[12:41:34.406892][info] 	- # vertices: 649082
	- # normals: 641459
	- # uv coordinates: 0
	- # triangles: 0
[12:41:36.180190][info] Mesh loaded: 
	- #points: 649082
	- # triangles: 0
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unable to load: /home/autoware/Aravind/MeshLabProject/COSI_Origin.obj
Aborted (core dumped)
``
   
Any workaround to fix this issue?  

Thanks! 

@fabiencastan
Copy link
Member

Could you share the header of your OBJ (or the full OBJ)?

@AravindChandradoss
Copy link

AravindChandradoss commented Jun 17, 2019

@fabiencastan

Mesh from LIDAR
MeshroomCache
I am trying to replace the mesh and use SfM to add texture.

This LIDAR mesh is a down-sampled one, once I get the expected results I will repeat the same with more accurate LIDAR map.

Thanks!

@AravindChandradoss
Copy link

Tried without normals and the results were as expected. :)

@nsitu
Copy link

nsitu commented Aug 23, 2020

This thread was useful to me to understand the process of reworking a 3D scan. For the record, in August 2020 I still had to uncheck "Write Normals" in the Export Settings when resaving a modified OBJ from Blender.

@bicukow
Copy link

bicukow commented Feb 11, 2023

I found the solution, that works for me: after exporting mesh from blender with custom unwrapped UVs you need just to "re-export" it from from another program to fix texturing process problems in Meshroom..
The fastest way to do it using MeshLab: (this program is acctually for cleaning 3d scans, so it should be used in your workflow)

  1. Just open your exported .obj in MeshLab (it takes like 1 sec)
  2. Press Ctrl+E to export it (also takes like 1 sec)
  3. Hit "OK" (with UV coordinates obviously)
  4. Processing the texturing in Meshroom should be done without any problems or errors

It looks like blender is exporting mesh to .OBJ with some problems with UV, but it can be fixed by another software...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants