animating multiple frames in MilkShape?


BillyNair
07-24-2004, 12:58 PM
In trying to get this PacPack (PTC, Pacific Theater Conversion) done, I decided to learn how to animate. I can caveman my way through but there are a few things that I don't know how to do that would make things 1 Billyon times easier. Right now I am working on animations for the Johnson LMG, and the animations were for a different gun with the magazine on the right side of the gun, where the Johnson is on the left, so I have the left hand grab the magazine.

I have the right hand down 'NEAR' the rear grip, but it floats around, and I need it to stay in place. I can brute force it and copy the fore-arm to each and every of the 110 frames, but there has got to be a better way (I hope)

THE QUESTION:
Is there a way to select multiple frames to do an action on?
(Specificly I want to paste that forearm onto frames 2~110)

Billie|Joe
07-24-2004, 01:36 PM
yeah...a "paste to all keyframes" would be a lot of help. There probably is a way, just not in milkshape :o :(

Trp. Jed
07-24-2004, 03:10 PM
The irony is I could write a plug-in to do it but I am absolutely crap at coding GUIs in C++ so thats a no-no.

I'm guessing though you just want something along the lines of selecting a bone from a drop down list, choose the source frame and then say which frames to paste it into?

One way might be to export you MS3D model in the MS3D ASCII format because you can edit certain elements in Notepad and its a darn sight easier and better than doing it with an SMD because you dont have a keyframe for each bone for each frame.

I've attached the MS3D Ascii format specs but in short you could try this:

Find the bone (joint) that you want to copy the keyframes for and look for the position and rotation keys. They look something like this (without the comments):


// name
"joint1"

// parent name
""

// joint: flags, posx, posy, posz, rotx, roty, rotz
0 0.250000 0.000000 0.000000 0.224024 1.570796 0.000000

// number of position keys
2

// position key: time, posx, posy, posz
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000

// number of rotation keys
2

// rotation key: time, rotx, roty, rotz
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000


Now, as you can see in the above example, there are keyframes for this joint on frame 1 and 30 so Milkshape will interpolate the translation (movement) and rotation of the bone between these two frames.

If you want to copy a keyframe for a specific bone, you could copy the position and rotation key for that frame, paste it in the relevant part and change the frame number, for example:


// number of position keys
2

// position key: time, posx, posy, posz
1.000000 0.000000 0.000000 0.000000
15.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000

// number of rotation keys
2

// rotation key: time, rotx, roty, rotz
1.000000 0.000000 0.000000 0.000000
15.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000


In this case, I've added a new keyframe on frame 15 with the relevant aposition and angles of rotation.

In theory you could copy and paste these value as you need and then re-import the TXT file into MS3D and off you go.

Also, in theory you dont need to paste the values into every frame. For example, if you want a bone to maintain its position between frames 10 and 25, just put keyframes on those frames. In theory as there is no difference in the keys the bone wont move in the frames in between. However... I have seen MS3D be a little wierd sometimes and "wobble" between two identical keyframes.

Also, keep in mind two important things.

First, that the rotation and position are always relative to the parent bone and note the global coordinate system. Probably of little use but good to know.

Second, keyframes only effect that bone and NOT the children of it. So for example, if your pasting a keyframe in to say keep an elbow joint in the same place, if the wrist, hand, finger, etc. bones have movement keyframes they'll still move. If you really want to lock the arm solid you'll need to paste keyframes for all the bones beneath it as well.

Personally I've ditched MS3D for animation and use Max instead. Using the timeline is tons easier and being able to do easing between keyframes makes it much more worthwhile.

Gmax uses the same system I believe but there isnt an SMD export plug-in for it but you might be able to use MD3 format as an interim and use MS3D for the final export.

Also, check the Milkshape3D forums, especially the "Announce" section. Thats where new plugins get released and I've seen a few animation plugins in there.

BillyNair
07-24-2004, 04:22 PM
Good stuff, i will see what I can make out in that TXT file. That might be all I need (want better, btu since I JUST paid for Milkshape, I can't just throw it away for another program. (Need to find a free animator)



Originally posted by Trp. Jed
However... I have seen MS3D be a little wierd sometimes and "wobble" between two identical keyframes. that is exactly what I need this for, not for other goodies, but to stop that damn motion where there is no keyframe telling it to move. It looks like it will work as long as you did it right the first time, but if you move a key frame later it will keep the old motion.
I have tried to trick it by removing the old keyframes, it will work how it should, then go back in and try adding another in the middle and it will remember the OLD motion, even through closing/opening MS.

Trp. Jed
07-24-2004, 06:53 PM
Try this plugin.

http://www.swissquake.ch/chumbalum-soft/forum/showthread.php3?s=&threadid=12258&perpage=15&pagenumber=1

I believe it has a copy/paste function in it.

BillyNair
07-27-2004, 03:39 AM
hey Jed, thanks for the replys.

I tried that plug-in and it LOOKED like it might work until I went back and tried to see it in animation mode, once i pressed the button, it crashed. I tried to keep the animation button on when i tried it, this time it crashed once i touched the scrub bar. Oh well.

As for the TXT file, holy cow, the anim I am working on has about 80 joints, and 156 frames, most of the frames are key frames so looking at that TXT file is like skimming the phone book looking for a name in a phone book by their phone number (caller ID gives you the number but no name, so you skim the numbers to find the name)

You said that you can't code GUIs very well, but if you could do this one thing, I am sure a lot of animators would loan you thier GFs for a few nights:
In a basic console app (C++), allow the user to remove the complete frame in an animation (say you just need to remove #30),
1) ask for the file name (user types reload.ms3d)]
2) ask which frame needs to be stripped from the anim (user types 30)
3) frame 30 is removed and as a result the animation goes from 160 frames to 159

