-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
78 lines (60 loc) · 2.16 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import unreal
# import unreal_until as util
#
def cout(obj):
unreal.log(obj)
def listMethod(nd, r_name='', show_help=False):
print("current object type {}".format(type(nd)))
for i in dir(nd):
if r_name:
if r_name.lower() in i.lower():
print(i)
if show_help:
help(getattr(nd, i))
continue
print(i)
if show_help:
help(getattr(nd, i))
eUtil = unreal.EditorUtilityLibrary()
aUtil = unreal.EditorAssetLibrary()
strUtil = unreal.StringLibrary()
sysUtil = unreal.SystemLibrary()
lUtil = unreal.EditorLevelLibrary()
def mainTest():
import importlib,os
import unrealUntil as uutil
from MPath import MPath
importlib.reload(uutil)
sel = lUtil.get_selected_level_actors()[0]
# listMethod(sel[0])
print(type(sel))
# print(sel.get_folder_path()) ## 大纲中的文件夹层级结构
# print(sel.get_full_name()) ## level 中的文件层级结构 包括类型名称
# print(sel.get_path_name()) ## level 中的文件层级结构
# 获取当前打开得 level
# lUtil.get_editor_world()
# 用于获取 content browser 中的选择对象
# eUtil.get_selected_assets() # 目前发现 folder 没法获取选中
# 用于获取 world outline 中的选择对象
# lUtil.get_selected_level_actors() # 目前发现 大纲中 的folder 无法判断是否选中
# sel = unreal.EditorLevelLibrary.get_selected_level_actors()[0]
# print(sel.get_actor_reference())
# world = unreal.World()
# world = unreal.EditorLevelLibrary.get_editor_world()
# util.listMethod(unreal.SystemLibrary,"actor_spawn")
# cone2 = world.actor_spawn(unreal.StaticMeshActor)
# cone2.StaticMeshComponent.StaticMesh = unreal.load_object(unreal.StaticMesh, '/Engine/BasicShapes/Cone')
# cone2.set_actor_label('A Better Cone')
# assets = e_util.get_selected_assets()
# for ass in assets:
# # unreal.log(ass.get_path_name())
# # unreal.log(ass.get_fname())
# # # unreal.log(ass.get_display_name())
# # unreal.log(ass.get_name())
# cls = ass.get_class()
# cout(ass.get_path_name())
# cout(cls.get_name())
#
#