This. You know what? Yes, there is absolutely a genetic component to obesity. I personally know several researchers who study weight gain/weight loss/obesity and I can't deny that. But even they will tell you that environment and the resultant food habits you pick up play a huge defining role in the eventual outcome. An organisms existence, in all aspects of life, is not just its genetic code: it's how environmental factors play on, influence and shape those genes.
The thing that bothers me about the whole "oh, I'm fat because it's in my genes thing" is that it is a perfect example of biological determinism - that is, letting your genes dictate your destiny. If people are told that it's genetic they be fat, they'll think it's a forgone conclusion, when really, it's a genetic predisposition that they merely have to work harder to battle than someone else.
Not to mention, for all the genes we've identified as being linked to obesity, not one, not a single one, has offered a magic bullet cure for obesity. That's because obesity is a much more complex condition than "I have a mutation in this gene here, therefore I am going to be fat".