Jump to content

Bone Length Axis Confusion


Chip Midnight
 Share

You are about to reply to a thread that has been inactive for 4182 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm trying to figure out a workflow for creating rigged avatars in 3ds Max, exporting them to MotionBuilder for mocap and animation, and then out as bvh for SL, and I've run into a confusing problem. I've been using SLAV for my bone rigs in Max which creates bones that have Y as their length axis. These work fine exported as Collada for SL so I'm guessing that for imported rigged meshes SL expects Y as bone length? When trying to use these rigs for animation though everything goes haywire because it seems that for animation SL expects X to be the bone length axis, which is what pretty much every animation package, game engine, and Poser uses. Does anyone have any insight into this discrepancy?

Link to comment
Share on other sites

Just opened one of my old Max anim templates for SL from when I did the BVH exporter. When I look at the axis in local space, the main for the arms is X and the main for the legs is Y. Haven't done this kind of work in a long time and I've never used MB, so I'm not sure if that tid-bit will help.

The only other thing I can think of is order of rotation.

Nitty-gritty. I say open a known working and a wacky in a text editor and compare them. Look for corresponding lines that look like this:

CHANNELS 3 Yrotation Zrotation Xrotation

In theory, it shouldn't be too difficult to manipulate them rotations, or swap certain axis, to straighten things out.

 

Link to comment
Share on other sites

Abu! You live! Good to see you again. Wasn't sure you were still around. I think you may be right about rotation order. Looking at the BVH files for the default avatar animations they're all written with a XZY rotation order. The BVHs I'm getting out of MotionBuilder are written with a ZXY rotation order. There must be some kind of workaround. Why must everything be so bloody complicated?

Link to comment
Share on other sites

Yeah, I'm still kicking around and keeping an eye on things. Waiting for a challenge that I can sink my teeth into.

Compared BVH provided by LL and the output from my own BVH exporter just to illustrate. Both show rotation order something like this:

JOINT rCollar
CHANNELS 3 Yrotation Zrotation Xrotation

JOINT rShldr
CHANNELS 3 Zrotation Yrotation Xrotation

JOINT rForeArm
CHANNELS 3 Yrotation Zrotation Xrotation

