Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: SimonBrown on August 26, 2017, 03:46:49 PM

Title: Split in Chunks - Copy Model
Post by: SimonBrown on August 26, 2017, 03:46:49 PM
Scripting newbie question:

I use the split_in_chunks script quite a lot (thank you to whoever authored it!) and its very useful.

I now have a situation where I want to split a chunk into separate chunks, duplicating not only the dense cloud/cameras but the 3D model as well.

I *think* I have found the section in the script:
 new_chunk = chunk.copy()
      new_chunk.label = "Chunk "+ str(i)+ "\\" + str(j) + "\\" + str(k)
      new_chunk.model = None
      doc.addChunk(new_chunk)

With the command that deals with the model in bold. I have checked the reference manual, but cannot find an example? I am guessing the None needs to be something else, and have tried a few guesses but no luck.

Can anyone help?
Title: Re: Split in Chunks - Copy Model
Post by: Alexey Pasumansky on August 26, 2017, 06:53:51 PM
Hello SimonBrown,

chunk.copy() function accepts the parameters to be copied (by default the chunk is fully duplicated). The line that you have highlighted means that the model for the new_chunk is discarded after duplicating.
Title: Re: Split in Chunks - Copy Model
Post by: SimonBrown on September 03, 2017, 01:20:20 PM
Thanks Alexey - much appreciated.