View Full Version : Copy & Paste Animation between Files?
ftTam 03-11-2011, 06:51 AM Hi Everyone!
Can any experienced Blenderers point me towards any tutorials that explain (ideally as if to an idiot :0) how you could copy animation from an armature in one blend file, and paste it onto an identical armature in another blend file (if indeed you can)?
So, basicially, can you transfer animation berween scenes? I've got my fingers crossed that it might be possible with datablocks and or the NLA editor, but cant seem to find a definitive answer or simple instructions...
Cheeeers Muchly,
Tam :bounce:
PS: Nearly forgot to mention... im using 2.5
|
|
RichardMarklew
03-11-2011, 03:23 PM
You can append 'Actions' from one blend to another with Shift+F1. You can then apply the imported in the Action Editor window
ftTam
03-11-2011, 03:42 PM
Thankyou Richard thats the best news i've had all day!
(Apologies for the duplicated post btw - i originally posted yesterday, and it hadn't appeared by this morning, so i posted another one.)
twohot
03-25-2011, 07:07 PM
Hmm, so this can be done through the Action-Editor. I'll be sure to experiment on that method. I achieve same functionality via two scripted tools that dump the keys to a file, and read it into another armature (It can be modified to dump to memory/variable).
It is still a manipulation of 'Actions' but through the curves ... I haven't tried it with the Action-Editor yet.
ftTam
03-28-2011, 09:19 AM
Would you be willing to share your scripts with us 2hot, or is it for personal use, as it were? :)
twohot
03-28-2011, 05:21 PM
Would you be willing to share your scripts with us 2hot, or is it for personal use, as it were? :)
Us? :curious:
Us? :curious:
Blender users in general was implied from what I can tell.
twohot
03-29-2011, 03:04 AM
Blender users in general was implied from what I can tell.
I got the insinuation the first time, fktt. I was just wondering if 'Blender Users' in general are actually 'in need' of that or just ftTam. The last time I shared a script, I got no feedback. That seemed to communicate that it wasn't a 'general need'. It is also, largely, possible that my forerunners/scripting gurus already have their versions of this tool. So, until it obviously becomes a general need (in which case, someone needs to file a 'feature request' at Blender Bug system), a PM request will be more appropriate for now.
Well, most users tend to be forum lurkers at best, so they probably wont be posting much if at all.
Also, there may yet be someone searching for a way to do something in python
and stumble on to your script as a source for a solution.
Even if your script only ends up helping a few,
that's still a few whom it would save a lot of head ache, and that's still something.
So unless your feeling overly protective of your code, I suppose it can't hurt to post it,
not like you have an obligation to maintain and offer support for the script,
unless you really want to off course. ;)
twohot
03-29-2011, 06:31 AM
Well, most users tend to be forum lurkers at best, so they probably wont be posting much if at all.
Also, there may yet be someone searching for a way to do something in python
and stumble on to your script as a source for a solution.
Even if your script only ends up helping a few,
that's still a few whom it would save a lot of head ache, and that's still something.
So unless your feeling overly protective of your code, I suppose it can't hurt to post it,
not like you have an obligation to maintain and offer support for the script,
unless you really want to off course. ;)
You know, fktt ... you've always had a way with words. I give you that.:thumbsup: No, this is not the kind of code to be 'overly protective' of. I composed it with the kind assistance of mfoxdogg, ideasman_42 and aligorith on #blendercoders IRC channel at freenode. Nice Python API Gurus, those people. They didn't even know how much their input was worth. Besides, its a very basic code ... any Python enthusiast can do it within minutes. I was only wondering if its worth sharing with the broad audience.
:banghead: Argh! To cut the story short, its here (http://pastebin.com/FmaHbwun).
Disclaimer: It has not been tested widely. It works for rigs or objects of same type, hierarchy and bone names.
Usage: Put it in the Scripts folder of choice and point Blender to that Script folder using the preference dialogue. It provides two functions named dump and dub under bpy.ops.action. The first dumps the keys of the selected object to '/tmp/blender' and the second loads the data unto another selected object provided the selection meets the criteria in the above disclaimer.
You can tell its for Blender running on Linux machine. So, users may have to tweak some lines in the code to make it work in Windows. Feedback is always welcome - it helps to improve the code and encourages me to learn more. :)
ftTam
03-29-2011, 01:26 PM
Thanks TwoHot!
I know exactly what you mean, that thing of posting something, getting a deafening silence in response, then thinking 'uhhhh, so did that actually help anyone?' But i agree with Fktt's theory that plenty of forum lurkers, and regular users do get something out of it.
For myself, because i'm really new to Blender, i'm interested in looking at all the possible options to do stuff i know i'll need to deal with further down the line. Copy/Paste animation is one that always crops up sooner or later in my workflow. Another one i often wish for but rarely find (despite flip pose options always being available) is flip animation. Surely this could be possible by just running a flip pose script for every frame of the timeline, then running another script that reduces the number of keyframes if necessary? Tho since i know - well - next to jacks**t about coding really, im just speculating :0D
Anyway, enough waffle from me: many thanks TwoHot, for the Copy/Paste script! :beer: I dont know anything about Python, so i might have to show it to my better half before i can run it on a Mac. But i'll swing by again when i do with feedback :0)
~Tam
twohot
03-30-2011, 06:16 AM
Thanks Twohot!
You're welcome
Another one i often wish for but rarely find (despite flip pose options always being available) is flip animation. Surely this could be possible by just running a flip pose script for every frame of the timeline, then running another script that reduces the number of keyframes if necessary? Tho since i know - well - next to jacks**t about coding really, im just speculating
Hmm, not really ... its an idea that can work but there are other things to consider. Iterating through the keys and flipping poses is a scripting assignment (... and I may compose that soon if its not already freely provided somewhere) but calculating the new positions of the curve handles may prove tough. The handles determine the ease-in and ease-outs of the motion or animation ... In other words, the smoothness. Getting the flip is easy ... rearranging the curve handles to maintain that same motion (in its flipped state) is the real challenge. I may be wrong because this is hypothetical ... It might be a breeze in practice when I actually look at the curve profile - now I'm brainstorming.
Reducing keyframes also affects the motion curves requiring that you adjust those handles again. Each point in a keyframe has handles. Remove the keyframes and the handles go with them ... that changes the profile of the curve and the animation.
ftTam
03-31-2011, 12:27 PM
Ah, good point! Yeah, i have to work with f-curves frequently myself so i definitely see your concerns about the handles etc.
Thinking back.. a technical artist at my last place managed to write a script that flipped quite complex animations successfully, although this was for Max... and i cant remember if it left a keyframe on every frame... maybe i'll prod him for his innermost secrets :) . There is a controller in Max that doesnt use conventional f-curves (TCB), so maybe this has something to do with it...
neuromancer1978
03-31-2011, 05:37 PM
I go by the assumption that there won't be feedback and if there is, it most likely is a complaint. I work in customer service daily so generally that is how people in general regard feedback, when one has a complaint then they are all about making sure SOMEONE knows, yet only a few actually give positive feedback or suggestions even. Most just stay silent.
When I post something I assume that very little will be said, I don't care either (unless it's against policies, rudeness, flame bait etc....) in general when posting something in the "Hey look here at this..." it's just that... if it gets good response then cool, if not oh well there are other things to worry about.
In regards to tools though, that is different. Some of the tools I have written or modified have had little or no response at all... in both positive or negative... I guess that's good??? Not sure. Eh... I don't loose sleep over it, I am not a programmer anyway lol.
twohot
04-01-2011, 09:38 AM
In regards to tools though, that is different. Some of the tools I have written or modified have had little or no response at all... in both positive or negative... I guess that's good??? Not sure. Eh... I don't loose sleep over it, I am not a programmer anyway lol.
:argh: That's ingratitude. A simple 'Thanks' does a lot. While I agree with you that It shouldn't bother me, I certainly don't think its a wonderful trend. I am often tempted to narrow my free contributions to those open enough to ask ... and do further service to those who remember to show gratitude. But then, people will be people. Shit happens! No sweat, what really matters is the inward satisfaction that comes with making a positive impact -- now that's a treasure.
Hey, If you can script, then ... hurray! you're a programmer. Maybe not a pro programmer, but indeed you're a programmer. Competing with the pros is a different ball game. Guess what? I've decided to give this scripted animation flip tool a try -- another pet project to grease and test my rusty python brains. :)
Happy to see you've linked the script. :)
Hey, If you can script, then ... hurray! you're a programmer. Maybe not a pro programmer, but indeed you're a programmer. Competing with the pros is a different ball game. Guess what? I've decided to give this scripted animation flip tool a try -- another pet project to grease and test my rusty python brains. :)
I can hack glsl & CG shaders together as well as some hacky code in ECMAScript & C/Cpp/C#/D,
doesn't make me a programmer, but you could call me a hacker
(not to be mistaken for a black-hat/cracker) then. ;)
twohot
04-01-2011, 09:30 PM
Happy to see you've linked the script. :)
fktt is hard to resist :)
I can hack glsl & CG shaders together as well as some hacky code in ECMAScript & C/Cpp/C#/D,
doesn't make me a programmer, but you could call me a hacker
(not to be mistaken for a black-hat/cracker) then. ;)
:bowdown:wow, wow, wow, wow ... now that's something. So what's the separating factor between hacking and coding/programming? Then you have cracking ... they all seem to be different ends achieved through same means i.e. programming. Looks like I've found myself a guide to shaders :deal: (that area appears mysterious at the moment). I can read C/C++ just up to where pointers become deep and class semantics look alien. I'll get it someday.
:bowdown:wow, wow, wow, wow ... now that's something. So what's the separating factor between hacking and coding/programming? Then you have cracking ... they all seem to be different ends achieved through same means i.e. programming. Looks like I've found myself a guide to shaders :deal: (that area appears mysterious at the moment). I can read C/C++ just up to where pointers become deep and class semantics look alien. I'll get it someday.
Ha-ha, don't read too much into it, as I said: hack,
that is to say I "scavenge" other peoples code for reference
and hack code together just so it functions, it wont be anywhere near optimal,
and every time I have to remind myself coding principles all over again just the same, nothing special really. ;)
The only reason it "kinda" works out is that I learned to read code back when I was twelve.
So using others code as reference works, writing something from scratch is crazy talk though. :D
twohot
04-02-2011, 02:30 PM
I just had a weird experience with the script. I decided to test-run it again and found it wasn't loading. Blender wasn't seeing it any more. I spent two hours troubleshooting the development before I could figure it out. Here is the solution if you're having the same problem:
1. Create a startup folder within your Script Folder (e.g. myScripts/startup)
2. Put the script in the startup sub-folder
3. Point Blender to the Script Folder (myScripts ... NOT myScripts/startup)
Such detail shouldn't be missing in Blender Docs but I'm grateful for people at #blendercoders. Don't forget to update the script. I changed it a bit. Now you should see a flip() function too ... but its not working yet.
CGTalk Moderation
04-02-2011, 02:30 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.