Hi
I'm using the C runtime and I need a list of all Point Attachment Names.
Is it possible to get the names via runtime?
Can someone post a code snippet or other hints?
Thanks a lot.
Kolja
1. sayfa (Toplam 1 sayfa)
pinguin
1 month ago
- pinguin
- Mesajlar: 5
Mario
This does the trick, including if you have more than 1 skin in your skeleton:
for (int i = 0; i < skeleton->data->skinsCount; i++) {
spSkin* skin = skeleton->data->skins[i];
spSkinEntry *entry = spSkin_getAttachments(skin);
while (entry) {
if (entry->attachment && entry->attachment->type == SP_ATTACHMENT_POINT) {
printf("%s\n", entry->attachment->name);
}
entry = entry->next;
}
}
spSkin* skin = skeleton->data->skins[i];
spSkinEntry *entry = spSkin_getAttachments(skin);
while (entry) {
if (entry->attachment && entry->attachment->type == SP_ATTACHMENT_POINT) {
printf("%s\n", entry->attachment->name);
}
entry = entry->next;
}
}
1 month ago
-
Mario - Mesajlar: 3082
pinguin
Hi Marion,
thanks a lot it's working like expected.
Do you know, is there a guaranteed order for the attachments?
Kolja
thanks a lot it's working like expected.
Do you know, is there a guaranteed order for the attachments?
Kolja
1 month ago
- pinguin
- Mesajlar: 5
Nate
Attachments in a skin are stored in a hash map, so the order is undefined. Attachments are sorted by name in the JSON and binary data format, but that order is lost when the data is loaded and the attachment is added to a skin.
1 month ago
-
Nate - Mesajlar: 11939
pinguin
Thanks for the info. Makes sense.
1 month ago
- pinguin
- Mesajlar: 5
Mark topic unread
• 1. sayfa (Toplam 1 sayfa)
Dön Runtimes
- Tüm zamanlar UTC