码迷,mamicode.com
首页 > 其他好文 > 详细

ue4导入staticMesh

时间:2020-01-15 21:33:10      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:nod   override   tools   dex   class   ons   war   fst   void   

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

标签:nod   override   tools   dex   class   ons   war   fst   void   

原文地址:https://www.cnblogs.com/Shaojunping/p/12198784.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!