I've been using a foam roller etc consistently for a year or so, whereas this problem has only just appeared in the last few weeks. Diet has been sub-optimal over the last few days but is normally fairly good. I do sit a lot, but no more than any other student with exams on the horizon does!
Funnily enough, I trained today and my hips felt a load better, the best they've been for ages actually. I just spent a good while warming up and getting loose and saw a significant improvement. I think it's just a case of ensuring I warm up effectively before training.