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
Page 1 of 1
pinguin
1 month ago
- pinguin
- Posts: 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 - Posts: 3089
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
- Posts: 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 - Posts: 11943
pinguin
Thanks for the info. Makes sense.
1 month ago
- pinguin
- Posts: 5
Mark topic unread
• Page 1 of 1
Return to Runtimes
- All times are UTC