Jump to content

Loading *.skel issue, on spineData


AvetisSargsian
 Share

Recommended Posts

Hello, I am trying to load and use spine in my project, but
When I am trying to load .skel file Loader defines the type of file incorrectly.
explain to me what I am doing wrong, please.

Loader.shared.add('ambient', 'assets/art/@1.5x/spine/ambient/ambient.skel')
Loader.shared.load(()=>{
	const resources = Loader.shared.resources;
    const { spineData } = resources['ambient_spine'];
    const spine = new Spine(spineData);
    Application.STAGE().addChild(spine);
})

 

"pixi-spine": "^3.0.13",

"pixi.js": "^6.2.2"


,1444510720_Screenshot2022-04-18at14_58_11.thumb.png.7b7e0d24e87502714bae8287ac3c58fe.png

Link to comment
Share on other sites

Hello again, so I found how to solve the issue, but I didn't  understand why it is happening;

In a nutshell, I solve it by adding these 2 lines in the module(file) where I create PIXI.Application

Loader.registerPlugin(SpineParser); 
LoaderResource.setExtensionXhrType('skel', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);

I know that pixi-spine is doing these 2 operations when it is loaded to the project, but in my case:

Loader._plugins and LoaderResource._xhrTypeMap where the pixi-spine setup happening is different from the Loader and LoaderResource that was used by the pixi app.

strange behavior looks like modules of the project loaded in the wrong way, or twice, or from different places...this needs to be investigated.

I assume that it is somehow related to webpack config or some other setting in the project, if anyone have any info on this please share :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...