Unreal Pythonで良く使うやつ列挙
------------------------------------------------------------------------------------------
import unreal
# コンテンツブラウザの選択取得
assets = unreal.EditorUtilityLibrary.get_selected_assets()
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
# world取得
world = unreal.EditorLevelLibrary.get_editor_world()
------------------------------------------------------------------------------------------
# 開いているSequencerを閉じる
unreal.LevelSequenceEditorBlueprintLibrary.close_level_sequence()
------------------------------------------------------------------------------------------
# Animation Sequenceをインポート
lTask = []
task = unreal.AssetImportTask()
task.automated = True
task.destination_path = destination_path
task.filename = filename
task.replace_existing = True
task.save = True
task.options = unreal.FbxImportUI()
task.options.import_animations = True
task.options.skeleton = skeleton
task.options.mesh_type_to_import = unreal.FBXImportType.FBXIT_ANIMATION
lTask.append(task)
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks(lTask)
------------------------------------------------------------------------------------------
# Level Sequence作成
sq = unreal.AssetToolsHelpers.get_asset_tools().create_asset(
asset_name,
package_path,
unreal.LevelSequence,
unreal.LevelSequenceFactoryNew())
# フレームレート設定
sq.set_display_rate(unreal.FrameRate(integer))
# インアウト設定(フレーム)
sq.set_playback_start(integer)
sq.set_playback_end(integer)
# ビューレンジ(秒)
sq.set_view_range_start(float)
sq.set_view_range_end(float)
# ワークレンジ設定(秒)
sq.set_work_range_start(float)
sq.set_work_range_end(float)
# Level Sequenceを開く
unreal.LevelSequenceEditorBlueprintLibrary.open_level_sequence(sq)
# カレントフレーム設定
unreal.LevelSequenceEditorBlueprintLibrary.set_current_time(integer)
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
import unreal
# コンテンツブラウザの選択取得
assets = unreal.EditorUtilityLibrary.get_selected_assets()
------------------------------------------------------------------------------------------
# フォルダに入っているアセット取得
assets = unreal.EditorAssetLibrary.list_assets(path)------------------------------------------------------------------------------------------
# アセットが存在するか
unreal.EditorAssetLibrary.does_asset_exist(path)------------------------------------------------------------------------------------------
# world取得
world = unreal.EditorLevelLibrary.get_editor_world()
------------------------------------------------------------------------------------------
# 開いているSequencerを閉じる
unreal.LevelSequenceEditorBlueprintLibrary.close_level_sequence()
------------------------------------------------------------------------------------------
# Animation Sequenceをインポート
lTask = []
task = unreal.AssetImportTask()
task.automated = True
task.destination_path = destination_path
task.filename = filename
task.replace_existing = True
task.save = True
task.options = unreal.FbxImportUI()
task.options.import_animations = True
task.options.skeleton = skeleton
task.options.mesh_type_to_import = unreal.FBXImportType.FBXIT_ANIMATION
lTask.append(task)
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks(lTask)
------------------------------------------------------------------------------------------
# Level Sequence作成
sq = unreal.AssetToolsHelpers.get_asset_tools().create_asset(
asset_name,
package_path,
unreal.LevelSequence,
unreal.LevelSequenceFactoryNew())
# フレームレート設定
sq.set_display_rate(unreal.FrameRate(integer))
# インアウト設定(フレーム)
sq.set_playback_start(integer)
sq.set_playback_end(integer)
# ビューレンジ(秒)
sq.set_view_range_start(float)
sq.set_view_range_end(float)
# ワークレンジ設定(秒)
sq.set_work_range_start(float)
sq.set_work_range_end(float)
# Level Sequenceを開く
unreal.LevelSequenceEditorBlueprintLibrary.open_level_sequence(sq)
# カレントフレーム設定
unreal.LevelSequenceEditorBlueprintLibrary.set_current_time(integer)
------------------------------------------------------------------------------------------
コメント