Halle Berry's baby daddy tried creating a "Sophie's Choice" for her -- earn a living, or be with her baby ... and that's why Halle went to court Wednesday and kicked his butt.
Sources connected with the former couple tell TMZ ... Gabriel Aubry told Halle he would not let her take Nahla to New York City to shoot a movie. We're told Halle agreed to put Gabriel up in a fancy hotel during the 1-week shoot so he could be with the kid, but he said no.
Gabriel -- who isn't working right now -- responded this way: "Why do I have to follow her? She can leave [Nahla] here."
TMZ broke the story ... a Los Angeles County Superior Court judge ruled Wednesday that Halle could take the baby with her.
Friends of Halle say Gabriel knew what he was signing up for when he impregnated her and he's just acting out of spite.
Halle -- who dropped out of the film, "New Year's Eve" to battle Gabriel in court -- was offered another role in the flick and that's why she's going to NYC. We're told she'll take the trip in 2 weeks.
But the battle isn't over. Halle has other films in the works, and she expects Gabriel will continue to cause problems.