Alternatively, if you have some advanced tar (e.g. GNU tar), you could try to use tar to exclude some patterns. But I am afraid that is not possible to only exclude hidden directories, but include hidden files.