Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Daz3d & Hip Translations Problem

Aindreas McGee
Registered User
Join date: 11 Jun 2006
Posts: 29
12-11-2006 23:13
I've already done some animations with Slat, even some involving some hip translations that can be tricky. Now that Daz3d has a BVH exporter that truly works, I was trying to do some simple animations and have some fun with the Power Pose Tool (which lets you thumbtack parts in place and then bend the body naturally).

So, I started out trying to make a kneeling animation. I thumbtack the feet in place and drag the upper body down. But when I uploaded into SL, rather than the feet staying on the ground, they move into the ground as if something is wrong with the hip translation.

I then made it my quest to turn off hip translation entirely (a side quest):
I tried opening the Daz3d bvh in Slat, but it won't work. I'm guessing the reason is the bvh from Daz3d has a much larger hierarchy description that confuses Slat. So, no luck using Slat's easy "Perturb First Frame" feature to fix (or at least change) the problem.

So, I looked into how BVH files are structured. Easy enough, 1st part hierarchy, 2nd part frames per line. So the X,Y,Z position of the hip is the first 3 columns. I tried all sorts of combinations. I tried matching the first 3 values of the first 2 or 3 frames. I tried making them all zero. I tried, making them 0 and 0.1 in the 2nd frame. Nothing I did changed the preview animation, it always translated the hips. I couldn't unperturb them.

I now realize that turning off hip translation isn't what I want, as the kneel animation will simply bring their feet up into the air so they float, but it would at least be something. That fact really confuses me because then it seems like the hip translation must not be scaled correctly between SL and Daz3d? Why do the feet punch through the floor in SL but stay right on the grid on Daz3d Studio?
Aindreas McGee
Registered User
Join date: 11 Jun 2006
Posts: 29
Solved my own problem: Hip Translations from Daz3d Need Scaled Down to 50%
12-12-2006 20:01
Ok, with a clearer mind I tackled the problem today. I still don't know how to unperturb the hip translate, but that's a problem for another day.

Since when the avatar kneeled in SL and the feet punched through the floor, I realized that the hip translation was working, it was just too great. If the feet were specified in position rather than joint angles, it wouldn't be an issue, but that's they way BVH is setup (and it makes sense).

So, grid units for hip translation in Daz 3D (Daz Studio) are greater than in SL. So, as a quick test, I copied the motion part of the BVH from Daz3D to a blank text file. I then imported this into MS Excel as a space delimited file. I then scaled the 2nd column data (the vertical hip translation) by 0.5 (seems to be a good value) and recopied these scaled data values over top the old second column. I then exported as a text(MS-DOS) file which I think is basically a tab-delimited file. I copied this scaled motion data back into the motion part of the BVH and uploaded the animation into SL. Viola, the feet stay in place!

So, it would probably be best to scale not only the vertical but also the horizontal and forward/backward translations of the hip by 0.5 as well. Doing it with Excel isn't too hard, and isn't ultra time-consuming for just a few animations. A script that could read in the BVH and scale the first 3 columns by 0.5 would be lovely. Even better if Escort DeFarge's script to export BVH's could do this, or do it by some user set value in case 0.5 wasn't exactly what someone wanted.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-12-2006 23:53
Interesting investigation Andreas - I'll take a look at this anomaly too and release an update to the plugin over the next few days if I can produce a solid "fix".

regs,
/esc

**edit note: FYI my initial look at this suggested the scale factor was 0.72:1 btw... **
_____________________
http://slurl.com/secondlife/Together
Aindreas McGee
Registered User
Join date: 11 Jun 2006
Posts: 29
12-13-2006 20:00
Hmm, that's interesting. One animation I uploaded needed a factor of 0.4 for me, but I had played around with the vertical scaling of the avatar so I figured it was a bad test. I had tried scaling the vertical in an attempt to quick fix it, as for a kneeling animation, the side to side and forward-backward translation isn't important like with dancing.

On that note, scaling the avatar in Daz3D didn't seem to affect the resulting animation in SL.

For the one that I found 0.5, I imported the female SL avatar, though I don't think the sex really matters. I'll have to try another animation again and see if I get the same or different number.

Also, another thing I found was I tried scaling the avatar inside SL to 0 and 100. In both cases, the avatar seemed to punch the feet through the floor by the same relative amount (butt hit floor and legs went knee-deep no matter which avatar height). So I'm guessing that SL smartly scales the hip translations to compensate for avatar height? It seems so, and that's pretty cool!

