Skip to content

Clarify TRS properties in the Object Model#2559

Merged
lexaknyazev merged 1 commit intoKhronosGroup:mainfrom
lexaknyazev:object-model-trs
Feb 3, 2026
Merged

Clarify TRS properties in the Object Model#2559
lexaknyazev merged 1 commit intoKhronosGroup:mainfrom
lexaknyazev:object-model-trs

Conversation

@lexaknyazev
Copy link
Member

@lexaknyazev lexaknyazev requested review from bghgary and javagl February 2, 2026 15:40
Copy link
Contributor

@javagl javagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #2547 ?

"Since the glTF 2.0 specification allows..."

It sounds like a reasonable change for me.

I cannot be sure that I fully understand the implications for consumers of such assets, and even less for producers. It may imply that, as a general rule, individual TRS properties should be preferred over a matrix. But to my understanding, that would perfectly make sense for anything that is related to interactivity, and have no drawbacks.

(The difficulties for consumers to track and handle a mix of TRS and matrix already exist, independently of the object model)

Tag @emackey because you also had some thoughts in the issue.

@lexaknyazev
Copy link
Member Author

Implications for consumers (i.e., engines or loaders):

  • Animation pointer & Interactivity: No need to support the ambiguous case when rotation or scale are updated on a node that defines a static matrix.
  • Interactivity only: Requirement to reject graph access (both read & write) to rotation and scale properties of such nodes. We should make test assets to assert that.

Implications for producers (i.e., exporters):

  • Do not write static matrices for nodes used for rotations or scale animations via animation pointers (it's already the case for base glTF 2.0 animations).
  • In case of interactivity, prefer to not export static matrices at all just to be safe.

Copy link
Contributor

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion is that translation should always be allowed, and it's good to specify this.

@lexaknyazev
Copy link
Member Author

lexaknyazev commented Feb 2, 2026

My opinion is that translation should always be allowed

That's what the PR says.

Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@emackey
Copy link
Member

emackey commented Feb 3, 2026

It's unfortunate that the spec needs to reference what exists "in JSON" as opposed to some parameter setting or value. But it's not clear how to get around this without creating more problems, so, I won't object to this.

@hybridherbst
Copy link

One question for something that's not entirely clear to me, what happens when matrix and translation are both defined? Does translation "win" and override the translation of the matrix? Can I in that case have the matrix and translation and then animate or make interactive just the translation property?

@lexaknyazev
Copy link
Member Author

what happens when matrix and translation are both defined

That's disallowed by the base spec.

@lexaknyazev lexaknyazev merged commit 890607a into KhronosGroup:main Feb 3, 2026
2 checks passed
@lexaknyazev lexaknyazev deleted the object-model-trs branch February 3, 2026 12:24
@hybridherbst
Copy link

Thanks, then I'm not sure if the section is clear enough: https://github.com/KhronosGroup/glTF/pull/2559/changes#diff-8f228d937d6ff200a2972f8164aa5f5738bf0377eab6023a9eba4f2b106e6fe5.

For me it sounds like "translation" can still be utilized with both interactivity and animation data, only rotation and scale are ruled out. But I might be misreading that.

@lexaknyazev
Copy link
Member Author

lexaknyazev commented Feb 3, 2026

@hybridherbst

  • Static JSON use of any TRS property with matrix is disallowed in the base spec. That remains unchanged.
  • The Object Model now says that rotation and scale pointers are undefined if the static matrix property is defined.
  • The statement about rotation and scale being undefined does not include translation, and the note below explicitly highlights why matrix presence does not affect translation validity.

Do you think more clarifications are needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants