Page 2 of 2
Re: skeletal animation usage
Posted: Tue Nov 10, 2009 2:51 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
I was thinking about that a long ago... I wanted to make a mod where you can rotate only head* but not body, but it'd be a f[ch367]ckload of work and wouldn't replicate (properly) if done without skeletal meshes.
* - no homo
Re:
Posted: Tue Nov 10, 2009 2:52 pm
by Turboman.
I was thinking about that a long ago... I wanted to make a mod where you can rotate only head* but not body, but it'd be a f[ch367]ckload of work and wouldn't replicate (properly) if done without skeletal meshes.
* - no homo
sorry i was still editing my messy post when you posted this
but i should note i'm doing this with skeletal animation only, i'm really willing to explore the possibilities and limitations of this new format.
as for "tracking" individual body parts, with skeletal animation how hard would this be to do? ut2004 had this, as do many unreal engine games (rune, undying, deep space 9, deus ex ps2). I really think this would be the biggest feature of animation combining if possible
Re: skeletal animation usage
Posted: Tue Nov 10, 2009 3:34 pm
by []KAOS[]Casey
if that skeletal skaarj of yours is set up right, yep :p
you should be able to set bonerotation of the head and body relative to it's enemy
and for blinking yeah, should be possible but a waste of bandwidth imo unless it's simulated
Re: skeletal animation usage
Posted: Tue Nov 10, 2009 6:16 pm
by Turboman.
but..... any example code of animation combining or tracking? i haven't been able to find any example code on UDN or stuff.
Re: skeletal animation usage
Posted: Tue Nov 10, 2009 7:57 pm
by []KAOS[]Casey
SkelPlayAnim(0,"Running",1, 0.1,0); //set all bones to run animation
SkelPlayAnim(1,"Firing",1,0.1,0); //set shoulder root bone and child bones to firing animation
Assuming 0 is the root bone for ALL bones, and 1 is the shoulder/arms/head bone.
on event AnimEndOnBone( int BoneIndex );
you can re play those animations to effectively loop
SetBoneRotation(5, Rotator(Location-Enemy.Location);
assuming bone 5 is head bone
HAven't actually tested it myself but thats my understanding of how it works
Re: skeletal animation usage
Posted: Mon Nov 23, 2009 5:04 pm
by Turboman.
SkelPlayAnim(0,"Running",1, 0.1,0); //set all bones to run animation
SkelPlayAnim(1,"Firing",1,0.1,0); //set shoulder root bone and child bones to firing animation
Assuming 0 is the root bone for ALL bones, and 1 is the shoulder/arms/head bone.
on event AnimEndOnBone( int BoneIndex );
you can re play those animations to effectively loop
SetBoneRotation(5, Rotator(Location-Enemy.Location);
assuming bone 5 is head bone
HAven't actually tested it myself but thats my understanding of how it works
setbonerotation seems to work as ucc didnt throw any error at me, but skelplayanim seems to be an unrecognized variable here, iscript simply give me a BAD OR MISSING PARAMETER 1 error.
here's the example code:
function PlayTurning()
{
BaseEyeHeight = Default.BaseEyeHeight;
SkelPlayAnim(BIP 01 R THIGH,"turn",1,0.1,0);
SkelPlayAnim(BIP 01 L THIGH,"turn",1,0.1,0);
}
here i'm trying to make the legs perform a subtle animation while turning (to simulate the effect of "anchored" feet, what newer games have).
also can i determine the speed (or the actual animation played) by turning speed and direction? for example if mr skaarjwarrior turns around 120 degrees to the left it plays a wild turn to left animation, then if he turns around 45 degrees to the right it plays a subtle move to the right animation?
another thing, you mentioned "numbering" your bones, but hows that? my bones are simply named BIP 01 THIGH, BIP 01 HEAD and such rather then having numbers, or am i supposed to count them from the root bone?
Re: skeletal animation usage
Posted: Mon Nov 23, 2009 5:12 pm
by Smirftsch
// Unreal Skeletal mesh implemention.
native(1726) final function int GetBoneIndex( string BoneName ); // Get bone index of a name (-1 if not found, "Weapon Bone" for weapon bone index).
native(1727) final function name GetBoneName( int Index ); // Get name of a bone index
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).
// Play an animation with bone index as root.
// @ Index - The root bone index for the animation.
// @ Rate (1.0) - The animation rate.
// @ TweenTime (0.0) - The "blend-in" time for the animation.
// @ bLoop (false) - Animation will loop forever.
// @ TweenOut (0.0) - When not looping, the "blend-out" time for the animation (-1 and it will freeze frame once animation completed).
native(1733) final function bool SkelPlayAnim( int Index, name AnimName, optional float Rate, optional float TweenTime, optional bool bLoop, optional float TweenOut );
// Stop an animation in this bone index.
// @ bCheckFromRoot (false) - If true, check if this bone is affected by any channel towards the root.
native(1734) final function bool StopSkelAnim( int Index, optional bool bCheckFromRoot );
// Remove all active animation channels and reset back all bone sizes and rotations (this is automatically done when mesh is switched to another skeletal mesh).
native(1735) final function ResetSkeletalMesh();
So it should work...
Re: skeletal animation usage
Posted: Mon Nov 23, 2009 5:22 pm
by .:..:
What you need to do is:
Code: Select all
function PlayTurning()
{
BaseEyeHeight = Default.BaseEyeHeight;
SkelPlayAnim(GetBoneIndex("BIP 01 R THIGH"),'turn',1,0.1,,0.1);
SkelPlayAnim(GetBoneIndex("BIP 01 L THIGH"),'turn',1,0.1,,0.1);
}
Re: skeletal animation usage
Posted: Mon Nov 23, 2009 5:24 pm
by Turboman.
thanks for that list, must have missed something in the faq.
native(1733) final function bool SkelPlayAnim( int Index, name AnimName, optional float Rate, optional float TweenTime, optional bool bLoop, optional float TweenOut );
okay apparantly the first step works when i insert a number instead of a name in int INDEX.
SkelPlayAnim(1,"walk",1,0.1,0);
then it gave me a type mismatch in parameter 2: and failed to compile, parameter 2 is walk, the animation called "walk" is present in the model, any suggestions?
And how exactly do i use int index? like i said my bones are named pelvis, arm, head etc rather then having a number, am i supposed to be able to look up that number somewhere?
wait dots posted a second before me... lemme read
okay that solved it!
but now, it seems to play the animation after actually turning, oh well thats probably related to the original turn script

Re: skeletal animation usage
Posted: Tue Dec 15, 2009 6:00 pm
by Turboman.
Ah i've discovered a bug regarding skeletalmodels!
Its the way d3d/opengl draws translucent textures on skeletalmeshes, it strangely seems to draw them behind normal solid textures, software rendering doesn't produce this bug though, neither does it occur on vertex meshes.
Example is a weapon with a scope i'm working on, the glass of the scope is partly obstructed by the solid tube around it, that renders over it instead of behind.
Also too bad unmirror=1 doesn't work on skeletalmeshes, with vertexmeshes it saved me alot of time by just letting unreal mirror left handed/right handed variants of weapons

Re: skeletal animation usage
Posted: Wed Dec 16, 2009 5:32 am
by .:..:
Ah i've discovered a bug regarding skeletalmodels!
Its the way d3d/opengl draws translucent textures on skeletalmeshes, it strangely seems to draw them behind normal solid textures, software rendering doesn't produce this bug though, neither does it occur on vertex meshes.
Example is a weapon with a scope i'm working on, the glass of the scope is partly obstructed by the solid tube around it, that renders over it instead of behind.
Hmm... I don't think that depends on skeletal meshes, perhaps just the order of the actors it renders?
Also too bad unmirror=1 doesn't work on skeletalmeshes, with vertexmeshes it saved me alot of time by just letting unreal mirror left handed/right handed variants of weapons
Guess we'd need to add a "DrawScale3D" option for actors for this and use Y scale -1 to mirror the model for best results.
As normal "unmirror" does only mirror the verts and the anim, but does not effect the skeletal animation or bones.
Re: skeletal animation usage
Posted: Wed Dec 16, 2009 4:37 pm
by Turboman.
Hmm... I don't think that depends on skeletal meshes, perhaps just the order of the actors it renders?
well i'm speaking of a single skeletalmesh with solid and translucent textures, but actually i discovered it only occurs between twosided and translucent textures.
here's an example pic of what problem i'm having, opengl/d3d draw the texture order wrong (the translucent texture is drawn behind the twosided one), software rendering does it fine.
Guess we'd need to add a "DrawScale3D" option for actors for this and use Y scale -1 to mirror the model for best results.
As normal "unmirror" does only mirror the verts and the anim, but does not effect the skeletal animation or bones.
will that work? casey already suggested using the normal scaling with a negative value, it works perfectly with the animation and such, but the model is drawn inside out.
Re: skeletal animation usage
Posted: Wed Dec 16, 2009 7:50 pm
by [§Ŕ] ŤhěxĐâŕkśîđěŕ
He's talking about the Y scale only, not X or Z, and yeah that will work for what I know.

Re: skeletal animation usage
Posted: Sat Dec 25, 2010 4:07 pm
by Kajgue
Hello Turboman,
Is this mesh importable for Blender? I don't have the privilege of using Max :/
Re: skeletal animation usage
Posted: Mon Dec 27, 2010 12:58 am
by Turboman.
Hello Turboman,
Is this mesh importable for Blender? I don't have the privilege of using Max :/
i assume you're talking about the skaarjwarrior? i don't know, you might want to check if blender can open .max files.
i should update the file i posted tho, it has some bugs that i fixed later, i didn't bother as i didn't think anyone would have checked it
