Summary

Hooks

Returns whether the local player's vehicle state allows drawing the legs.
Creates the clientside legs model from the local player's model, skin and material.
Syncs the legs model with the local player for the current frame.
Called when screenspace effects are rendered; draws the local player's legs model.
Returns whether the local player's legs should be drawn this frame.
Called when a player's animation is updated; creates or advances the local player's legs model.
Updates the legs model's hold type and hides the bones that should not be visible.

Hooks

cwAnimatedLegs:CheckDrawVehicle()

client gamemodes/catwork/plugins/animatedlegs/plugin/cl_plugin.lua:116

Returns whether the local player's vehicle state allows drawing the legs.

Returns

  • Boolean True when the player is not in a vehicle, or the vehicle is in third-person mode

Creates the clientside legs model from the local player's model, skin and material.

The model is stored in cwAnimatedLegs.LegsEntity and set not to draw on its own; it is drawn manually in the RenderScreenspaceEffects hook.

cwAnimatedLegs:LegsThink(maxSeqGroundSpeed)

client gamemodes/catwork/plugins/animatedlegs/plugin/cl_plugin.lua:188

Syncs the legs model with the local player for the current frame.

Calls cwAnimatedLegs:WeaponChanged when the active weapon changed, and copies the model, material, skin, sequence, playback rate and pose parameters from the player. Does nothing when the legs model does not exist.

Parameters

  • maxSeqGroundSpeed Number Ground speed of the current sequence; the playback rate is the player's 2D speed divided by it, clamped to 0.01-10

cwAnimatedLegs:RenderScreenspaceEffects()

client gamemodes/catwork/plugins/animatedlegs/plugin/cl_hooks.lua:30

Called when screenspace effects are rendered; draws the local player's legs model.

Positions the legs behind the player's eye position (or in the vehicle seat), tints them with the player's color, clips everything above the eyes and runs the PostDrawAnimatedLegs hook with the legs entity, render position and render angle. Does nothing when cwAnimatedLegs:ShouldDrawLegs returns false.

Returns whether the local player's legs should be drawn this frame.

False when the legs model does not exist, the player is dead, in third person, observing another entity, viewing through another entity, in a vehicle without third-person mode, or in the FACTION_VORT or FACTION_VORT_SLAVE faction.

Returns

  • Boolean Whether to draw the legs

cwAnimatedLegs:UpdateAnimation(player, velocity, maxSeqGroundSpeed)

client gamemodes/catwork/plugins/animatedlegs/plugin/cl_hooks.lua:14

Called when a player's animation is updated; creates or advances the local player's legs model.

Only acts for the local player: creates the legs with cwAnimatedLegs:CreateLegs if they do not exist yet, otherwise syncs them with cwAnimatedLegs:LegsThink.

Parameters

  • player Player The player whose animation is updated
  • velocity Vector The player's velocity
  • maxSeqGroundSpeed Number Ground speed of the current sequence, used to scale the playback rate

cwAnimatedLegs:WeaponChanged(weapon)

client gamemodes/catwork/plugins/animatedlegs/plugin/cl_plugin.lua:141

Updates the legs model's hold type and hides the bones that should not be visible.

Resets every bone, then shrinks and moves away the bones listed in cwAnimatedLegs.BoneHoldTypes for the weapon's hold type, or the vehicle or chair set when the player is seated. Does nothing when the legs model does not exist.

Parameters

  • weapon Weapon The newly active weapon; an invalid weapon uses the none hold type

Defined in