Add TextureSet browser and reverse model lookup#37
Open
UncleRito wants to merge 1 commit into
Open
Conversation
Decima archives strip most filenames at build time; only TextureSets keep their surviving paths (via TextureSetTextureDesc.path). Finding a model currently means manually walking 10+ ref hops backwards from a known texture, which is painful at 4000+ unnamed ArtPartsDataResource files. This change adds a TextureSet browser panel listing every named TextureSet in the archive, plus a "Find Containing Model" action available on any ObjectIdHolder selection. Both flows BFS the existing LinkDatabase incoming-link graph and stop at game-configurable "container" types (ArtPartsDataResource / ArtPartsCoverModelSettingResource for DS2; SkinnedModelResource / StaticModelResource for HFW as a starting point), then display the matches in the existing Usages panel. The list of container types is exposed via a new ContainerTypeRegistry SPI in odradek-game-decima so each game can declare its own set without touching shared code. The same SPI resolves display names for objects that carry surviving names (currently just TextureSet), and the Usages panel uses it to label nodes with their texture path. Also makes LinkDatabase.build tolerant of per-group read failures so a single bad group no longer kills the whole scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two related features to make finding a model from its (named) textures sane, plus a small reliability fix to
LinkDatabase.TextureSet browser panel. A new dockable secondary panel lists every TextureSet in the loaded archive with its surviving path name (from
TextureSetTextureDesc.pathminus thework:prefix), filterable by substring. Double-clicking a row fires a reverse BFS through the existingLinkDatabaseincoming-link graph and surfaces every top-level model container that transitively references it —ArtPartsDataResource,ArtPartsCoverModelSettingResource, and variants for DS2.Find Containing Model action. The same BFS is exposed as a right-click /
Alt+Shift+F7action on anyObjectIdHolder. Useful when you're staring at a TextureSet, RenderEffect, mesh, or any node mid-chain and want to jump to the model that owns it.LinkDatabase.buildfault tolerance. A single bad group (e.g. theInvalid boolean value: 111reader error I hit on a current DS2 build) used to kill the whole scan. Now it logs and skips, and a final tally reports how many groups were lost. The reverse-BFS feature obviously depends on the database actually existing, so this was unblocking.Design notes
The list of "container" types is per-game and configurable via a new
ContainerTypeRegistrySPI inodradek-game-decima(ServiceLoader-discovered). Each game module supplies its own implementation listing the types BFS should stop at; the same SPI'snameOf(TypedObject)resolves display names for nodes that carry surviving names (currently justTextureSet), and the Usages panel renders those names alongside the existing[gid:idx]+ type labels — so this also makes TextureSets readable in the existing "Show Usages" view.DS2 lists
ArtPartsDataResourceandArtPartsCoverModelSettingResourceas containers. HFW has noArtPartsDataResourcein itstypes.json, so the HFW registry starts withSkinnedModelResourceandStaticModelResourceas the closest equivalents — happy to refine based on review.BFS bounds default to
maxDepth=20,maxResults=500; both are constants inUsagesToolPanel.FindContainersWorker. The chain depth in DS2 is around 10 hops so the depth cap is roomy. Results are bounded mostly to keep wildly-shared TextureSets from spraying a thousand rows; happy to tune.Test plan
./mvnw clean packagesucceeds against JDK 25.fgl_face_fuzzdeferred_v00_clr.psdreturns the correct ArtPartsDataResource group.LinkDatabasescan completes despite theInvalid boolean value: 111group on the current DS2 build; WARN line lists the skipped group id.🤖 Generated with Claude Code