57 lines
2.0 KiB
Diff
57 lines
2.0 KiB
Diff
--- ./VMC4UE/Source/VMC4UE/Source/VMC4UEBlueprintFunctionLibrary.cpp
|
|
+++ ./VMC4UE_54/Source/VMC4UE/Source/VMC4UEBlueprintFunctionLibrary.cpp
|
|
@@ -119,27 +119,29 @@
|
|
{
|
|
return nullptr;
|
|
}
|
|
-
|
|
+
|
|
+ UVMC4UEStreamingSkeletalMeshTransform* StreamingSkeletalMeshTransform = nullptr;
|
|
+
|
|
+ // Try to get existing transform
|
|
{
|
|
- // Get
|
|
FRWScopeLock RWScopeLock(OSCManager->RWLock, FRWScopeLockType::SLT_ReadOnly);
|
|
- auto StreamingSkeletalMeshTransform = OSCManager->StreamingSkeletalMeshTransformMap.Find(Port);
|
|
- if (StreamingSkeletalMeshTransform != nullptr)
|
|
+ auto FoundTransform = OSCManager->StreamingSkeletalMeshTransformMap.Find(Port);
|
|
+ if (FoundTransform != nullptr)
|
|
{
|
|
- return *StreamingSkeletalMeshTransform;
|
|
+ return *FoundTransform;
|
|
}
|
|
}
|
|
+
|
|
+ // Create new transform if not found
|
|
{
|
|
- // Create
|
|
FRWScopeLock RWScopeLock(OSCManager->RWLock, FRWScopeLockType::SLT_Write);
|
|
- auto StreamingSkeletalMeshTransform = OSCManager->StreamingSkeletalMeshTransformMap.Find(Port);
|
|
- if (StreamingSkeletalMeshTransform != nullptr)
|
|
+ auto FoundTransform = OSCManager->StreamingSkeletalMeshTransformMap.Find(Port);
|
|
+ if (FoundTransform != nullptr)
|
|
{
|
|
- return *StreamingSkeletalMeshTransform;
|
|
+ return *FoundTransform;
|
|
}
|
|
- UVMC4UEStreamingSkeletalMeshTransform* NewStreamingSkeletalMeshTransform = NewObject<UVMC4UEStreamingSkeletalMeshTransform>();
|
|
|
|
- //FRWScopeLock RWScopeLock2(NewStreamingSkeletalMeshTransform->RWLock, FRWScopeLockType::SLT_Write);
|
|
+ UVMC4UEStreamingSkeletalMeshTransform* NewStreamingSkeletalMeshTransform = NewObject<UVMC4UEStreamingSkeletalMeshTransform>();
|
|
OSCManager->StreamingSkeletalMeshTransformMap.Emplace(Port, NewStreamingSkeletalMeshTransform);
|
|
|
|
// Bind Port
|
|
@@ -149,9 +151,10 @@
|
|
|
|
OSCManager->OscReceivers.Emplace(OscReceiver);
|
|
|
|
- return NewStreamingSkeletalMeshTransform;
|
|
+ StreamingSkeletalMeshTransform = NewStreamingSkeletalMeshTransform;
|
|
}
|
|
- return nullptr;
|
|
+
|
|
+ return StreamingSkeletalMeshTransform;
|
|
}
|
|
|
|
void UVMC4UEBlueprintFunctionLibrary::RefreshConnection(float Seconds)
|