Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading JSON, Atlas, and image from data URLs #501

Open
ABrozovic opened this issue May 12, 2023 · 3 comments
Open

Loading JSON, Atlas, and image from data URLs #501

ABrozovic opened this issue May 12, 2023 · 3 comments

Comments

@ABrozovic
Copy link

Description:
I'm currently working with Pixi.js and the Spine loader to load a Spine animation that consists of a JSON file and an accompanying Atlas file. While the Pixi.js/Spine loader handles the JSON file correctly, I'm encountering an issue when trying to parse the Atlas data URL.

I have attempted to modify the metadata fields, but haven't been successful in resolving the problem. It seems that the Asset loader is unable to properly parse the Atlas data URL.

Additional Information:
I have verified that the Atlas data URL is valid and contains the necessary information.
I have explored modifying the metadata fields in an attempt to resolve the issue, but have been unsuccessful so far.

Environment:
pixi.js: 7.2.4
pixi-spine: 4.0.3
spine:3.8

I made some small modifications to the SpineLoaderAbstract.ts and atlasLoader.ts files to handle this way:

const manifest = {
      bundles: [
        {
          name: 'tank',
          assets: [
            {
              name: 'tank',
              srcs: jsonDataURL,
              data: {
                image: imageDataURL,
                spineAtlasFile: atlasDataURL,
              },
            },
          ],
        },
      ],
    };

However, I would like to know if there is an existing solution or configuration that allows for the parsing of data URLs without requiring any modifications.

@JonnyCodes
Copy link

Is this the same issue I've fixed in this PR?

@miltoncandelero
Copy link
Contributor

I need to know the urls and the content of the .atlas file since the route for the .png is stored inside of that file

@ABrozovic
Copy link
Author

ABrozovic commented May 25, 2023

Is this the same issue I've fixed in this PR?

What I'm trying to achieve is to load a spine animation by utilizing strings/Data URLs exclusively for the json, image, and atlas files.
This would be one of the use cases https://spine-tools.vercel.app/

I need to know the urls and the content of the .atlas file since the route for the .png is stored inside of that file

Here are the modifications I have implemented to address issue #506. If you have any alternative suggestions, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants