Hello folks,
Been looking through forums for a while but haven't found an answer yet. Went through the mix and match examples and docs extensively too.
We're looking to add one smaller skeleton into another main one with bones (and hopefully anims too). Primarily we're in need of customizing the location of bones per attached (sub) skeleton. There'd be tons of these customizations and updates so can't really have them all in one rig. And we need to do it at run-time.
Perhaps I'm doing something wrong... Seen also the ability to add Skins, but doesn't seem to add materials and parts from a different skeleton. And also with the mix and match, have also noticed the new sprite must fit into the old sprite's width and height, which in this case is undesired.
Any ideas?
Tried AddAttachments and AddSkin
Seems to add attachment references though (but not materials, skeleton slots, etc.). Would like to be able to use the Mix and Match techniques on the sub-skeleton after its been added.
// skin from the primary skeleton
var skeletonData = skeletonDataAsset.GetSkeletonData(true);
var templateSkin = skeletonData.FindSkin("default");
// skin from the second skeleton
var skeletonData2 = skeletonDataAttachment.GetSkeletonData(true);
var templateSkin2 = skeletonData2.FindSkin("default");
// expecting to place new bones, slots, image uvs, and materials
Skin collectedSkin = new Skin("Collected skin");
collectedSkin.Clear();
collectedSkin.AddAttachments(templateSkin);
collectedSkin.AddAttachments(templateSkin2);
skeletonAnimation.skeleton.SetSkin(collectedSkin);
skeletonAnimation.skeleton.SetSlotsToSetupPose();
skeletonAnimation.AnimationState.Apply(skeletonAnimation.Skeleton);
The secondary rig structure (we intend to make it more complex, but this gets us going)