From e958a692896027fe351e1b74266546eef5eb3fb3 Mon Sep 17 00:00:00 2001 From: Simone Barbieri Date: Tue, 21 Feb 2023 17:30:23 +0000 Subject: [PATCH] Fix UnrealActorCreator when getting actors from the scene --- openpype/hosts/unreal/api/plugin.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/unreal/api/plugin.py b/openpype/hosts/unreal/api/plugin.py index 2498a249e8..d60050a696 100644 --- a/openpype/hosts/unreal/api/plugin.py +++ b/openpype/hosts/unreal/api/plugin.py @@ -217,12 +217,9 @@ class UnrealActorCreator(UnrealBaseCreator): # Check if instance data has members, filled by the plugin. # If not, use selection. if not instance_data.get("members"): - selection = [] - - if pre_create_data.get("use_selection"): - utility_lib = unreal.EditorUtilityLibrary - sel_objects = utility_lib.get_selected_assets() - selection = [a.get_path_name() for a in sel_objects] + actor_subsystem = unreal.EditorActorSubsystem() + sel_actors = actor_subsystem.get_selected_level_actors() + selection = [a.get_path_name() for a in sel_actors] instance_data["members"] = selection