虚幻 Python 将材质添加到 CachedGeometry

分享于2022年07月17日 python unreal-blueprint unreal-engine4 unrealscript 问答
【问题标题】:虚幻 Python 将材质添加到 CachedGeometry(Unreal Python add material to CachedGeometry)
【发布时间】:2022-07-13 01:39:15
【问题描述】:

我找不到使用 python 脚本将材质分配给 CachedGemotry 的方法。

在 staticGeometry 上,我可以使用“.set_material”来实现,但 CachedGeometry 上不存在该功能。

你有解决办法吗?

谢谢!


【解决方案1】:

当您谈论 CachedGeometry 时,我假设您的意思是 GeometryCache ,还是我弄错了?

假设我不是(如果我是的话,请道歉)那么您应该能够通过修改 GeometryCache 对象上的“材料”属性来做到这一点。

import unreal

# Gets Pre-existing objects
cached_geo_asset = unreal.load_asset(‘’)

mat_asset = unreal.load_asset(‘

我希望这会有所帮助!我没有经常使用 GeometryCache,所以我很想知道这个解决方案是否适合你。