Save and load bone animation to any file!!!
Moderators: Víctor Paredes, Belgarath, slowtiger
Vern,
One thing I can tell you -- I *never* type in any bone rotation values. I've always rotated bones by hand.
But, more than that, I never rotate bones on frame 0. I simply create them there by drawing them out -- if they aren't where I want them I delete them and start again. Quite frankly it never occurred to me to rotate them in the process of building a skeleton (duh!).
So I don't know how my bone values could be an issue here unless it just means that during creation this can happen -- but you are welcome to look at any of my rigs (bad as they are) to see.
One thing I can tell you -- I *never* type in any bone rotation values. I've always rotated bones by hand.
But, more than that, I never rotate bones on frame 0. I simply create them there by drawing them out -- if they aren't where I want them I delete them and start again. Quite frankly it never occurred to me to rotate them in the process of building a skeleton (duh!).
So I don't know how my bone values could be an issue here unless it just means that during creation this can happen -- but you are welcome to look at any of my rigs (bad as they are) to see.
I think I did it! I really think I did it!
Mkelly, please download this version. It is v 0.1d and the text file produced is 0.14:
http://www.lowrestv.com/anime_studio/sc ... n_v01d.zip
Please note, I have not updated this in the first thread. This is a different zip file. Once I get this one perfect I will update that one.
Here's the scoop though on some issues about what is happening.
The script now checks the bones on frame 0 of both files and properly adjusts all the key frames. But what is going to happen is that the first key frame will appear differently then from the saved file. All other keys will have identical rotations.
This is will cause those bones not to spin but they may appear rotated oddly. I have not taken into account "flipped" rigs yet as you described. I think I will need two actual files of yours to test this. I am going to try and "guesss" what you are doing and see if I can get that option in. For now this is a straight forward import that doesn't allow for mirror image rigs, rigs that are flipped left to right for 3/4 views.
p.s. Genete the GENIUS has come up with a much better solution. I will have to work on using his solution because it requires extensive changes to both scripts and the exported files. In the mean time test out this version to see if it works.
-vern
Mkelly, please download this version. It is v 0.1d and the text file produced is 0.14:
http://www.lowrestv.com/anime_studio/sc ... n_v01d.zip
Please note, I have not updated this in the first thread. This is a different zip file. Once I get this one perfect I will update that one.
Here's the scoop though on some issues about what is happening.
The script now checks the bones on frame 0 of both files and properly adjusts all the key frames. But what is going to happen is that the first key frame will appear differently then from the saved file. All other keys will have identical rotations.
This is will cause those bones not to spin but they may appear rotated oddly. I have not taken into account "flipped" rigs yet as you described. I think I will need two actual files of yours to test this. I am going to try and "guesss" what you are doing and see if I can get that option in. For now this is a straight forward import that doesn't allow for mirror image rigs, rigs that are flipped left to right for 3/4 views.
p.s. Genete the GENIUS has come up with a much better solution. I will have to work on using his solution because it requires extensive changes to both scripts and the exported files. In the mean time test out this version to see if it works.
-vern
Short answer: Yes, it is safe to save your files with the new version above or the one in the main link. I don't plan on changing the file format any more. I don't see any need for it because of the simplicty and the fact it has everything in it.
--------
Long answer:
At this point the last two versions are fine to save with. No changes have been made to the file format and I don't see any need to make any more except for version number changes.
Only the very first one would have been missing data if you saved starting at frame 1 instead of 0. Each version since that had all the data needed, I've only been changing the script that writes the file and added a version number to the text file.
So far everything works with the original data format and I will make sure it will continue to work until i decide to "weed out" the older versions once the final script has been locked down, or I need to make major changes. I don't see the need for that in the immediate future.
The file format is as simple as it can be. One line for the bone attribute (ie; AnimAngle) and the next line is the value. So simple. Why change it?
I have Genete's brilliant suggestion added in as sort of a separate function. I will upload that one soon but it basically works the same. If I look for the version number I can use that small bit of code or the original for any files saved now earlier or in the future.
Eventually I can phase out the old code... or not. It's just code. It's not like checking bags at the airport.
Basically what Genete suggested was to "normalize" the angle values based on frame 0 before they are written to the file. When the script reads the file back in to any file it will be reading the normalized values independent of frame 0 and applying them based on the new files frame 0 values.
It works really well and also allows for the option of "adding" the angles. It "adds" the rotations to the base rotation on frame 0. This would be an option as a check box since it might not be wanted in all situations. You may want the "original" saved values to be used.
I'm really thrilled with this. It's really taking shape. I hope to hear from Mkelly soon to verify the change worked in his situation. I have a feeling those "flipped" or reversed bones will require a bit more work. It's not exactly something I had planned for. I usually flip the layer if I want a character to turn the other way. I just don't know how feasible it will be.
---------
DK, can you send me another one of your saved files? I need to check line enders. Line enders are going to be the next issue to resolve so the files can be saved.
Each platform has different returns. I have to make sure I take that into account when READING the file. I wish the idiots who designed the dang computers in the first place would have PICKED ONE FREAKING TYPE OF LINE ENDER! What a bunch of idiots. It would be like if I went to Europe and couldn't plug in my hair dryer or... uh... never mind. Bad example. I have no hair.
-vern
--------
Long answer:
At this point the last two versions are fine to save with. No changes have been made to the file format and I don't see any need to make any more except for version number changes.
Only the very first one would have been missing data if you saved starting at frame 1 instead of 0. Each version since that had all the data needed, I've only been changing the script that writes the file and added a version number to the text file.
So far everything works with the original data format and I will make sure it will continue to work until i decide to "weed out" the older versions once the final script has been locked down, or I need to make major changes. I don't see the need for that in the immediate future.
The file format is as simple as it can be. One line for the bone attribute (ie; AnimAngle) and the next line is the value. So simple. Why change it?
I have Genete's brilliant suggestion added in as sort of a separate function. I will upload that one soon but it basically works the same. If I look for the version number I can use that small bit of code or the original for any files saved now earlier or in the future.
Eventually I can phase out the old code... or not. It's just code. It's not like checking bags at the airport.
Basically what Genete suggested was to "normalize" the angle values based on frame 0 before they are written to the file. When the script reads the file back in to any file it will be reading the normalized values independent of frame 0 and applying them based on the new files frame 0 values.
It works really well and also allows for the option of "adding" the angles. It "adds" the rotations to the base rotation on frame 0. This would be an option as a check box since it might not be wanted in all situations. You may want the "original" saved values to be used.
I'm really thrilled with this. It's really taking shape. I hope to hear from Mkelly soon to verify the change worked in his situation. I have a feeling those "flipped" or reversed bones will require a bit more work. It's not exactly something I had planned for. I usually flip the layer if I want a character to turn the other way. I just don't know how feasible it will be.
---------
DK, can you send me another one of your saved files? I need to check line enders. Line enders are going to be the next issue to resolve so the files can be saved.
Each platform has different returns. I have to make sure I take that into account when READING the file. I wish the idiots who designed the dang computers in the first place would have PICKED ONE FREAKING TYPE OF LINE ENDER! What a bunch of idiots. It would be like if I went to Europe and couldn't plug in my hair dryer or... uh... never mind. Bad example. I have no hair.
-vern
Hi Vern.
Here's a "RUN" cycle. When loaded you have to select all keys and set them to smooth...then select the last keyframes on the timeline and set them to cycle. It would be great if you could import cycled frames.
http://www.wienertoonz.com/RUN.zip
Cheers
D.K
Here's a "RUN" cycle. When loaded you have to select all keys and set them to smooth...then select the last keyframes on the timeline and set them to cycle. It would be great if you could import cycled frames.
http://www.wienertoonz.com/RUN.zip
Cheers
D.K
Thanks! Yes, key frame interpolation is next on my list. The code is there from the original Macton script but it isn't getting loaded. Macton had text to that effect so i need to see what the cause of the trouble is. Might be a simple fix... might not.DK wrote:It would be great if you could import cycled frames.
-vern
WOOOOOHOOOOOOO!!!!!
I did it I did it I did it!!!
Finally! Perfect crossplatform support for sharing files.
DK, I loaded that walk cycle PERFECTLY into my own test skeleton (it's a total mess to all the weird things I did to it for testing).
I have to go now and have dinner with my aged parents at the old folks home... well... it's their home... they are old folks... so....
Later tonight I will upload a new version.
Next up is key frame interpolation. The cycle key is going to be a pain. I never thought of that. The other keys should be easy, a single number tagged onto the end of the key value but the cycle key has frames... I'll figure it out.
-vern
I did it I did it I did it!!!
Finally! Perfect crossplatform support for sharing files.
DK, I loaded that walk cycle PERFECTLY into my own test skeleton (it's a total mess to all the weird things I did to it for testing).
I have to go now and have dinner with my aged parents at the old folks home... well... it's their home... they are old folks... so....
Later tonight I will upload a new version.
Next up is key frame interpolation. The cycle key is going to be a pain. I never thought of that. The other keys should be easy, a single number tagged onto the end of the key value but the cycle key has frames... I'll figure it out.
-vern
I just updated the link in the first post with the new version.
http://www.lowrestv.com/anime_studio/sc ... on_v02.zip
-vern
http://www.lowrestv.com/anime_studio/sc ... on_v02.zip
-vern