Hi

we use the c-runtime and settings Skin seems not to work, only if a image is attached at all skins.

I made a small example. Only the left qube changes the skin at runtime.

In editor it looks right.

Spine Runtime tag 4.0 hash b7a7870

As a hack we can add a transparent image, but maybe there is a better solution.

Related Discussions
...

Can you show how you are setting the skin at runtime?

We use spSkeleton_setSkinByName like this:

void SpineObject::setSkin(const std::string &skin)
{
    int resault = spSkeleton_setSkinByName(skeleton->skeleton, skin.c_str());
    if (!resault)
    {
        jngl::debugLn("The Skin " + skin + " does not exist.");
    }
}

Thanks. Take a look at Skeleton setSkin.

When you call setSkin, the runtime doesn't know which attachments you want visible. You may want to call Skeleton setSlotsToSetupPose after setting the skin. That's commonly what is wanted, but not always, so the runtime doesn't do it for you. Alternatively, you may want to set the visible attachment for each slot yourself.

I know you probably created a test project to show the problem, but your skins are set up strangely. You probably don't want a skin placeholder for each skin.

The left box changes when you change skins because the old skin has it visible, so the attachment for the same skin placeholder in the new skin is also made visible. The right box doesn't change because the old skin doesn't have an attachment for that skin placeholder. The runtime doesn't know if you want or don't want the attachment in the new skin visible, so it leaves it blank.

Note it wouldn't usually make sense to make visible all the attachments in a skin when the skin is changed. Which attachments are visible either comes from what was visible in the old skin, or from the setup pose if you call Skeleton setSlotsToSetupPose, or whichever attachments you want to set (eg with Skeleton setAttachment).

14 days later

Thanks for explaining it so detailed.

I added the setSlotsToSetupPose and it's working fine now.