KhronosGroup / glTF

glTF – Runtime 3D Asset Delivery
Other
7.18k stars 1.14k forks source link

Clarify animation channel target path validity #2430

Open lexaknyazev opened 3 months ago

lexaknyazev commented 3 months ago

The current spec says:

When node isn’t defined, channel SHOULD be ignored. Valid path names are "translation", "rotation", "scale", and "weights".

Additionally, the JSON schema for the path property allows any string value for extensibility.


The KHR_animation_pointer spec says:

To use this extension, the animation channel target path MUST be set to "pointer" and the actual JSON pointer value is provided in the extension object's pointer property. The animation channel node property MUST NOT be set.

This extension spec does not (and cannot) cover the inverse case: if the path is set to "pointer" but the extension object is not present.


Proposed base spec update

When the node property is defined, valid values for the path property are "translation", "rotation", "scale", and "weights".

When the node property is not defined, the channel SHOULD be ignored and the path property MAY have any value.

@emackey @javagl WDYT?

emackey commented 3 months ago

Would there ever be an extension object that wants to keep the node property defined, but replace path with some new enum?

(I can't think of one, I'm just pondering what the proposed change might disallow...)

lexaknyazev commented 3 months ago

That extension would extend the list of valid enums (schema-wise, any string is valid anyway).

javagl commented 3 months ago

The proposed rewording looks fine for me.


I might not really be able to nitpick on this level of the language. But the suggested wording is

When the node property is defined, valid values for the path property are "translation", "rotation", "scale", and "weights".

and I think that the concern that Ed brought up might be avoided with

When the node property is defined, then "translation", "rotation", "scale", and "weights" are valid values for the path property

or

When the node property is defined, valid values for the path property include "translation", "rotation", "scale", and "weights".

I think that this could make clear that these values are always valid when the node is there, but other values might also be valid, regardless of whether the node is there or not, depending on details of possible extension. (To be confirmed by someone who might have a better understanding of the details...)