You would have to modify the GetRepackedSkin()
method, which is quite involved. spine-runtimes/AtlasUtilities.cs at 842dffbd8379b17e4d8a14d9fcac2bd6130b914c
Step 1. The method takes all the attachments from a skin and adds them and their textures to a handful of scratch arrays (texturesToPack
, etc.). The attachments are also added to a new skin. All of this happens in lines 321 to 363.
Step 2. Once everything is collected, we generate a new texture and pack the collected texture regions from the attachments into it (lines 363 to 367). The result is a list of new UV coordinates for the repacked attachments stored in rects
.
Step 3. These rects are converted to AtlasRegions (lines 381 to 386). An AtlasRegion describes on what texture and where on that texture an attachment is.
Step 4. The AtlasRegions are then set on the repacked attachments (lines 389-393), which makes the attachments point to the repacked texture.
You have 2 atlases, one for diffuse and one for normals. If you pass each to that method, they packing will not be the same, so the UVs don't line up. To make that work, you'd have to modify the method to take both atlases, perform steps 1 and 2 for the diffuse atlas, and then use the rects from step 2 to manually copy the texture parts of the normal map atlas to a new repackged normap map texture. Finally, you'd have to do steps 3 and 4 for the normal map atlas as well.