diff --git a/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp b/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp index a0fada895..af1e50a8a 100644 --- a/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp +++ b/Engine/Source/Developer/AssetTools/Private/AssetTools.cpp @@ -1167,10 +1167,10 @@ void UAssetToolsImpl::ImportAssetTasks(const TArray& ImportTa Params.bAutomated = ImportTask->bAutomated; Params.SpecifiedFactory = ImportTask->Factory; Filenames[0] = ImportTask->Filename; - TArray ImportedObjects = ImportAssetsInternal(Filenames, ImportTask->DestinationPath, nullptr, Params); + ImportTask->Result = ImportAssetsInternal(Filenames, ImportTask->DestinationPath, nullptr, Params); - PackagesToSave.Reset(1); - for (UObject* Object : ImportedObjects) + PackagesToSave.Reset(ImportTask->Result.Num()); + for (UObject* Object : ImportTask->Result) { ImportTask->ImportedObjectPaths.Add(Object->GetPathName()); if (ImportTask->bSave) @@ -2067,6 +2067,7 @@ TArray UAssetToolsImpl::ImportAssetsInternal(const TArray& Fi Factory->SetAssetImportTask(Params.AssetImportTask); ImportAssetType = Factory->ResolveSupportedClass(); + UObject* Result = Factory->ImportObject(ImportAssetType, Pkg, FName(*Name), RF_Public | RF_Standalone | RF_Transactional, Filename, nullptr, bImportWasCancelled); Factory->SetAutomatedAssetImportData(nullptr); diff --git a/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp b/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp index 3f1a9b030..16bb229fc 100644 --- a/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp +++ b/Engine/Source/Runtime/Engine/Private/Components/SceneComponent.cpp @@ -1747,17 +1747,20 @@ void USceneComponent::SetRelativeRotationCache(const FRotationConversionCache& I void USceneComponent::SetupAttachment(class USceneComponent* InParent, FName InSocketName) { - if (ensureMsgf(!bRegistered, TEXT("SetupAttachment should only be used to initialize AttachParent and AttachSocketName for a future AttachToComponent. Once a component is registered you must use AttachToComponent."))) + if (InParent != AttachParent || InSocketName != AttachSocketName) { - if (ensureMsgf(InParent != this, TEXT("Cannot attach a component to itself."))) + if (ensureMsgf(!bRegistered, TEXT("SetupAttachment should only be used to initialize AttachParent and AttachSocketName for a future AttachToComponent. Once a component is registered you must use AttachToComponent. Component [%s] Owner [%s], InParent [%s], InSocketName [%s]"), *GetFullName(), *GetPathNameSafe(GetOwner()), *GetNameSafe(InParent), *InSocketName.ToString())) { - if (ensureMsgf(InParent == nullptr || !InParent->IsAttachedTo(this), TEXT("Setting up attachment would create a cycle."))) + if (ensureMsgf(InParent != this, TEXT("Cannot attach component %s to itself."), *GetFullName())) { - if (ensureMsgf(AttachParent == nullptr || !AttachParent->AttachChildren.Contains(this), TEXT("SetupAttachment cannot be used once a component has already had AttachTo used to connect it to a parent."))) + if (ensureMsgf(InParent == nullptr || !InParent->IsAttachedTo(this), TEXT("Attaching %s to %s would create a cycle."), *GetFullName(), *InParent->GetFullName())) { - SetAttachParent(InParent); - SetAttachSocketName(InSocketName); - bShouldBeAttached = AttachParent != nullptr; + if (ensureMsgf(AttachParent == nullptr || !AttachParent->AttachChildren.Contains(this), TEXT("SetupAttachment cannot be used once a component has already had AttachTo used to connect it to a parent. %s is already attached to %s"), *GetFullName(), *AttachParent->GetFullName())) + { + SetAttachParent(InParent); + SetAttachSocketName(InSocketName); + bShouldBeAttached = AttachParent != nullptr; + } } } } diff --git a/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp b/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp index 0be36dab4..9b3a41a07 100644 --- a/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp +++ b/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp @@ -1874,7 +1874,7 @@ void FSlateApplication::AddModalWindow( TSharedRef InSlateWindow, const UE_LOG(LogSlate, Warning, TEXT("A modal window tried to take control while running in unattended script mode. The window was canceled.")); if (FPlatformMisc::IsDebuggerPresent()) { - UE_DEBUG_BREAK(); + // UE_DEBUG_BREAK(); } else {