Forum

Author Topic: Build Texture Without Cameras  (Read 191 times)

seikamoomoo

  • Newbie
  • *
  • Posts: 1
    • View Profile
Build Texture Without Cameras
« on: May 11, 2021, 09:09:03 AM »
Hello!

I'm trying to build a textured model from a dense point cloud. The point cloud was generated in Dot3D and has normals and vertex colors but does not have any aligned cameras. When using the Metashape Pro client, I was able to create a mesh and then generate a texture directly from the mesh. However, I have not been able to do this with the Python API. Depending on the settings I use, BuildTexture() either gives an error that says "no aligned cameras" or one that says "model has no diffuse texture." I tried to copy the settings I used in the client (I've included a screenshot) but was unable to match them exactly - for example, there is no keep_uv mapping mode. I tried running BuildUV() before generating the texture, but still had the same issues.

Any help would be appreciated!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 12851
    • View Profile
Re: Build Texture Without Cameras
« Reply #1 on: May 12, 2021, 05:03:28 PM »
Hello seikamoomoo,

If the polygonal model contains the vertex color information, then you should use the following lines to build the texture (including UV layout) from the vertex colors:

Code: [Select]
chunk.buildUV()
chunk.buildTexture(blending_mode = Metashape.BlendingMode.MosaicBlending, texture_size = 4096, texture_type = Metashape.Model.TextureType.DiffuseMap, source_model = chunk.model, transfer_texture = False)
Best regards,
Alexey Pasumansky,
Agisoft LLC