Home Technical Talk

Biped Keyframe Per Frame when saving BIPs

polycounter lvl 14
Offline / Send Message
pixeldamage polycounter lvl 14
I've noticed that any bip files I save out in a separate max file completely screws up when I import them into another file's biped. This is unless I use the Key Frame Per Frame checkbox. I've started saving all my bip files with two versions (one with an added suffix '_kfpf').

What I'd like to know is A)why does it require a KFPF to get the biped to respond correctly and B) Is there a way of saving out bip files without this option and still getting a true animation out?

I'd understand going from 3dsmax to another package but natively should the bip's screw up like this? From a pipeline point of view I'd like to keep one max file and keep all the animations as bip files to be loaded in. Unfortunately, only the key frame per frame files work properly which are very difficult to adapt later on.

Replies

  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    After more testing it's not always the case that bip files need to be saved with keyframe per frame checked but most of the time. It's difficult to know when it's needed. I'm trying to sync up all the bip files so that they all start from the same position in world space. Trouble is when I line up their COM to 0,0,0 using either a layer or "move all mode" and resave... it still reverts to a different starting location when I reload the same bip after loading a different bip first.
  • Mark Dygert
    Do you have a scene that has a bunch of different animations run, walk, jump and you're saving out each one as a seperate clip?

    If so you need to make sure the clips are book-ended, with a key on ever bone, at the start and end of each clip. The curves on these keys should be linear, if you're using Eular, and tension 50 if you're using Quaternion.
    This will keep the end keys from trying to effect other keys when the clips are mixed in a different order.

    If you don't bookend the clips, then it will save in the middle of a curve.
    CurveEditor00.jpg
    • If you save out 10-50 there isn't a end key on 50 so you can't relay on the curve being accurate from 25-50, it will blend with the first key it finds in the next clip whatever that is.
    • If you save 10-25 you'll get more accurate results because there is a key on each end, however the curve will still be calculated based on whatever key it finds next.
    • If you save out 10-25 with it set to linear you have a better chance of the curve interpretation coming out closer to what you like.


    To really transition between clips/tracks you should use motion mixer and create a transition track so they blend from one motion to the next a little more seamlessly.
    http://docs.autodesk.com/3DSMAX/13/ENU/Autodesk%203ds%20Max%202011%20Tutorials/index.html?url=./files/WS1a9193826455f5ff-e569a012180ce5891f55.htm,topicNumber=d0e16485
  • monster
    Offline / Send Message
    monster polycounter
    Make sure any IK Objects are set to the same objects on the target scene.

    For example, if set the left hand to use the right hand as an IK object, but you load the bip file on a biped that isn't set the same way the animation won't load properly.
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    I understand about the bookending (that checkbox seems to add a bookend for you) but that doesn't seem to be the issue -at least I don't think so. I haven't got a bunch of different animations just one biped with a bunch of frames making him do a dive to one side. I've just found that loading my bips onto a normal biped works fine but what was screwing up when I load them into the biped of a premade turbosquid character that uses physique. It works ok with the same bip files when I tick the "keyframe per frame" checkbox on saving them. I'm pretty sure the biped is normal except the bones are displayed as grey boxes. When I don't save using KFPF the animation isn't sightly off, its completely screwed. It's not that it's blending badly between frames, more that joints rotate completely the wrong way and the feet are up behind the back and above the head!. Poor poor cg character, he's going to need some serious therapy!

    - Update:

    This is even weirder. I just found out the following:

    Reset>Create Biped>Load dive.bip -results in perfect animation

    Reset>Load turbosquidcharacter.max>select their biped>Load dive.bip - animation totally screwed

    BUT! Reset>Load turbosquidcharacter.max>create NEW biped in that same max scene>Load dive.bip - animation totally screwed too!


    So a biped created in a new scene works great with that bip file. A biped created within the same scene as the turbosquid character wont work as expected with that bip file. What could be different?
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    In the max file just mentioned any new bipeds created are afflicted by the same problems when loading the dive.bip file. As soon as I delete the biped attached to the turbosquid character then any new bipeds added to the scene work fine with the dive.bip file. Is this a bug? could there be a setting somewhere in that character's biped that affects the handling of bip data on other objects in the scene? Perhaps it's messing with world coordinates or something?
  • monster
    Offline / Send Message
    monster polycounter
    Without posting the files, I'm not sure we can help you debug this further.

    Here's a work flow I used to do back in the Max 3.0 days when loading bips was unreliable:

    1. Turn all sliding and planted keys on hands and feet to free keys.
    2. Save the bip with key per frame checked.
    3. Load the animation on a biped.
    4. Delete most of the keys, but leave every 4th key.
    5. Recreate the sliding and planted keys.

    Since you only have one animation, it shouldn't be a big deal.
  • Mark Dygert
    Are you working in the scene file that came from Turbosquid or did you import the biped into a new scene? I've had mixed results (most in past versions of max) merging old bipeds into new scenes but if it works go with it.

    What happens if you merge the TS biped into a new scene and then load and save? It sort of sounds like the max file might be really old and had trouble being brought into a newer version of max? Generally I keep the bipeds in the scene they where created because merging them has caused some stability issues for me in the past. But it sounds like loading the .bip into a newly created biped in a new scene fixes it?

    Have you tried going into figure mode, saving out a .fig file (same as saving out a .bip), exit figure mode, load the .bip motion file, enter figure mode, load the .fig file again.

    My guess is that its a sub animation controller they loaded and animated on their biped, which would show up in the list controllers list box when you go to save. But I agree without working with the files its hard to diagnose whats wrong.
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    Ok should've done this sooner:

    max file (mesh removed for copyright reasons)

    http://dl.dropbox.com/u/3647139/scene.max

    bip file

    http://dl.dropbox.com/u/3647139/dive.bip
  • Mark Dygert
    Looks like There is a big scale difference. One is 1.8m tall and the other is 114m tall. If you import it with "restructure biped to match file" it will be about 100x taller and the animation will play fine.

    If you don't restructure or if you load the .fig file from the tiny character, it just messes up the curves a little which is pretty easy to fix. If you select the Center of Mass, set it to Eular, select all the keys for Position Curve and change the tangents to something else. The curves should snap and normalize ditching all the extreme curves.

    http://dl.dropbox.com/u/1306131/dive2.bip
    EDIT: I saved out a clean .bip file that's to the scale of the original biped but has the dive motion on it, you might need to do a little more curve clean up.
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    Thanks Vig. The scale thing is weird. The bip file was made in a fresh file with a character roughly 150 generic units tall. How did that become 150m? Also why is it that if I make a new biped of any size the bip loads in fine so long as I delete the TS character's biped first?

    I tried both ways you mentioned. The restructure to biped screwed up the physique, and reloading the fig file didn't solve it. I guess that leaves only the tangent changing method which did fix most of the issues except for a bendy leg key that deleting resolved. So as a future lesson does this mean I need to always create the animation biped to be the exact height of the target biped? In cases where I reuse old animations this would be a problem but i'm guessing most of the issue was that the 150gu became 150m. I also checked for list controllers but there wasn't any in the save bip window.
  • Mark Dygert
    Thanks Vig. The scale thing is weird.
    Sure no problem at all, glad its working!

    I found another way to fix it, scale might not be an issue after all. It looks like the dive.bip file was saved out with quaternion curves and the biped in the scene was set to Eular. Changing the scene biped to quaternion before or after loading the dive.bip file seems to fix the curves also. So either set it to quaternion, or toggle the tangents in Eular, both should get more or less the same fixed results.
    I tried both ways you mentioned. The restructure to biped screwed up the physique, and reloading the fig file didn't solve it.
    Yep physique doesn't handle that kind of scale change well at all. Skin isn't much better but it does load weights back in after a scale change a little better and is easier to clean up thanks to the advanced weighting tools it has. I love paint weights and blend paint is like a magic fix.

    With either skin or phy you could transfer the weights from one scale to another by:
    - Saving out the skin weights or Phy file.
    - Delete the skin or Physique modifier.
    - Scale the mesh to match the new skeleton scale.
    - Reset scale/transform on the mesh.
    - Reapply phy or skin and load the weights back in.
    The skeleton and mesh should be back in the bind pose for the files to load correctly.
    Monster also has a script that transfers skin to physique and back again, VERY handy.
    I guess that leaves only the tangent changing method which did fix most of the issues except for a bendy leg key that deleting resolved.
    Awesome! I'd roll with this =)
    So as a future lesson does this mean I need to always create the animation biped to be the exact height of the target biped?
    Not always but it will help. The leg hickup looks like its coming from the planted keys and shift in scale, so it would probably fix those problems.
    The important thing is to make sure your biped pieces are set to the same settings, eular or quaternion. Remember that you can set different pieces to different settings it isn't a global setting for your whole biped. I normally set them all to one or the other. Keep in mind that hands and feet because they can be planted in world space and will always use the quaternion cordinate system.

    http://www.guerrillacg.org/home/3d-rigging/the-rotation-problem
    This helps explain the difference between the two systems and gives a hint at why the hands and feet will always use quaternion.

    I would probably load them onto a properly scaled biped, fix all the curve issues and save them back out as .bip files set to the same settings, just so I (or other people that might use the files) don't have the same problems. But I'm a little anal like that...
    I also checked for list controllers but there wasn't any in the save bip window.
    I didn't see any either, that was just a wild shot in the dark without looking at the file. It's one of those things that's easy to miss when transferring anims from one rig to another and will surely screw things up.

    Anywho... I'm glad its all working!
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    Ok so I tried another method.

    - went into original max file with dive animation. Changed the max units from generic to cm. Changed scale 1=1cm.

    - checked the biped height in fig mode and now it reads the correct height (factor of ten smaller).

    - resaved new bip

    - loaded bip onto the new file.

    - same problem happens. It's as if it still is trying to apply the keyframe data to a huge biped.

    Really annoying because changing the tangents doesn't fix everything and it means a lot of reworking of all the other bip files now to get them working with the TS mesh.


    EDIT: Looks like we posted within seconds of each other!
  • Mark Dygert
    Ha, yea we did.

    If you click on the CoM and set it to quaternion does it clean up the spikes in the curve?

    The biped workbench also has tools for analyzing the curves and smoothing out spikes and rotation issues (I hardly use it and I think it works only on quaternion). They can be found on the tabs above the selection list.
  • pixeldamage
    Offline / Send Message
    pixeldamage polycounter lvl 14
    yeah it helped a lot. still have some stuff to fix but looks like that was definitely the main issue. thanks :)
Sign In or Register to comment.