Compare commits

..

2 Commits

Author SHA1 Message Date
5e8a775fa7 Consolidate Vive SDK lib + DLLs under ThirdParty/VBS_SDK/Win64/
Why: vendor SDKs distributed inside UE plugins typically ship a single
folder per platform rather than the Unix-style include/lib/bin split.
Grouping VS_PC_SDK.lib alongside the three runtime DLLs matches what
HTC and most XR SDKs publish and keeps the layout closer to what a
maintainer expects when dropping in a new SDK release.

- Move VS_PC_SDK.lib from lib/Win64/ into Win64/ alongside the DLLs.
- Remove the now-empty lib/ and bin/ subdirectories.
- Update Build.cs to use a single Win64Dir variable.
- Update FilterPlugin.ini to reference the consolidated path.

Validated by clean rebuilds of PS_ViveVBSEditor and PS_ViveVBS Win64
Development targets, both exit 0 with the three DLLs auto-copied next
to the binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 07:31:11 +02:00
7f9d5cbe4c Refactor ViveVBS plugin build to UE5 conventions
Why: the previous Build.cs copied the Vive DLLs manually via File.Copy
only for the Editor target, leaving Game/packaged builds with missing
runtime dependencies. The DYNAMIC_LINKAGE branch was also syntactically
broken, the SDK header/lib lived inside Source/, and the .uplugin used
the deprecated WhitelistPlatforms key.

- Move SDK to ThirdParty/VBS_SDK/{include,lib/Win64,bin/Win64}/ via
  git renames so history is preserved.
- Replace File.Copy + Editor-only branch with idiomatic
  RuntimeDependencies.Add(staged, source, NonUFS) — UBT now copies the
  DLLs next to the binary for both Editor (modular) and Game (monolithic)
  and stages them at packaging time.
- Drop dead #if DYNAMIC_LINKAGE block.
- Move SDK include path from Public to Private (no public header
  exposes Vive types) and remove the now-dead include from 4 public
  headers; add the SDK include to the 4 .cpp that actually use it.
- Rename WhitelistPlatforms -> PlatformAllowList (UE5).
- Populate FilterPlugin.ini with the ThirdParty paths so the plugin
  is redistributable when packaged standalone.

Validated by clean builds of PS_ViveVBSEditor (Win64 Development) and
PS_ViveVBS (Win64 Development Game), both exit 0, with UBT logging
the automatic Copy steps for the 3 Vive DLLs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 07:25:15 +02:00
16 changed files with 40 additions and 96 deletions

View File

