def METHOD_NAME(self, filename, v_pos, t_pos_idx, v_tex=None, t_tex_idx=None):
    v_pos = v_pos.cpu().numpy()
    t_pos_idx = t_pos_idx.cpu().numpy()
    save_dir = os.path.dirname(filename)
    os.makedirs(save_dir, exist_ok=True)
    if v_tex is not None and t_tex_idx is not None:
        v_tex = v_tex.cpu().numpy()
        t_tex_idx = t_tex_idx.cpu().numpy()
        self.write_obj(filename, v_pos, t_pos_idx, v_tex, t_tex_idx)
    else:
        self.write_obj(filename, v_pos, t_pos_idx, v_tex, t_tex_idx)