Skip to content

Group Layer Tree Matching and Linked Cel Texture Extraction#28

Merged
AristurtleDev merged 2 commits intoAristurtleDev:mainfrom
exokem:trees-linked-cels
May 2, 2024
Merged

Group Layer Tree Matching and Linked Cel Texture Extraction#28
AristurtleDev merged 2 commits intoAristurtleDev:mainfrom
exokem:trees-linked-cels

Conversation

@exokem
Copy link
Contributor

@exokem exokem commented Apr 26, 2024

Description

This pull request includes two relatively minor changes. One for the assignment of layers as children to group layers, and another for the extraction of textures from linked cels.

1. Group Layer Child Assignment

Previously, layers would always be added as children to the last-read group layer, regardless of their level relative to that group. As a result, layer structures like this:

A
. B
. C
... D

could end up looking more like this at runtime:

A
. C
... D
..... B

This PR introduces a change that caches one last-read group layer per level. With this change, layers will be added to the last-read group layer whose level is one less than theirs, if such a group layer has previously been read. This should at least ensure that the actual hierarchy is preserved in more cases.

2. Linked Cel Texture Extraction

This PR also adds a simple check for linked cels in the ExtractCel extension for the AsepriteCel class.
Instead of throwing an exception for instances of the AsepriteLinkedCel class, the extension will now extract the texture from the cel that a linked cel is linked to. While it is true that linked cels do not contain pixel data, the extension is more useful if automatically resolves the actual cel reference.

@AristurtleDev
Copy link
Owner

Thanks @exokem, I agree, the extraction from the LinkedCel is a better experience for the consumer.

@AristurtleDev AristurtleDev merged commit e94dc53 into AristurtleDev:main May 2, 2024
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.

2 participants