unreal.EditorStaticMeshLibrary 中没有 get_lod_build_settings()。 (UE4 蟒蛇)

时间:2021-04-27 10:48:55

标签: python unreal-engine4

我找不到获取和修改静态网格物体上的构建设置的方法。我正在编写一个 python 脚本并在 Unreal 编辑器中运行它。 (虚幻编辑器 4.25 版)

我曾尝试使用 EditorStaticMeshLibrary,文档说它具有 get_lod_build_settings() 函数,但错误消息返回,好像它无效。任何人都可以看到我的问题或建议从 Python 访问 LOD 构建设置的另一种方法吗?谢谢。

import unreal

selected_items = unreal.EditorUtilityLibrary.get_selected_assets()

print 'Num of items selected = ' + str(len(selected_items))
for item in selected_items:    
    print 'Name=' + item.get_name() + '  Class=' + item.get_class().get_name()
    num_lods = unreal.EditorStaticMeshLibrary.get_lod_count(item)
    print 'Num LODs=' + str(num_lods)       
    build_data = unreal.EditorStaticMeshLibrary.get_lod_build_settings(item, 0)

这是输出:

LogPython: Num of items selected = 1
LogPython: Name=30_06_Cartridge_SM  Class=StaticMesh
LogPython: Num LODs=1
LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "C:/PL/console/HL/Content/Python/meshtest.py", line 10, in <module>
LogPython: Error:     build_data = unreal.EditorStaticMeshLibrary.get_lod_build_settings(item, 0)
LogPython: Error: AttributeError: type object 'EditorStaticMeshLibrary' has no attribute 'get_lod_build_settings'

文档: https://docs.unrealengine.com/en-US/PythonAPI/class/EditorStaticMeshLibrary.html?highlight=get_lod_build_settings#unreal.EditorStaticMeshLibrary.get_lod_build_settings

1 个答案:

答案 0 :(得分:0)

我收到了 Epic 的回复,显然这已在 4.26 版中修复