ue4导入staticMesh
Posted shaojunping
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ue4导入staticMesh相关的知识,希望对你有一定的参考价值。
SContentBrowser::ImportAsset(inPath)
UAssetToolsImpl::ImportAssetsWithDialog(destPath)
UAssetToolsImpl::ImportAssets
UAssetToolsImpl::ImportAssetsInternal
UFactory::ImportObject(UClass* InClass, UObject* InOuter, FName InName, EObjectFlags InFlags, const FString& Filename, const TCHAR* Parms, bool& OutCanceled)
UObject* UFbxFactory::FactoryCreateFile
(
UClass* Class,
UObject* InParent,
FName Name,
EObjectFlags Flags,
const FString& InFilename,
const TCHAR* Parms,
FFeedbackContext* Warn,
bool& bOutOperationCanceled
)
这个函数用FFbxImporter。
FbxStaticMeshImport.cpp文件
UObject* UFbxFactory::RecursiveImportNode(void* VoidFbxImporter, void* VoidNode, UObject* InParent, FName InName, EObjectFlags Flags, int32& NodeIndex, int32 Total, TArray<UObject*>& OutNewAssets)
UObject* UFbxFactory::RecursiveImportNode(void* VoidFbxImporter, void* VoidNode, UObject* InParent, FName InName, EObjectFlags Flags, int32& NodeIndex, int32 Total, TArray<UObject*>& OutNewAssets)
UObject* UFbxFactory::ImportANode(void* VoidFbxImporter, TArray<void*> VoidNodes, UObject* InParent, FName InName, EObjectFlags Flags, int32& NodeIndex, int32 Total, UObject* InMesh, int LODIndex)
UStaticMesh* UnFbx::FFbxImporter::ImportStaticMeshAsSingle(UObject* InParent, TArray<FbxNode*>& MeshNodeArray, const FName InName, EObjectFlags Flags, UFbxStaticMeshImportData* TemplateImportData, UStaticMesh* InStaticMesh, int LODIndex, void *ExistMeshDataPtr)
这个函数里
bool UnFbx::FFbxImporter::BuildStaticMeshFromGeometry(FbxNode* Node, UStaticMesh* StaticMesh, TArray<FFbxMaterial>& MeshMaterials, int32 LODIndex,
EVertexColorImportOption::Type VertexColorImportOption, const TMap<FVector, FColor>& ExistingVertexColorData, const FColor& VertexOverrideColor)
看是否有材质,没有则创建
vertexInstance EdgeInstance PolygonInstance等 都赋值了。
最后返回这个staticMesh。
以上是关于ue4导入staticMesh的主要内容,如果未能解决你的问题,请参考以下文章