Author Topic: Q> Mocap files into mdl format ?  (Read 1139 times)

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« on: February 17, 2011, 08:49:20 pm »


               gratefully i was dirtected here to repost my question from the general discussion forum

Killmonger wrote...
Hey,
As a long time player/builder of Nwn1, I've grown more interested in making new phenotypes. I am somewhat skilled in max and I've created my own content. However, I want to know more about how to use the controllers in max7 to produce keyframes onto the Nwn mesh (yes using biped not cat). Sort of like the excellent work by NinjaWeasel and others.
I understand how to fully rig and apply mocap files thru biped, but the automation of keyframe placement and the correct alignment of assemblies and list controllers still eludes me. Online tutorials that I've found are not explicit enough.
Could anyone please help me sort it out or at least point me in the correct direction?


Thankyou for your assistance in advance
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #1 on: February 17, 2011, 10:00:37 pm »


               CCG On Animation



That gives you the 10 base animations that a general mdl can use.  It can be a bit difficult to read as the coding for underlining, bolding, etc, got damaged/lost at some point in time.



Beyond that, it might be best to actually follow the directions on that page, and export a mdl to see how it is accomplished in NWN.  the a_ba base mdl is inherited downwards into most other mdls in game.  Any mdl you create, would be overwriting the inherited versions, for your specific mdl.  



However, it does NOT explain how to use MOCAP at all.  NWMax will allow you to move frame by frame through each animation sequence, shorten or lengthen them as necessary and "blend" them as well.  All of that IS explained in the link above.

               
               

               
            

Legacy_gutwrench66kg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #2 on: February 17, 2011, 10:20:15 pm »


               side note: we now get 20 custom animations as of 1.69! (and mount/dismount got moved to their own unique ones)



               
               

               
            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #3 on: February 17, 2011, 10:37:23 pm »


               Thankyou Sir Bloodfist



The link, (NWMax) tho a bit busted up, does relate to me the inclusions of custom animations (both the start/finish and looping) and the roots of inheritance that the engine follows (Re the CustomContentGuide v3) These are processes that I do understand and can create (in game) upon models, either thru text editing or file exports (All praise to the model suite creators and Velmar). However, the constraints of max require some special "wiring" in order to translate biped info into animations upon the Nwn1 mesh. Once the biped is removed from the file, it takes all the keyframe info with it unless the controller parameters are correctly set. It is this "wiring profile" that I seek. Exporting new mdl animations is quite a straightforward process, but transferring detailled mocap info, and retaining it upon the mdl format seems a bit more complex (due to my ignorance and/or oversight)



Short of an extremely tedious processing task, I remain confident that the methodology for what I seek is relatively simple, but it requires a deep understanding of the principles of max (or blender or whatever). I would like to use some mocap to "humanize" and improve upon the animations that I already have.



Thanks tho, for your input along my quest
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #4 on: February 17, 2011, 11:14:09 pm »


               Using NWMax, you can easily edit the start/end frames, and actually add/delete frames etc.  The wiring dummy is displayed in max for you, according to the bone structure of the creature.  The data IS there, but you have to dig around a bit and get used to the NWMax rollout menus for where to find things etc.



MOCap appears to do a lot of the grunt work for you, and there MAY be a script somewhere that will directly import/export what you need from Mocap into NWmax / NWN format.  I have NOT seen it, so I can't link you to it, but I have seen references to MOCap on the old bioware nwn custom content forums.  



Old Bioware Custom Content Forum You will have to dig/search around in there for the actual help though.
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #5 on: February 17, 2011, 11:29:12 pm »


               This has been a daunting task for me but I'll try to share what I know and maybe that will help you. 

