THERE'S a scene in Ted 2 where John and his fluffy and foul-mouthed friend Ted head to a comedy improvisation night, with the sole purpose of heckling and suggesting wildly inappropriate ideas for the comedians to use, including 9/11 and the Charlie Hebdo shooting.

But Seth MacFarlane, who co-wrote and directed the movie - and voices the sexually charged Ted - insists he's not out "just to shock".

"The context, to me, makes it OK. You're not mocking any one of those events or people, you're acknowledging these are all tragedies that don't belong in a comedy club, and that is why the audience goes along with you," notes the 41-year-old.

"Anyone who has ever been to an improv' show knows there's always some asshole in the back shouting out completely unusable, offensive remarks," he adds. "We tested it [that scene] on several audiences. But if something gets a gasp or a groan then you know, no matter how much you love it, it's got to go, you've gone over the line."

He believes Jerry Seinfeld's comment, that "political correctness is harming comedy", is correct, "to some extent".

"I don't think the public feels the same way about political correctness in comedy as the media does. I think the media would like us to believe that the public feels a certain way and the public is angry at this and that, but all my experience is contrary to that."

When MacFarlane first pitched the idea of Ted, he thought they'd have to use a hand puppet to bring the character to life, because nobody wanted to spend the money it would take to generate a special effects bear for a R-rated comedy.

"It was a risk," notes the Connecticut-born actor.

But, as it happened, Universal Pictures saw the potential in the story of a childhood bear who comes alive, and Mark Wahlberg stepped in to play John, Ted's best friend and "thunder buddy for life".

When the film was released in 2012, it made almost 550million US dollars in global ticket sales, and it wasn't long before there was talk of a sequel.

Although John and Ted's relationship would remain at the core of the tale, "one of the things that was very important for me was to make this something that wasn't just a rehash of the first movie", continues MacFarlane. "I see a lot of comedy sequels that are essentially safe reviews of the originals, and it just seems like a weak way to approach it."

For the first movie, the whole point was how people would react if a teddy bear actually came to life and started talking. At first, they'd be amazed, of course, but they'd eventually just have to get used to it, and wouldn't care. But this time, MacFarlane had to move the story, and Ted and John's friendship, forwards.

Given the duo's penchant for cannabis, he originally wrote an outline in which they smuggle a pot shipment across the country.

"I personally agree that legalisation [of marijuana] is a good idea, but I wasn't out to make that point in the movie," he says of the subject.

But then We're The Millers, with a very similar story arc and starring Jennifer Aniston, was released, and MacFarlane realised he'd have to rethink.

It was while he was shooting the 2014 comedy A Million Ways To Die In The West and reading about the American Civil War that he came across the Dred Scott case, about a slave who unsuccessfully sued for his freedom.

"I thought, 'What about an interesting way to tell that story in the modern era?' You can only do something like that with Ted, who is not human and doesn't have legal status as a person," he notes.

When the newly-married Ted and Tami-Lynn (Jessica Barth) decide to have a baby, they're told that Ted's not a person - he's property - and therefore ineligible to adopt. He then loses his job and is informed that his marriage has been annulled, and so he sets out, with the help of lawyer Samantha L. Jackson (Amanda Seyfried), to sue the state and win the rights he deserves.

Although MacFarlane says "you want something that doesn't necessarily have to be saying something, but at least it's about something", it's no coincidence that the storyline reflects current issues.

"Whether you're talking about gay marriage or mass incarceration, or any other number of rights violations that are going on, it's a general look at the 'us and them' mindset that you see all around the world," he explains.

"There is a great Michael Shermer book called The Moral Arc, [in which he says] that no matter what the battle, eventually justice wins out, because the younger generation ages and don't have the same hang-ups as the generation before. Eventually the good guys always win."

MacFarlane was 24 when he became the youngest executive producer in TV history, and his award-winning animated series, Family Guy, is now in its 14th series.

He also co-created American Dad!, which debuted in 2005, and Family Guy spin-off series The Cleveland Show, which ran from 2009 to 2013.

Known for their social commentary and razor-sharp lines, the animated series also poke fun at well-known faces, but bar "an earful from Adrien Brody" at a party, he notes that "people take it as a weird compliment that you're taking the time to take a crack at them".

The shows have received numerous plaudits, but even now, MacFarlane admits that when he sits down to write: "It's hard to look at a blank page."

"It's terrifying," he continues. "Harold Ramis put it better than anyone I've ever heard. He said, 'There is joy in having written, but there is no joy in writing', which is how I feel about it."

A keen jazz singer - who was nominated for an Academy Award for best original song in 2013 (for Everybody Needs A Best Friend, the Ted song he co-wrote with the film's composer Walter Murphy), the same year he hosted the ceremony - MacFarlane insists he's not sure whether there will be a third outing for the outrageous bear. "We've not discussed it in depth."

In the meantime, he's focusing on keeping his other projects "fresh".

"That's part of your job, to not rest on your laurels, but to keep it interesting."

Ted 2 is released in cinemas on Wednesday, July 8