Forum

Author Topic: Is batch with relative paths/names possible ?  (Read 3799 times)

andrekje

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Is batch with relative paths/names possible ?
« 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

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14890
    • View Profile
Re: Is batch with relative paths/names possible ?
« Reply #1 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
Best regards,
Alexey Pasumansky,
Agisoft LLC

andrekje

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Is batch with relative paths/names possible ?
« Reply #2 on: November 16, 2016, 04:39:22 PM »
fantastic :) - thank you

andrekje

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: Is batch with relative paths/names possible ?
« Reply #3 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:"


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14890
    • View Profile
Re: Is batch with relative paths/names possible ?
« Reply #4 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.
Best regards,
Alexey Pasumansky,
Agisoft LLC