So, nomatter what road you go down (either using fancy controllers and hand-animating or using a biped rig loaded with a BVH) it all gets baked down to linear keys at the end because it appears that's all that NWN can understand.  There are lots of different approaches to exactly how that conversion is performed.  The "Bake Anims" in NWMax is just one way to do it.  I've also exported to FBX to bake the controllers and used a couple of homebrew MaxScripts to bake out the Character Studio rigs as well.  Depending on what the controllers are, you're going to have to look for a baking process which works best with them.  You might also puzzle over some elements of this very old post (pre NWMax, IIRC) which maybe hints that there are (non-Biped) controllers which can be baked down to rotation keys only (but by what method they meant remains a mystery), which is what I'd be shooting for based on what I know so far.  They might have been talking about a baking process performed by the official BioWare export scripts/plugin or something else (maybe even a function inside Max).  If for some reason you find yourself needing KeyManager and AttributeKeyer (which are mentioned in that thread) I think I have copies of them floating around somewhere.

Animators like NinjaWeaselMan and every other animator I've either been able to contact or learn about have all done their animations by hand even when it looked good enough to be mocap.  He talks about his process for creating the animations starting about 38 minutes into the podcast and it goes on for about 5 minutes.  I bring this up because in my hunt to tame BVH files one of my first tasks was to find out if anyone else had done it before.  It doesn't look like it.

Ok, so that's hand animating and controllers and baking things down.  You can probably get pretty far if you're good with setting up your rig and the animations you're looking to get in-game are something you can make yourself.  I was pleasently surprised what a good HI-IK rig can do after watching a video which showed how to rig with it but I'm usually too busy to get lost in hand animation.

Now for the fun part! Biped!

Using Biped to get something out to NWN is a nightmare and you probably already know that by now, LOL.  In trying to bend this damned thing to my will I had devised three milestones in using a Biped rig with a single BVH loaded on it:

1. Export a biped rig converted to editable mesh and bake the Biped keys into linear position and rotation
2. Same as above but with a series of animations (producing the smaller animation list subset of a "creature", basically)
3. All of the above, plus a zillion more animations converted into a phenotype OR developing a successful method of replacing individual player animations seamlessly with ones from BVH files.

I was only able to get the first part achieved by using "Biped Dumper" (look here for it).  That's a slightly newer version than I was using so it may work even better.  There's a chance that's not the right script but it jives with what I've got in my MaxScript directory.  If it fubars for you let me know and I'll do more digging.

So with that you make your Biped rig, load a BVH onto it, turn on in-place mode so the model doesn't go traipsing around (i.e. leave X/Y 0-ish of the model base), run biped dumper and then you should be able to figure out where to go from there.  It's not pretty but pretty doesn't matter: It's all about those animations.  If you know what you're doing, that'll basically get you an animated dancing (or whatever) skeleton placeable.

At least milestone 2 is technically possible using the above method if you want to throw the time at it to start stitching those animations together, assuming you have the BVH animations to support walking, running, fighting, etc and assuming that you can make decent "bookend" (neutral pose/bind pose/whatever you want to call it) frames for your animation so NWN (hopefully) plays everything back correctly.

Ok, let's stop right there for a sec.  Just like I said there were more than one way to bake animation keys, there's actually a better way to do all this, but I wasn't able to actually execute it.  Hypothetically, there's a much more elegant solution and one which also should allow you to make a phenotype much more easily, and here it is:

1. Create a custom .fig file for Character Studio whose pivot points match pmh0's pivot point locations and which also matches the pmh0 skeleton, including being named correctly (i.e. torso_g, rhand_g)
2. Create a custom .mnm file so importing the BVH animations maps the animations correctly onto your new skeleton.  This is not a perfect approximation but it's going to look something like this.  You can just open it up in a text editor.  Notice how you're going to have to make some tradeoffs and tradeoffs mean cleanup, probably in the Curve Editor.  Now, if you know how to interpolate the rotations (for instance) of several different objects into a new, single, object then you could take a regular Biped rig (or one with only minor changes) and use that conversion process to "blend down" the animations to the NWN skeleton.  I have no idea if such a thing is even possible.

If you can get that part achieved you'll basically have a NWN-friendly Biped rig which you can load BVH anims onto, dump them to something usable, and turn around and export them to NWN.

I'm no expert but when I see you talking about the assemblies and list controllers I'm thinking you may be getting hung up on a problem (in regards to Biped rigs with BVH anims on them, at least) which isn't something you have to deal with.  However, as with everything in Max, there are always multiple paths to get to the same finish line.  I came to my own conclusions about what was the absolute shortest path from beginning to goal and those conclusions might not have been authoritative.

I am busy but I might have some time to work with you to develop either a technique, a MaxScript interface, or both in order to make it possible to realize BVH->NWN and share that with the community.
               
               

               


                     Modifié par OldTimeRadio, 18 février 2011 - 12:10 .
                     
                  


            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #6 on: February 17, 2011, 11:51:14 pm »


               

From those very boards, long ago, I do still recall a thread or two that did relate to this topic but my answers seem to require human innovation rather than archival restoration. I believe it was pre-DLA, near the time that horse animations were being prototyped. I have been on this trail for quite some time. Thank you tho, I shall continue to dig thru the info.





The "script" is for me, perhaps, an excellent clue. I already know some basics of how to wire up in max7, but I'd need more info (detailled top down), because I'm not so confident in Maxscripting the matrices. The technology is already in max, but expeditiously arriving at a solution still confounds my progress:

A program to translate the Biped movement data into rotational controllers for assimilation into the Nwn mesh.

Clearly, there still is much to learn...



Also thanks for NWMax plus

and so much more.....
               
               

               
            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #7 on: February 17, 2011, 11:58:02 pm »


               OMG !!



OldTimeRadio, a mighty helpful dissertation.... Thanxs !!



It'll take a moment to read it and get it, but I do get it. Wow



afk
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #8 on: February 17, 2011, 11:58:55 pm »


               As far as I've ever been able to find, there is no way to bake down a Biped rig to pure rotation keys.  You always get stuck with position keys too.  Hope I'm wrong, though.  It's been a while since I mucked with this anyway.  Finding out whether it really is possible would, I think, require understanding a lot about how the Max animation system (and Character Studio) works at a really deep level and I've never been able to find anything from Discreet on the topic.
               
               

               


                     Modifié par OldTimeRadio, 18 février 2011 - 12:32 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #9 on: February 18, 2011, 12:03:29 am »


               

usagreco66kg wrote...
side note: we now get 20 custom animations as of 1.69! (and mount/dismount got moved to their own unique ones)

The latest version of NWMax does not allow one to work with those new animations very well but I made a fix for that and Michael Darkangel was kind enough to include it in his newest release of NWMax Plus.  I have been using NWMax Plus after slowly weaning myself off the original BioWare export scripts over the last few months and I have no complaints.

I used NWMax Plus exclusively (in 3ds Max 2011, no less) to create my Jarilith model and it was a pleasure to use.  The only complaints people migth receive from Max is in regards to heapsize when starting the script and that's a trivial matter to either change or comment out.  And it may also have solely been based on some settings on my end, anyway.
               
               

               


                     Modifié par OldTimeRadio, 18 février 2011 - 12:04 .
                     
                  


            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #10 on: February 18, 2011, 04:24:21 am »


               Fantastic stuff OldTimeRadio !!

Had to go eat nutrition....

I've gone thru the links, listened to the podcast (around minute 38, he spoke of his methods)

Now I will immediately learn about Joco and apply NWMaxPlus. Although I'm restricted to max7, I trust the plugin will function. In the past, I tended not to use it, preferring the works of Velmar and the mdl suite but "baking" the controllers down to an approximation is all that is initially required (detailling can be done later). I will proceed with all the variations that you had mentioned with great care, and test their productivity against what I can gleen from NWMaxPlus.

I've put quite a lot of research into this too, I probably could have animated my intentions by hand by now, but the siren of some form of limited mocap keeps drawing me in. Despite the manyears to be invested, I believe it would speed up the innovative animation process for a wonderful game like Nwn

A very big Thankyou for helping me consolidate my thoughts. I could not have expressed what you did, so eloquently and concisely so quickly. I am confident that I will be on the right "track" very soon. Furthermore, I would be interested to know more about the Keymanager and AttributeKeyer, but as yet I don't know if they are required.



