Commit 6c3f8ba7 by Kai Westerkamp

compile and execute

parent e838ab2a
{
"Changelist" : 3013449,
"BuildId" : "521bff43-3bc1-4230-8558-29af88fc728e",
"Changelist" : 3249277,
"CompatibleChangelist" : 3195953,
"BuildId" : "afcfff98-97a3-4269-9c38-2ec2156cd5a3",
"Modules" :
{
"GLTFLoader" : "UE4Editor-GLTFLoader.dll"
......
......@@ -32,7 +32,7 @@ UGLTFFactory::UGLTFFactory(const FObjectInitializer& ObjectInitializer)
bDetectImportTypeOnImport = false;
}
//This function is adapted from UFbxFactory::CreateBinary()
//This function is adapted from ::CreateBinary()
UObject* UGLTFFactory::FactoryCreateBinary
(
UClass* Class,
......@@ -123,7 +123,7 @@ UObject* UGLTFFactory::FactoryCreateBinary
int32 NodeIndex = 0;
int32 ImportedMeshCount = 0;
UStaticMesh* NewStaticMesh = NULL;
UStaticMeshComponent* NewStaticMesh = NULL;
if (bCombineMeshes)
{
......
......@@ -216,7 +216,8 @@ TSharedRef<SDockTab> FGLTFLoaderModule::OnSpawnPluginTab(const FSpawnTabArgs& Sp
void FGLTFLoaderModule::OpenImportWindow()
{
TArray<FString> Filenames;
/*
//TArray<FString> Filenames;
if (FDesktopPlatformModule::Get()->OpenFileDialog(nullptr,
TEXT("Choose a GLTF file to import"),
......@@ -230,11 +231,14 @@ void FGLTFLoaderModule::OpenImportWindow()
{
UE_LOG(LogTemp, Log, TEXT("File: %s"), *File);
}
*/
FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>("AssetTools");
TArray<FString> Filenames;
Filenames.Add("D:/Dropbox/Studium/MasterArbeit/glTF-Sample-Models/1.0/Box/glTF/Box.gltf");
AssetToolsModule.Get().ImportAssets(Filenames, FString("/Game/Content"));
}
//}
}
void FGLTFLoaderModule::PluginButtonClicked()
......
......@@ -56,7 +56,7 @@ public:
/// @param InName The name of the package to be saved.
/// @param Flags Metadata used for the creation of the new package.
/// @param InStaticMesh A pointer to the StaticMesh to be built and have this new geometry added to it.
UStaticMesh* ImportStaticMeshAsSingle(UObject* InParent, TArray<FString>& MeshNameArray, const FName InName, EObjectFlags Flags, UStaticMesh* InStaticMesh);
UStaticMeshComponent* ImportStaticMeshAsSingle(UObject* InParent, TArray<FString>& MeshNameArray, const FName InName, EObjectFlags Flags, UStaticMeshComponent* InStaticMesh);
/// Obtains the geometry data from the file and adds it to the RawMesh ready to be built for the StaticMesh.
/// This function mirrors that in FFbxImporter of the same name.
......@@ -65,7 +65,7 @@ public:
/// @param MeshMaterials An array of materials to convert to those used by the engine and send to the build process.
/// @param LODIndex Level of detail for this mesh - currently unused i.e. always 0.
/// @param RawMesh The intermediate container for the data between the external format (glTF in our case) and the built StaticMesh.
bool BuildStaticMeshFromGeometry(tinygltf::Mesh* Mesh, UStaticMesh* StaticMesh, int LODIndex, FRawMesh& RawMesh);
bool BuildStaticMeshFromGeometry(tinygltf::Mesh* Mesh, UStaticMeshComponent* StaticMesh, int LODIndex, FRawMesh& RawMesh);
/// Material/texture system does nothing currently.
UMaterialInterface* ToUMaterial(tinygltf::Material* Material);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment