I have a same issue when spine atlas textures compressed by BASIS.
In playcanvas-spine.3.6.js
line 7347 textureData[path] = asset.resource;
From PlayCanvas Engine v1.46.1,
asset.resource is mapped into textureData as path like “xxx.basis”.
However line 5200 page.texture = textureLoader(line); line from .atlas file is “xxx.png”
line 6726 return new SpineTextureWrapper(textureData[path]);
textureLoader get different path name, so textureData[path] is undefined.
line 6675 width: texture.width,
cause
TypeError: Cannot read property ‘width’ of undefined
I’m temporarily writing the code as follows.
This is probably the wrong way to fix it.
var atlas = new spine.TextureAtlas(atlasData, function (path) {
if(!textureData[path]) {
path = path.replace('.png', '.basis');
}
return new SpineTextureWrapper(textureData[path]);
});
In this PR we changed the workings of the asset file object to point to the selected variant. Now spine is picking up variant filename here instead of the original texture filename (.png).
I can see that asset.name is the original .png filename so the spine code could use that instead of asset.file.filename like so: