Forum

Author Topic: Export Cameras/Model No File?  (Read 5524 times)

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Export Cameras/Model No File?
« on: September 30, 2015, 12:53:56 AM »
My export cameras and export model is successful:

chunk.exportCameras(path_photos, format='xml')
chunk.exportModel(path_photos)

but no camera file or model file is created in the path. Any ideas for what's going on?
« Last Edit: September 30, 2015, 02:04:51 AM by thuang »

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Export Cameras/Model No File?
« Reply #1 on: October 08, 2015, 10:57:45 PM »
In Python scripting, my export cameras and export model is successful:

chunk.exportCameras(path_photos, format='xml')
chunk.exportModel(path_photos)

but no camera file or model file is created in the path. Any ideas for what's going on?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14837
    • View Profile
Re: Export Cameras/Model No File?
« Reply #2 on: October 08, 2015, 11:11:35 PM »
Hello thuang,

Export path should contain full path including filename with extension.
Best regards,
Alexey Pasumansky,
Agisoft LLC

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export Cameras/Model No File?
« Reply #3 on: October 09, 2015, 12:56:32 AM »
Thank you!

I'm having trouble with exporting model now (function executes but no file is created). Could you please help?

   model_path = path_photos + "model.obj"
   chunk.exportModel(model_path, format='obj')

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14837
    • View Profile
Re: Export Cameras/Model No File?
« Reply #4 on: October 09, 2015, 01:15:41 AM »
Hello thuang,

Check the path by printing "model_path".

I think you need to assign:
Code: [Select]
model_path = path_photos + "\\model.obj"
Best regards,
Alexey Pasumansky,
Agisoft LLC

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export Cameras/Model No File?
« Reply #5 on: October 09, 2015, 01:23:53 AM »
Hmm still no luck. Printed out path name is correct but file still doesn't appear. I also tried using .ply format but didn't make a difference.

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export Cameras/Model No File?
« Reply #6 on: October 14, 2015, 02:17:45 AM »
Hello,

Could you please post an example snippet of code for a successful exporting of the model? I would appreciate it very much.

Thank you!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14837
    • View Profile
Re: Export Cameras/Model No File?
« Reply #7 on: October 14, 2015, 01:02:55 PM »
Hello thuang,

Code: [Select]
chunk = PhotoScan.app.document
path = "D:\\model.obj"
chunk.exportModel(path)
It will work for the active chunk, providing that path is valid (and the user has write permissions) and chunk contains mesh.
Best regards,
Alexey Pasumansky,
Agisoft LLC

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export Cameras/Model No File?
« Reply #8 on: October 15, 2015, 10:57:51 PM »
I'm getting an error that "PhotoScan.Document object has no attribute 'exportModel'"

Did you mean chunk = PhotoScan.Chunk()?

After doing chunk = PhotoScan.Chunk() and using chunk.exportModel(path) on a valid path with an existing mesh and chunk, I got "False" and "Finished processing in 0 sec (exit code 0)"

I've also tried multiple paths (and printed out to double check that they matched) and am getting the same result.
« Last Edit: October 15, 2015, 11:02:46 PM by thuang »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14837
    • View Profile
Re: Export Cameras/Model No File?
« Reply #9 on: October 15, 2015, 11:14:36 PM »
Hello thuang,

If you wish to access active chunk in the document, you need to do the following assignment:
Code: [Select]
chunk = PhotoScan.app.document.chunkIn other cases, use proper index in the list of chunks:
Code: [Select]
chunk = PhotoScan.app.document.chunks[i]where i is an integer number of the chunk (first chunk has zero index).

Using chunk = PhotoScan.Chunk() creates an empty instance of .Chunk() class that is not connected anyhow to the active project file.
Best regards,
Alexey Pasumansky,
Agisoft LLC

thuang

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Export Cameras/Model No File?
« Reply #10 on: October 16, 2015, 12:03:33 AM »
It works! Thank you very much for your help.