@echo off
setlocal enabledelayedexpansion

set cal[1] = -29.659901341322005, 0.6433726450048046, -0.014244532370922039
set cal[2] = 0, 0, 0
set cal[3] = -0.3034849520908068, -21.326642231053118, -0.8374944622340491
set cal[4] = -28.88942070783364, -21.912151930283546, -0.0692748535739252
set cal[5] = -14.676537573848027, -10.658947918332823, -0.28212116158984546

rem Set this to 6 to populate all data. Set to 1-5 to not populate for the specified band
set referenceBand=6

for /L %%i in (1,1,5) do (
   for /D %%f in (*) do (
      set str=exiv2.exe -M"reg Camera http://pix4d.com/camera/1.0" -M"del Xmp.Camera.RigRelatives"
rem      for %%a in (!cal[%%i]!) do (
rem         set str=!str! -M"set Xmp.Camera.RigRelatives XmpSeq %%a"
rem      )
      if NOT %%i==%referenceBand% (
         set str=!str! -M"set Xmp.Camera.RigRelatives XmpText !cal[%%i]!"
      )
      call !str! "%%~ff\*_%%i.tif"
   )
)

