import unreal OLD = unreal.load_asset("/Game/ImportedAssets/Trees/SM_tree04.SM_tree04") NEW = unreal.load_asset("/Game/ImportedAssets/Trees/SM_tree01.SM_tree01") sub = unreal.get_editor_subsystem(unreal.EditorActorSubsystem) actors = sub.get_all_level_actors() old_mesh_count = 0 for actor in actors: comp = actor.get_component_by_class(unreal.StaticMeshComponent) if comp and comp.static_mesh == OLD: old_mesh_count += 1 print(f"Found {old_mesh_count} instances of the old mesh")