Skip to content

fix(ue58): use versioned material sampler API - #127

Open
kunkunGames wants to merge 1 commit into
tumourlove:masterfrom
kunkunGames:agent/ue58-material-sampler
Open

fix(ue58): use versioned material sampler API#127
kunkunGames wants to merge 1 commit into
tumourlove:masterfrom
kunkunGames:agent/ue58-material-sampler

Conversation

@kunkunGames

@kunkunGames kunkunGames commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Add one reusable UE 5.7/5.8 compatibility boundary for material sampler inference and route both Monolith consumers through it.

Problem

UE 5.8 moved GetSamplerTypeForTexture from UMaterialExpressionTextureBase to MaterialExpressionUtils and deprecated the former entry point. UE 5.7 does not expose MaterialExpressionUtils.h, so an unconditional migration would break Monolith's supported compile floor.

The deprecated call existed independently in MonolithIndex and MonolithMaterial, which duplicated the compatibility problem and produced both sampler warnings tracked in #121.

Solution

Introduce MonolithMaterialSamplerCompat::GetSamplerTypeForTexture as a small header-only adapter:

  • UE 5.7 uses UMaterialExpressionTextureBase::GetSamplerTypeForTexture
  • UE 5.8 and newer use MaterialExpressionUtils::GetSamplerTypeForTexture
  • both existing consumers call the same Monolith compatibility API

Centralizing the version gate avoids repeated preprocessor branches and gives future sampler consumers one stable extension point. Returned metadata and runtime behavior remain unchanged.

Verification

  • UE 5.7 RunUAT BuildPlugin -NoTargetPlatforms -Rocket: 434/434 Editor actions passed; UAT exit code 0
  • UE 5.8 RunUAT BuildPlugin -NoTargetPlatforms -Rocket: 434/434 Editor actions passed; UAT exit code 0
  • both builds compiled GenericAssetIndexer.cpp and MonolithMaterialActions.cpp as individual actions
  • the UE 5.8 build log contains zero GetSamplerTypeForTexture C4996 warnings
  • git diff --check passed
  • detailed evidence: Docs/testing/2026-08-04-ue58-material-sampler-api.md

Compatibility and risk

This PR addresses only the two material-sampler deprecations in #121; unrelated UE 5.8 warnings remain out of scope. The adapter preserves UE 5.7 support and does not change public MCP actions, serialized data, or configuration.

Visual evidence

Not applicable: this is a compile-time engine API compatibility change with no visual or editor-facing UI behavior.

@kunkunGames
kunkunGames marked this pull request as ready for review August 4, 2026 16:30
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.

1 participant