From f8ff9ba196afacd39bd0054879013b7189fc427b Mon Sep 17 00:00:00 2001 From: Brandon Wilson Date: Wed, 31 Jul 2024 09:52:19 -0400 Subject: [PATCH] Mark keyframe easing values as optional in schema (#67) * Mark keyframe easing values as optional in schema Docs updated to specify when these are required * Add back accidentally deleted section --- docs/specs/properties.md | 7 +++++-- schema/properties/base-keyframe.json | 17 ----------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/docs/specs/properties.md b/docs/specs/properties.md index cdb18ec..22a7c5e 100644 --- a/docs/specs/properties.md +++ b/docs/specs/properties.md @@ -17,8 +17,11 @@ Their structure depends on whether it's animated or not: Keyframe arrays MUST be stored in order of strictly ascending `t` frame number. Two keyframes cannot have the same `t` value. -If `h` is present and it's 1, you don't need `i` and `o`, as the property will keep the same value -until the next keyframe. +All keyframes MUST have an `i` and `o` value, unless- + +* It is the last keyframe in the sequence OR +* `h` is present and it's 1, as the property will keep the same value until the +next keyframe. If the first keyframe occurs after the start of the animation, the initial property value will be from the first keyframe. Similarly if the last keyframe is before the end of the animation, the last keyframe value will be held until the end. diff --git a/schema/properties/base-keyframe.json b/schema/properties/base-keyframe.json index 7dca3b2..5b36d08 100644 --- a/schema/properties/base-keyframe.json +++ b/schema/properties/base-keyframe.json @@ -28,23 +28,6 @@ "$ref": "#/$defs/properties/easing-handle" } } - }, - { - "if": { - "oneOf": [ - { - "properties": { - "h": { "const": 0 } - } - }, - { - "not": {"required": ["h"]} - } - ] - }, - "then": { - "required": ["i", "o"] - } } ], "required": ["t"]