Method of imparting function to molded polymer and apparatus therefor