Page 1 of 2

skeletal animation usage

Posted: Sat Sep 26, 2009 2:26 pm
by Turboman.
Hello everyone, I'm converting some of my models to skeletal models just for testing, and i was wondering if anyone could answer me some questions about specific skeletal animation basics?

1. How do you decapitate skeletal models? i'm trying to include a headshot animation for a pawn and i can't figure out how skeletal models handle these, am i supposed to draw the decapitate animation in the 3dsmax file or can i use some uscript code to scale bones to remove a limb?

2. How do i use animation combining in my model? am i supposed to specify something in 3dsmax or does it involve alot of uscript coding?


Again i'm trying to understand some of these basics, its a bit different from ut2004 where most of the documentation points to.

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 3:09 pm
by Pyro
1. i'd make a headshot animation where the head twists upside down into the body..

2. whats combining? you mean animating, or giving an object a bone?

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 3:48 pm
by Gizzy
2. How do i use animation combining in my model?
iirc, anim combining is supported in 227g, and I assume it would require some uScript, but not much hopefully.

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 5:02 pm
by .:..:
This is only possible in 227g (unless you add in a lot of animations).
To be specific what 227g can do with skeletal meshes:
- Scale bones.
- Rotate bones.
- Change bone offset.
- Change bone root (so they act like some other bone is the parent bone).
- Combine animations (such as play running while firing recoil weapon).
- Attach stuff on bones (such as turrets on a vehicle, or a second hand weapon on player).

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 5:16 pm
by Gizzy
Niiice... Would there be coding required for the animation combining, or would that be handled in defaults?
Also, in the case of the former, would this feature be documented so people know how to use it?

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 5:35 pm
by []KAOS[]Casey
Use these
native(1733) final function bool SkelPlayAnim( int Index, name AnimName, optional float Rate, optional float TweenTime, optional bool bLoop, optional float TweenOut );
native(1726) final function int GetBoneIndex( string BoneName );
native(1727) final function name GetBoneName( int Index );

multiple calls of these if there are other bones you need to animate seperately, I believe for this bone its the root bone and most bones are effected by this animation.
SkelPlayAnim(GetBoneIndex("bip01 Spine"),FiringAnim,Rate,0,,-1);

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 9:04 pm
by Turboman.
Okay so bone scaling and combining are upcoming features, i'll use a temporarily IK solver solution for the headshot decap meanwhile :)

In the upcoming 227g will this function work for headshot decap?
SetBoneScale(0,0.0,'Bip01 Head' );
fyi i got it from the udn site, i'm essentially trying to scale the head bone size to 0% in uscript.


I was wondering another two things:

3. can i load a psk file back into actorx, or atleast keep the export settings? everytime i reload my max scene i have to re-export every animation by hand, loading animations in the actorx animation manager fails to load them.

4. Is it possible to MIRROR skeletal objects upon import? actorx has no mirror option, and i was wondering if there's an exec command, vertex animation had #exec UNMIRROR=1, that's something i'm kinda looking for.
It isn't such a big deal but my characters now hold their weapons in the wrong hands (they're left handed instead of right handed as in the max file).

5. How do i get twosided textures on my imported model? my model has hair/fur, does the naming scheme like ut2004 work to identify surface flags? eg: SKIN00TWOSIDED SKIN00TRANSLUCENT?

Re: skeletal animation usage

Posted: Sat Sep 26, 2009 10:50 pm
by []KAOS[]Casey
native(1728) final function Coords GetBoneCoords( int Index ); // Get world coords of a bone.
native(1729) final function bool SetBoneRotation( int Index, rotator RotModifier ); // Set bone rotation.
native(1730) final function bool SetBoneScale( int Index, vector New3DScale ); // Set bone size 3D.
native(1731) final function bool SetBoneRoot( int Index, optional int RootIndex ); // Change bone's root bone (attach bone to bone, 0 root = orginal bone).
native(1732) final function bool SetBonePosition( int Index, vector Offset ); // Change bone location offset (offset is in mesh coords, not world coords).

3 no idea,

4 #exec MESHMAP SCALE MESHMAP=MYMESH X=-1

5 not sure

dots will need to answer some

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 12:38 am
by .:..:
Well to shrink head size to zero would be like: SetBoneScale(GetBoneIndex("bip01 Head"),vect(0,0,0));

