Skip to content

Commit 8191d58

Browse files
ClementPasteauD8H
authored andcommitted
TODO: fix asset not loading
1 parent 41ccb3a commit 8191d58

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Extensions/Spine/JsExtension.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ module.exports = {
323323
this._pixiResourcesLoader
324324
.getSpineData(this._project, this._spineResourceName)
325325
.then((spineDataOrLoadingError) => {
326+
console.log(spineDataOrLoadingError);
326327
if (this._wasDestroyed) return;
327328
if (this._spine) this._pixiObject.removeChild(this._spine);
328329

Extensions/Spine/managers/pixi-spine-atlas-manager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ namespace gdjs {
147147
: 'anonymous',
148148
});
149149
PIXI.Assets.add(resource.name, url, { images });
150+
console.log('Loading spine atlas:', resource.name, url, images);
150151
PIXI.Assets.load<pixi_spine.TextureAtlas | string>(resource.name).then(
151152
(atlas) => {
153+
console.log('Loaded spine atlas:', resource.name, atlas);
152154
/**
153155
* Ideally atlas of TextureAtlas should be passed here
154156
* but there is known issue in case of preloaded images (see https://github.com/pixijs/spine/issues/537)

newIDE/app/src/ObjectsRendering/PixiResourcesLoader.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ export default class PixiResourcesLoader {
622622
const promise = spineAtlasPromises[spineTextureAtlasName];
623623
if (promise) return promise;
624624

625+
console.log('in _getSpineTextureAtlas', spineTextureAtlasName);
626+
625627
if (!spineTextureAtlasName) {
626628
return {
627629
textureAtlas: null,
@@ -679,22 +681,33 @@ export default class PixiResourcesLoader {
679681
);
680682

681683
return (spineAtlasPromises[spineTextureAtlasName] = new Promise(resolve => {
684+
console.log('in _getSpineTextureAtlas promise', spineTextureAtlasName);
682685
const atlasUrl = ResourcesLoader.getResourceFullUrl(
683686
project,
684687
spineTextureAtlasName,
685688
{
686689
isResourceForPixi: true,
687690
}
688691
);
692+
console.log(atlasUrl);
689693
PIXI.Assets.setPreferences({
690694
preferWorkers: false,
691695
crossOrigin: checkIfCredentialsRequired(atlasUrl)
692696
? 'use-credentials'
693697
: 'anonymous',
694698
});
695699
PIXI.Assets.add(spineTextureAtlasName, atlasUrl, { images });
700+
console.log(
701+
'added',
702+
spineTextureAtlasName,
703+
resource,
704+
embeddedResourcesMapping
705+
);
696706
PIXI.Assets.load(spineTextureAtlasName).then(
697707
atlas => {
708+
// TODO: FIX.
709+
// atlas returned here is null for some reason even if the resource exists.
710+
console.log('loaded atlas', atlas);
698711
// Ideally atlas of type `TextureAtlas` should be passed here.
699712
// But there is a known issue in case of preloaded images (see https://github.com/pixijs/spine/issues/537
700713
// and search the other mentions to this issue in the codebase).
@@ -787,6 +800,8 @@ export default class PixiResourcesLoader {
787800
};
788801
}
789802

803+
console.log(spineName);
804+
790805
return (spineDataPromises[spineName] = new Promise(resolve => {
791806
this._getSpineTextureAtlas(project, spineTextureAtlasName).then(
792807
textureAtlasOrLoadingError => {
@@ -798,6 +813,8 @@ export default class PixiResourcesLoader {
798813
});
799814
}
800815

816+
console.log(textureAtlasOrLoadingError);
817+
801818
const spineUrl = ResourcesLoader.getResourceFullUrl(
802819
project,
803820
spineName,

0 commit comments

Comments
 (0)