Created
June 15, 2019 04:48
-
-
Save nobolu-ootsuka-unrealengine/e01de8d751bc72e972b68227f940c927 to your computer and use it in GitHub Desktop.
UE4_Python_Asset_SkeletalMesh_Importer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unreal | |
# FBXインポート時の設定 | |
mesh_data = unreal.EditorAssetLibrary.find_asset_data(task.destination_path + task.destination_name) | |
mesh = mesh_data.get_asset() | |
mesh.skeleton | |
op = unreal.FbxImportUI() | |
op.import_materials = True # マテリアルもインポート | |
op.static_mesh_import_data.combine_meshes = True # メッシュを1つにまとめる | |
op.skeleton= mesh.skeleton | |
# FBXインポートのタスクを生成 | |
task = unreal.AssetImportTask() | |
task.automated = True | |
task.destination_name = 'TestMesh' # UE4上のアセット名 | |
task.destination_path = '/Game/Test/' # アセットを保存するフォルダ | |
task.filename = "D:/test.fbx" # 読み込みたいFBXファイル名を指定する | |
task.options = op | |
tasks = [task] | |
# タスクを実行 | |
# FBXとマテリアルがインポートされる | |
atool = unreal.AssetToolsHelpers.get_asset_tools() | |
atool.import_asset_tasks(tasks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment