  We continue our investigation of the nested loop approach to the O(n) model
on random maps, by extending it to the case where loops may visit faces of
arbitrary degree. This allows to express the partition function of the O(n)
loop model as a specialization of the multivariate generating function of maps
with controlled face degrees, where the face weights are determined by a fixed
point condition. We deduce a functional equation for the resolvent of the
model, involving some ring generating function describing the immediate
vicinity of the loops. When the ring generating function has a single pole, the
model is amenable to a full solution. Physically, such situation is realized
upon considering loops visiting triangles only and further weighting these
loops by some local bending energy. Our model interpolates between the two
previously solved cases of triangulations without bending energy and
quadrangulations with rigid loops. We analyze the phase diagram of our model in
details and derive in particular the location of its non-generic critical
points, which are in the universality classes of the dense and dilute O(n)
model coupled to 2D quantum gravity. Similar techniques are also used to solve
a twisting loop model on quadrangulations where loops are forced to make turns
within each visited square. Along the way, we revisit the problem of maps with
controlled, possibly unbounded, face degrees and give combinatorial derivations
of the one-cut lemma and of the functional equation for the resolvent.
