donmccurdy / donmccurdy/glTF-Transform

Support for applying transform to TRS animations

Open
#1,013 0 comments 1 reaction 0 assignees View on GitHub
feature package:functions
Dominant language
TypeScript
Stars
2k
Forks
206
Avg merge
2d 2h
Merged PRs (30d)
16

Description

### Discussed in https://github.com/donmccurdy/glTF-Transform/discussions/1008

Originally posted by **kzhsw** July 2, 2023
Currently the function [clearNodeTransform](https://github.com/donmccurdy/glTF-Transform/blob/1203855141862134f49106c30382238778ee5a24/packages/functions/src/clear-node-transform.ts) could apply local transform to mesh primitives.
It seems morph targets are already [supported](https://github.com/donmccurdy/glTF-Transform/blob/1203855141862134f49106c30382238778ee5a24/packages/functions/src/transform-mesh.ts#L59), but could there be an option or function to apply this on `translation`, `rotation`, `scale` [animations](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/Specification.adoc#animations)?

***

I'm in favor of supporting transforming (translate, rotate, scale) animation keyframe data. Probably this would be organized into two new functions...

- `transformAnimation(animation, matrix)`
- `transformAnimationChannel(channel, matrix)`

... which could then be imported and applied by other functions like `transformNode` and `quantize`.

Contributor guide

Open the contributing guide

Research direction

Start with packages/functions/src/clear-node-transform.ts and the morph-target handling in packages/functions/src/transform-mesh.ts, then read the glTF animation specification linked in the issue. Define the scope for transforming translation, rotation, and scale keyframe data through the proposed transformAnimation and transformAnimationChannel functions; done means those animation channels can receive the requested transform.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.