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

Legacy_Killmonger

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


               Ok,

max is back (whew)

Upon careful recalibration of all things biped, I can perform all the functions to "benchmark 1" however the dumped biped's animation keys are not retained upon my few attempts of copying them over to the mesh (B2). I still am of the belief that this data must be processed thru maxscript and controllers. It will take me some study to comprehend the architecture required to make the conversions possible.

Someone out there has already got the knowledge and perhaps the program to accomplish this in an old version of max.

The application of mocap would allow for quick and detailled animation. However, as OldTimeRadio has pointed out, a well rigged 1k animation is a fairly smooth and productive workflow. Hmm....

Perhaps those freelance Kinect gurus have some insight? A layered, incrementing series of snapshots (see plugin) would produce the linear keys desired.

I shall continue with some applied research...

More input is welcome
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #16 on: February 21, 2011, 12:52:20 am »


               

Killmonger wrote...
Upon careful recalibration of all things biped, I can perform all the functions to "benchmark 1" however the dumped biped's animation keys are not retained upon my few attempts of copying them over to the mesh (B2). I still am of the belief that this data must be processed thru maxscript and controllers. It will take me some study to comprehend the architecture required to make the conversions possible.

Whoops, my bad.  Or maybe not.  I couldn't pull up my notes (I had 500 gigs of data go up in smoke, might have been there) so I walked through it again.  Anyway, I think I missed a step and I apologize.  After the biped dump it looks like the keys aren't converted to linear.  So, refined steps go something like this:

* Create a biped and scale it up till it's 2-3 meters or big enough to see

* Load the BIP or BVH onto the biped.  BIP is preferred because that's the native biped animation format.  Character Studio has a built in conversion/mass conversion utility for converting BVH to BIP.  You should be able to scrub the animation timeline and see your biped move about with the new animation at this point.

