Director Sean Anders used his own foster care experiences to shape the warm winter dramedy.

Sean Anders’ creative impulses ran to the hard-R side in his earliest works including the raunchy “Sex Drive” and Adam Sandler’s “That’s My Boy.”

Six years ago, his life changed when he and his wife adopted three foster siblings. He started looking at the world through the eyes of a parent.

He switched into making the family-friendly “Daddy’s Home” films, but there was an even more meaningful tale he hoped to tell with his writing-producing partner, John Morris.

The duo used their clout from those hits to re-enlist “Daddy’s Home” star Mark Wahlberg for “Instant Family” (out Nov. 16). The dramedy is based on Anders’ experiences as an adoptive parent adjusting to family life in a variety of circumstances.

The film is a terrific start to the holiday season, offering a story the whole family can enjoy.

Even better?

The film’s message can literally save lives yet meshes perfectly with its funny elements. The result is a rare dramedy that is enormously affecting without being heavy-handed. Anders took time to discuss how he pulled off this remarkable balance.

HIT: How did you decide to do this film? How much of it is rooted in your personal experience?

Anders: A lot of it is rooted in my personal experience, but also in that of other families I met along the way and kids who grew up in foster care that we interviewed while working on the script.

HIT: You were known for really outrageous R-rated comedies for several years, but made a big switch starting with “Daddy’s Home.” What prompted that shift?

Anders: I had grown up loving really outrageous and irreverent comedy, like “Stripes,” “Blazing Saddles” and that kind of thing to comedians I loved like Steve Martin and Richard Pryor. That’s what comedy was for me for so long, but then I was getting older and I adopted three kids through foster care and when I became a dad I had to grow up pretty fast.

I’d been hanging onto my youth too long.

We started looking at all we were writing through a family perspective. We jumped on “Daddy’s Home” when that came along and had fun with the second too, but It was tricky how to get my own story made.

It was a long process for us to figure out, but once we had written a few drafts of the script I was able to go to Mark Wahlberg and said this is different – it’s a little less screwball and more dramatic, would you like to go in on it? Mark had met a lot of foster kids over the years, so he said he’d love to do it and once he jumped in, the whole thing became very real, very fast and that was exciting.

HIT: How did you know how to strike the balance so well between the emotionally rough serious scenes and the funny ones? It’s really a remarkable film in that regard.

Anders: It was almost the number one thing that we were focused on throughout the project. We knew we wanted to do this as a comedy, but that’s dicey to do a comedy about something so serious.

We tried to be as honest as possible, and the comedy comes from the honesty – the frustrations of the parents, the crazy things that kids do, the attitudes of extended family about that kind of adoption. We always went to the reality of what was happening. My own story was funny and absurd and we tried to get that across in the right way from the first draft of the screenplay.

HIT: How did you and your wife decide to try a foster care adoption?

Anders: It happened for my wife and I exactly like in the movie. For a long time, we thought we couldn’t afford to have kids but once I felt more secure in my career, we started to talk about it. I thought I’m getting to the age where I’ll be an old dad who can’t throw a football when they’re 15. I said why not adopt a 5 year old and she said she’d do it. I said I was kidding, but we went to a website and learned about all these kids growing up without families.

We thought if we’re going to entertain this idea, we almost have to do it. It was terrifying, very scary, but we decided to jump off this cliff and see what happened.

We instantly regretted our decision and felt out of our depths just like in the movie, but as we figured things out we became a family and realized it was the best decision we ever made. They moved in with us seven years ago this March, and they were 6, 3, and 1 ½ at the time.

HIT: Why did you have a 15-year-old girl as the main, oldest sister in the film then?

Anders: There were a couple reasons. Among the first kids we were matched with was a teenage girl at a foster fair. It’s not what we went there to do, but we met her, she seemed great and had a brother and sister who seemed great.

We said we’ll do this but in our story that teenage girl was understandably very connected to her birth mother and was holding out hope that she was coming for them, and she didn’t want to be placed with us so it fell apart and they gave us three others. It was always important for a teenager to be in the mix of the movie because people need to have an understanding of older foster kids. We met with a lot of families who had adopted older kids and their stories were what we wove together to be the Lizzy story.

HIT: Mark Wahlberg and his wife have a couple of serious prayer scenes in the film with the kids, and there’s a hilarious passive-aggressive prayer scene at Thanksgiving with extended family. You also have a secondary Christian couple who are positively portrayed and a social worker who’s a woman of faith. How did you decide to take such an approach?

Anders: There’s so much faith around adoption in general, and so many of the people that do so much good work are faith-based. When you go to these classes you see everyone – couples who can’t conceive or found their way there through church. We wanted [the main couple] Pete and Ellie to feel like the every-parents a little bit so they had influences of every couple we met with.

With the other religious couple, we wanted to start them feeling like that kind of cute churchy couple but as we went on we filled them out and had some more depth. That’s what happens when you first go through these support groups: the people in them seem like archetypes but then you get to know each other because we’re in it together and had respect for each other and have each other’s backs.

HIT: What do you hope to achieve with the film? I think it could really save lives.

Anders: It’s a piece of entertainment like anything else, very funny and a good time. If you see it you’ll learn about things you may not know much about going in.

The studio found from the very first screening at a convention for people who work in foster care. We were hoping for the best but had no idea it would be as overwhelming as it was. It’s like these people have been hunkered down in foxholes for year s and feel for the first time, reinforcements are coming.

They saw that there was finally a movie about this that is more about joy than fear. It got them excited, which got Paramount more excited.

I would love it if the movie would help people when they see the movie, would make them feel differently when they hear the words “foster care,” because often dark ugly images come to mind and get applied to kids. It touches on the heartbreak and darkness but also the love and the hope, that people will walk away having a different idea of what foster care is and can be.

And that it might move people who had trepidation or negative thoughts about adopting foster kids will be more positive about it.