source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

all games: Fix bad default pose parameters in model panels

Open copperpixel opened this issue 1 month ago • 1 comments

Description

Studio_CalcDefaultPoseParameters is used in CMDLPanel::SetPoseParameters to reset pose parameters to default values.

If a zero-state for a pose parameter doesn't exist, it sets the value to middle of the pose parameter range instead of the start contrary to CBaseAnimating::InitBoneControllers.

Some animations might've been expecting defaulting to the start such as Pyro's all-class melee sequence:

Before After
matsys_controls_bad_pose_defaults_before matsys_controls_bad_pose_defaults_after

This PR fixes that by making Studio_CalcDefaultPoseParameters set pose parameters to 0 by default.

Also it updates CTFPlayerModelPanel::SwitchHeldItemTo to reset all pose parameters before overriding them to values declared in the econ item schema. Previous behavior for instance caused Pyro's arm to break when switching from The Hot Hand to The Gas Passer.

Closes https://github.com/ValveSoftware/Source-1-Games/issues/4639

copperpixel avatar Nov 23 '25 00:11 copperpixel

~~Alternate solution would be to update Studio_CalcDefaultPoseParameters in bonesetup.cpp to default to start of pose param range but I don't know if there would be any side effects in tools.~~

copperpixel avatar Nov 25 '25 12:11 copperpixel