sbox-issues icon indicating copy to clipboard operation
sbox-issues copied to clipboard

`MorphCollection.Set` restricted in [0,1] range

Open PolSpock opened this issue 6 months ago • 0 comments

Describe the bug

Hi,

I'm trying to set my morph to a value below 0 or above 1, but it doesn't apply in the game. Lets jump to the reproduction steps

To Reproduce

  1. Use a model with Morphs
  2. Set its morph to a value greater than 1f: SkinnedModelRenderer.SceneModel.Morphs.Set( "my_morph", 100f );

or to a negative value : SkinnedModelRenderer.SceneModel.Morphs.Set( "my_morph", -1f );

  1. Print the returned value : Log.Info( "my_morph " + SkinnedModelRenderer.SceneModel.Morphs.Get( "my_morph" ) ); This will print "100" for the positive value and "0" for the negative value.

Additionally, even though the 100 weight is printed, the Morph behaves the same as if the value were set to 1f.

Expected behavior

Set() in https://sbox.game/api/Sandbox.MorphCollection/Set should not be restricted to the [0;1] range

Media/Files

Positive value: image image

Negative value: image image

Additional context

No response

PolSpock avatar Aug 10 '24 17:08 PolSpock