2

I will be generating a mesh outside of Meshlab, but viewing it in Meshlab. I haven't decided on a format yet. I want to have a single file that would contain all the data - the triangles, uv maps and the textures.

However, I have 2 textures between which I want to switch. They should not be visible at the same time. Imagine I want to show the mesh with some flame texture in one moment, but with a flower texture in another - the user should be able to switch between them. I tried searching for something similar, but all I find are questions on how to combine multiple textures into a single visible one, which is not what I want. There is a way to switch the texture file via Filters->Texture->Set Texture, but I'd like something less cumbersome.

Is there some way in Meshlab to easily switch between textures/UV maps? If yes, for what formats is this supported?

M.K.
  • 346
  • 3
  • 14
  • Why is `Set Texture` cumbersome? What did you expect in exchange of current `Set Texture`? – Rockcat Nov 27 '19 at 13:55
  • The mesh is going to be viewed by people who are not very technical and I need this to be a simple button or shortcut, not 3 levels deep in a menu and then requiring you to fill out some fields. There isn't even a file dialogue and you have to set the size manually...it's not very user friendly. I could even have them use a different program than Meshlab, but I haven't found anything comparable yet. – M.K. Nov 27 '19 at 15:14
  • Do you plain to use meshlab just as a viewer? What other Meshlab capabilities are you planing to use? Maybe a supersimple viewer using [libIGL](https://libigl.github.io/) is enough for you – Rockcat Nov 27 '19 at 15:30
  • Yeah, writing my own viewer is another option, but I was hoping to use some standard tool if possible, and everybody around here already knows Meshlab a little. I don't really have much time to write a custom one, make it work on both Linux and Windows, and also distribute it among users... – M.K. Nov 27 '19 at 15:39

1 Answers1

1

It is sad to say... but current meshlab does support loading files with several textures (for example .ply and .obj), but AFAIK it does not let the user choose the texture/material to apply in each moment. It should be very easy to write a custom plugin to rotate between textures, but it is not done.

One easy alternative you can use and teach for your users is this:

  • In your external program, create two separate files, each one with one texture. (called texture1.ply and texture2.ply in this example)
  • Open both files with meshlab using command line "meshlab texture1.ply texture2.ply". You can see an strange combination of both meshes by now, because both meshes are being rendered.

Both meshes active

  • Tell your users that they can change current view with Ctrl-Click in the eye icon near of the name of each mesh. This will activate one mesh and deactivate every else.

Ctrl-Click in texture2

  • You can rotate/move the camera in any view and repeat Ctrl-Click in the eye icon to change to another mesh, keeping the current camera position.

enter image description here

Of course, if you modify a mesh (for example, selecting and deleting some faces) the changes affects only to one mesh, not the other.

Rockcat
  • 3,002
  • 2
  • 14
  • 28
  • Thanks. Sad to hear that Meshlab doesn't support it. I'd rather not have several files, because that creates a lot of data duplication that I can't afford :( – M.K. Nov 27 '19 at 18:21
  • Then, your next option is using an external viewer or hire somebody to write a meshlab plugin to change the texture with a button. It is not hard to do, but it is not done :-( – Rockcat Nov 27 '19 at 18:26
  • Yeah I'm currently thinking about writing a web viewer because distributing the software would be painful otherwise (same with a Meshlab plugin). But it really helps to know that Meshlab doesn't have it, because then I don't have to pointlessly look for it anymore, so you saved me a lot of effort :) – M.K. Nov 27 '19 at 18:33