Code Monkey home page Code Monkey logo

ue4_assimp's Introduction

Assimp Mesh Importer 5.4.2 for Unreal engine

Features:

  • Static Mesh and Procedural Mesh support
  • Mesh instancing for Static Meshes
  • Async Loading
  • Users can use multpile approaches for maximum flexiblity
  • Garbage collection using unreal GC and integration with UObjects
  • Embedded Texture import
  • Supports 57 different file formats for reading
  • Supports auto generating missing data such as normals

Docs :

For instructions about how to use visit : Docs

ue4_assimp's People

Contributors

irajsb avatar sfjohnston avatar xeroderma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ue4_assimp's Issues

Import Scene Async

I wanted to point out that the "import scene async" function shown in the graph in the wiki is not present in the code, is it possible to have an update with this function?

Thanks in advance

fatal error LNK1181: cannot open input file assimp-vc142-mt.lib

I pulled plugin with git (git clone --recurse-submodules https://github.com/irajsb/UE4_Assimp/)
Built assimp with cmake CMakeLists.txt
Generated Visual Studio 2019 Project Files with right click menu of .uproject
But when try to build project it gives me this error. (Error copied from VS 2019 Debug output)

fatal error LNK1181: cannot open input file
...\Plugins\UE4_Assimp\Source\ThirdParty\UE_AssimpLibrary\assimp\lib\Release\assimp-vc142-mt.lib

I use Visual Studio 2019 Community Edition and Windows Terminal with PowerShell 7.1.4
CMake installed and its path has been written in environment variable.

Edit:
I also tried to copy latest assimp 5.1 from its github page and updated PowerShell to 7.2.1
Result same.

Crash on importing models without normals.

thanks for sharing this great work.
I can load FBX format correctly but
when i am trying to test other format ( .obj .ply) , ue crashed and exit :
image

using lastest release [5.4.2 texture support]

Can Assimp Lib also recognize FBX Embedded textures that are not recognized by Unreal?

Unreal seems to only recognize Embedded Textures in certain paths in the FBX. Assimp seems to be similar to Unreal. The scene->GetEmbeddedTexture() function does not recognize Embedded Textures that are not recognized by Unreal. I wonder if this is because I'm not very good at using the Assimp library or if the Assimp library depends on a specific path in the FBX.

An example of this is the FBX exported from Unreal.

If the FBX has a texture embedded, if you remove the texture created in the absolute path, Unreal will assume that the FBX doesn't have a texture, but if you use the FBX viewer you will still see the textured model.

Missing Documentation

Hi There,

is there any sort of complete documentation to this? I struggle a bit with getting cameras working
Best regards
Matthias

Calling Exporter from Unreal crashes Unreal Engine

Describe the bug
Calling Exporter object to export AIScene to file crashes Unreal Engine

To Reproduce
Exposing the function below to Blueprints and calling the function at runtime results in an access violation.

void UAIScene::EmptySceneTestExport()
 {
 aiScene testscene;
	 FString dir = FPaths::ProjectDir();
	 dir += FString(TEXT("Export/Scenes/test.fbx"));
	 Exporter exporter;
	 if (exporter.Export(&testscene, "fbx", TCHAR_TO_ANSI(*dir)) != AI_SUCCESS)
	 {
		 UE_LOG(LogAssimp, Fatal, TEXT("Exporting scene to fbx failed."));
	 }
 }
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000

assimp
assimp
assimp
assimp
UnrealEditor_UE_Assimp!UAIScene::EmptySceneTestExport() [C:\Users\...\Documents\UnrealProjects\MyProject\Plugins\UE4_Assimp\Source\UE_Assimp\Private\AIScene.cpp:448]
UnrealEditor_CoreUObject!UObject::execCallMathFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1054]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188]
UnrealEditor_CoreUObject!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1018]
UnrealEditor_CoreUObject!ProcessLocalFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1258]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188]
UnrealEditor_CoreUObject!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1018]
UnrealEditor_CoreUObject!ProcessLocalFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1258]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188]
UnrealEditor_CoreUObject!ProcessScriptFunction<void (__cdecl*)(UObject *,FFrame &,void *)>() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1018]
UnrealEditor_CoreUObject!ProcessLocalFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1258]
UnrealEditor_CoreUObject!ProcessLocalScriptFunction() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1188]
UnrealEditor_CoreUObject!UObject::ProcessInternal() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:1285]
UnrealEditor_CoreUObject!UFunction::Invoke() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:6455]
UnrealEditor_CoreUObject!UObject::ProcessEvent() [C:\Users\...\Documents\UE\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2116]
UnrealEditor_Engine!AActor::ProcessEvent() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\Actor.cpp:1055]
UnrealEditor_Engine!FInputActionUnifiedDelegate::Execute() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h:302]
UnrealEditor_Engine!UPlayerInput::ProcessInputStack() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp:1433]
UnrealEditor_EnhancedInput!UEnhancedPlayerInput::ProcessInputStack() [C:\Users\...\Documents\UE\Engine\Plugins\EnhancedInput\Source\EnhancedInput\Private\EnhancedPlayerInput.cpp:257]
UnrealEditor_Engine!APlayerController::ProcessPlayerInput() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2707]
UnrealEditor_Engine!APlayerController::TickPlayerInput() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:4955]
UnrealEditor_Engine!APlayerController::PlayerTick() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:2311]
UnrealEditor_Engine!APlayerController::TickActor() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\PlayerController.cpp:5107]
UnrealEditor_Engine!FActorTickFunction::ExecuteTick() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\Actor.cpp:222]
UnrealEditor_Engine!FTickFunctionTask::DoTask() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284]
UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1348]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:760]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:649]
UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2203]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:565]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1592]
UnrealEditor_Engine!UWorld::RunTickGroup() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:794]
UnrealEditor_Engine!UWorld::Tick() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1537]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [C:\Users\...\Documents\UE\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1890]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [C:\Users\...\Documents\UE\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:517]
UnrealEditor!FEngineLoop::Tick() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5367]
UnrealEditor!GuardedMain() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Launch\Private\Launch.cpp:202]
UnrealEditor!GuardedMainWrapper() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:107]
UnrealEditor!LaunchWindowsStartup() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:244]
UnrealEditor!WinMain() [C:\Users\...\Documents\UE\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:282]
UnrealEditor!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll```

Question about GetEmbeddedTexture function

Q1: AIScene 147: auto EmbedTexture=scene->GetEmbeddedTexture(TCHAR_TO_UTF8(*FilePath));

What is TCHAR_TO_UTF8? Why Use it?

Q2: AIScene 209: auto result =reinterpret_cast<const unsigned char*>(EmbedTexture->pcData)

I knew, pcData Is Structure. How can you cast it to const unsigned char*?

External texture import

After importing, the material of the model itself is not loaded. Does it lose the original meaning of Assist.

One question about Material

I saw in the BP, there is material as return, I wander are you able to get the Material/Texture from the 3D Mesh directly?

Bug with large files

Large files not loading correctly
For some reason, some of the objects lose their position and move to the zero position.
Also, displaying an imported model uses a lot of resources, which does not happen if the model is simply imported into the unreal engine outside of runtime mode.

To Reproduce
Simply try to open .fbx or .gltf (didn't tried any other formats) file with lots of small elements.
Used latest release: https://github.com/irajsb/UE4_Assimp/releases/tag/5.4.2CustomFlagsSupport

Screenshots
изображение

UE5.2 Failed to Import fbx Related issues

Describe the bug

  1. UE5.2 asynchronous import function ImportScenesAsync will crash, and do not know how to call this function in the blueprint, can only copy from your example project

  2. After packaging projects need AIMesh. CPP UAIMesh: : GetStaticMesh () function must add MeshDescriptionsParams. BFastBuild = true; Otherwise, it will crash, but the effect of loading after adding is wrong, and the whole model will become dark after the camera is close

To Reproduce
Steps to reproduce the behavior:

Screenshots
If applicable, add screenshots to help explain your problem.
image

**Sample file for testing **
Provide an optional sample file for testing .
image

Compiling issues with UE 4.26.2 & VS 2017

Hey, thanks for your effort I'm hoping to make use of this in the future!

Just some feedback from trying to get things compiling and working in UE 4.26.2 - VS2017:

  • Following your guide generated x32 build, which I eventually ran into issue trying to load into the editor, I had to manually make a x64 configuration using cmake ui.
  • I also ran into this issue, marked closed but isn't really fixed... I modified the file as @ReynoldChen suggested to solve the problem.
  • UE4_Assimp/Source/ThirdParty/UE_AssimpLibrary/UE_AssimpLibrary.Build.cs
    This file has file versions hard coded for 2019, so maybe just point out to people that depending on their VS version they may need to adjust this?

Thanks!

LINK : fatal error LNK1181

Describe the bug
When following the build instructions, the build at step 4: Build Unreal Project fails while linking against assimp.

To Reproduce

Platform:
Windows 11
Unreal Engine 4.27.2
Visual Studio 2022

Steps to reproduce the behavior:

  1. create a new UE4 project
  2. follow instructions at https://github.com/irajsb/UE4_Assimp/wiki/How-To-Build

Logs
Here is the full output from VS:

Build started...
1>------ Build started: Project: UE4_Assimp_Test, Configuration: Development_Editor x64 ------
1>Invalidating makefile for UE4_Assimp_TestEditor (UE_Assimp.uplugin has been added)
1>Copying D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Source\ThirdParty\UE_AssimpLibrary\assimp\bin\Release\assimp.dll to D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Binaries\Win64\assimp.dll
1>Failed to copy file: Could not find a part of the path 'D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Source\ThirdParty\UE_AssimpLibrary\assimp\bin\Release\assimp.dll'.
1>UnrealBuildTool : warning : Library 'D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Source\ThirdParty\UE_AssimpLibrary\assimp\lib\Release\assimp.lib' was not resolvable to a file when used in Module 'UE_AssimpLibrary', assuming it is a filename and will search library paths for it. This is slow and dependency checking will not work for it. Please update reference to be fully qualified alternatively use PublicSystemLibraryPaths if you do intended to use this slow path to suppress this warning.
1>Parsing headers for UE4_Assimp_TestEditor
1> Running UnrealHeaderTool "D:\Unreal Projects\UE4_Assimp_Test\UE4_Assimp_Test.uproject" "D:\Unreal Projects\UE4_Assimp_Test\Intermediate\Build\Win64\UE4_Assimp_TestEditor\Development\UE4_Assimp_TestEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\isaac\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
1>LogInit: Display: Loading text-based GConfig....
1>Reflection code generated for UE4_Assimp_TestEditor in 4.0002073 seconds
1>Building UE4_Assimp_TestEditor...
1>Using Visual Studio 2022 14.33.31629 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629) and Windows 10.0.22000.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 8 actions with 16 processes...
1> [1/8] Default.rc2
1> [2/8] UE4Editor-UE4_Assimp_Test-0001.lib
1> Creating library D:\Unreal Projects\UE4_Assimp_Test\Intermediate\Build\Win64\UE4Editor\Development\UE4_Assimp_Test\UE4Editor-UE4_Assimp_Test-0001.lib and object D:\Unreal Projects\UE4_Assimp_Test\Intermediate\Build\Win64\UE4Editor\Development\UE4_Assimp_Test\UE4Editor-UE4_Assimp_Test-0001.exp
1> [3/8] UE4Editor-UE4_Assimp_Test-0001.dll
1> Creating library D:\Unreal Projects\UE4_Assimp_Test\Intermediate\Build\Win64\UE4Editor\Development\UE4_Assimp_Test\UE4Editor-UE4_Assimp_Test-0001.suppressed.lib and object D:\Unreal Projects\UE4_Assimp_Test\Intermediate\Build\Win64\UE4Editor\Development\UE4_Assimp_Test\UE4Editor-UE4_Assimp_Test-0001.suppressed.exp
1> [4/8] Module.UE_Assimp.gen.cpp
1> [5/8] Module.UE_Assimp.cpp
1> [6/8] UE4Editor-UE_Assimp-0001.lib
1> Creating library D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Intermediate\Build\Win64\UE4Editor\Development\UE_Assimp\UE4Editor-UE_Assimp-0001.lib and object D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Intermediate\Build\Win64\UE4Editor\Development\UE_Assimp\UE4Editor-UE_Assimp-0001.exp
1> [7/8] UE4Editor-UE_Assimp-0001.dll
1>LINK : fatal error LNK1181: cannot open input file 'D:\Unreal Projects\UE4_Assimp_Test\Plugins\UE4_Assimp\Source\ThirdParty\UE_AssimpLibrary\assimp\lib\Release\assimp.lib'
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""C:\Program Files\Epic Games\UE_4.27\Engine\Build\BatchFiles\Build.bat" UE4_Assimp_TestEditor Win64 Development -Project="D:\Unreal Projects\UE4_Assimp_Test\UE4_Assimp_Test.uproject" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "UE4_Assimp_Test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Sample project?

Hi! Thanks for putting together this awesome stuff.
It would be awesome if you share a sample project that demonstrates this plugin functionality,
Do you have one to share?

Android Build

I just trying to package unreal project with this plugin, but error begins:

/AssimpHolder/Plugins/UE4_Assimp/Source/UE_Assimp/Public/AIScene.h(7,10): fatal error: 'assimp/scene.h' file not found
UATHelper: Packaging(Android (ASTC)): #include "assimp/scene.h"

https://github.com/irajsb/UE4_Assimp/wiki/How-To-Build

I followed this document faithfully, and it completed.

this error seems to be a dependency error. where have i fix it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.