In the cases of Brave and Moana at Pixar and Disney Animation respectively, the story definitely came before the tech was developed. I was an intern at Pixar during the production of Brave, and I worked on Moana, and I can say that in both cases, there was a mad scramble to develop the tech to catch up with the story. We didn't really have the water on Moana working completely correctly until like 6 months before the movie came out.