This is a script that allows you to create dynamic animations using only Lua. Two example stances are included. It is obviously for coders. There is no use for the average gmod user.

Use Entity(1):SetLuaAnimation("staffholdspell") or Entity(1):SetLuaAnimation("stancetest") and then turn third person mode on to see the examples. staffholdspell will only work correctly if you have a weapon out that uses the ACT_HL2MP_IDLE_MELEE2 group.

Hooking up with your addon/gamemode/whatever
include("boneanimlib.lua") in the server code. include("cl_boneanimlib.lua") in the client code. You are now ready to make calls to the API.
It's suggested you put this stuff in its own folder.

Editor
An editor is included. Type animate in the console to open it. I did not make the editor.

Animation table structure
integer Type - The type of animation it is. Can be one of these: TYPE_GESTURE, TYPE_STANCE, TYPE_SEQUENCE, TYPE_POSTURE. See the script for more info on each.
integer Interpolation - Can be one of these: INTERP_LINEAR, INTERP_COSINE, INTERP_CUBIC, INTERP_DEFAULT. Determines how the animation is smoothed between frames. Linear is no smoothing. Cosine is the best quality/compatibility balance. Cubic will smooth the best but your animation frames may overflow in to each other.
table FrameData - See above and the examples inside the code.
function PreCallback(pl, sGestureName, tGestureTable, iCurFrame, tFrameData, fFrameDelta) - Allows you to do work on the animation before being processed. Perform actions on tGestureTable.
function ShouldPlay(pl, sGestureName, tGestureTable, iCurFrame, tFrameData, fFrameDelta, fPower) - If this exists and doesn't return true then the animation stops early.

Awesome Strike: Source uses a few animations made with this system.Your browser doesn't support HTML 5 videos!

By the way, stancetest is only testing the ability to move bones. In a normal custom animation you would only want to ROTATE the bones since the engine automatically handles offsetting from the parent bone and moving child bones.

It could be used for anything you want, even having it so the animation can interact with the environment. Example, you could get the closest wall next to the npc and have their arm extend to it. It's really tedious without an editor.

Now, i might throw this phrase around occasionally,but often i dont mean it. Now however, i really really really want to say that this is made of so much win that you deserve a cake that is both delicious and moist!

Usefull and fun reguardless of whether it needs it, I know that users on my server would like something like this, with an editor. (Not for IN the server, unless the supposed editor could support live making it, and then being able to use it, admin or not.) . I know that I'd want to add animations into sweps that I download. (Ex: The hax swep, simply pointing.) .