Skip to content

Fix UE 5.7 compatibility: replace ANY_PACKAGE + add static_mesh to spawn_actor#54

Open
krsmer wants to merge 1 commit into
chongdashu:mainfrom
krsmer:fix/ue57-compatibility-and-static-mesh-spawn
Open

Fix UE 5.7 compatibility: replace ANY_PACKAGE + add static_mesh to spawn_actor#54
krsmer wants to merge 1 commit into
chongdashu:mainfrom
krsmer:fix/ue57-compatibility-and-static-mesh-spawn

Conversation

@krsmer

@krsmer krsmer commented Jun 1, 2026

Copy link
Copy Markdown

Summary

  • UE 5.7 compile fix: Replace deprecated ANY_PACKAGE with nullptr in all FindObject<UClass>() calls in UnrealMCPBlueprintCommands.cpp and UnrealMCPBlueprintNodeCommands.cpp. ANY_PACKAGE was removed in UE 5.1+ and causes build errors on UE 5.5–5.7.
  • New feature: Add optional static_mesh parameter to spawn_actor (both C++ handler and Python tool) so a StaticMeshActor can be spawned with a mesh asset assigned in one call (e.g. /Engine/BasicShapes/Cube.Cube).

Changes

File Change
UnrealMCPBlueprintCommands.cpp ANY_PACKAGEnullptr (4 occurrences)
UnrealMCPBlueprintNodeCommands.cpp ANY_PACKAGEnullptr (5 occurrences)
UnrealMCPEditorCommands.cpp Load + assign mesh when static_mesh param provided
Python/tools/editor_tools.py Expose static_mesh optional param in spawn_actor tool

Test plan

  • Plugin compiles on UE 5.7 (macOS, Apple Silicon)
  • spawn_actor with static_mesh="/Engine/BasicShapes/Cube.Cube" spawns a visible cube
  • spawn_actor without static_mesh still works as before

🤖 Generated with Claude Code

- Replace deprecated ANY_PACKAGE with nullptr in FindObject<UClass>()
  calls (UnrealMCPBlueprintCommands.cpp, UnrealMCPBlueprintNodeCommands.cpp)
  which was removed in UE 5.1+ and causes compile errors on UE 5.7
- Add static_mesh parameter to spawn_actor C++ handler so a mesh asset
  path can be assigned directly at spawn time for StaticMeshActors
- Expose static_mesh as optional parameter in Python spawn_actor tool

Co-Authored-By: Claude Sonnet 4.6 <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