Agisoft Metashape

Agisoft Metashape => General => Topic started by: andrekje on November 16, 2016, 04:04:08 PM

Title: Is batch with relative paths/names possible ?
Post by: andrekje on November 16, 2016, 04:04:08 PM
my projects are usually in own folder:
~/photoscan projects/placename/placename.psx

making a batch that ends with multiple exports, is hard, because every export needs it's path, like:
import photos from:
~/photoscan projects/placename/photos/*
export:
~/photoscan projects/placename/placename-orto/placename-orto.tiff
~/photoscan projects/placename/placename-dem/placename-dem.tiff
~/photoscan projects/placename/placename-las/placename.las

I miss the possibility to script something like:
# %pname% is the name of .psx file
# %ppath% is the path of the .psx file

import:
%ppath%/photos/*
export:
%ppath%/%pname%-orto/%pname%-orto.tiff
%pname%/%pname%-dem/%pname%-dem.tiff
%pname%/%pname%-las/%pname%.las


This way . a script would be perfectly re-usable between projects.
this way - the same batch could be used on every dataset, and
Title: Re: Is batch with relative paths/names possible ?
Post by: Alexey Pasumansky on November 16, 2016, 04:09:27 PM
Hello andrekje,

There are several marcos options that can be used in the path field for the export depending on the export type:
{filename}
{fileext}
{camera}                             - camera label
{frame}
{imagefolder}
{chunklabel}                       - chunk label
{projectfolder}
{filenum}
{projectname}

I think that {projectname} should fit your needs. In case you have multiple chunks in the project, you can also use {chunklabel} macros.

So in the export field of the batch process you can input something like this: /proejcts/export/{projectname}_ortho.tif
Title: Re: Is batch with relative paths/names possible ?
Post by: andrekje on November 16, 2016, 04:39:22 PM
fantastic :) - thank you
Title: Re: Is batch with relative paths/names possible ?
Post by: andrekje on November 16, 2016, 07:55:15 PM
how can an non-existing folder be created during a batch ?
An attempt to export to non-existing path gives "Error: Can't create file:"

Title: Re: Is batch with relative paths/names possible ?
Post by: Alexey Pasumansky on November 16, 2016, 08:08:46 PM
Hello andrekje,

The folder should exist, as PhotoScan is not creating new folders, but only putting newly exported files to the directory that already exist.