Skip to content

fix: resolve C4996 deprecation warnings in asset/material query tools#287

Open
Mistweaver wants to merge 1 commit into
softdaddy-o:mainfrom
Mistweaver:upstream/asset-material-deprecation-fixes
Open

fix: resolve C4996 deprecation warnings in asset/material query tools#287
Mistweaver wants to merge 1 commit into
softdaddy-o:mainfrom
Mistweaver:upstream/asset-material-deprecation-fixes

Conversation

@Mistweaver

Copy link
Copy Markdown
Contributor

Summary

The SoftUEBridge editor plugin emits two C4996 deprecation warnings when built against UE 5.7. The engine states these APIs will become hard compile errors in the next release, so this updates them to the current APIs.

QueryEnumTool.cpp(45): warning C4996: IAssetRegistry::GetAssetByObjectPath: Asset path FNames have been deprecated, use Soft Object Path instead.
QueryMaterialTool.cpp(242): warning C4996: UMaterialExpression::GetInputsView: Use FExpressionInputIterator instead or GetInput() directly.

Changes

  • QueryEnumTool: IAssetRegistry::GetAssetByObjectPath(FName)GetAssetByObjectPath(FSoftObjectPath). The FName path overload is deprecated; FSoftObjectPath is constructed directly from the path string.
  • QueryMaterialTool: UMaterialExpression::GetInputsView()FExpressionInputIterator, the engine''s canonical bounded traversal. It advances via GetInput(Index) and terminates when that returns nullptr past CachedInputs.Num(), preserving the original loop''s bounded-iteration intent.

Verification

C++ plugin changes — not compile-verified locally (requires the UE editor). Both replacement APIs were confirmed against the UE 5.7 engine headers (Materials/MaterialExpression.h, IAssetRegistry).

🤖 Generated with Claude Code

Replace deprecated UE 5.7 APIs flagged at build time:
- QueryEnumTool: IAssetRegistry::GetAssetByObjectPath(FName) ->
  GetAssetByObjectPath(FSoftObjectPath)
- QueryMaterialTool: UMaterialExpression::GetInputsView() ->
  FExpressionInputIterator (the engine's canonical bounded traversal;
  terminates when GetInput() returns nullptr past CachedInputs.Num()).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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