• Bugs
  • Only Skeleton in scene

Related Discussions
...

Does your skeleton not have attachments in its default skin? Do you have other skins than the empty default skin? Then you have to set a skin first, e.g. like this:

[skeletonNode setSkin:@"your-skin-name-here"];

You are setting the skin in the 5th code line in your code above. Just change the name to the skin you want to use.

badlogic a écrit

Does your skeleton not have attachments in its default skin? Do you have other skins than the empty default skin? Then you have to set a skin first, e.g. like this:

[skeletonNode setSkin:@"your-skin-name-here"];

You are setting the skin in the 5th code line in your code above. Just change the name to the skin you want to use.

Really appreciate for your reply. My myskeleton.json has default skins, followed by another skin json node, see this

"skins": {
        "default": {
            "1x/shadow": {
                "shadow": {
                    "y": 6.15,
                    "scaleX": 0.542,
                    "rotation": 360,
                    "width": 203,
                    "height": 27
                }
            },
            "base_body": {
                "body": {
                    "color": "ce7272ff",
                    "x": 56.64,
                    "rotation": -90,
                    "width": 36,
                    "height": 99
                }
            },
            "base_head": {
                "head": {
                    "color": "ce7272ff",
                    "x": 51.38,
                    "rotation": -90,
                    "width": 54,
                    "height": 55
                }
            },
            "base_left_foot": {
                "foot_left": {
                    "color": "ce7272ff",
                    "x": 14.43,
                    "y": -8.58,
                    "scaleX": 0.995,
                    "rotation": 89.42,
                    "width": 29,
                    "height": 24
                }
            },
            "base_left_hand": {
                "left_hand": {
                    "color": "ce7272ff",
                    "x": 1.59,
                    "y": -0.2,
                    "scaleX": 0.5,
                    "scaleY": 0.5,
                    "rotation": -89.27,
                    "width": 20,
                    "height": 20
                }
            },
            "base_left_lower_arm": {
                "left_lower_arm": {
                    "color": "ce7272ff",
                    "x": 23.11,
                    "y": 0.46,
                    "rotation": 103.96,
                    "width": 25,
                    "height": 55
                }
            },
            "base_left_lower_leg": {
                "left_lower_leg": {
                    "color": "ce7272ff",
                    "x": 38.31,
                    "y": 0.06,
                    "rotation": 89.87,
                    "width": 10,
                    "height": 72
                }
            },
            "base_left_upper_arm": {
                "left_upper_arm": {
                    "color": "ce7272ff",
                    "x": 33.48,
                    "y": -0.05,
                    "rotation": 106.91,
                    "width": 25,
                    "height": 57
                }
            },
            "base_left_upper_leg": {
                "lower_upper_leg": {
                    "color": "ce7272ff",
                    "x": 28.81,
                    "y": -0.8,
                    "rotation": 89.11,
                    "width": 10,
                    "height": 74
                }
            },
            "base_right_foot": {
                "foot_right": {
                    "color": "ce7272ff",
                    "x": 14.41,
                    "y": 8.3,
                    "rotation": 90.87,
                    "width": 29,
                    "height": 24
                }
            },
            "base_right_hand": {
                "right_hand": {
                    "color": "ce7171ff",
                    "x": 2.75,
                    "y": 2.14,
                    "scaleX": 0.5,
                    "scaleY": 0.5,
                    "rotation": -89.55,
                    "width": 20,
                    "height": 20
                }
            },
            "base_right_lower_arm": {
                "right_lower_arm": {
                    "color": "ce7171ff",
                    "x": 23.28,
                    "y": -1.34,
                    "rotation": 72.02,
                    "width": 24,
                    "height": 55
                }
            },
            "base_right_lower_leg": {
                "right_lower_leg": {
                    "color": "ce7171ff",
                    "x": 38.32,
                    "y": -0.83,
                    "rotation": 89.69,
                    "width": 10,
                    "height": 72
                }
            },
            "base_right_upper_arm": {
                "right_upper_arm": {
                    "color": "ce7171ff",
                    "x": 33.47,
                    "y": -0.98,
                    "rotation": 72.2,
                    "width": 25,
                    "height": 57
                }
            },
            "base_right_upper_leg": {
                "right_upper_leg": {
                    "color": "ce7171ff",
                    "x": 28.82,
                    "y": 0.23,
                    "rotation": 90.44,
                    "width": 10,
                    "height": 74
                }
            },
            "base_waist": {
                "waist": {
                    "color": "ce7171ff",
                    "y": 3.57,
                    "scaleX": 0.471,
                    "scaleY": 0.392,
                    "width": 34,
                    "height": 34
                }
            }
        },

I already set the skin to default with

[skeletonNode setSkin:@"default"];

Or should I manually set all skin listed in my myskeleton.json'skin?

No, if your skeleton has a default skin with attachments (and based on your copy & paste it does), then just calling setSkin:@"default" should do the trick.

Could you maybe try to load and display your skeleton with your spine-cocos2d-objc project? It's hard to diagnose what's going on without having access to your exact setup.

badlogic a écrit

No, if your skeleton has a default skin with attachments (and based on your copy & paste it does), then just calling setSkin:@"default" should do the trick.

Could you maybe try to load and display your skeleton with your spine-cocos2d-objc project? It's hard to diagnose what's going on without having access to your exact setup.

Already tried my skeleton in the spine-cocos2d-objc project example, but still only bones. I replaced the asset from RaptorExample scene. Is there any something that cause it happen?

I can not tell without your .json, .atlas, and .png files I'm afraid.

badlogic a écrit

I can not tell without your .json, .atlas, and .png files I'm afraid.

Here is my asset, looking forward to see your help. Thank you.

This is what I see when loading your skeleton into our spine-cocos2d-objc example project, modifying "SpineboyExample.m":

https://marioslab.io/uploads/screenshots/vUHxoNdYRH.png

This is what is to be expected based on the "default" skin. E.g. this is what you see in the Spine Editor when the "default" skin is activated.

https://marioslab.io/uploads/screenshots/oWhvLQlTU5.png

This is correct.

How to open that asset in spine editor?

You can import .json files in the editor: Import - Spine User Guide

You can also unpack the .atlas files into a folder. Then set the Images node in the editor to the folder to which you unpacked the atlas.

badlogic a écrit

This is what I see when loading your skeleton into our spine-cocos2d-objc example project, modifying "SpineboyExample.m":

https://marioslab.io/uploads/screenshots/vUHxoNdYRH.png

This is what is to be expected based on the "default" skin. E.g. this is what you see in the Spine Editor when the "default" skin is activated.

https://marioslab.io/uploads/screenshots/oWhvLQlTU5.png

This is correct.

I think i need to add some of the skin manually. Is there any way to do it? Something like

Skin newSkin = new Skin("new-skin"); // 1. Create a new empty skin
newSkin.addSkin(skeletonData.findSkin("shirt/pink"); // 2. Add items
newSkin.addSkin(skeletonData.findSkin("pants/green");
newSkin.addSkin(skeletonData.findSkin("shoes/sneakers");

Sure! Assuming you are working with Spine 3.8 and the corresponding runtimes, you can use the spine-c Skin API as illustrated here:

spine-runtimes/main.cpp at 3.8