assign the same unwrap UV to all of the objects, use the material ID filter dropdown (bottom of UV editor window), select all the filtered faces and pack based on your selection i think to do it as part of an auto unwrap you'd have to script it
I asked chat GPT to make me script using same idea. Packing matID as UDIMs pattern 4x4 first then normalize for selected objects . Took it seconds and it understand the idea quicker than a typical programmer adding extra helpful features I have not even thought about like working with 12 materials and doing 4x3 pattern .…
i attached a quick Blenders geometry node example that packs all same mat ID UV islands in sort of automated style as rows. it uses material id index to shift UV in U direction each in 1 . So each UV islands having mat ID 1 shifts to 1 , islands with matID2 shifts to 2 etc. They all scales back to 0-1 in the end . I have 4…