WIP Automatize prop import
This commit is contained in:
parent
6d31d3fc4a
commit
cd7ab57622
|
@ -0,0 +1,22 @@
|
|||
// 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 "USDImporterActor.h"
|
||||
|
||||
AUSDImporterActor::AUSDImporterActor(const FObjectInitializer &ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
RootSceneComponent = CreateDefaultSubobject<USceneComponent>(TEXT("SceneRootComponent"));
|
||||
RootComponent = RootSceneComponent;
|
||||
RootComponent->SetMobility(EComponentMobility::Movable);
|
||||
}
|
||||
|
||||
|
||||
void AUSDImporterActor::LoadUSDFile()
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
// 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>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GameFramework/Actor.h"
|
||||
|
||||
#include "USDImporterActor.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class CARLA_API AUSDImporterActor : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
AUSDImporterActor(const FObjectInitializer &ObjectInitializer);
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Carla USD Importer")
|
||||
FString USDPath = "";
|
||||
|
||||
UFUNCTION(CallInEditor, BlueprintCallable, Category = "Carla USD Importer")
|
||||
void LoadUSDFile();
|
||||
|
||||
private:
|
||||
UPROPERTY(Category="Carla USD Importer", VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||
USceneComponent* RootSceneComponent;
|
||||
|
||||
};
|
|
@ -58,6 +58,8 @@ public class CarlaTools : ModuleRules
|
|||
"Slate",
|
||||
"SlateCore",
|
||||
"UnrealEd",
|
||||
"OmniverseUSD",
|
||||
"OmniverseRuntime",
|
||||
"Blutility",
|
||||
"UMG",
|
||||
"EditorScriptingUtilities",
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// 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 "OmniverseUSDImporter.h"
|
||||
|
||||
|
||||
void UUSDImporterWidget::ImportUSDProp(
|
||||
const FString& USDPath, const FString& DestinationAssetPath)
|
||||
{
|
||||
FOmniverseImportSettings Settings;
|
||||
Settings.bImportUnusedReferences = false;
|
||||
Settings.bImportAsBlueprint = true;
|
||||
FOmniverseUSDImporter::LoadUSD(USDPath, DestinationAssetPath, Settings);
|
||||
}
|
||||
|
||||
void UUSDImporterWidget::ImportUSDVehicle(
|
||||
const FString& USDPath, const FString& DestinationAssetPath)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// 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>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
|
||||
#include "USDImporterWidget.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class CARLATOOLS_API UUSDImporterWidget : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
void ImportUSDProp(const FString& USDPath, const FString& DestinationAssetPath);
|
||||
void ImportUSDVehicle(const FString& USDPath, const FString& DestinationAssetPath);
|
||||
};
|
Loading…
Reference in New Issue