ue-mcp 1.0.40 → 1.0.41
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/dist/tool-counts.json +2 -2
- package/package.json +1 -1
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/PIE/PIEFrameSampler.cpp +51 -2
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/PIE/PIEFrameSampler.h +1 -0
- package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/PIE/PIEInputRecorder.cpp +14 -0
package/dist/tool-counts.json
CHANGED
package/package.json
CHANGED
|
@@ -146,6 +146,7 @@ namespace UEMCPPIE
|
|
|
146
146
|
TrackedValues.Reset();
|
|
147
147
|
Tracked.Reset();
|
|
148
148
|
PendingMarkerLabels.Reset();
|
|
149
|
+
PrevPawnLocation = FVector::ZeroVector;
|
|
149
150
|
// Re-seed TrackedValues from config in case the caller calls AttachToPIE again.
|
|
150
151
|
for (const FString& P : Config.TrackedValuePaths)
|
|
151
152
|
{
|
|
@@ -218,6 +219,41 @@ namespace UEMCPPIE
|
|
|
218
219
|
APawn* Pawn = PC->GetPawn();
|
|
219
220
|
if (!Pawn) return Row;
|
|
220
221
|
|
|
222
|
+
// Rescan for late-bound actions (IMCs added after initial attach).
|
|
223
|
+
if (UEnhancedInputComponent* EIC = Cast<UEnhancedInputComponent>(Pawn->InputComponent))
|
|
224
|
+
{
|
|
225
|
+
TSet<FString> Known;
|
|
226
|
+
for (const FTrackedAction& T : Tracked) Known.Add(T.Path);
|
|
227
|
+
|
|
228
|
+
TSet<FString> Whitelist;
|
|
229
|
+
for (const FString& P : Config.ActionPaths) Whitelist.Add(P);
|
|
230
|
+
|
|
231
|
+
for (const TUniquePtr<FEnhancedInputActionEventBinding>& Bind : EIC->GetActionEventBindings())
|
|
232
|
+
{
|
|
233
|
+
const UInputAction* Action = Bind->GetAction();
|
|
234
|
+
if (!Action) continue;
|
|
235
|
+
const FString Path = Action->GetPathName();
|
|
236
|
+
if (Known.Contains(Path)) continue;
|
|
237
|
+
if (!Whitelist.IsEmpty() && !Whitelist.Contains(Path)) continue;
|
|
238
|
+
Known.Add(Path);
|
|
239
|
+
|
|
240
|
+
FTrackedAction T;
|
|
241
|
+
T.Action = Action;
|
|
242
|
+
T.Name = Action->GetName();
|
|
243
|
+
T.Path = Path;
|
|
244
|
+
T.ValueType = ConvertValueType(Action->ValueType);
|
|
245
|
+
Tracked.Add(T);
|
|
246
|
+
|
|
247
|
+
FActionSpec Spec;
|
|
248
|
+
Spec.Name = T.Name;
|
|
249
|
+
Spec.Path = Path;
|
|
250
|
+
Spec.ValueType = T.ValueType;
|
|
251
|
+
Actions.Add(Spec);
|
|
252
|
+
UE_LOG(LogMCPBridge, Log, TEXT("[PIE-SAMPLER] Late-discovered action: %s (%s)"),
|
|
253
|
+
*T.Name, *Path);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
221
257
|
if (Config.bCapturePawnState)
|
|
222
258
|
{
|
|
223
259
|
Row.PawnLocation = Pawn->GetActorLocation();
|
|
@@ -232,8 +268,21 @@ namespace UEMCPPIE
|
|
|
232
268
|
}
|
|
233
269
|
else
|
|
234
270
|
{
|
|
235
|
-
|
|
236
|
-
|
|
271
|
+
FVector Vel = Pawn->GetVelocity();
|
|
272
|
+
if (Vel.IsNearlyZero())
|
|
273
|
+
{
|
|
274
|
+
if (UPrimitiveComponent* Root = Cast<UPrimitiveComponent>(Pawn->GetRootComponent()))
|
|
275
|
+
{
|
|
276
|
+
Vel = Root->GetPhysicsLinearVelocity();
|
|
277
|
+
}
|
|
278
|
+
if (Vel.IsNearlyZero() && FrameNumber > 0)
|
|
279
|
+
{
|
|
280
|
+
Vel = (Pawn->GetActorLocation() - PrevPawnLocation) / FMath::Max(DeltaTime, 0.001);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
PrevPawnLocation = Pawn->GetActorLocation();
|
|
284
|
+
Row.PawnVelocity = Vel;
|
|
285
|
+
Row.Speed2D = Vel.Size2D();
|
|
237
286
|
}
|
|
238
287
|
}
|
|
239
288
|
|
|
@@ -242,6 +242,20 @@ namespace UEMCPPIE
|
|
|
242
242
|
ActorRows.Add(MoveTemp(AR));
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
// Detect late-discovered actions and rebuild CSV header.
|
|
246
|
+
const TArray<FActionSpec>& CurrentActions = Sampler.GetActions();
|
|
247
|
+
if (CurrentActions.Num() != CSVHdr.Actions.Num())
|
|
248
|
+
{
|
|
249
|
+
CSVHdr.Actions = CurrentActions;
|
|
250
|
+
CSVHdr.TrackedValues = Sampler.GetTrackedValues();
|
|
251
|
+
CSVHeader = BuildCSVHeader(CSVHdr);
|
|
252
|
+
CSVBody.Reset();
|
|
253
|
+
for (const FCSVRow& Prev : Rows)
|
|
254
|
+
{
|
|
255
|
+
AppendCSVRow(CSVBody, Prev, CSVHdr);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
245
259
|
AppendCSVRow(CSVBody, Row, CSVHdr);
|
|
246
260
|
Rows.Add(MoveTemp(Row));
|
|
247
261
|
}
|