And yes, I liked and dloaded your Jarilith long before this posting



I have downloaded the various things that you have indicated above and I will be "at IT" probabably for the rest of my tonights (ahahaha). The "baking process" is clearly the crucial step to producing the linear keyframes. All I have to do now is figure out the correct recipe (LOL, as I sip my Coke)



As an aside, it was Nwn1 that inspired me to really learn max in the first place, rekindling my interests in animation and digital production. Thank you for sharing your experience with me. I am giddy with anticipation as I continue my attempt to tame the wicked BVH file. Especially as it is new territory for the mighty Nwn to yet overcome. It is gratifying to know that I am not alone.



I can see far because I have stood upon the shoulder of giants....



< posts pending>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #11 on: February 18, 2011, 05:37:10 am »


               Glad that helped.  If you don't have NWMax installed, here is a tutorial video I made explaining exactly what you need to do to get all your tools and scripts installed and here is a tutorial video I made which covers playing around with non-linear controllers and collapsing them down to linear using the NWMax "Bake Anims" button. The first video might cover things you've probably already done so it may only be of limited use but that second video will walk you through the workflow of carrying out these kinds of operations in Max,  including setting your environment in Max/GMax and setting your default animations keys to linear (that stuff only needs to be done once), along with other things it's easy to get rusty on like setting up the base properly for a quick-n-dirty experiment like you'd be doing with a biped export.

Drop a line or post here with progress/problems. It would be pretty sweet to start getting more animations in this old game.
               
               

               


                     Modifié par OldTimeRadio, 18 février 2011 - 05:41 .
                     
                  


            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #12 on: February 18, 2011, 08:55:31 am »


               Yes it will be



I have, as of this post, tried many iterations of your suggestions, upto and including the mnm file edit. Each with limited success. Fear not, I will continue to refine my ideas in the tomorrows.



Of note

The BipedDumper v03 worked well and is the most promising avenue except the mdl explodes when imported (even after restructuring the hierarchy) But the work is early yet

The NWMaxPlus heap size crashes the script program in max7> can I just reduce that parameter?

Does Joco's Toolsv123 contain the plus upgrade? It does work in max7

Nwn, tho primitive, is still the best. Besides, who doesn't enjoy a good cartoon on occasion....



afk

<posts pending>

               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #13 on: February 18, 2011, 02:07:16 pm »


               

Killmonger wrote...
The BipedDumper v03 worked well and is the most promising avenue except the mdl explodes when imported (even after restructuring the hierarchy) But the work is early yet

Select all the parts of the model and select the Reset Xform button in either NWMax or NWMax Plus.  If you can see it animating fine in Max then it just needs a Reset XForms.  But use the one I direct you to, not the one in Max.

The NWMaxPlus heap size crashes the script program in max7> can I just reduce that parameter?

Yes, or comment out the code entirely in the script or adjust the heapsize in Max. Customize->Preferences->MaxScript Tab->Memory

I think NWMax Plus is set for either 50 or 500 megs scripts space, can't recall.

Does Joco's Toolsv123 contain the plus upgrade? It does work in max7

It's VelTools you're thinking of and Velmar was the creator, not Joco. Joco "just" made NWMax.  VelTools does not contain NWMax Plus.  NWMax Plus is an updated version of NWMax released only a few months ago or soemthing like that.  VelTools is very old, but absolutely indespensible.  If one sets VelTools to work with "NWMax", it will also work with NWMax Plus.
               
               

               
            

Legacy_Killmonger

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #14 on: February 18, 2011, 02:54:34 pm »


               Indeed

Apologies to Velmar for my last send, it was late and I'd been at it for many hours
Now to try again...

Commenting out the "if Heap..." caused error condition and it still won't run
Ouch, Increased max Heapsize from 7.5Mb to 50Mb crashed max very badly (I must reinstall)
Back soon (I hope)
               
               

               


                     Modifié par Killmonger, 18 février 2011 - 03:52 .