Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: picare on November 26, 2020, 11:39:32 AM

Title: Orthophotos impossible to remove
Post by: picare on November 26, 2020, 11:39:32 AM
Hi,

I am unable to remove orthophotos from a chunk whith python, whereas they are not visible in the chunk treeview:

chunk.orthomosaics
Out[69]: 2020-11-26 09:35:55 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]

chunk.orthomosaics.clear()

chunk.orthomosaics
Out[71]: 2020-11-26 09:36:08 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]

chunk.orthomosaics[0].clear()

chunk.orthomosaics[1].clear()

chunk.orthomosaics
Out[74]: 2020-11-26 09:36:43 [<Orthomosaic 'Sol, '>, <Orthomosaic 'Cylindre, '>]

Any ideal to remove these orthomosaics?
Title: Re: Orthophotos impossible to remove
Post by: Alexey Pasumansky on November 26, 2020, 12:49:42 PM
Hello picare,

To remove the orthomosaic you should use the following code:

Code: [Select]
chunk.remove(chunk.orthomosaics[0])
this example removes the first orthomosaic in the chunk.

To remove all orthomosaics from the chunk:
Code: [Select]
chunk.remove(chunk.orthomosaics)
Title: Re: Orthophotos impossible to remove
Post by: picare on November 26, 2020, 01:09:55 PM
Perfect, that's working now. Thanks!