☑ Spine with new scripting system

Greetings,
Are there any plans for porting the Spine plugin to the new script system? I’ve been attempting to make it work but I’m not making much progress and I’m starting to get close to a deadline for evaluating PC. Any advice on porting the plugin or info about when a new version may be available would be a huge help.

Thanks

Hi,

Yes, we have a version of the spine plugin ported over already. I’ll get the repo updated in the mean time. I think you just need to replace the Entity script with this code:

var Spine = pc.createScript("spine");

Spine.attributes.add("atlas", {type: "asset", assetType: "text"});
Spine.attributes.add("skeleton", {type: "asset", assetType: "json"});
Spine.attributes.add("textures", {type: "asset", array: true, assetType: "texture"});
Spine.attributes.add("priority", {type: "number", default: 1});


Spine.prototype.initialize = function () {
    if (this.atlas && this.textures && this.skeleton) {
        // If all assets are present, add the spine component to the entity
        this.entity.addComponent("spine", {
            atlasAsset: this.atlas.id,
            textureAssets: this.textures.map(function (a) {return a.id}),
            skeletonAsset: this.skeleton.id
        });

        if(this.entity.spine) {
            this.priority = this.priority ? this.priority : 0;
            this.entity.spine.spine.priority = this.priority;
        }
    }    
};

We’re always on hand to help out with evaluations, so let us know if you have any more questions.

Thanks,

You. Are. AWESOME.
Apologies if that post seemed a bit terse, I’d been banging my head against the wall for a few hours before sending it. I’ll give this a shot asap and look forward to seeing the repo updates.

As for the eval I’m doing, its for a startup that is building a game-ified training system. There is already a product but everything is in a format that makes it extremely difficult to maintain. So for v2.0 we are looking to use a WebGL renderer for the “game” side and an overlay for UI content. I have lots of Unity experience and little JavaScript experience… but we have a hard requirement to run on the latest IE, which pretty much chokes on the Unity WebGL runtime. So far I really like PC because of the tooling, I just need to get over the JS learning curve.

Thanks for the quick response

Dave,
I just wanted to let you know that your patch worked.

This was a huge step forward, thanks again for the help and fast response.