3: I'd recommend keeping up a backup version of 3ds max file format rather than reimporting the PSK/PSA files.
4: Yes you can simply use unmirror=1, setting scale to -1 on meshmap scale will only invert the surfaces normal.
5: I don't know... but I do know UT2004 uses different method for two-siding the textures (materials). So you have to somehow set the surface flags there...
I would like to see UnrFX handle PSK files someday...

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 1:11 am
by Turboman.
3. .:..: , i am aware of that, i keep many backups ;) however in the animation manager i always need to re-import every animation every time i start up my scene, it doesnt even seem to store my settings :(

4.Thanks for the replies, a negative SCALE MESHMAP inverts the mesh just fine, however its surface normals also become flipped inside out , looks freaky as hell.
Haven't tried unmirror yet, but good to hear its still functional, i've just flipped the 3ds scene, oh well :P

5. To confirm this one, I've tried the SKIN##TWOSIDED trick and it works just fine, any material named like that will become twosided in the game!

1. i'm still having troubles with the headshot one, sofar i'm a complete idiot at uscript so i was wondering if someone could help me a bit out here:

i have a standard pawn death code (crap code omitted):

Code: Select all

function playheaddeath
{
PlayAnim('Death5',0.7,0.1);
SetBoneScale(GetBoneIndex("bip01 Head"),vect(0,0,0));
}
but this gives me an error when compiling, am i missing something here? :(


Anyway let me bore you guys with more questions:

6. So with vertex animation you can determine properties of animation sequences in the .uc file (ex: #exec mesh sequence RATE= GROUP=), do #exec mesh sequences work in skeletal models too? i prefer that over setting it up in actorx :P


Those are all my questions, if everything goes right i might release the model tomorrow, its nothing really special but it might interest the modders.

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 2:36 am
by Jâçkrâßßit
your missing the () in function playheaddeath(). As for the actual code.. it looks alright to me, but I'm not sure.

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 7:59 am
by .:..:
6: It works like: #EXEC ANIM  SEQUENCE ANIM=BipedMaleA SEQ=DodgeF STARTFRAME=13 NUMFRAMES=13 RATE=30 COMPRESS=1,00
If you use MilkShape 3D to make animations you must use that.

Also keep in mind, you may respawn with no head aswell so you need to reset the head scale afterwards.

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 12:29 pm
by Turboman.
This is only possible in 227g (unless you add in a lot of animations).
To be specific what 227g can do with skeletal meshes:
- Scale bones.
- Rotate bones.
- Change bone offset.
- Change bone root (so they act like some other bone is the parent bone).
- Combine animations (such as play running while firing recoil weapon).
- Attach stuff on bones (such as turrets on a vehicle, or a second hand weapon on player).

Doh, i must have missed this, no wonder it doesn't work as i'm still using 227f.
Guess i'll wait, or i might add an IK solver for head scaling in max sometime, but now i'm just too lazy :P

Anyway then i'll just release it as it is:


behold... just a skaarjwarrior! but a skeletal skaarjwarrior!

Image

download:
http://www.megaupload.com/?d=LN2MXLUK
instructions are found in the readme file


Anyway thanks to you guys for all the help!

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 1:40 pm
by .:..:
My god.. did you actually re-animate the whole model again?

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 2:01 pm
by Turboman.
My god.. did you actually re-animate the whole model again?
yes i did, but that was years ago (2003-2004ish), anyone still remember the Legend of Vandora mod?

i've hooked up my 5 gig IDE drive, and figured it was worth a try :P

anyway download link is up again.

DOWNLOAD:
http://www.megaupload.com/?d=LN2MXLUK

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 3:09 pm
by Gizzy
Wow, Skeletal Skaarj. Nice work Turbo!

I recall a mod called Legend of Vandora, but I had no idea what it was about...

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 3:27 pm
by []KAOS[]Casey
was supposed to be a fan sequel to unreal using ut2k4..

was looking pretty good for a while

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 4:50 pm
by Jâçkrâßßit
I'm pretty much freaking out at this point..... holy hell.

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 4:55 pm
by Smirftsch
Turboman, contact me if you want to test the upcoming 227g with your stuff, I see lil problem in that, such things definitely need testing too (although its implementation seems to be flawless yet :) )

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 5:04 pm
by Jâçkrâßßit
Turboman, contact me if you want to test the upcoming 227g with your stuff, I see lil problem in that, such things definitely need testing too (although its implementation seems to be flawless yet :) )
yes.. this should definitely be in 227g.  It is absolutely remarkable work.  Now if I could only get the source to open up in Lightwave, maybe I could learn a thing or two! **yes, my unreal fanboyism just kicked in**

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 5:46 pm
by mentalhunter
I can't wait for 227 to come out, with 227g i can possibly port custom postal2 models. They are usage of the Weaponattatchment i believe.

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 7:53 pm
by Pyro
This is only possible in 227g (unless you add in a lot of animations).
To be specific what 227g can do with skeletal meshes:
- Scale bones.
- Rotate bones.
- Change bone offset.
- Change bone root (so they act like some other bone is the parent bone).
- Combine animations (such as play running while firing recoil weapon).
- Attach stuff on bones (such as turrets on a vehicle, or a second hand weapon on player).
HAIL YOU. because i have more than 30 animations for the jaffa already, including firing while walking, walking, idle/pistol,/idle rifle/idle staff/ idle unarmed/ idle knife... and so on, like , 5 anims for each different weapon type  :o

btw, GJ at bone rescaling :)

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 7:55 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
bone rescaling
lololololol

Re: skeletal animation usage

Posted: Sun Sep 27, 2009 7:56 pm
by Pyro
bone rescaling
lololololol
....

had a long day.

Re: skeletal animation usage

Posted: Tue Nov 10, 2009 2:43 pm
by Turboman.
*BUMP*

I got the bone rescaling (lolol) working properly, it's pretty cool for some location specific dismemberment (now imagine bone based collision cylinders for leet collision detection!)  :o

So now on to the next step, i wanted to ask the 227g developers/testers a question:

Is there any example code of animation combining? i'm thinking of experimenting with combining some animations, and the UDN site really mentions nothing, neither does the ut2004 xpawn code.

I've specifically wanted to ask about these things:
  • *Can i get a pawn (eg the skaarjwarrior) to track you with his head at all times? for example you strafe to his left and his head follows you but his body stands still?
    *Can i have a pawn strafe you with the lower body following the strafing direction, and the upper body tracking your direction?
    *Can i have a simple animation (eyes blinking occasionally) performing at random intervals during every animation?