Why is this valuable??
there are a few times where I have everything perfect, but there is a frame or 2 that are just off enough to mess everything up. Moving each frame from 30 to 160 back one frame will work, but undeniably time consuming (days if not weeks, and what are the chances you mess up a frame on the way)
Also this will allow someone to create a 0th frame in this way:
Make the anim you need for the 0th frame, merge or import the anim you have onto the end of the 0th frame anim, and remove the added frames (should be frame #2 and #3, since MS creates the 0th frame from your #1 frame, unless the 0th frame was a key frame)

k, that one will be uber elite to use. This next one is actualy for the problem that started this thread:

1) open the MS3D (filename)
2) ask which joint to copy (joint 71) (this would be cool with a print out of all the joints, but, typing it in could work)
3) ask which frame you want to reference from that joint (say you like the joints position in frame 18, type 18)
4) ask which frames you want to paste to (19 <ENTER> 45 <ENTER> - pastes the position the joint was in from frame 18 onto the positions of that joint from frames 19 to 45)

This second one would be good to have, but that frame removal program would rule. I realize making GUIs is a pain, I am a software engenering major and I know, but I know that this would be a lot easier. Even if it was done using the TXT MS creates would be good enough, anything is better then the alternative: NOTHING, or Caveman style (paste each frame one step back for all 160 frames)

Don't feel obligated, I realize poeple have lives outside of the MSA forums, but if I was to get these I would consider it the best Christmas in July ever ;)

Trp. Jed
07-27-2004, 08:06 PM
O.K. I dont know if your aware but there is limited scripting support in Milkshape that lets you write your own basic sort of plugins using Javascript.

I read what you wrote but I'm still not 100% clear on some parts.

It should be easy enough to write something that deletes a frame from all bones, say in a 30 frame animation you say drop frame 15 and all bones lose frame 15 and the animation length drops to 29.

It should also be easy to write something that removes a keyframe or range of keyframes for a set bone or bones. i.e if you have bone Bip01 and you want to delete all the keyframes for just that bone between say 15 and 20, that could be possible.

You'd need to give me more specific examples though.

Sushi
07-28-2004, 03:41 AM
Jed, I'd owe you my life if you could write a plugin like that.

Billy:
The best thing you can do before any plugin that helps with animations exists, you can change they keys in which you animate with. Go to tools>Shortcut & Plugin Manager to do that. Heres my animation keyset:

Toggle Operate on Selected Joints only: Insert
Set Keyframe: Home
Delete Keyframe: Ctrl + Home
Copy Keyframe: Page Up
Paste Keyframe: Page Down
Remove all Keyframes: Shift + End

I find it more comfortable and easy to have all my animation keys in 1 place.

Now, for your question (Given that you use my keyset/A similar keyset):
-Toggle OoSJo (operate on selected joints only)
-Select the forearm position and copy it

(I move my mouse over the next keyframe button to do this next part)

-Paste + Set Keyframe + Next Keyframe, repeat

With the amount of keyframes you have in your current anim, it shouldnt take more than 30 seconds.

Of course, you should do this AFTER you finish the basic actions of your anim.

Trp. Jed
07-28-2004, 04:20 AM
Originally posted by Sushi
Jed, I'd owe you my life if you could write a plugin like that.

Well I was chatting with Nem about it early today and about how I could make a grid type interface with the frames along the top and the bones along the side and each "cells" showing a set keyframe or not. It would then just be a case of copying cells from one place to another or deleting them.

However, as I said, thats a bit beyond my abilities to be honest.

BillyNair
07-28-2004, 09:32 AM
Originally posted by Trp. Jed
I read what you wrote but I'm still not 100% clear on some parts.

It should be easy enough to write something that deletes a frame from all bones, say in a 30 frame animation you say drop frame 15 and all bones lose frame 15 and the animation length drops to 29.

It should also be easy to write something that removes a keyframe or range of keyframes for a set bone or bones. i.e if you have bone Bip01 and you want to delete all the keyframes for just that bone between say 15 and 20, that could be possible.

