Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional hidden layers and parenting docs #89

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/specs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ The `ty` property defines the specific layer type based on the following values:

{schema_object:layers/visual-layer}

#### Parenting

Layer parenting offers a way to connect layers such that the movement of one layer (child) follows
the movement of another (parent). Multiple child layers can reference the same parent (this is
useful for applying the same transform animation to a group of layers).

When the `parent` property points to another layer, the referencing layer's current transformation
matrix (CTM) is composed with the parent CTM:

$$CTM(child) = Transform(child) \times CTM(parent)$$
Copy link
Member Author

Choose a reason for hiding this comment

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

I would normally write this in inverted order, but I think this is aligned with the proposed matrix/operations format. @mbasaglia please confirm.

Copy link
Member

Choose a reason for hiding this comment

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

I believe it should be parent x child

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


Parenting is transitive, and reference cycles are not allowed (undefined behavior).


#### Hidden Layers

The hidden flag `hd` determines whether a layer is rendered: hidden layers are not rendered as
part of the normal layer tree, but their properties and content are evaluated when used as a
reference target in other contexts.

Specifically, hidden layers

* contribute to a layer's total transform when used as a `parent`
* contribute to a layer's track matte when used as a matte source

`hd` only affects the layer for which it is defined, it does not transitively apply to other
referencing layers.

#### Mattes

Expand Down
1 change: 1 addition & 0 deletions docs/specs/shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ The `ty` property defines the specific element type based on the following value

{schema_subtype_table:shapes/all-graphic-elements:ty}

Hidden shapes (`hd: True`) are ignored, and do not contribute to rendering nor modifier operations.

<h2 id="shape">Shapes</h2>

Expand Down