The rotation order is different for quite a few bones (limb hierarchies). Not only is that interesting (and a pain to keep track of - don't get me started), but all bones should have local Y as the up.

I've never used MotionBuilder and I doubt I can find a trial for my dinosaur machine. But I imagine that there has got to be options or preferences somewhere to re-arrange rotation orders. Hmm... looks like MB can do Python, which might be a place to look.

Or BVHacker as mentioned by Dilbert.

I'm a very hands-on kind of guy and I don't take "no" for an answer from software. But the best I can do right now is hopefully get you going in the right direction. Other than that, wait a bit more to hear more chimes from folks.

 Edit: Okay, even though I can't help as directly as I would like to, my curiosity is getting the better of me. Would you mind posting one of your wacky MB BVH files so I can take a peak? Pretty please?

 

Link to comment
Share on other sites

Try and run the MB exported bvh file through poser. Change the name of the bones to match the sl poser figure if they are not already. Export it from Poser, load up in bvhacker and use retarget, change the height of the animation to normal. Add a tpose,export and upload to sl.  The mocap that comes with motionbuilder has the wrong rotations btw, at least on the hip or spline 1. Your animation will look right in mb with these, but exported will load up in say bvhacker with the waist bent 90-.

Try for an experiment loading up a default sl bvh to your motionbuilder character and export it. Minus the 2 dummy bones.

Run through poser, then bvhacker. That will load up np. You have to run through poser at least in my experience to fix the rotation and scaling.Bvhacker will not do this by itself.

Link to comment
Share on other sites

I don't have MotionBuilder and I'm not going to try to get a trial. And I can't install SLAV because apparently it doesn't get along well with Max 8. Looks like I'll be flying mostly blind.

I have been running this through my head quite a bit trying to figure out how to trouble-shoot this with the least amount of pain possible. And I think we (you) need to start with SLAV.

Get SLAV rig into Max. First thing to check is the order of rotations of the bones right in Max. Select a bone, Motion > Rotation > Euler Parameters > Axis Order, and see what it tells you.

If they are all the same, say XYZ, you might get lucky and be able to fix all of it right there. If I remember correctly, the axis order actually has to be backwards from what the LL BVH files say. If an LL BVH file says ZXY, then tell Max to use YXZ.

The next step is to get a working SL anim out of SLAV and Max sans MotionBuilder. Once you manage that, then try adding MB at the end of your workflow.

Link to comment
Share on other sites

There's no way to get a working SL animation directly out of Max except for your exporter. The only other option was PuppetShop and that's gone now. I've used your exporter for some stuff and it works well, but the idea of going out to MotionBuilder is to be able to animate directly on the rigged character and go out to BVH. That becomes especially important when working with tinies and non-human avatars that need to take the size and shape of the mesh into account. The other option is to use MotionBuilder to retarget the animation created with the original rig in Max to a separate SL compliant rig, bake that and export as BVH. The only downside of that is that it's more work than being able to take the animation straight off the original rig and loses some accuracy. That's the route I'll be going for now. It is possible to get SL compliant BVH out of MotionBuilder. It seems the issues are entirely rig related and it's kind of bizarre that a rig that works for exporting a working mesh avatar won't work for animation. What I don't know if that's an issue with Max specifically or with SL. Are Blender users able to use the same rig for Collada export and BVH export?

Link to comment
Share on other sites

I was hoping that you had a way of getting BVH out of Max other than my exporter. Kind of a bad assumption on my behalf considering how somethings went back when I was developing it.

Okay, time to get a little long-winded with my thinking.

I had assummed that you are using SLAV because of the custom avatar things. Tinies and non-human, absolutely. Mesh things work fine because verts are verts. All that is really needed is position, UV and possibly weights.

Another assumption. I assume that rotation order is preserved between Max and MotionBuider. Shame on MotionBuilder if it is so heavy-handed as to say, "Use XYZ all the time!" I highly doubt that is the case. I'm willing to bet that rotation order is preserved, even when exporting BVH from MB. Yes?

More big assumptions on the way.

Now, even though I can't use SLAV, I did notice that there are XML files in its directory. For example, avatar_skeleton.xml does have bone information in it, like position - but not rotation order. Strictly for avatar appearance reasons and bone rotation order is not needed.

If you create an SLAV rig in Max, I highly doubt that proper rotations are in the bones because that information is not in SLAV's directory. Max will default to XYZ.

I believe that if you change SLAV bones order of rotations in Max, then they will be preserved the rest of the way through. If you change them properly, then you will get a final animation that is proper.

Make a script that will change the names of the bones and order of rotations. Run it as soon as you create an SLAV rig. Put it in a toolbar or something. Then you should be good to go.

Do the default female with SLAV (free in trial and should be okay). Save the Max file, upload it, and I will see if I can open it (Max 8). If I can, then I'll do the script.

I seriously want to kick this one in the nuts... but in a good way.

 

 

  • Like 1
Link to comment
Share on other sites

I'll have to experiment with changing rotation order on the bones in Max. If the problem is strictly that it might work. If the issue is the orientation of the bone axes that's probably not fixable since skin vertex weights are axis dependent. If you try and change the pivot orientation of a bone on a skinned character it will also rotate the verts assigned to that bone even though the bone itself doesn't rotate.


I don't think it's possible to make a max file from 2013 compatable with Max 8. I can only save for backward compatability back to 2010. We'd probably have to go out as fbx and use the standalone fbx converter to convert it to an eariler fbx version. Any idea if the Max 8 fbx plugin can be upgraded and if not what fbx version it is?

Link to comment
Share on other sites

I thought I was being smart, but I was being stupid. Now I have *zero* fbx support. Heh. But I won't let that stop me because I'm in full-on battle rage mode. My tenacity and deviousness know no bounds. Limits? What are those? I live for these kinds of fights.

The immediate goal is now to get me the information that I need. Screw max files, fbx files, 3ds, obj, and all of those. I will write my own MS exporter for the SLAV output, get it to you, you run it, and get that raw data to me. Big ol' regular low-tech text file with all the information that I could ever want to kick nuts.

If you are still in, know that it will take some time. I'm gonna have to learn MS and MS file I/O all over again. Take lots of notes and all that. And hopefully MS hasn't changed so much that you won't be able to run my scripts.

However, if you don't want to do this, I'll understand and walk away.

Challenge accepted?

 

Link to comment
Share on other sites

I'm game but we should get Wiz Daxter's OK since SLAV is his commercial product so I don't want to step on his toes in any way. At one point I know he was working on BVH export out of Max but as far as I can tell nothing was ever released but a youtube video.


I tested changing the euler rotation order on all the bones in the SLAV rig to match SL bvh files and then ran it through MotionBuilder to retarget a mocap file to it. It made no difference. The rotation orders in the BVH out of MoBu didn't match the SL files. I also tried enabling DOF (degrees of freedom) on each of the bones in MoBu and used it to change the rotation order and that didn't work either. This is all confusing as hell since I know there are motionbuilder rigs for SL whose BVH output works in SL. I don't think I have a future as a character TD. :matte-motes-crying:

Link to comment
Share on other sites

Looks like two major hurtles. :sigh:

The first being SLAV rig. This I know would be no big deal. Just basic pre-animation data and some re-arranging. Even manipulating the pivot points of the bones and vert weights is not a problem. The only hard part would be the semantics of it.

The second hurtle, the new one, is now the mocap files for MotionBuilder. I did some poking around and it looks like MotionBuilder friendly mocap files have all joints have ZYX as the order of rotation. This is a completely new can of worms.

I have more poking around - and quite a bit of thinking - to do. The possibility of me bowing out has become very real. Hard to say right now.

In the meantime, take Ichago's advice. The math required is already there in BVHacker and Poser. Or something else that you know works.

 

Link to comment
Share on other sites

I don't think the preffered rotation order in MoBu really matters since it's only used to drive another rig but I'm a novice with it and could be completely wrong. I do know for a fact that there are motion builder rigs that work for SL output as someone was kind enough to send me one. I should be able to animate on whatever rig in Max and then retarget that to the SL friendly rig for output. I'd love to understand what's going on under the hood though. I imported that rig into max to have a look and built a rig out of editable mesh so I could match the bone axis orientations and euler rotation orders. I then skinned a test character to it and tried exporting as collada to SL. It was, er. interesting. The skin was zig-zagged as if every bone was rotated 90 degrees. It looks like what works for animation does not work for mesh rigging and vice versa.

Is anyone doing both rigged mesh and bvh output from Blender? Is it the same situation there?

If it's true across the board that rigged mesh uses different bone axis orientations than SL's animation system that's such a ridiculously bad design decision I don't even know what to say about it. My guess would be that since custom animation was added after the avatar system was set up that they did this mismatch on purpose just to make it compatable with Poser's bvh output. Now with the introduction of rigged mesh that decision is coming back to bite us all on the ass and we're stuck having to use convoluted workarounds and hacks. surely others have already banged their heads against this and have some insight? Anyone? Bueller?

Link to comment
Share on other sites

Avatastar looks really good. One thing I can't tell from watching the videos for it is if you can animate with a custom mesh avatar after it's rigged. Is it using two different bone setups or is it doing axis conversions on bvh export? Ideally I'd really like to build a workflow around the tools I already have and know well before I give up and move over to Blender,

Link to comment
Share on other sites

The avastar rig has many more bone sets than the base SL rig, to enable use of IK and to make tweaking individial rotations easier. Since it was designed from the ground up to make SL anims and rigs, provided you dont screw up the avastar rig itself somehow it tends to "just work" (but trust me, as I learned to use it I found a LOT of ways to screw it up!)

Link to comment
Share on other sites

Hi Da5id, do share how you broke it :). No seriously .. it would be good to know what broke so we can improve it. Send me an Im if it's too product specific too be interesting in the forum.