@@ -1,8 +1,6 @@
[FilterPlugin] [FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples: /ThirdParty/VBS_SDK/include/...
; /README.txt /ThirdParty/VBS_SDK/Win64/...
; /Extras/...
; /Binaries/ThirdParty/*.dll

View File

@@ -2,6 +2,7 @@
#include "../Public/Global.h" #include "../Public/Global.h"
#include "VS_PC_SDK.h"
DEFINE_LOG_CATEGORY(PS_ViveVBS); DEFINE_LOG_CATEGORY(PS_ViveVBS);

View File

@@ -2,6 +2,7 @@
#include "../Public/GunMode.h" #include "../Public/GunMode.h"
#include "VS_PC_SDK.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS); //DEFINE_LOG_CATEGORY(PS_ViveVBS);

View File

@@ -3,6 +3,7 @@
#include "../Public/MBLS.h" #include "../Public/MBLS.h"
#include "../Public/Global.h" #include "../Public/Global.h"
#include "VS_PC_SDK.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS); //DEFINE_LOG_CATEGORY(PS_ViveVBS);

View File

@@ -2,6 +2,7 @@
#include "../Public/Passthrough.h" #include "../Public/Passthrough.h"
#include "VS_PC_SDK.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS); //DEFINE_LOG_CATEGORY(PS_ViveVBS);

View File

@@ -4,7 +4,6 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h" #include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.generated.h" #include "Global.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All); DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All);

View File

@@ -4,7 +4,6 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h" #include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h" #include "Global.h"
#include "GunMode.generated.h" #include "GunMode.generated.h"

View File

@@ -4,7 +4,6 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h" #include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h" #include "Global.h"
#include "MBLS.generated.h" #include "MBLS.generated.h"

View File

@@ -4,7 +4,6 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h" #include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h" #include "Global.h"
#include "Passthrough.generated.h" #include "Passthrough.generated.h"

View File

@@ -8,96 +8,42 @@ public class ViveVBS : ModuleRules
{ {
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange( PublicDependencyModuleNames.AddRange(new string[]
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{ {
"Core", "Core",
// ... add other public dependencies that you statically link with here ... });
}
);
PrivateDependencyModuleNames.AddRange(new string[]
PrivateDependencyModuleNames.AddRange(
new string[]
{ {
"CoreUObject", "CoreUObject",
"Engine", "Engine",
"Slate", "Slate",
"SlateCore", "SlateCore",
// ... add private dependencies that you statically link with here ... });
}
);
if (Target.Platform == UnrealTargetPlatform.Win64)
{
string SdkRoot = Path.Combine(PluginDirectory, "ThirdParty", "VBS_SDK");
string IncludeDir = Path.Combine(SdkRoot, "include");
string Win64Dir = Path.Combine(SdkRoot, "Win64");
DynamicallyLoadedModuleNames.AddRange( PrivateIncludePaths.Add(IncludeDir);
new string[] PublicAdditionalLibraries.Add(Path.Combine(Win64Dir, "VS_PC_SDK.lib"));
{
// ... add any modules that your module loads dynamically here ...
}
);
#if DYNAMIC_LINKAGE
PublicDefinitions.Add("VBS_DYNAMIC_LINKAGE=1");
#endif
string VBS_SDK_PATH = Path.Combine(PluginDirectory, "Source/ViveVBS/VBS_SDK/");
PublicIncludePaths.Add(VBS_SDK_PATH);
#if DYNAMIC_LINKAGE
PublicDelayLoadDLLs.Add("VS_PC_SDK.dll");
PublicDelayLoadDLLs.Add("RRServerManageAPI.dll");
RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/VBS_SDK/VS_PC_SDK.dll"));
RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/VBS_SDK/RRServerManageAPI.dll"));
#else string[] Dlls =
PublicAdditionalLibraries.Add(Path.Combine(VBS_SDK_PATH, "VS_PC_SDK.lib")); {
"VS_PC_SDK.dll",
"RRServerManageAPI.dll",
"VSWPipeVarClient64U_MT.dll",
};
if (Target.Type == TargetRules.TargetType.Editor) foreach (string Dll in Dlls)
{ {
string srcPath = Path.Combine(ModuleDirectory, "../../ThirdParty/Win64/"); RuntimeDependencies.Add(
string destPath = Path.Combine(ModuleDirectory, "../../../../Binaries/Win64/"); Path.Combine("$(BinaryOutputDir)", Dll),
Path.Combine(Win64Dir, Dll),
string[] dlls = { "VS_PC_SDK.dll", "RRServerManageAPI.dll", "VSWPipeVarClient64U_MT.dll" }; StagedFileType.NonUFS);
foreach (string dll in dlls)
{
string src = srcPath + dll;
string dest = destPath + dll;
bool needCopy = !File.Exists(dest);
if (!needCopy)
{
var srcInfo = new FileInfo(src);
var destInfo = new FileInfo(dest);
needCopy = srcInfo.LastWriteTimeUtc > destInfo.LastWriteTimeUtc
|| srcInfo.Length != destInfo.Length;
}
if (needCopy)
{
try
{
File.Copy(src, dest, true);
}
catch (IOException)
{
System.Console.WriteLine("ViveVBS: Could not copy " + dll + " (file locked). Using existing copy.");
} }
} }
} }
}
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/VS_PC_SDK.dll");
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/RRServerManageAPI.dll");
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/VSWPipeVarClient64U_MT.dll");
#endif
}
} }

View File

@@ -19,7 +19,7 @@
"Name": "ViveVBS", "Name": "ViveVBS",
"Type": "Runtime", "Type": "Runtime",
"LoadingPhase": "Default", "LoadingPhase": "Default",
"WhitelistPlatforms": [ "PlatformAllowList": [
"Win64" "Win64"
] ]
} }