I regularly (when the skies are nice) make panoramas of the rising sun (that’s the advantage of retirement: I have all the time in the world). For creating the panoramas i use the Hugin User Command script. That works fine, except I have to throw away the temporary tifs and I can’t use the ‘assistant’. This is sometimes useful for making several panoramas in quick succession.
Recently I discovered that in Darktable it is possible with a LUA script. Would it be possible to modify the User command script in such a way that it is also possible to use the assistant and not?
Hi,
I’m not sure I understand (for a start, I don’t know what you mean with “assistant”, sorry). But in general user commands can do whatever they want…
If you can give a better description of the missing features we can try to come up with a solution.
Hugin can be used in three ways: with the simple interface (the ‘Assistant’ with three buttons: 1) open image, 2) position and align and 3) create panorama) and with an advanced interface and expert interface.
The User script provides the advanced interface, Darktable’s LUA script provides both options: simple (automatically by the assistant) and advanced.
I don’t think there’s a way to select the interface to run from the command line, as far as I know hugin remembers the last used interface. So, you can try starting hugin from a terminal, select the simple interface (i.e. the “assistant”), and quit, and see if now the same interface shows up the next time you run it through ART. FWIW it works here…
I understand, but I mean something else, namely that the user command directly starts the assistant without showing the GUI. So that nothing has to be filled in and the panorama is created automatically.
So maybe a second user command script, one like the one already is (which brings up the GUI) and one that immediately tries to create the panorama (like it does in Darktable’s LUA script).
Ah ok, now I understand. It’s certainly possible, but if you are asking me to do it, I’m afraid I don’t have the time right now, sorry.
I’ll see if I can give it a try in the next days, but I wouldn’t hold my breath if I were you.
(Incidentally, the whole point of user commands is to avoid having to add – and maintain – this kind of functionality myself…)
@agriggio I don’t know if it is relevant, but you wrote some user scripts to use Hugin that I never tested on W10.
The txt file
[ART UserCommand]
# the command label
Label=Hugin
# the actual command to execute (which we define below)
Command=./hugin_raw.sh
# we want at least 2 files to stitch
MinArgs=2
# restrict to raw files
FileType=raw
# make sure that all shots come from the same camera/session
MatchCamera=true
MatchLens=true
MatchShutter=true
MatchAperture=true
MatchFocalLen=true
# we could also consider adding additional criteria, like
# MatchISO=true
# MatchDimensions=true
and the Hugin_raw.sh
#!/bin/bash
# create a temporary file for a default processing profile
# here, we want to make sure we have a suitably large output color space,
# because we want to continue editing after stitching
t=$(mktemp --suffix=.arp)
cat <<EOF > $t
[Version]
Version=1015
[Color Management]
OutputProfile=RTv4_ACES-AP1
EOF
if [ -f "$1.arp" ]; then
# if the first selected file has a sidecar, we are going to use that
# (except that we override the output profile, see above)
sidecar=("-p" "$1.arp")
else
# if the first selected file has no sidecar, we create a default one
sidecar=()
cat <<EOF >> $t
[Exposure]
HLRecovery=Blend
[ToneCurve]
Enabled=false
[LensProfile]
LcMode=lfauto
LCPFile=
UseDistortion=true
UseVignette=true
UseCA=false
[RAW]
CAEnabled=true
CA=true
CAAvoidColourshift=true
CAAutoIterations=2
EOF
fi
# process the raw files with ART-cli, adding a progress dialog
# for user notification
ART-cli "${sidecar[@]}" -p $t -Y -t -b16 -c "$@" | zenity --progress --pulsate --no-cancel --auto-close --text="Converting to TIFF..."
# remove the temporary sidecar
rm -f $t
# prepare the list of arguments to provide to hugin.
# Note: we are using bash arrays here to be robust wrt. file names
# with spaces and/or other funny characters
i=0
for fn in "$@"; do
tiffs[$i]="${fn%.*}.tif"
i=$(expr $i + 1)
done
# finally, we can run hugin
hugin "${tiffs[@]}" || zenity --error --text="Something went wrong..."
Yes I definitely wrote it, but for demonstration/documentation purposes more than anything else. That’s why they are not shipped with art. Anyway, glad you got it working!