  We prove a 1999 conjecture of Veys, which says that the opposite of the log
canonical threshold is the only possible pole of maximal order of Denef and
Loeser's motivic zeta function associated with a germ of a regular function on
a smooth variety over a field of characteristic zero. We apply similar methods
to study the weight function on the Berkovich skeleton associated with a
degeneration of Calabi-Yau varieties. Our results suggest that the weight
function induces a flow on the non-archimedean analytification of the
degeneration towards the Kontsevich-Soibelman skeleton.
