1
Python and Java API / Re: Script for filtering mesh via gradual selection, connected component size option
« on: August 03, 2023, 02:46:43 AM »Yes, that's possible too
This is example of how to check all chunks' labels and then, if label equal to desired name - make it active, so that all Metashape.app.document.chunk accesses were addressed to it:Code: [Select]for chunk in Metashape.app.document.chunks:
if chunk.label == "My Custom Chunk Name":
Metashape.app.document.chunk = chunk
Probably you meant to name a chunk from GUI - but for the sake of completeness - this is how to change the currently active chunk name from Python:Code: [Select]Metashape.app.document.chunk.label = "My Custom Chunk Name"
P.S. script was adapted from https://www.agisoft.com/forum/index.php?topic=7815.0 (googled with "metashape python make chunk active")
Thanks for that, but still incredibly confused how to implement it or what to type to replace words.
At the moment my script looks like:
Code: [Select]
PhotoScan.app.document.chunk.importModel('Path/0.obj')
PhotoScan.app.document.chunk.model.removeComponents(100000)
And yes I am doing this in Phtoscan at the moment but I know it's possible to do the same in Metashape.