Isolation is a good idea! This way it will even cut down the render time of each map , because the groups(LPs + HPs) will be considered in the baking process one at a time, instead of loading all objects at once. So bassicaly the script should : 1)group coresponding parts into different selection sets based on naming…
Maybe not explode the pieces but "isolate selection" then run a AO bake and exit isolation mode? Have it iterate over your selection or maybe objects in a specific selection set, layer or named group?
This is how my script works: - Type in the name of the target mesh (or select). - Set your options (AO/Normal Map image size) - Hit the render button. Maya selects the correct mesh, and uses that as the source. I am not doing any kind of tricky math with this one, all I do is take the functions of Maya, wrap them in a UI…