Add terrain paint resource. optimized the clone code.