3DS Max Anim Thingie
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
01-16-2008 05:43
I can't get to the grid, but I did test this with Avimator and QAvimator2 and it seems good with those two.
Tons of little notes.
- The first frame is hard-coded. No need for first frame to be T-pose.
- The point helpers for the joints are still in the scene and hidden.
- OMG the script is ugly and long-winded. This is my first experience with Max Script, so elegance does not exist. But it works so far and that alone is not too shabby for a first Max Script project.
- You should be able to make your own meshes for the parts as long as you use the same names for the parts.
- It's all FK. I currently have no idea why IK makes the rotations puke. I even tried baking the trajectories and the rotations still go all wonky.
- When you run the script, the BVH will open in Max's cute little text editor. I left this in for debug/inspection purposes.
- The body parts that I did for the rig are ugly. Each part took me about five minutes. They are a bit dense for what they are.
- If you decide to make your own body parts, Reset X-Form is good. That is, in all parts, Local = World in the starting T-pose position.
That's about all I can remember right now.
Hopefully someone out there will pick this up and make it better.
|
Gusher Castaignede
SL Builder
Join date: 8 Oct 2007
Posts: 342
|
01-16-2008 07:46
From: Abu Nasu I can't get to the grid, but I did test this with Avimator and QAvimator2 and it seems good with those two.
Tons of little notes.
- The first frame is hard-coded. No need for first frame to be T-pose.
- The point helpers for the joints are still in the scene and hidden.
- OMG the script is ugly and long-winded. This is my first experience with Max Script, so elegance does not exist. But it works so far and that alone is not too shabby for a first Max Script project.
- You should be able to make your own meshes for the parts as long as you use the same names for the parts.
- It's all FK. I currently have no idea why IK makes the rotations puke. I even tried baking the trajectories and the rotations still go all wonky.
- When you run the script, the BVH will open in Max's cute little text editor. I left this in for debug/inspection purposes.
- The body parts that I did for the rig are ugly. Each part took me about five minutes. They are a bit dense for what they are.
- If you decide to make your own body parts, Reset X-Form is good. That is, in all parts, Local = World in the starting T-pose position.
That's about all I can remember right now.
Hopefully someone out there will pick this up and make it better. Thanks for this, I appreciate your time and efforts at this. if I ever pass by an experienced Max Scripter I will try to get their interest on this.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-11-2008 01:10
O M G
The files that I posted are SO borked. Why, I almost feel like a noob.
Since I posted those files, I've been playing and noticing more and more anomolies. The more I played and further I dug, the more I realized that I have more than a few things to figure out.
I now know more about Parent, Gimbal, pivot orientation, and rotation order than I care to. These are the kinds of things that I generally avoid because I'm easily confused.
The good news is that I have it all figured out and will be posted a proper update when I get it all squared away.
I also figured out most of the trajectory baking stuff, but not sure if I can automate that with a script just yet.
The last real problem left to figure out is the IK solver bendy thing. But with everything else I've been already accomplished and have yet to clean up, I think I can live with FK for a bit longer.
Just a quick little update. Back to the grind with me.
edit:
Found the IK bendy thingie. Hierarchy > IK > Rotational Joint It's all right there to set the bend and stuff.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-13-2008 18:44
Hey Abu,
I just wanted to post to offer some encouragement and thanks for your efforts. I would love to see a nice Max SL rig for animations that is on the level of the Maya one that was posted (and disappeared) a while ago.
I tested your beta rig by trying to do a walk cycle and hit issues with how the arms rotate in towards the torso on a simple back and forth swing for the cycle. I assume this is one of the borken things you speak of.
I don't mind FK on the arms, but if you could get IK going at least for the legs that would be awesome and win. Making the rig bones based rather than a mesh would be a nice thing too. That way you could easily hang what ever skin you wanted on top (like say skinning the SL mesh) and use Maxes bones tools.
If there's anything I can do to help, lemme know. I can rig and animate, but my Maxscript skills consist of typing "select $geometry" or whatever in the command line and perplexed looks while gazing at your code.
Keep up the good work!
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-14-2008 06:33
The bone vs. mesh thing is something I mulled over for quite some time. I eventually did go with mesh because you can only get a general idea of what any given avatar will look like when animated. I figured if you are going to end with a general idea, may as well start with a general idea.
But bones would be good because of said bone tools. For one thing, they scale easily and properly without breaking, meaning that it would be theoretically possible to fit a bone rig to a given avatar and then get proper hand and feet placement once the anim is in-world. You could say to someone, "Stand on this t-pose stand let me take a snap." Take that into Max, re-scale the bones, and then end up with predictable motion. You could team-up with a shape maker and do some serious custom animations. No more hands through the chest and stuff.
In theory, that is.
The FK/IK gets into Parent and Gimbal. As far as I know right now, once IK is used, you have to bake the motion. Once you do this, Parent and Gimbal are no longer the same. The bad is that Gimbal is needed and Max Script doesn't allow easy Gimbal output. I don't know with absolute certaintly on all of this, but I'll keep digging. For all I know, I could be missing something excessively simple.
I'll do my next update using bones. Once I get it up using pure FK, feel free to try different rigging set-ups. Skin it up using the default SL OBJ files and all that jazz.
(I've also started looking into CR2 files. I *might* be able to rip them and hack them into Max. No promises, though.)
---- addendum edit ----
OMG this is just sick and wrong. Everything I could find about coordsys did not list gimbal. Not one reference. On a total fluke - and in desperation - I tried in coordsys gimbal ... and it bloody worked. Why isn't gimbal listed in any of the references?
I just did a quick IK and trajectory bake test. Looks damn good so far.
Now I just gotta rebuild the entire thing from scratch and hope I can keep the pivots and rotation orders in good shape.
Wish me luck.
See you in a few days. Or maybe a week. I don't know, but I'll get there.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-14-2008 18:30
Alright! Good to hear about your find. Sounds like you are moving right along and kicking hinder. Good luck With the rebuild, fight the good fight, dig the good dig, break a leg, etc.
If you are doing it with bones I'll be skinning that puppy up as soon as you release it. Well, at the fist block of free time I get any way. I'll do simple first and trick it out from there.
You can always put a poly or mesh edit on top of the bones if you wanna stick with the general idea shape thing you got going now and still get the best of both worlds.
By the way, what version of Max are you bashing this together in? I was animating at home in 9 SP 2, but I use 8 SP 3 at work, so I can rig in whichever.
This is relevant to my interests so I'll be checking back every few days.
|
Domino Marama
Domino Designs
Join date: 22 Sep 2006
Posts: 1,126
|
02-15-2008 02:06
From: Abu Nasu - The first frame is hard-coded. No need for first frame to be T-pose. I'm not a Max user but this jumped out at me as a bad idea. For example with motorbike animations, I tend to use the default riding position as the first frame rather than the T-Pose, so only the changes to lean left, right etc are in the animation rather than every bone being keyframed.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-15-2008 02:09
I use Max 8.
I did some messing around with bones and it looks like it's going to take longer than I thought because of the pivot point thing. Max doesn't like the pivots of bones to be messed with. (I'm gonna have to get another notebook to jot uber stuff down to keep it all straight and dandy. Paper and pencil is my biggest trick to not getting confused. So low-tech, but it works wonders for me.)
As far as rigging goes, I did fire up Mr. Comet's CharRigger script and it does work in Max 8. But I'll save that for later after you've done your magic.
Back under my rock with me.
edit:
Domino, I'm sure I can hack in an option for that once I learn more about Max Script.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-24-2008 08:19
Little update.
The pivot point thing with Bones is driving me nuts. At this point, or any time soon, I don't think I will be able to get Bones to play nice with SL's skeleton and BVH. It's a mess. Rotational nightmare for an easily confused guy like me.
So, for the time being, gonna hack out a really quick and dirty boxish mesh skeleton. If I burn the candle in the middle... both ends... toss in some midnight oil... I should have something up soon.
But there is something soothing about a keyboarrd click-clacking away all night long.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-24-2008 20:26
- Not quite as thoroughly tested as I would like. A handful of basic tests and every looks pretty good so far.
- Ground is Hip's parent for rotation reasons. Y is up vs. Z is up type stuff. However, Hip's position is World with Y and Z swapped.
- The script will do the hierarchy. If you feel the need to do hierarchy tricks for rigging reasons, the script will set it proper.
- Initial T-pose still hard-coded. If you feel the need, you can easily take it out by opening the BVH with a text editor, subtracing 1 from the frame count, and deleting the first frame channel data.
- FK looks good with handful of tests that I did.
- IK and Trajectory baking is weird. Sometimes it kind of works and other times it gets way ugly. I'll be digging into this on my next run. And I'm sure it will be driving me nuts after a few days.
I don't know. But I do have to give my brain a break from this for awhile.
edit: I think the IK/Trajectory baking is doing something funky with the rotation orders. Seems to be resetting to XYZ for the baking. I'm pretty sure I'm on the right track. Ewww. But I'm taking a break. Honestly. I mean it this time.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-28-2008 06:17
Okay, I think I have something that work using beta 5 template and script.
Let's say that you want to use IK on the left arm.
Select the hand and IK Limb to the upper arm. If you move the goal, chances are that it will bend at the wrong angle. With the IK selected, turn off Enable, bend the elbow properly, click Set as Pref Angle, and turn Enable back on. From here, you should be able to IK to your heart's content. Keys, Swivel Angle, and all that.
Once you are happy, save Save SAVE - because we are about to hit the Point of No Return.
Select each part and use Motion > Trajectories > Collapse. Once each part is baked, do not delete the IK. Run the beta5 script to export.
- Once trajectories are baked, things might go crazy if you further mess with it. - Delete the IK and things might go crazy.
Rotations kept changing on me. But once I tried explicitly to do it in one shot, things got much better.
Still so much to understand. If only... if only...
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-28-2008 14:33
Hey Abu. I DLed the new rig but haven't played with it much. Looks good for the most part. I've got IK working properly on your rig arms. At least the BVH appears similar to what I animated in Max when I look at it in QAvimator and the SL upload preview window. My personal preference is to use a target (set up right under the swivel angle in the IK plain solver), usually a spline shape, as my solver plane controller. That way you have the control for that right in the viewport when animating. Also, bending the arm at the elbow a bit helps with establishing the initial proper bend angle for IK. The solver likes having the path through the joints back start to the be a triangle Unfortunately, I'm not getting the IK working so good on the legs out of the box. I think one of the problems The IK solver needs the solving plane to be, well, er, plainer in two local axes for the solving path. For the legs this would normally be the YZ in Max. With bones you just build in one of the orthographic views, top for arms, sides for legs, and that is that. From what I'm seeing your leg objects ("Leg" and "Shin"  are aligned to the world YZ so the solver is returning goofy rotations when the target moves. Now I can align the legs up properly before setting up IK no problem, but I wanna check and see if you can give an idea of how bad that will mess up the BVH output part of your script? Hold on. I'll rig up something and do a quick walk cycle to show you what's going on. -- edit: I'm uploading a file with IK set up on the feet and a walkcycle animated. Also included is the script BVH output I get. The hip switches from an up-down motion to a fowrward-back, and some other things...
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
02-29-2008 02:18
I grabbed the zip, but it's going to be awhile before I can dig into it. I'm getting a new machine and it takes me awhile to settle in. Plus archiving and scrubbing this machine before it moves on is going to take some time as well.
If I can't figure this out to my satisfaction soon, I might actually ask for help at CGSociety. Egads!
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-29-2008 07:41
No problem man, I just migrated to a new box myself. I'm still getting it set up to my liking, moving archives, and otherwise settling in. I took the plunge and went 64 bit Vista so I'm working on getting 64 bit Max 2008. Woo!
I meant to explain the upload a bit more, but I was rushing to leave work when I was posting it. The .max file is how the animation is before doing trajectory baking. After baking the .hip appears to swap Y and Z so the animation transforms get borked. The export seems to reflect this.
|
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
|
03-12-2008 05:44
I'm pretty much settled into my new computer. Last two things to figure out why OpenGL keeps crashing and why my monitor is blowing out highlights. :sigh: Hip is flipping? Open the script and look for this bit, fiddle with it, and save under a different version number: -- swap z and y -- i think i got it right na = hip.position.x nb = hip.position.z nc = hip.position.y format "% % % " na nb nc to:output_file -- don't forget \n
If it's position that's swapping, just swap hip.position.z and hip.postion.y. I'm assuming that it's position that getting swapped. If it's rotations that are getting swapped, then you will have to fiddle with the next little code chunk. Don't fear fiddling with the code as long as you save under version numbers or something. I think I got the rotation order thing figured out. At least conceptually. Nothing like getting into quaternions and how Max Script handles them. What can MS do with quats? How do I trick into doing what I need done with quats? How do I solve the flipping problem? It's going to be quite a while before I'm back with anything of substance. I'm getting pretty deep into unknown territory.
|