Fix set_bone_override documentation (#15353)

This commit is contained in:
Lars Müller 2024-11-09 18:13:36 +01:00 committed by GitHub
parent cce4fe5a3f
commit 77e78193a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8244,7 +8244,13 @@ child will follow movement and rotation of that bone.
object. object.
* `set_detach()`: Detaches object. No-op if object was not attached. * `set_detach()`: Detaches object. No-op if object was not attached.
* `set_bone_position([bone, position, rotation])` * `set_bone_position([bone, position, rotation])`
* Shorthand for `set_bone_override(bone, {position = position, rotation = rotation:apply(math.rad)})` using absolute values. * Sets absolute bone overrides, e.g. it is equivalent to
```lua
obj:set_bone_override(bone, {
position = {vec = position, absolute = true},
rotation = {vec = rotation:apply(math.rad), absolute = true}
})
```
* **Note:** Rotation is in degrees, not radians. * **Note:** Rotation is in degrees, not radians.
* **Deprecated:** Use `set_bone_override` instead. * **Deprecated:** Use `set_bone_override` instead.
* `get_bone_position(bone)`: returns the previously set position and rotation of the bone * `get_bone_position(bone)`: returns the previously set position and rotation of the bone
@ -8254,15 +8260,18 @@ child will follow movement and rotation of that bone.
* `set_bone_override(bone, override)` * `set_bone_override(bone, override)`
* `bone`: string * `bone`: string
* `override`: `{ position = property, rotation = property, scale = property }` or `nil` * `override`: `{ position = property, rotation = property, scale = property }` or `nil`
* `property`: `{ vec = vector, interpolation = 0, absolute = false}` or `nil`;
* `vec` is in the same coordinate system as the model, and in degrees for rotation
* `property = nil` is equivalent to no override on that property
* `absolute`: If set to `false`, the override will be relative to the animated property:
* Transposition in the case of `position`;
* Composition in the case of `rotation`;
* Multiplication in the case of `scale`
* `interpolation`: Old and new values are interpolated over this timeframe (in seconds)
* `override = nil` (including omission) is shorthand for `override = {}` which clears the override * `override = nil` (including omission) is shorthand for `override = {}` which clears the override
* Each `property` is a table of the form
`{ vec = vector, interpolation = 0, absolute = false }` or `nil`
* `vec` is in the same coordinate system as the model, and in radians for rotation.
It defaults to `vector.zero()` for translation and rotation and `vector.new(1, 1, 1)` for scale.
* `interpolation`: The old and new overrides are interpolated over this timeframe (in seconds).
* `absolute`: If set to `false` (which is the default),
the override will be relative to the animated property:
* Translation in the case of `position`;
* Composition in the case of `rotation`;
* Per-axis multiplication in the case of `scale`
* `property = nil` is equivalent to no override on that property
* **Note:** Unlike `set_bone_position`, the rotation is in radians, not degrees. * **Note:** Unlike `set_bone_position`, the rotation is in radians, not degrees.
* Compatibility note: Clients prior to 5.9.0 only support absolute position and rotation. * Compatibility note: Clients prior to 5.9.0 only support absolute position and rotation.
All values are treated as absolute and are set immediately (no interpolation). All values are treated as absolute and are set immediately (no interpolation).