Added patch for omniverse importer
This commit is contained in:
parent
5b600ed16b
commit
98c0145120
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) 2023 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). This work is licensed under the terms of the MIT license. For a copy, see <https://opensource.org/licenses/MIT>.
|
||||
|
||||
#include "USDImporterWidget.h"
|
||||
#include "USDAlternateImporter.h"
|
||||
#include "USDCARLAInterface.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "IMeshMergeUtilities.h"
|
||||
|
@ -12,7 +12,7 @@
|
|||
void UUSDImporterWidget::ImportUSDProp(
|
||||
const FString& USDPath, const FString& DestinationAssetPath, bool bAsBlueprint)
|
||||
{
|
||||
FUSDAlternateImporter::ImportUSD(USDPath, DestinationAssetPath, false, bAsBlueprint);
|
||||
FUSDCARLAInterface::ImportUSD(USDPath, DestinationAssetPath, false, bAsBlueprint);
|
||||
}
|
||||
|
||||
void UUSDImporterWidget::ImportUSDVehicle(
|
||||
|
@ -61,8 +61,3 @@ bool UUSDImporterWidget::MergeStaticMeshComponents(
|
|||
MeshUtilities.MergeComponentsToStaticMesh(ComponentsToMerge, World, MeshMergeSettings, nullptr, nullptr, DestMesh, AssetsToSync, NewLocation, ScreenAreaSize, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
FString UUSDImporterWidget::GetFileName(FString& FullPath)
|
||||
{
|
||||
return FPaths::GetBaseFilename(FullPath, true);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,4 @@ class CARLATOOLS_API UUSDImporterWidget : public UUserWidget
|
|||
static AActor* GetGeneratedBlueprint(UWorld* World, const FString& USDPath);
|
||||
UFUNCTION(BlueprintCallable, Category="USD Importer")
|
||||
static bool MergeStaticMeshComponents(TArray<AActor*> Actors, const FString& DestMesh);
|
||||
UFUNCTION(BlueprintPure, Category="USD Importer")
|
||||
static FString GetFileName(const FString& FullPath);
|
||||
};
|
||||
|
|
|
@ -141,6 +141,12 @@ if %USE_CHRONO% == true (
|
|||
set OPTIONAL_MODULES_TEXT=%CARSIM_STATE% %CHRONO_STATE%
|
||||
echo %OPTIONAL_MODULES_TEXT% > "%ROOT_PATH%Unreal/CarlaUE4/Config/OptionalModules.ini"
|
||||
|
||||
set OMNIVERSE_PATCH_FOLDER=%ROOT_PATH%Util\Patches\omniverse_4.26\
|
||||
set OMNIVERSE_PLUGIN_FOLDER=%UE4_ROOT%Engine\Plugins\Marketplace\NVIDIA\Omniverse\
|
||||
|
||||
xcopy /Y /S /I "%OMNIVERSE_PATCH_FOLDER%USDCARLAInterface.h" "%OMNIVERSE_PLUGIN_FOLDER%Source\OmniverseUSD\Public\" > NUL
|
||||
xcopy /Y /S /I "%OMNIVERSE_PATCH_FOLDER%USDCARLAInterface.cpp" "%OMNIVERSE_PLUGIN_FOLDER%Source\OmniverseUSD\Private\" > NUL
|
||||
|
||||
if %BUILD_UE4_EDITOR% == true (
|
||||
echo %FILE_N% Building Unreal Editor...
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
#include "USDCARLAInterface.h"
|
||||
#include "OmniverseUSDImporter.h"
|
||||
|
||||
|
||||
bool FUSDCARLAInterface::ImportUSD(
|
||||
const FString& Path, const FString& Dest,
|
||||
bool bImportUnusedReferences, bool bImportAsBlueprint)
|
||||
{
|
||||
FOmniverseImportSettings Settings;
|
||||
Settings.bImportUnusedReferences = bImportUnusedReferences;
|
||||
Settings.bImportAsBlueprint = bImportAsBlueprint;
|
||||
return FOmniverseUSDImporter::LoadUSD(Path, Dest, Settings);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
||||
class OMNIVERSEUSD_API FUSDCARLAInterface
|
||||
{
|
||||
public:
|
||||
static bool ImportUSD(const FString& Path, const FString& Dest, bool bImportUnusedReferences, bool bImportAsBlueprint);
|
||||
};
|
Loading…
Reference in New Issue