ue-mcp 0.4.28 → 0.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ue-mcp",
3
- "version": "0.4.28",
3
+ "version": "0.4.29",
4
4
  "description": "Unreal Engine MCP server — 19 tools, 300+ actions for AI-driven editor control",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,9 +35,9 @@
35
35
  #include "AnimStateTransitionNode.h"
36
36
  #include "AnimStateEntryNode.h"
37
37
  #include "AnimationStateMachineGraph.h"
38
+ #include "AnimGraphNode_AssetPlayerBase.h"
38
39
  #include "AnimGraphNode_SequencePlayer.h"
39
40
  #include "AnimGraphNode_BlendSpacePlayer.h"
40
- #include "AnimGraphNode_Inertialization.h"
41
41
  #include "Kismet2/BlueprintEditorUtils.h"
42
42
  #include "Kismet2/KismetEditorUtilities.h"
43
43
 
@@ -1697,14 +1697,19 @@ TSharedPtr<FJsonValue> FAnimationHandlers::CreateStateMachine(const TSharedPtr<F
1697
1697
 
1698
1698
  // Create the state machine container node in the AnimGraph
1699
1699
  UAnimGraphNode_StateMachine* SMNode = NewObject<UAnimGraphNode_StateMachine>(TargetGraph);
1700
- SMNode->GetStateMachineNode()->SetStateMachineName(FName(*Name));
1701
1700
  TargetGraph->AddNode(SMNode, false, false);
1702
1701
  SMNode->CreateNewGuid();
1703
- SMNode->PostPlacedNewNode();
1702
+ SMNode->PostPlacedNewNode(); // This creates the EditorStateMachineGraph sub-graph
1704
1703
  SMNode->AllocateDefaultPins();
1705
1704
  SMNode->NodePosX = 200;
1706
1705
  SMNode->NodePosY = 0;
1707
1706
 
1707
+ // Rename the state machine graph to the desired name
1708
+ if (SMNode->EditorStateMachineGraph)
1709
+ {
1710
+ SMNode->EditorStateMachineGraph->Rename(*Name);
1711
+ }
1712
+
1708
1713
  CompileAndSave(AnimBP);
1709
1714
 
1710
1715
  Result->SetStringField(TEXT("assetPath"), AssetPath);
@@ -1992,7 +1997,7 @@ TSharedPtr<FJsonValue> FAnimationHandlers::SetStateAnimation(const TSharedPtr<FJ
1992
1997
  SeqPlayer->PostPlacedNewNode();
1993
1998
  SeqPlayer->AllocateDefaultPins();
1994
1999
  }
1995
- SeqPlayer->GetSequencePlayerNode()->SetSequence(Seq);
2000
+ SeqPlayer->SetAnimationAsset(Seq);
1996
2001
  }
1997
2002
  else if (UBlendSpace* BS = Cast<UBlendSpace>(AnimAsset))
1998
2003
  {
@@ -2004,7 +2009,7 @@ TSharedPtr<FJsonValue> FAnimationHandlers::SetStateAnimation(const TSharedPtr<FJ
2004
2009
  BSPlayer->PostPlacedNewNode();
2005
2010
  BSPlayer->AllocateDefaultPins();
2006
2011
  }
2007
- BSPlayer->GetBlendSpacePlayerNode()->SetBlendSpace(BS);
2012
+ BSPlayer->SetAnimationAsset(BS);
2008
2013
  }
2009
2014
  else
2010
2015
  {
@@ -2177,18 +2182,11 @@ TSharedPtr<FJsonValue> FAnimationHandlers::ReadStateMachine(const TSharedPtr<FJs
2177
2182
  {
2178
2183
  for (UEdGraphNode* Inner : State->BoundGraph->Nodes)
2179
2184
  {
2180
- if (UAnimGraphNode_SequencePlayer* SP = Cast<UAnimGraphNode_SequencePlayer>(Inner))
2181
- {
2182
- if (UAnimSequence* Seq = SP->GetSequencePlayerNode()->GetSequence())
2183
- {
2184
- StateObj->SetStringField(TEXT("animAsset"), Seq->GetPathName());
2185
- }
2186
- }
2187
- else if (UAnimGraphNode_BlendSpacePlayer* BSP = Cast<UAnimGraphNode_BlendSpacePlayer>(Inner))
2185
+ if (UAnimGraphNode_AssetPlayerBase* AssetNode = Cast<UAnimGraphNode_AssetPlayerBase>(Inner))
2188
2186
  {
2189
- if (UBlendSpace* BS = BSP->GetBlendSpacePlayerNode()->GetBlendSpace())
2187
+ if (UAnimationAsset* Asset = AssetNode->GetAnimationAsset())
2190
2188
  {
2191
- StateObj->SetStringField(TEXT("animAsset"), BS->GetPathName());
2189
+ StateObj->SetStringField(TEXT("animAsset"), Asset->GetPathName());
2192
2190
  }
2193
2191
  }
2194
2192
  }