Hello,
I'm upping that subject after having investigated a bit further. I can now send the project to be processed on the cloud, but there's a task that doesn't seem to be working : building the AO. Here is my code:
def build_task_list(tasks, chunk):
network_tasks = []
'''Match photos'''
task = Metashape.Tasks.MatchPhotos()
task.downscale = 0
task.keypoint_limit = 40000
task.tiepoint_limit = 4000
task.generic_preselection = True
task.reference_preselection = True
tasks.append(task)
'''AlignCameras'''
task = Metashape.Tasks.AlignCameras()
tasks.append(task)
'''BuildDepthMaps'''
task = Metashape.Tasks.BuildDepthMaps()
task.downscale = 1
task.filter_mode = Metashape.MildFiltering
tasks.append(task)
'''BuildModel'''
task = Metashape.Tasks.BuildModel()
task.surface_type = Metashape.Arbitrary
task.interpolation = Metashape.EnabledInterpolation
task.face_count = Metashape.HighFaceCount
task.source_data = Metashape.DepthMapsData
tasks.append(task)
'''BuildDiffuse'''
task = Metashape.Tasks.BuildTexture()
task.texture_type = Metashape.Model.TextureType.DiffuseMap
task.blending_mode = Metashape.MosaicBlending
task.texture_size = 16384
task.fill_holes = True
task.ghosting_filter = True
tasks.append(task)
'''BuildAO'''
task = Metashape.Tasks.BuildTexture()
task.texture_type = Metashape.Model.TextureType.OcclusionMap
task.texture_size = 16384
task.source_model = chunk.model.key
task.transfer_texture = False
tasks.append(task)
for t in tasks:
network_tasks.append(t.toNetworkTask(chunk))
return network_tasks
def main():
output_path = path.join('C:\\', 'GITLAB_PROJECTS', '3dscanpipeline', '02_Production', '05_Scripts', 'Tests', 'hotdog_test.psx')
tasks = []
doc = Metashape.Document()
doc.save(output_path)
chunk = doc.addChunk()
import_images(chunk)
network_tasks = build_task_list(tasks, chunk)
doc.save()
# Go retrieve the projects on the cloud
client = Metashape.CloudClient()
client.username = **************
client.password = ***************
# projects = client.getProjectList()
client.uploadProject(doc)
client.processProject(doc,network_tasks)
main()
The code seems to crash at the line where I'm defining the AO source model parameter, with the "chunk.model.key". It returns an error implying that there is no model (null object). I thought that maybe the project had to be processed before being able to create the AO, so I tried uploading the project, then processing it, then downloading again and feeding it the AO task, but it still didn't work.
Can you help me again?
Many thanks,
Best,
Popi
PS: Also, do you have an ETA about the possibility to process an AO through XML batch?