从python中删除无情的演员

发布于 2025-01-27 06:36:02 字数 361 浏览 4 评论 0原文

我尝试使用python删除场景中的一些演员,但要遇到错误,我不知道如何修改代码。

错误是在第二个句子中生成的:

get_editor_subsystem()恰好1个参数(0给定)

这是我的代码:

path=“Test.thisIsTest”
unrealSystem=unreal.get_editor_subsystem()
delete_actor=unrealSystem.get_actor_reference(path)
unreal.EditorActorSubsystem.destroy_actor(delete_actor)

I try to delete some actors in the scene using python but keep getting errors, I don't know how to modify my code.

The error is generated in the second sentence:

get_editor_subsystem() takes exactly 1 argument (0 given)

Here is my code:

path=“Test.thisIsTest”
unrealSystem=unreal.get_editor_subsystem()
delete_actor=unrealSystem.get_actor_reference(path)
unreal.EditorActorSubsystem.destroy_actor(delete_actor)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

简单 2025-02-03 06:36:02

您需要在第2行中指定子系统类型:

unreal.get_editor_subsystem(unreal.EditorActorSubsystem)

希望它有所帮助。

You need to specify the Subsystem type in line 2:

unreal.get_editor_subsystem(unreal.EditorActorSubsystem)

I hope it helps.

独守阴晴ぅ圆缺 2025-02-03 06:36:02

我建议另一种方法:

editorActorSubsys = unreal.EditorActorSubsystem()
editorActorSubsys.destroy_actor(delete_actor)

I would suggest another way:

editorActorSubsys = unreal.EditorActorSubsystem()
editorActorSubsys.destroy_actor(delete_actor)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文