python - unreal.EditorStaticMeshLibrary 中没有 get_lod_build_settings()。(UE4 Python)
问题描述
我找不到获取和修改静态网格上的构建设置的方法。我正在编写一个 python 脚本并在 Unreal 编辑器中运行它。(虚幻编辑器版本 4.25)
我尝试使用文档说具有 get_lod_build_settings() 功能的 EditorStaticMeshLibrary,但错误消息又回来了,好像它是无效的。任何人都可以看到我的问题或建议从 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'
解决方案
我收到了 Epic 的回复,显然这已在 4.26 版中修复
推荐阅读
- reactjs - 在 React 中上传图像和 json 数据的混合
- r - 格式化data.frame
- python - 根据检查 df1 的字符串列值是否与 df2 的任何列(列表类型)匹配,从 df2 映射列
- python-3.x - 将地址拆分为州、城市、街道地址和邮政编码
- javascript - 使用原型定义 getter 会导致“unbound-method”ts-lint 错误
- angular - 如何在 ionic 5 angular 中创建多行离子标签?
- c++ - 有没有一种简单的方法可以将前导零添加到通过 std::to_string(int) 创建的字符串中?
- sql - Teradata:如何在特殊字符后删除部分字符串
- python - FFMPEG 使用 Python 输出到精确文件夹
- html - 根据最大内容的宽度在单独的容器中对齐匹配的内容