虚幻引擎5.2渲染影片

问题描述 投票:0回答:2

我有一个包含超人类的序列文件,其中的动画已准备就绪。如何使用 python 将此序列呈现为 mp4 文件?如果我可以使用命令,是否有任何命令或流程?请给出如何解决的示例。

我在网络上找不到任何可用的东西。

谢谢!

python video render movieclip unreal-engine5
2个回答
1
投票

以下是使用 Python 将虚幻引擎 5.2 序列渲染为 MP4 文件的潜在解决方案:

  1. 将必要的虚幻引擎模块导入到您的 Python 脚本中:
import unreal_engine as ue
import os
  1. 使用以下命令从 Python 脚本中加载序列资源:
my_sequence = ue.load_asset("/Game/MySequence")
  1. 设置序列的渲染设置,例如分辨率和帧速率:
settings = ue.MovieSceneCaptureSettings()
settings.set_resolution(1920, 1080)
settings.set_frame_rate(30)
  1. 定义渲染输出路径和文件名:
output_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "MySequence.mp4")
  1. 使用以下命令将序列渲染为 MP4 文件:
capture = ue.MovieSceneCapture()
capture.open_output(output_path)
capture.capture_settings = settings
capture.begin_capture()
my_sequence.play()
capture.end_capture()
capture.close_output()

请记住,这只是一种潜在的解决方案,可能还有其他方法可以做到这一点。我希望这可以帮助你!如果您还有其他问题,请告诉我。


0
投票

如何安装unreal_engine模块?我在网上找不到任何东西,也不想冒险只做 pip install unreal_engine。

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.