ue-mcp 0.4.6 → 0.4.7

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.6",
3
+ "version": "0.4.7",
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",
@@ -1325,6 +1325,25 @@ TSharedPtr<FJsonValue> FAnimationHandlers::GetBoneTransforms(const TSharedPtr<FJ
1325
1325
  return MakeShared<FJsonValueObject>(Result);
1326
1326
  }
1327
1327
 
1328
+ // ---------------------------------------------------------------------------
1329
+ // Helper: Set the protected SegmentLength property on an FAnimLinkableElement
1330
+ // (e.g. FCompositeSection) via reflection.
1331
+ // ---------------------------------------------------------------------------
1332
+ static void SetSegmentLength(FAnimLinkableElement& Element, float NewLength)
1333
+ {
1334
+ FProperty* Prop = FAnimLinkableElement::StaticStruct()->FindPropertyByName(TEXT("SegmentLength"));
1335
+ if (!Prop) return;
1336
+
1337
+ if (FFloatProperty* FloatProp = CastField<FFloatProperty>(Prop))
1338
+ {
1339
+ FloatProp->SetPropertyValue_InContainer(&Element, NewLength);
1340
+ }
1341
+ else if (FDoubleProperty* DoubleProp = CastField<FDoubleProperty>(Prop))
1342
+ {
1343
+ DoubleProp->SetPropertyValue_InContainer(&Element, static_cast<double>(NewLength));
1344
+ }
1345
+ }
1346
+
1328
1347
  // ---------------------------------------------------------------------------
1329
1348
  // Helper: Set the protected SequenceLength property on a montage via reflection.
1330
1349
  // Handles both float (UE 5.3 and earlier) and double (UE 5.4+) property types.
@@ -1436,7 +1455,7 @@ TSharedPtr<FJsonValue> FAnimationHandlers::SetMontageSequence(const TSharedPtr<F
1436
1455
  // Update composite sections' segment lengths to match new duration
1437
1456
  for (FCompositeSection& Section : Montage->CompositeSections)
1438
1457
  {
1439
- Section.SegmentLength = NewTotalLength;
1458
+ SetSegmentLength(Section, NewTotalLength);
1440
1459
  }
1441
1460
 
1442
1461
  Montage->PostEditChange();
@@ -1491,7 +1510,7 @@ TSharedPtr<FJsonValue> FAnimationHandlers::SetMontageProperties(const TSharedPtr
1491
1510
  // Also update composite sections' segment lengths to match
1492
1511
  for (FCompositeSection& Section : Montage->CompositeSections)
1493
1512
  {
1494
- Section.SegmentLength = NewLength;
1513
+ SetSegmentLength(Section, NewLength);
1495
1514
  }
1496
1515
  Modified.Add(TEXT("sequenceLength"));
1497
1516
  }