首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >unreal.EditorStaticMeshLibrary中没有get_lod_build_settings()。(UE4 Python)

unreal.EditorStaticMeshLibrary中没有get_lod_build_settings()。(UE4 Python)
EN

Stack Overflow用户
提问于 2021-04-27 18:48:56
回答 1查看 172关注 0票数 1

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

我尝试使用文档中所说的具有get_lod_build_settings()函数的EditorStaticMeshLibrary,但返回的错误消息看起来好像是无效的。有没有人能看到我的问题,或者提出从Python访问LOD构建设置的另一种方法?谢谢。

代码语言:javascript
运行
复制
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)

这是输出:

代码语言:javascript
运行
复制
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

EN

回答 1

Stack Overflow用户

发布于 2021-04-29 15:48:46

我从Epic那里收到了关于这个的反馈,显然这是在4.26版本中修复的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67281593

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档