That will be great if you can do an all-in-one plug-in like that. I'll tip you. :)
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
12-13-2006 21:53
From: Escort DeFarge
Interesting investigation Andreas - I'll take a look at this anomaly too and release an update to the plugin over the next few days if I can produce a solid "fix".

regs,
/esc

**edit note: FYI my initial look at this suggested the scale factor was 0.72:1 btw... **


I am very very curious to know how you came up with that number... I wrote a quick little C# app to do the scaling for me, so that I could easily test values, and empirical evidence in my case suggests that it is more nearly 0.5 than 0.72

My tests were fairly limited, however, since my only concern was vertical hip placement. I only wanted to make sure that when I used the "drop to floor" or whatever it is called in Daz, that my avatar was indeed on the floor. In this case, 0.5 works adequately.

I love the plugin, Escort, it is really really fantastic!!! Thank you very much for making it available :D
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-14-2006 00:49
We are talking here about avatar scaling and not about sit targets? If it's sit targets on pose balls? In those, there's a 0.4 offset of the rotation center...
_____________________
http://slurl.com/secondlife/Together
Aindreas McGee
Registered User
Join date: 11 Jun 2006
Posts: 29
12-14-2006 20:56
All my tests were simply uploading the animation and playing them by opening them from the inventory. No pose ball or anything else involved.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-15-2006 01:26
...in which case, it's my current (unsubstantiated) belief that SL makes a further post-adjustment in order to get the feet on the ground depending on the av sliders... just a suspicion atm!

/esc
_____________________
http://slurl.com/secondlife/Together
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-15-2006 10:02
The position of root in the first frame is considered the zero point, and all other positions are made local to it at upload.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
12-15-2006 11:37
I am having some pretty serious issues with this at this time....

First of all, I am pretty much a noob at animating.. I have tried Poser, and do not care for it at all. So mostly I use QAvimator, and it works okay. Not great, but adequate for what I need at this point in time. I should point out that while I *am* a noob I have created probably around 20 anims that work well enough for me, so I know a little bit at least.

The only time I ever seriously considered using Daz was when Escort released the BVH exporter (THANKS AGAIN!!!). And I gotta say, I love Daz|Studio. It's got a much easier UI than Poser, more power and features than QAvimator, and is overall much more pleasant to use than the other two programs I've mentioned.

But....

When I use Escort's BVH exporter to create an SL-compatible anim, the head of my avatar is completely spastic, moving back and forth by at least 2 degrees per frame. I can watch it in DAZ, and it never moves (relatively) at all. But every program I have that is capable of viewing a BVH shows the spastic head and sometimes spastic legs.

I am using the SL Avatar downloaded from the SecondLife downloads page within DAZ to do the anims, as the others do not appear to work right :) I have also tried using Ulrika's Poser figure just to see if that made a significant difference, but it does not seem to. Michael 3 obviously won't work, either.

I looked at the source for the exporter, and nothing jumps out at me about why the problem exists, the following code to get the local rotation of any given bone at a given frame
CODE

var rot = bone.getLocalRot(time).getValue(1, 0, 2).multiply(RAD_TO_DEG);

seems pretty straightforward and not obviously incorrect, and the rest of the script is similarly easy to understand and looks correct.

[EDIT] Just noticed that in the exported anim the hip never moves, while in the DAZ animation the hip does, such that it appears as if the hips are locked in place and everything propagates from that point.

Anybody got some pointers for me? I really want to use DAZ, I just hate the Poser UI that much!!! And QAvimator is buggy and I really would like some of Daz|Studio's features.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
12-15-2006 12:34
Hmmm.... Well, looking at the exported BVH, the hips are indeed locked at <0,0,0>.

This is a new behavior, and I do not believe it existed before yesterday's upgrade to Daz|Studio 1.4.16, I was only experiencing the hip translation problems mentioned by the OP in 1.3.??.

Huh.

On another note, is there any sticky or other good post about using Daz for SL? I mean one which mentions the real basic stuff like which figure you should use and how to set it up, that sort of stuff? I could not find much of anything via Search about using DS.
Aindreas McGee
Registered User
Join date: 11 Jun 2006
Posts: 29
12-15-2006 14:16
I've been using Daz3D 1.3.1; I didn't even know there was a newer version. Maybe the scale from 0.5 changed in the newer version to 0.72? Were you using 1.4, Escort?

As for the possible hip-locking problem in 1.4.16, I'll have to try that version and keep the install to the old one. I've never had the head go spastic really. Well, sometimes in SL when you point the camera a weird way that happens but doesn't correspond to the animation for me.

I agree with the post-adjustment to make animations invariant of avatar height, Escort. That's pretty awesome and means a lot less headaches for us.