Avastar uses the LL defined skeleton, including attachment points and volume deform bones, modified by whatever SL shape you use. There's a few other bones to support IK and so forth but the modelling and animation is done againts the SL bones. Yes you can change the rig, or move bones around and animate them afterwards but it does get tricky see here for an example: http://www.sluniverse.com/php/vb/content-creation/73726-extreme-skinning.html.

For that rig we wrote our own exporters for collada, bvh and anim. 

Link to comment
Share on other sites

Hi All

I was playing with this script to make bones and use Abus exporter early mesh days but put the project on hold when Wiz released SLAV. Mostly because I hadn't worked out the character.LL file format but did get some good bvh anim into SL straight from max. Added a bake function to Abus exporter which helped and changed some of the rotation orders I think but my memory has been overwritten at that address. Used bvh hacker to sort the sl anim loop error. The annoyance was having to xform the bones.

I'm not great at scripting and can't promise no errors but it may have some use or save time if anyone is maxscripting in this area. Sadly I can't SL for a while yet but would like to finish the script and release freeware one day.  Fill your boots and use it as you like in the mean time.

AvyBones007.ms  (beta)

(ignore the resize tab that was before Prep added the height adjust in the SL importer. & the rig can be tiny depending on your max units) 

There are various other bits in the folder that I was experimenting with, puppet shop files and a backup of Abu's script from the old  forum. 

*Abu, I hope this is ok to post. Your script was in the wild on the forum and I have been careful to attribute. Please let me know if it isn't I will remove at once.

BTW. Daves Google group for bvhhacker is always there for bvh help, really knows his beans and is more than generous with his time on brain teasing rotation problems etc.

Link to comment
Share on other sites

I am more than cool with that, Heb. As a matter of fact, it tickles me pink.

You said that you quit dev on your own project because of SLAV et al. I did pretty much the *exact* same thing. Just for giggles, I did a quick peruse of my old stuff. A lot of it is starting to come back to me. There was something about type-casting in Max that I was having a problem with, so I did a text dump of all of the LLM files using VB. From there I had zero problem reading into Max.

I still have the original, straight-up raw text dumps of the LLM files. Makes me wonder if I should offer them up to the community or something (I think I did once along time ago, but I can't remember for sure).

I think I am going to head in the direction of resurrecting. Dig back in from the very beginning and ride it all the way through.

 

Link to comment
Share on other sites

Great news Abu. Sounds like a challenge has taken root.
 
Makes sense to me there is more need than ever for your exporter now that people are making mesh and skinning. It's only natural to follow through and animate your character and there are a lot more max questions poping up on the forum these days. I'm not around for a while but if your still on it when I get back I would love to help out anyway I can, testing etc. Chip seems busy on a project too. Which is great, always good to see more 3ds in the scene or getting back in there. All we need now is Shack Dougall to chime in with some cool libomv project,
 
and big thanks for sharing your code it worked a treat, I learnt a lot and had fun with some long circus animations.
 
hope the ride is smooth!
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4182 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...