Forum

Author Topic: Agisoft Viewer Command Line Usage  (Read 9965 times)

alisakrstova

  • Newbie
  • *
  • Posts: 1
    • View Profile
Agisoft Viewer Command Line Usage
« on: June 27, 2019, 03:24:39 PM »
Hi everyone,

I have generated an .obj model using the Metashape Python API and now I'd like to visualize it. When I try to start Agisoft Viewer through the command line like so:
Code: [Select]
D:\Programs\Agisoft Metashape> .\viewer.exe "path_to_obj_file"I get the error message that the file cannot be opened:
Code: [Select]
2019-06-27 14:17:18 :1: parser error : Start tag expected, '<' not found
2019-06-27 14:17:18 mtllib 3d_mesh.mtl
2019-06-27 14:17:18 ^
2019-06-27 14:17:18 Error: XML syntax error

Am I doing something wrong? Any help would be appreciated. Thanks!
« Last Edit: June 27, 2019, 03:39:02 PM by alisakrstova »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15469
    • View Profile
Re: Agisoft Viewer Command Line Usage
« Reply #1 on: June 27, 2019, 06:34:45 PM »
Hello alisakrstova,

Actually Agisoft Viewer doesn't support loading models to the playlist space via command line. The only argument that can be used from the command line for viewer.exe is the path to the .3dv file that contains the existing Viewer playlist.
If you would like to open Agisoft Viewer automatically via Python script call and display the model there, I can suggest to check the structure of the simple .3dv file and generate it via script using the path to your OBJ file.

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<document>
  <site>
    <title>Project Name</title>
    <datasets>
      <dataset path="../model.obj"/>
    </datasets>
    <transform>1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</transform>
    <default_camera pos="-3.1832933425903320e-002 -3.4107985345183636e+001 1.9800861358642578e+001" rot="7.0710678118654757e-001 0.0000000000000000e+000 0.0000000000000000e+000 7.0710678118654757e-001"/>
   
  </site>
</document>
So the additional thing that you may need to calculate for this file is the default camera position for the model.
Best regards,
Alexey Pasumansky,
Agisoft LLC