Military deployment

A parent has temp custody, and the other parent has been seeing the child on reg. visitation… then finds out that the other parent(with temp) is getting deployed to Iraq and is planning to leave the child with mother and stepfather. Does the other parent who doesn’t have temp papers need to modify the custody with an attorney or just file contempt papers…and will the parent have to fight custody with the grandmother?