You'd need to give me more specific examples though. what you have here is what i was talking about, yes, all the bones/keyframes/animations/hairstyles in frame 15 would be removed, then all the info in frame 16 would be moved to frame 15, 17's to 16, etc, then frame 30 would be gone.
(be cool to remove frames 9 to 20 also)
And this doesn't have to even be a plug-in, a seperate console app would do fine. As for the grid, that would be sexy, but way more than needed (but I would be willing to pay a few bucks for a program that did that, I was going to buy CharacterFX for only that feature, but I couldn't get it to work, so, scrap that idea, but people would be willing to pay I bet)

----------------------------------------------------
Originally posted by Sushi
[B]The best thing you can do before any plugin that helps with animations exists, you can change they keys in which you animate with. Go to tools>Shortcut & Plugin Manager to do that. Heres my animation keyset:

Toggle Operate on Selected Joints only: Insert
Set Keyframe: Home
Delete Keyframe: Ctrl + Home
Copy Keyframe: Page Up
Paste Keyframe: Page Down
Remove all Keyframes: Shift + End

I find it more comfortable and easy to have all my animation keys in 1 place.

Now, for your question (Given that you use my keyset/A similar keyset):
-Toggle OoSJo (operate on selected joints only)
-Select the forearm position and copy it

(I move my mouse over the next keyframe button to do this next part)

-Paste + Set Keyframe + Next Keyframe, repeat

With the amount of keyframes you have in your current anim, it shouldnt take more than 30 seconds.
[B] I am so glad that shortcut plug in exists. I have a similar set up, and that makes it easier, which is why the focus changed from multiple frame amination to removing a frame or set of frames.
BTW an even nicer feature is once you click the next frame button, you only need to hit the spacebar anytime after that to move to the next frame until you make another mouse click, keeps both hands on the keyboard ;)

(I just made an animation that is about 50 frames to many in the middle, nothing realy going on in the begining and a whole bunch of stuff on the end. Right now I guess the only way to fix this is to copy major keyframes over one at a time via copy/paste, but I am not that stoaked on doing it so I am leaving it as is, but if this program works Jed will be known in ALL mods as the Patron Saint of MOD editing (I have already seen his name in about 4 other game forums while looking for answers to these questions with his HLMV))

Trp. Jed
07-28-2004, 11:15 AM
Billy, I'll look into it. The code to do the first part is only about 16 lines long so if its a case of just junking frames X - Y for all bones I can probably put that together.

Actually, if I can ever find a good download site for it (discreets site is WAY slow) I might install GMAX and see if its got the same subset of anim stuff as Max has.

To be honest, I'm drifting away from Milkshape for modelling and moving more into Max now that I've got my head around low poly mesh modelling with it.

I did fire up Max cold to animate the falling trees for Falaise and to be honest, its so easy and logical to animate with it insane. It literally took me 15 minutes to figure out how to do it.

Whats nice is you can ease the keyframes to create nice smooth speed transitions between keyframes and have a much finer level of control.

Seriously, if you have Max or are a student and can get it cheap then get it because you wont want to use Milkshape for animating again.

BillyNair
07-29-2004, 01:02 AM
i dont know why but MS3D is tripping out reciently for me, ill set keyframes and they won't be there when I test it, 2 seconds after I set them, even when I go up to the menu and select it to set. Other times when I rotate items they snap back, even with playing with the XYZ buttons on that tool bar. I will check to see if my school has a GMAX account or if there is a way to get it a different way.

BTW, w00t for 16 lines of code, I will be happy if that gets working, until I can get a better program.

Trp. Jed
07-29-2004, 05:54 AM
Well GMAX is free Billy, you just need to download it from discreet, but I havent so far as the download speed is like 0.3k a sec for some reason for me.

If you want the full version of Max, if your a strudent you can get it at a ridiculously cheaper prices - ask Kamakazi as thats what he did. I got my version via work and our "education fund".

Trp. Jed
07-29-2004, 10:50 AM
Billy, I managed to get GMax installed and although its not as good as the full version for animating it still allows you do do what your doing in Milkshape but better.

However, the SMD import script plugin works fine with GMAX but the exporter doesnt because GMAX is restricted to no allow files to be written. I hacked the exporter to dump the SMD as text to the debug window but the damn copy buffer is too small so you have to copy and past the SMD out in parts! :(

BillyNair
07-29-2004, 01:53 PM
yeah, I am going to try out that download, now that I look on the site, I remember way back in the day I was going to try this out, but never got the chance. Now that I am actuly animating and know a little bit there is a reason to get it.

Trp. Jed
08-03-2004, 06:35 AM
Billy,

You might want to keep an eye on this:

http://www.swissquake.ch/chumbalum-soft/forum/showthread.php3?s=&threadid=14439

BillyNair
08-03-2004, 07:54 AM
Oh my Fetch, Jed, thanks for finding that. I will definately be watching that guy for more of the stuff he was talking about.

In the mean time will test out his current plug-in

ty Jed

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.