Error in adding spine from remote

Error in adding spine from remote.
Following this link :

also found this on discuss but it is of no use

export class spineAnim extends Component {
    start() {
        let image = "";
        let ske = "";
        let atlas = "";

        assetManager.loadRemote(image, (error, texture: Texture2D) => {
            if (error) {
            } else {
                        { url: atlas, ext: ".txt" },
                        { url: ske, ext: ".txt" },
                    (finished, total, item) => {
                        console.log(finished, total, item);
                    (err, imageAsset) => {
                        if (err) {
                        } else {
                            console.log("texture", texture);
                            console.log("JSON", imageAsset[1]);
                            console.log("Atlas", imageAsset[0]);
                            let asset = new sp.SkeletonData();
                            asset.skeletonJson = imageAsset[1];
                            asset.atlasText = imageAsset[0];
                            asset.textures = [texture];
                            asset.textureNames = ["maskLeft.png"];
                            this.node.getComponent(sp.Skeleton).skeletonData = asset;

Assets are loaded successfully but the error is:

skeleton-texture.ts:50 Uncaught TypeError: this.getRealTexture(…).setFilters is not a function
at SkeletonTexture.setFilters (skeleton-texture.ts:50:36)

Cocos version 3.6.2

Hi, I tested with the code you provided and it works fine, but there is a mistake in your code.

  • The object loaded by assetManager.loadRemote is an imageAsset object, not a texture2D object, so you need to create a texture2d object and use the imageAsset data to assign it.

I will provide the test code and the test project

  1. download the code package, open the project with visual studio code, and install the live server extension on visual studio code, and set the remote folder to the local server’s remote load path address
  2. In the code, first load the image object of texture and create texture2D dynamically, initialize the texture2D object with the image data.
  3. load the ske data and json data, and fill the spine’s SkeletonData data, and set the spine’s animation.

Finish the remote loading of spine by the above steps (1.4 MB)

Thank You :grinning:

Why this same is not working for local storage? @muxiandong
Like loading spine from localStorage for Android.
Creator 3.5.2
Getting this error

Can not render dynamic created SkeletonData