Agisoft Metashape > Agisoft Viewer

Agisoft Viewer Command Line Usage

(1/1)

alisakrstova:
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: ---D:\Programs\Agisoft Metashape> .\viewer.exe "path_to_obj_file"
--- End code ---
I get the error message that the file cannot be opened:

--- Code: ---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
--- End code ---

Am I doing something wrong? Any help would be appreciated. Thanks!

Alexey Pasumansky:
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: ---<?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>

--- End code ---
So the additional thing that you may need to calculate for this file is the default camera position for the model.

Navigation

[0] Message Index

Go to full version