feat: 2D portrait fallback when the 3D model isn't loaded (12.0)#1844
Open
mjodheim wants to merge 2 commits into
Open
feat: 2D portrait fallback when the 3D model isn't loaded (12.0)#1844mjodheim wants to merge 2 commits into
mjodheim wants to merge 2 commits into
Conversation
Reimplements the oUF portrait Update via portrait.Override = UF.PortraitOverride (oUF's Path calls `self.Portrait.Override or Update`), leaving the oUF library file untouched. The override: - detects secret-GUID units (UnitGUID secret inside instances) and secret booleans from UnitIsPlayer/UnitIsVisible/UnitIsConnected, treating them safely; - shows a 2D cover frame (SetPortraitTexture, a child Frame above the PlayerModel) whenever the 3D model isn't loaded -- question mark, NPCs, not-visible units -- instead of leaving a permanent question mark; - hides the cover via an OnModelLoaded hook (only when a DIFFERENT model file id streams in, for secret units) and a bounded RetryPortraitModel ticker. Fixes blank/stuck 3D portraits on targets/bosses/NPCs in 12.0 where models stream asynchronously and UnitIsVisible returns false for NPCs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 6, 2026
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 a 2D portrait fallback for unit-frame portraits when the 3D model cannot be loaded on Midnight.
In instanced content, non-group unit identities are secret. Since 12.0.5, PlayerModel:SetUnit rejects those unit tokens and returns nil, so retrying the model load cannot succeed and can cause repeated work and stale portraits.
Approach
The portrait update is implemented through portrait.Override, leaving the bundled oUF element untouched.
Validation
Limitations
A 3D model cannot be recovered for a secret-identity unit through the public API on 12.0.5+: PlayerModel:SetUnit intentionally rejects it. The 2D portrait is therefore the supported fallback until the identity is declassified.