0
点赞
收藏
分享

微信扫一扫

UE4 自动换行——按排序关键字1.2.3.

得一道人 2024-07-27 阅读 3
ue5ue4

使用UE 4.25以上版本后,python代码改动相对较少。

如下类库在4.20/21/22等早起版本不适用,建议查询UE的python文档

unreal.EditorAssetLibrary

1.获取当前选中的资源(Content中)

    # 获取当前选中的资产
    selected_assets = unreal.EditorUtilityLibrary.get_selected_assets()

2.过滤出staticmesh资产

# assets 是一个列表
def filter_static_meshes(assets):
    # 过滤出静态网格资产
    static_mesh_assets = unreal.EditorFilterLibrary.by_class(assets, unreal.StaticMesh)
    return static_mesh_assets

3.过滤出texture资产(同上)

#过滤assets_loaded列表,只包含Texture2D贴图。
myTextures = unreal.EditorFilterLibrary.by_class(assets_loaded, unreal.Texture2D)
举报

相关推荐

0 条评论