The lifestyle a person shares with a partner has a greater influence than upbringing does on the chances of becoming obese, research suggests.
By middle age, the choices made by couples - including those linked to diet and exercise - will have a much greater impact than the lifestyle they shared with their siblings and parents when growing up, the study found.
The results suggest that people from families with a history of obesity can still reduce their risk by changing their habits.
Researchers said the study will help scientists better understand the links between obesity, genetics and lifestyle.
They said the findings reinforce the message that lifestyle changes in adulthood can have a significant impact in tackling obesity, regardless of a person's genetic profile.
The study was led by Professor Chris Haley of the Medical Research Council's Human Genetics Unit at the University of Edinburgh.
The team analysed data provided by 20,000 people from Scottish families.
The information was originally gathered as part of the Generation Scotland project, a national resource of health data that helps researchers to investigate genetic links to health conditions.
Scientists compared people's family genetics and home environments in childhood and adulthood and related those to measures linked to health and obesity. A total of 16 measures were considered including waist to hip ratio, blood pressure, body fat content and body mass index.
Prof Haley said of the findings: "Although genetics accounts for a significant proportion of the variation between people, our study has shown that the environment you share with your partner in adulthood also influences whether you become obese and this is more important than your upbringing.
"The findings also show that even people who come from families with a history of obesity can reduce their risk by changing their lifestyle habits."
The study is published in the journal PLoS Genetics.