Heya
I have an issue where when I update a cat rig it confuses the data that’s stored in the tracks for a set of custom attributes it has on it. To get round this I’m writing a piece of code which will just store the original keys for the custom attribute subanims before the rig is updated and then reapply them. I have not found a way to make a deep copy of the keys though as when I clone them and then try to reapply the originals are deleted, the original keys are also lost.
I’ve now attempted to copy the controllers and then copy the keys back to the original controllers but I’m only getting the keys come through for a single subanim. Can anyone explain where I’m going wrong please?
fn CopyKeysBetweenControllers &OGController &newController =
(
for i = 1 to newController[1].numSubs do
(
newController[1].SelectedLayer = i
format "Pasting keys on SubAnim: % \n" newController[1][i].name
with animate on
(
for key in OGController[1].controller.LayerControllers[i].keys do
(
format "Pasting Key: % \n" key
at time key.time newController[1].controller.LayerControllers[i] = key.value
)
)
format "Resulting Keys: % \n" newController[1].controller.LayerControllers[i].keys
)
)