* Turn on "In Place Mode" in the Biped rollout.  This keeps X/Y movement to a minimum.  To find this guy, with the root of the Biped selected, click on the Motion Tab, scroll down till you see Biped rollout (it'll be under the Biped Apps rollout), and click the + next to Modes and Display.  The icon looks like a target.  Just click on it to turn it on.  Now when you scrub the aniamtion timeline the biped should not move around so much.

*  Ok, now run the Biped Baker and when it's done, delete the original biped (which I think will be hidden).  The one you want to keep will have the suffix "snap" and the hierarchy should be maintained so no worries there.

* Now for this next step I used the "Bake Anims" function in NWMax Plus but you might be able to get away with just doing a "Reset Controllers" (also in NWMax under Anims rollout).  Anyway, Bake Anims definitely works.  After that's done, just like the Biped Dumper, there will be two copies of the biped and the original one will be hidden.  Delete that or leave it, as long as it's not connected to the animation base it won't export anyway.  You should be able to confirm that all the keys are linear by selecting any part of the geometry and going to the motion tab and visually inspecting that the keys for rotation, position and scale are all linear.

* Drop a NWMax/Plus "Reset XForms" on all geometry because some of them (fingers and toes, for whatever reason) may still have world scale which does not equal 1.  If you've got VelTools installed, and EVERYONE should have VelTools installed, you can (with all that geometry still selected) apply the Aurora Trimesh modifier en masse to all of it which is going to help out with potential problems caused by the crappy shadow system NWN uses.  It's in VelTools under "NWN Tools" rollout, called "Object Parameters".  Just make sure Render is the only thing selected and click "Add Properties".  Now all your geometry has a basic trimesh modifer and the engine doesn't have to make any guesses.

* Create an Aurora base and put a "default" animation segment on it and be sure to give it the appropriate length for your full animation and make sure that that edit is applied to the animation segment.  In my case the animation segment starts at 0 and goes to frame 574.  Link the base of the Biped to the Aurora Base and then export anims.  You should get errors on export but only because there are spaces in each of the geometry's names.  Just click yes to each little message if you want to rename them and then check over the sanity check.  Also turn off the Weld To Nearest CM check.  You can also export it again and with those two things dealt with you shouldn't get any sanity check issues.

I...heh heh....I think that's "it".  As you know these things aren't really that difficult if you've done it a few times but the descriptions can make it seem more imposing than it is.



My machine isn't that great at recording video but you get the idea. You can download the .mdl here. Just drop it in your override folder, go into the toolset and search for the "armoire" placeable, place it and you should see it dancing.  If not just hit F9 to run the module and you will.  Hands and head are a bit tweaked but that only has to do with the specific mocap data/import method I used.

And yes, if other people have been working on this kind of thing I'd love to hear any input they have, or suggestions.
               
               

               


                     Modifié par OldTimeRadio, 21 février 2011 - 01:34 .
                     
                  


            

Legacy_Killmonger

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


               After eating my keyboard a few times.....
OMG....
OldTimeRadio, I am agog at the ease with which you have demonstrated your prowess.
Your insight is gratefully appreciated....

I got it. '<img'>
(But I'm not as savvy as you to demonstrate it online)
My skeletal "biped snap", also dances in celebration too.

I had to study the procedure and model file very closely and insure that I was correctly operating the NWMax/Plus gui (I recommend that all those interested download it now !!)
Furthermore, as instructed, one must use the control panels NWmax Aura export function (not Mdl suite). Old Time Radio, your updated info was critical to comprehending the process. The + control on the motion roll out was a special kind of surprise !! Thankyou very much.....

The procedural recipe takes a bit of caution (but the process can be ironed out thru careful repetition)
I expect to get better, and faster at it.

Kudos to the NWMax/Plus plugin. I had not upgraded to this new version. Although I will probably never use the Nwn2 functions, it has expanded the toolbox for Nwn1. Excellent ! If one's max is correctly setup it runs just fine, so far. (Yes I crashed the program(s) a few times, pesky current startup, dlms,dlu,dle, ms et al LOL)
It is important to be current and correct with the maxscript files. I had to re-jig and restart max quite a few times. If one is low on RAM the edit of the parameters in the nwmax.ms works just fine too (I reduced the Heapsize by 100 (I also compared it with the NWmax v08 .ms file)) but, for those interested, take care with the current auto startup scripts.

Now the hard part...

The replacement of the biped_snap with useful in game meshes
The animations so far have resisted mapping or transfer to a body rig (torso_g, etc) The inclusion of .nmn and Fig files in the workflow, has not yet been explored by me.
My biped mesh is either not recognized (by 3rd party plugins) or the "merge" collapses the mesh into the node. However, the head texture, tho distorted, will appear on the biped head. The internal structure of the objects in max, I believe, is the culprit.

My interests in Nwn mocap will continue renewed ....
Imagine:     Angry mob/crowd placeables, or a Scavenger placeable (for a couple of ideas)

This forum was the crucible in which I could discern some answers....
Thanxs
i'll be back
               
               

               


                     Modifié par Killmonger, 22 février 2011 - 01:54 .
                     
                  


            

Legacy_OldTimeRadio

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


               

Killmonger wrote...
Now the hard part...

The replacement of the biped_snap with useful in game meshes.  The animations so far have resisted mapping or transfer to a body rig (torso_g, etc)

Here are 3 approaches which you might consider.  These are basically notes I'm going to be trying to make headway on, as well.

One thing you can try is using the Anim Mapper in NWMax/Plus.  It allows you to import animations from geometry in saved .MDL files meshes in Max.  I don't have time to do a mini tutorial on it but you can get the hang of using its features by grabbing using NWN Explorer Reborn to export c_yinnkeep.mdl and (for instance) a_ba_non_combat.mdl from the game resources, import c_yinnkeep.mdl into NWMax/Plus and practice using the Anim Mapper to load one or more animations from a_ba.non_combat.mdl onto the c_yinnkeep.mdl "target".  In regards to your goal, a_ba_non_combat.mdl would be a proxy for an exported biped model (like my dancing skeleton) and c_yinnkeep.mdl makes for a good all-around male human base.

The other way you could approach this is to change the Biped into Figure Mode and either modify the geometry on the biped to be equivalent to an NWN model or attach an NWN model's pieces to the bones directly.  Remember, bones don't have to manipulate a skin, they can also act as support struts for other rigid geometry.

Ok, so buffer the thought about attaching rigid NWN geometry (i.e. player/creature parts) to a Biped while I go on a tangent about Biped.  Biped is really inflexible.  You can't delete a Biped bone on a native Biped rig without the whole rig disappearing.  You can't even rotate a Biped rig without using a specific button the Biped rollout, IIRC.  Nor collapse the transforms via the Curve editor or the Motion tab->Trajectories->Collapse Transform->Collapse, or reassign a controller manually on Motion tab->Parameters->Assign Controllers.  The "answer" to this inflexibility is Figure Mode.  Figure mode allows a great deal of flexibility, including substantially changing the length and orientation of bones.  There are a lot of good rigging videos on YouTube and I can't find the one I wanted you to look at but the model being rigged is kind of dressed like Grand Moff Tarkin from Star Wars.  That's what his uniform looks like.  The guy who does that video gives a good breakdown of using Figure mode but it's still not all encompassing.  Whatever you do, don't start out by going into figure mode and rigging anything up because as soon as you drop out of Figure mode it could all go "Poof!".  Character Studio Bipeds are really non-intuitive and picky.  One thing I've heard bandied about a lot from Max artists is you can't bend Biped to your art, you have to bend your art to Biped.

And while all the stuff we've talked about and experimented with so far results in geometry with a lot of keys, there's a trick I've just come across which I wanted to share with you, especially in case you could understand it better than I could.

Look down to Cactus Dan's response in this thread at CGSociety.  What I take away from that is to take a Biped rig and make an IK/HI-IK bone rig which basically takes up the same space and is attached to the Biped rig.  So when you load a BVH/BIP (in, say, autokey mode?) it manipulates the IK/HI-IK rig.  Which might be able to be collapsed to rotation keys. Which would mean, hopefully, just a few keys instead of dense 1 keyframe per frame results.

The inclusion of .nmn and Fig files in the workflow, has not yet been explored by me.

If you know enough about rigging an IK/HI-IK (and especially have experience collapsing them via Max rollouts, not NWMax/Plus, you might be able to skip the .MNM because your IK/HI-IK would be set up like a NWN skeleton but attached to a Biped skeleton- with you making the choices for tradeoffs.

My biped mesh is either not recognized (by 3rd party plugins) or the
"merge" collapses the mesh into the node. However, the head texture, tho
distorted, will appear on the biped head. The internal structure of the
objects in max, I believe, is the culprit.

Eh?  What are you trying to do, specifically?  What plugins are you using, etc?
               
               

               


                     Modifié par OldTimeRadio, 22 février 2011 - 11:55 .
                     
                  


            

Legacy_Killmonger

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


               Bit busy today, cant experiment just yet, maybe later

However,

I had begun using Anim map in NWmax/Plus. Also coming to terms with the other features

My old max seems to have had few applicable plugins written but so far:

Attribute keyer v2

Automatron v12 (for max8)

KeyTransfer v107

Manakin (version?)

Ani-pose (version?)

Those learnings aside, I have begun using the techniques available inside max. By constraining the dumped biped and making it drive a 1k rig seemed the logical approach (aka like a puppeteer)

The indicated thread seems to confirm the idea. PEN's notions of layers and point helpers to gather the animations and then bake them into a "proxy place holder for animations" (my words) which may then be transferred to the mesh could be a viable avenue (aargh, list controllers again)



My interests for doing this thing are mostly intellectual (to learn and to see if it can be done)

Beyond that I have some ideas to help make Nwn more interactive and immersive. (ala Dom Queron's interactives) That said, I realize that straight forward hand animation most often will achieve the goal without dealing with all the editting tweaks in mocap that will be necessary.

Evaluating the necessary trade offs is, for me, the slow part of this process

To use the Anim Mapper well, the key density must be reduced, preserving the animation. Initially I am going to degrade the BVH import. Yes, I agree that biped is very inflexible.

I have often used the c_yinnkeeper as a template for model transpositions. Although decoding the pivot points (from an npc to a pc) is a procedural annoyance that must be accounted for, my initial goal is just to make it work first. It will take some time to become proficent in NWmax/Plus but using the Nwn aba models provided will be the fastest approach. So far I am in agreement with everything that you have indicated

How much do i know about quickly manipulating FK and IK? Probabably alot, but for me to express it in words is nearly impossible. Properly transferring the data from one type of controller to another is a process that I am fast learning. (But I do comprehend how to manipulate the Track view and work with curve editting) Although I practice, animation is not my career, more of a hobby.

But due to this fine forum, I will try to gear up the specificity of my words so as to be both more concise and accurate (I think you type faster than me too).

But first I must consolidate my experimental procedure...



Thanks again for your insights (and useful links)  '<img'>
               
               

               
            

Legacy_Killmonger

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


               Upon some idle reflections, the Reaction controller and Block controllers seem promising

               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Q> Mocap files into mdl format ?
« Reply #21 on: April 21, 2011, 02:08:12 am »


               Just thought I'd tack on a little addendum, changing my recommendation of "Biped Dumper" above to IK Tools v3.1.  These scripts might only run under Max, unfortunately.

To convert an animated, skinned (skinned is optional) Biped rig just add all the biped bones and skin under the Bones area in the IK Replicate v3.0 rollout, select solving method Simple under "Solving Method" spot.  Under Animation Range set the "to time" to whatever the animation length is, but leave the step time 3.  I tried lowering it and received errors.  Don't really know what the deal is there but it might require being at least 3 for the conversion process.  Then just click the "Simple Replicate" button, wait for it to process and you'll have two copies.  Delete your Biped rig, move the geometry along with skin to 0,0.  Select geometry (bones) only, make sure they're converted to editable mesh, have render turned off and attach all geometry you can get away with to lower the bones to at least 17, you migth be able to get away with one or two more but it's right up to the limit.  Then, with all bones selected use the NWMax "Reset Controllers" and I believe you're good to create an Aurora Base, attach, and go from there.

For Biped rigs, I recommending taking the upper torso and attaching the left and right clavicle.  For the hands, collapse fingers and thumb into palm/wrist/whatever they call it.  It's not that bad to get a full biped rig down to 17 bones this way.  I use Max to make sure that no more than 3 bones are affecting each vert, I suppose you can go up to 4 but I never found I really needed that.

I may not have described everything perfectly but if you have a biped rig that you can load a BIP animation onto (Max allows you to convert from BVH to BIP, which is handy) you can play around with this yourself using the rigged/skinned/animated biped as your starting point.

Lot of words but it only took me 10 minutes, max, to actually get this working from having a rigged skinned biped to an in-game placeable.  And, of course, don't forget if you use a skin mesh on your placeable to have all properties (Plot/Static/Usable) to be unchecked.  Don't know how much the animated-NWN -placeable-as-character can be abused by loading more animations on the placeable than just "default" but even to crank one-trick pony placeables is still pretty nice for giving flavor to areas with NPC's.

Check it out in action here, NUDITY WARNING (she's just naked, nothing lewd):
'Image

So, my first impression is that this MaxScript will probably allow you to do a subset of all the above tasks more easily.  Mainly, that means being able to animate Biped, convert to editable mesh geometry with linear controllers and then swap out the geometry for NWN parts which can then (theoretically) be made into a custom model which could be supermodeled into a_ba.  You'd have to rename the Biped parts to NWN parts for that to work.  In this way a total animation amateur (with a little help from YouTube tutorials) could crank out animations, like a few of the simpler examples from Vaéi's Additional Animations.

Without having to do it in FK or IK. '<img'>
               
               

               


                     Modifié par OldTimeRadio, 21 avril 2011 - 01:10 .