Forum

Author Topic: Merge Models (within a chunk) Via Python?  (Read 1401 times)

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Merge Models (within a chunk) Via Python?
« on: March 01, 2023, 05:27:57 PM »
Is this possible? If not this is a feature request. Please advise.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14851
    • View Profile
Re: Merge Models (within a chunk) Via Python?
« Reply #1 on: March 01, 2023, 06:15:12 PM »
Hello wojtek,

You can do it in the following way using MergeAssets task. The example shows how to merge all models in the active chunk:
Code: [Select]
chunk = Metashape.app.document.chunk
task = Metashape.Tasks.MergeAssets()
task.source_data = Metashape.DataSource.ModelData
task.assets = [model.key for model in chunk.models]
task.apply(chunk)
Best regards,
Alexey Pasumansky,
Agisoft LLC