Files
UnrealEngineUWP/Engine/Source/Editor/UnrealEd/Private/EditorObject.cpp

845 lines
29 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
EditorObject.cpp: Unreal Editor object manipulation code.
=============================================================================*/
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "CoreMinimal.h"
#include "Misc/CoreMisc.h"
#include "Misc/Paths.h"
#include "Misc/FeedbackContext.h"
#include "UObject/ObjectMacros.h"
#include "UObject/Object.h"
#include "UObject/Class.h"
#include "UObject/UnrealType.h"
#include "UObject/PropertyPortFlags.h"
#include "Serialization/ArchiveReplaceObjectRef.h"
#include "Misc/PackageName.h"
#include "Components/ActorComponent.h"
#include "GameFramework/Actor.h"
#include "Components/PrimitiveComponent.h"
#include "Model.h"
#include "Engine/Brush.h"
#include "Editor/EditorEngine.h"
#include "Factories/ModelFactory.h"
#include "GameFramework/Volume.h"
#include "Editor.h"
#include "BSPOps.h"
#include "Kismet2/BlueprintEditorUtils.h"
#include "FoliageType.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "InstancedFoliageActor.h"
#include "InstancedFoliage.h"
#include "Components/BrushComponent.h"
#include "Algo/Transform.h"
DEFINE_LOG_CATEGORY_STATIC(LogEditorObject, Log, All);
/*
Subobject Terms -
Much of the confusion in dealing with subobjects and instancing can be traced to the ambiguity of the words used to work with the various concepts.
A standardized method of referring to these terms is highly recommended - it makes the code much more consistent, and well thought-out variable names
make the concepts and especially the relationships between each of the concepts easier to grasp. This will become even more apparent once archetypes
and prefabs are implemented.
Once we've decided on standard terms, we should try to use these words as the name for any variables which refer to the associated concept, in any
code that deals with that concept (where possible).
Here are some terms I came up with for starters. If you're reading this, and you have a more appropriate name for one of these concepts, feel that any
of the descriptions or terms isn't clear enough, or know of a concept that isn't represented here, feel free to modify this comment and update
the appropriate code, if applicable.
Instance:
a UObject that has been instanced from a subobject template
Template (or template object):
the UObject associated with [or created by] an inline subobject definition; stored in the UClass's Defaults array (in the case of a .h subobject).
TemplateName:
the name of the template object
TemplateClass:
the class of the Template object
TemplateOwner:
the UObject that contains the template object; when dealing with templates created via inline subobject
definitions, this corresponds to the class that contains the Begin Object block for the template
SubobjectRoot:
when dealing with nested subobjects, corresponds to the top-most Outer that is not a subobject or template (generally
the same as Outer)
*/
class FDefaultPropertiesContextSupplier : public FContextSupplier
{
public:
/** the current line number */
int32 CurrentLine;
/** the package we're processing */
FString PackageName;
/** the class we're processing */
FString ClassName;
FString GetContext()
{
return FString::Printf
(
TEXT("%sDevelopment/Src/%s/Classes/%s.h(%i)"),
*FPaths::RootDir(),
*PackageName,
*ClassName,
CurrentLine
);
}
FDefaultPropertiesContextSupplier() {}
FDefaultPropertiesContextSupplier( const TCHAR* Package, const TCHAR* Class, int32 StartingLine )
: CurrentLine(StartingLine), PackageName(Package), ClassName(Class)
{
}
};
static FDefaultPropertiesContextSupplier* ContextSupplier = NULL;
void UEditorEngine::RenameObject(UObject* Object,UObject* NewOuter,const TCHAR* NewName, ERenameFlags Flags)
{
Object->Rename(NewName, NewOuter, Flags);
Object->SetFlags(RF_Public | RF_Standalone);
Object->MarkPackageDirty();
}
static void RemapProperty(FProperty* Property, int32 Index, const TMap<AActor*, AActor*>& ActorRemapper, uint8* DestData)
{
if (FObjectPropertyBase* ObjectProperty = CastField<FObjectPropertyBase>(Property))
{
// If there's a concrete index, use that, otherwise iterate all array members (for the case that this property is inside a struct, or there is exactly one element)
const int32 Num = (Index == INDEX_NONE) ? ObjectProperty->ArrayDim : 1;
const int32 StartIndex = (Index == INDEX_NONE) ? 0 : Index;
for (int32 Count = 0; Count < Num; Count++)
{
uint8* PropertyAddr = ObjectProperty->ContainerPtrToValuePtr<uint8>(DestData, StartIndex + Count);
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
AActor* Actor = Cast<AActor>(ObjectProperty->GetObjectPropertyValue(PropertyAddr));
if (Actor)
{
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
AActor* const* RemappedObject = ActorRemapper.Find(Actor);
if (RemappedObject && (*RemappedObject)->GetClass()->IsChildOf(ObjectProperty->PropertyClass))
{
ObjectProperty->SetObjectPropertyValue(PropertyAddr, *RemappedObject);
}
}
}
}
else if (FArrayProperty* ArrayProperty = CastField<FArrayProperty>(Property))
{
FScriptArrayHelper ArrayHelper(ArrayProperty, ArrayProperty->ContainerPtrToValuePtr<void>(DestData));
if (Index != INDEX_NONE)
{
RemapProperty(ArrayProperty->Inner, INDEX_NONE, ActorRemapper, ArrayHelper.GetRawPtr(Index));
}
else
{
for (int32 ArrayIndex = 0; ArrayIndex < ArrayHelper.Num(); ArrayIndex++)
{
RemapProperty(ArrayProperty->Inner, INDEX_NONE, ActorRemapper, ArrayHelper.GetRawPtr(ArrayIndex));
}
}
}
else if (FStructProperty* StructProperty = CastField<FStructProperty>(Property))
{
if (Index != INDEX_NONE)
{
// If a concrete index was given, remap just that
for (TFieldIterator<FProperty> It(StructProperty->Struct); It; ++It)
{
RemapProperty(*It, INDEX_NONE, ActorRemapper, StructProperty->ContainerPtrToValuePtr<uint8>(DestData, Index));
}
}
else
{
// If no concrete index was given, either the ArrayDim is 1 (i.e. not a static array), or the struct is within
// a deeper structure (an array or another struct) and we cannot know which element was changed, so iterate through all elements.
for (int32 Count = 0; Count < StructProperty->ArrayDim; Count++)
{
for (TFieldIterator<FProperty> It(StructProperty->Struct); It; ++It)
{
RemapProperty(*It, INDEX_NONE, ActorRemapper, StructProperty->ContainerPtrToValuePtr<uint8>(DestData, Count));
}
}
}
}
}
//
// ImportProperties
//
/**
* Parse and import text as property values for the object specified. This function should never be called directly - use ImportObjectProperties instead.
*
* @param ObjectStruct the struct for the data we're importing
* @param DestData the location to import the property values to
* @param SourceText pointer to a buffer containing the values that should be parsed and imported
* @param SubobjectRoot when dealing with nested subobjects, corresponds to the top-most outer that
* is not a subobject/template
* @param SubobjectOuter the outer to use for creating subobjects/components. NULL when importing structdefaultproperties
* @param Warn output device to use for log messages
* @param Depth current nesting level
* @param InstanceGraph contains the mappings of instanced objects and components to their templates
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
* @param ActorRemapper a map of existing actors to new instances, used to replace internal references when a number of actors are copy+pasted
*
* @return NULL if the default values couldn't be imported
*/
static const TCHAR* ImportProperties(
uint8* DestData,
const TCHAR* SourceText,
UStruct* ObjectStruct,
UObject* SubobjectRoot,
UObject* SubobjectOuter,
FFeedbackContext* Warn,
int32 Depth,
FObjectInstancingGraph& InstanceGraph,
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
const TMap<AActor*, AActor*>* ActorRemapper
)
{
check(!GIsUCCMakeStandaloneHeaderGenerator);
check(ObjectStruct!=NULL);
check(DestData!=NULL);
if ( SourceText == NULL )
return NULL;
// Cannot create subobjects when importing struct defaults, or if SubobjectOuter (used as the Outer for any subobject declarations encountered) is NULL
bool bSubObjectsAllowed = !ObjectStruct->IsA(UScriptStruct::StaticClass()) && SubobjectOuter != NULL;
// true when DestData corresponds to a subobject in a class default object
bool bSubObject = false;
UClass* ComponentOwnerClass = NULL;
if ( bSubObjectsAllowed )
{
bSubObject = SubobjectRoot != NULL && SubobjectRoot->HasAnyFlags(RF_ClassDefaultObject);
if ( SubobjectRoot == NULL )
{
SubobjectRoot = SubobjectOuter;
}
ComponentOwnerClass = SubobjectOuter != NULL
? SubobjectOuter->IsA(UClass::StaticClass())
? CastChecked<UClass>(SubobjectOuter)
: SubobjectOuter->GetClass()
: NULL;
}
// The PortFlags to use for all ImportText calls
uint32 PortFlags = PPF_Delimited | PPF_CheckReferences;
if (GIsImportingT3D)
{
PortFlags |= PPF_AttemptNonQualifiedSearch;
}
FString StrLine;
TArray<FDefinedProperty> DefinedProperties;
// Parse all objects stored in the actor.
// Build list of all text properties.
bool ImportedBrush = 0;
int32 LinesConsumed = 0;
while (FParse::LineExtended(&SourceText, StrLine, LinesConsumed, true))
{
// remove extra whitespace and optional semicolon from the end of the line
{
int32 Length = StrLine.Len();
while ( Length > 0 &&
(StrLine[Length - 1] == TCHAR(';') || StrLine[Length - 1] == TCHAR(' ') || StrLine[Length - 1] == 9) )
{
Length--;
}
if (Length != StrLine.Len())
{
StrLine.LeftInline(Length, false);
}
}
if ( ContextSupplier != NULL )
{
ContextSupplier->CurrentLine += LinesConsumed;
}
if (StrLine.Len() == 0)
{
continue;
}
const TCHAR* Str = *StrLine;
int32 NewLineNumber;
if( FParse::Value( Str, TEXT("linenumber="), NewLineNumber ) )
{
if ( ContextSupplier != NULL )
{
ContextSupplier->CurrentLine = NewLineNumber;
}
}
else if( GetBEGIN(&Str,TEXT("Brush")) && ObjectStruct->IsChildOf(ABrush::StaticClass()) )
{
// If SubobjectOuter is NULL, we are importing defaults for a UScriptStruct's defaultproperties block
if ( !bSubObjectsAllowed )
{
Warn->Logf(ELogVerbosity::Error, TEXT("BEGIN BRUSH: Subobjects are not allowed in this context"));
return NULL;
}
// Parse brush on this line.
TCHAR BrushName[NAME_SIZE];
if( FParse::Value( Str, TEXT("Name="), BrushName, NAME_SIZE ) )
{
// If an initialized brush with this name already exists in the level, rename the existing one.
// It is deemed to be initialized if it has a non-zero poly count.
// If it is uninitialized, the existing object will have been created by a forward reference in the import text,
// and it will now be redefined. This relies on the behavior that NewObject<> will return an existing pointer
// if an object with the same name and outer is passed.
UModel* ExistingBrush = FindObject<UModel>( SubobjectRoot, BrushName );
if (ExistingBrush && ExistingBrush->Polys && ExistingBrush->Polys->Element.Num() > 0)
{
ExistingBrush->Rename();
}
// Create model.
UModelFactory* ModelFactory = NewObject<UModelFactory>();
ModelFactory->FactoryCreateText(UModel::StaticClass(), SubobjectRoot, FName(BrushName, FNAME_Add), RF_NoFlags, NULL, TEXT("t3d"), SourceText, SourceText+FCString::Strlen(SourceText), Warn);
ImportedBrush = 1;
}
}
else if (GetBEGIN(&Str, TEXT("Foliage")))
{
UFoliageType* SourceFoliageType;
FName ComponentName;
if (SubobjectRoot &&
Deprecating ANY_PACKAGE. This change consists of multiple changes: Core: - Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject) - Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter - Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses - Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names - Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed. - Added static UClass::TryConvertShortNameToPathName utility function - Added static UClass::TryFixShortClassNameExportPath utility function - Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass') - All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath - Added a new startup test that checks for short type names in UClass/FProperty MetaData values AssetRegistry: - Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath - Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names - This also applies to a few other modules' APIs to match AssetRegistry changes Everything else: - Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input) - Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName() - Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names #jira UE-99463 #rb many.people [FYI] Marcus.Wassmer #preflight 629248ec2256738f75de9b32 #codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246) [CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
ParseObject<UFoliageType>(Str, TEXT("FoliageType="), SourceFoliageType, nullptr) &&
FParse::Value(Str, TEXT("Component="), ComponentName) )
{
UPrimitiveComponent* ActorComponent = FindObjectFast<UPrimitiveComponent>(SubobjectRoot, ComponentName);
if (ActorComponent && ActorComponent->GetComponentLevel())
{
UWorld* World = ActorComponent->GetWorld();
TMap<AInstancedFoliageActor*, TArray<FFoliageInstance>> FoliageInstances;
const TCHAR* StrPtr;
FString TextLine;
while (FParse::Line(&SourceText, TextLine))
{
StrPtr = *TextLine;
if (GetEND(&StrPtr, TEXT("Foliage")))
{
break;
}
// Parse the instance properties
FFoliageInstance Instance;
FString Temp;
if (FParse::Value(StrPtr, TEXT("Location="), Temp, false))
{
FVector Location;
GetFVECTOR(*Temp, Location);
Instance.Location = Location;
}
if (FParse::Value(StrPtr, TEXT("Rotation="), Temp, false))
{
GetFROTATOR(*Temp, Instance.Rotation, 1);
}
if (FParse::Value(StrPtr, TEXT("PreAlignRotation="), Temp, false))
{
GetFROTATOR(*Temp, Instance.PreAlignRotation, 1);
}
if (FParse::Value(StrPtr, TEXT("DrawScale3D="), Temp, false))
{
FVector DrawScale3D;
GetFVECTOR(*Temp, DrawScale3D);
Instance.DrawScale3D = (FVector3f)DrawScale3D;
}
FParse::Value(StrPtr, TEXT("Flags="), Instance.Flags);
Instance.BaseComponent = ActorComponent;
if (AInstancedFoliageActor* IFA = AInstancedFoliageActor::Get(World, true, ActorComponent->GetComponentLevel(), Instance.Location))
{
FoliageInstances.FindOrAdd(IFA).Add(MoveTemp(Instance));
}
}
for (const auto& Pair : FoliageInstances)
{
AInstancedFoliageActor* IFA = Pair.Key;
FFoliageInfo* MeshInfo = nullptr;
UFoliageType* FoliageType = IFA->AddFoliageType(SourceFoliageType, &MeshInfo);
TArray<const FFoliageInstance*> InstancePtrs;
InstancePtrs.Reserve(Pair.Value.Num());
Algo::Transform(Pair.Value, InstancePtrs, [](const FFoliageInstance& FoliageInstance) { return &FoliageInstance; });
if (MeshInfo)
{
MeshInfo->AddInstances(FoliageType, InstancePtrs);
}
}
}
}
}
else if( GetBEGIN(&Str,TEXT("Object")))
{
// If SubobjectOuter is NULL, we are importing defaults for a UScriptStruct's defaultproperties block
if ( !bSubObjectsAllowed )
{
Warn->Logf(ELogVerbosity::Error, TEXT("BEGIN OBJECT: Subobjects are not allowed in this context"));
return NULL;
}
// Parse subobject default properties.
// Note: default properties subobjects have compiled class as their Outer (used for localization).
UClass* TemplateClass = NULL;
bool bInvalidClass = false;
Deprecating ANY_PACKAGE. This change consists of multiple changes: Core: - Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject) - Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter - Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses - Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names - Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed. - Added static UClass::TryConvertShortNameToPathName utility function - Added static UClass::TryFixShortClassNameExportPath utility function - Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass') - All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath - Added a new startup test that checks for short type names in UClass/FProperty MetaData values AssetRegistry: - Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath - Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names - This also applies to a few other modules' APIs to match AssetRegistry changes Everything else: - Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input) - Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName() - Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names #jira UE-99463 #rb many.people [FYI] Marcus.Wassmer #preflight 629248ec2256738f75de9b32 #codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246) [CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
ParseObject<UClass>(Str, TEXT("Class="), TemplateClass, nullptr, &bInvalidClass);
if (bInvalidClass)
{
Warn->Logf(ELogVerbosity::Error,TEXT("BEGIN OBJECT: Invalid class specified: %s"), *StrLine);
return NULL;
}
// parse the name of the template
FName TemplateName = NAME_None;
FParse::Value(Str,TEXT("Name="),TemplateName);
if(TemplateName == NAME_None)
{
Warn->Logf(ELogVerbosity::Error,TEXT("BEGIN OBJECT: Must specify valid name for subobject/component: %s"), *StrLine);
return NULL;
}
// points to the parent class's template subobject/component, if we are overriding a subobject/component declared in our parent class
UObject* BaseTemplate = NULL;
bool bRedefiningSubobject = false;
if( TemplateClass )
{
}
else
{
// next, verify that a template actually exists in the parent class
UClass* ParentClass = ComponentOwnerClass->GetSuperClass();
check(ParentClass);
UObject* ParentCDO = ParentClass->GetDefaultObject();
check(ParentCDO);
BaseTemplate = StaticFindObjectFast(UObject::StaticClass(), SubobjectOuter, TemplateName);
bRedefiningSubobject = (BaseTemplate != NULL);
if (BaseTemplate == NULL)
{
BaseTemplate = StaticFindObjectFast(UObject::StaticClass(), ParentCDO, TemplateName);
}
if ( BaseTemplate == NULL )
{
// wasn't found
Warn->Logf(ELogVerbosity::Error, TEXT("BEGIN OBJECT: No base template named %s found in parent class %s: %s"), *TemplateName.ToString(), *ParentClass->GetName(), *StrLine);
return NULL;
}
TemplateClass = BaseTemplate->GetClass();
}
// because the outer won't be a default object
checkSlow(TemplateClass != NULL);
if (bRedefiningSubobject)
{
// since we're redefining an object in the same text block, only need to import properties again
SourceText = ImportObjectProperties( (uint8*)BaseTemplate, SourceText, TemplateClass, SubobjectRoot, BaseTemplate,
Warn, Depth + 1, ContextSupplier ? ContextSupplier->CurrentLine : 0, &InstanceGraph, ActorRemapper );
}
else
{
UObject* Archetype = NULL;
UObject* ComponentTemplate = NULL;
// Since we are changing the class we can't use the Archetype,
// however that is fine since we will have been editing the CDO anyways
if (!FBlueprintEditorUtils::IsAnonymousBlueprintClass(SubobjectOuter->GetClass()))
{
// if an archetype was specified in the Begin Object block, use that as the template for the ConstructObject call.
FString ArchetypeName;
if (FParse::Value(Str, TEXT("Archetype="), ArchetypeName))
{
// if given a name, break it up along the ' so separate the class from the name
FString ObjectClass;
FString ObjectPath;
if ( FPackageName::ParseExportTextPath(ArchetypeName, &ObjectClass, &ObjectPath) )
{
// find the class
Deprecating ANY_PACKAGE. This change consists of multiple changes: Core: - Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject) - Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter - Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses - Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names - Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed. - Added static UClass::TryConvertShortNameToPathName utility function - Added static UClass::TryFixShortClassNameExportPath utility function - Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass') - All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath - Added a new startup test that checks for short type names in UClass/FProperty MetaData values AssetRegistry: - Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath - Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names - This also applies to a few other modules' APIs to match AssetRegistry changes Everything else: - Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input) - Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName() - Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names #jira UE-99463 #rb many.people [FYI] Marcus.Wassmer #preflight 629248ec2256738f75de9b32 #codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246) [CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
check(FPackageName::IsValidObjectPath(ObjectClass));
UClass* ArchetypeClass = (UClass*)StaticFindObject(UClass::StaticClass(), nullptr, *ObjectClass);
if (ArchetypeClass)
{
ObjectPath = ObjectPath.TrimQuotes();
// if we had the class, find the archetype
Deprecating ANY_PACKAGE. This change consists of multiple changes: Core: - Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject) - Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter - Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses - Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names - Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed. - Added static UClass::TryConvertShortNameToPathName utility function - Added static UClass::TryFixShortClassNameExportPath utility function - Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass') - All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath - Added a new startup test that checks for short type names in UClass/FProperty MetaData values AssetRegistry: - Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath - Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names - This also applies to a few other modules' APIs to match AssetRegistry changes Everything else: - Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input) - Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName() - Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names #jira UE-99463 #rb many.people [FYI] Marcus.Wassmer #preflight 629248ec2256738f75de9b32 #codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786 #ROBOMERGE-OWNER: robert.manuszewski #ROBOMERGE-AUTHOR: robert.manuszewski #ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246) [CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
if (!FPackageName::IsShortPackageName(ObjectPath))
{
Archetype = StaticFindObject(ArchetypeClass, nullptr, *ObjectPath);
}
else
{
Archetype = StaticFindFirstObject(ArchetypeClass, *ObjectPath, EFindFirstObjectOptions::NativeFirst | EFindFirstObjectOptions::EnsureIfAmbiguous);
}
}
}
}
}
if (SubobjectOuter->HasAnyFlags(RF_ClassDefaultObject))
{
if (!Archetype) // if an archetype was specified explicitly, we will stick with that
{
Archetype = ComponentOwnerClass->GetDefaultSubobjectByName(TemplateName);
if(Archetype)
{
if ( BaseTemplate == NULL )
{
// BaseTemplate should only be NULL if the Begin Object line specified a class
Warn->Logf(ELogVerbosity::Error, TEXT("BEGIN OBJECT: The component name %s is already used (if you want to override the component, don't specify a class): %s"), *TemplateName.ToString(), *StrLine);
return NULL;
}
// the component currently in the component template map and the base template should be the same
checkf(Archetype==BaseTemplate,TEXT("OverrideComponent: '%s' BaseTemplate: '%s'"), *Archetype->GetFullName(), *BaseTemplate->GetFullName());
}
}
}
else // handle the non-template case (subobjects and non-template components)
{
ComponentTemplate = FindObject<UObject>(SubobjectOuter, *TemplateName.ToString());
if (ComponentTemplate != NULL)
{
// if we're overriding a subobject declared in a parent class, we should already have an object with that name that
// was instanced when ComponentOwnerClass's CDO was initialized; if so, it's archetype should be the BaseTemplate. If it
// isn't, then there are two unrelated subobject definitions using the same name.
if ( ComponentTemplate->GetArchetype() != BaseTemplate )
{
}
else if ( BaseTemplate == NULL )
{
// BaseTemplate should only be NULL if the Begin Object line specified a class
Warn->Logf(ELogVerbosity::Error, TEXT("BEGIN OBJECT: A subobject named %s is already declared in a parent class. If you intended to override that subobject, don't specify a class in the derived subobject definition: %s"), *TemplateName.ToString(), *StrLine);
return NULL;
}
}
}
// Propagate object flags to the sub object.
EObjectFlags NewFlags = SubobjectOuter->GetMaskedFlags( RF_PropagateToSubObjects );
if (!Archetype) // no override and we didn't find one from the class table, so go with the base
{
Archetype = BaseTemplate;
}
UObject* OldComponent = NULL;
if (ComponentTemplate)
{
bool bIsOkToReuse = ComponentTemplate->GetClass() == TemplateClass
&& ComponentTemplate->GetOuter() == SubobjectOuter
&& ComponentTemplate->GetFName() == TemplateName
&& (ComponentTemplate->GetArchetype() == Archetype || !Archetype);
if (!bIsOkToReuse)
{
UE_LOG(LogEditorObject, Log, TEXT("Could not reuse component instance %s, name clash?"), *ComponentTemplate->GetFullName());
ComponentTemplate->Rename(nullptr, nullptr, REN_DontCreateRedirectors); // just abandon the existing component, we are going to create
OldComponent = ComponentTemplate;
ComponentTemplate = NULL;
}
}
if (!ComponentTemplate)
{
ComponentTemplate = NewObject<UObject>(
SubobjectOuter,
TemplateClass,
TemplateName,
NewFlags,
Archetype,
!!SubobjectOuter,
&InstanceGraph
);
}
else
{
// We do not want to set RF_Transactional for construction script created components, so we have to monkey with things here
if (NewFlags & RF_Transactional)
{
UActorComponent* Component = Cast<UActorComponent>(ComponentTemplate);
if (Component && Component->IsCreatedByConstructionScript())
{
NewFlags &= ~RF_Transactional;
}
}
// Ensure DefaultSubojbect flag persists through the clearing of flags
if (ComponentTemplate->HasAllFlags(RF_DefaultSubObject))
{
NewFlags |= RF_DefaultSubObject;
}
// fix crash when comment below is true as it is now forbidden to clear RF_PendingKill using ClearFlags (see UObjectBaseUtility.h)
ComponentTemplate->ClearGarbage();
// Make sure desired flags are set - existing object could be pending kill
ComponentTemplate->ClearGarbage();
ComponentTemplate->ClearFlags(RF_AllFlags);
Copying //UE4/Release-Staging-4.12 to //UE4/Main (Source: //UE4/Release-4.12 @ 2992821) ========================== MAJOR FEATURES + CHANGES ========================== Change 2992821 on 2016/05/27 by Max.Chen Subway Sequencer: Add "Assets" and "Character" to the list of additional directories to cook. #jira UE-31279 #lockdown Cristina.Riveron Change 2992761 on 2016/05/27 by Max.Chen Add assets from "Directories to Always Cook". #jira UE-31279 #lockdown Cristina.Riveron Change 2992371 on 2016/05/26 by Dmitry.Rekman Fix GUBP Tools node (UE-31378). #jira UE-31378 #lockdown Josh.Adams Change 2992279 on 2016/05/26 by Dmitry.Rekman One more fix for UAT compilation failure (UE-31312). - Make EnvVarsToXML target framework v4.5. #lockdown Josh.Adams #jira UE-31312 Change 2992060 on 2016/05/26 by Josh.Adams - Reset PVRTC compression quality to default, so cooks don't take forever for IOS. We shipped with PVRTC Quality 4 for the App Store version. This is set in the Cooker Settings in the Project Settings window. #lockdown cristina.riveron #jira UE-31373 Change 2992009 on 2016/05/26 by Dmitry.Rekman Fix packaging on Linux (UE-31312). - System.Xml was spelled as System.XML. #jira UE-31312 #lockdown Josh.Adams Change 2991784 on 2016/05/26 by Martin.Wilson Fix for RecalcRequiredBones crashing when there is no lod data #jira UE-30028 #lockdown cristina.riveron Change 2991744 on 2016/05/26 by Dmitry.Rekman Fix Linux code project generation (UE-31322). - Also fixes UE-31318 (not reopening when creating BP project). - Apparently, we cannot reset all signals to default, this makes posix_spawn() fail after fork (child exits with 127). - Added logging of child's return code. #lockdown Josh.Adams #jira UE-31322 #jira UE-31318 Change 2991448 on 2016/05/26 by Nick.Darnell Disabling the logging in the git module that was added from the previous commit. #jira UE-30781 #lockdown cristina.riveron Change 2991352 on 2016/05/26 by Max.Chen Subway Sequencer: Add "Sequencer" to the list of additional directories to cook. #jira UE-31279 #lockdown Cristina.Riveron Change 2991121 on 2016/05/26 by Ben.Marsh Fix ShooterGame warnings on XboxOne. #lockdown cristina.riveron Change 2991097 on 2016/05/26 by Nick.Darnell PR #2386: Git Plugin: fix initialization of a new repository broken by new "migrate" support 4.12 (Contributed by SRombauts) #jira UE-30781 #lockdown cristina.riveron Change 2991095 on 2016/05/26 by Dmitry.Rekman Fix packaging on Linux (UE-31312). - Excludes UAT modules unsupported on the platform (e.g. TVOS). #jira UE-31312 #lockdown Josh.Adams Change 2990806 on 2016/05/25 by Michael.Gay Last minute adjustments to SubwaySequencer shots. Fixed Fade track on master and moved Event tracks to shots. #jira UE-30804 #lockdown Cristina.Riveron Change 2990739 on 2016/05/25 by Dan.Oconnor Fix for transaction buffer failing to restore preview widget trees, these are regenerated post undo/redo and should not be tagged as transactional #jira UE-31155 #lockdown cristina.riveron Change 2990657 on 2016/05/25 by Dmitry.Rekman Fix crash in mono when invoked by the engine (UE-31312). - Reset signal mask on spawning a subprocess. We mask out all signals except explicitly handled, which does not play well with mono. - See also https://answers.unrealengine.com/questions/420161/mono-process-crash.html #jira UE-31312 #lockdown Josh.Adams Change 2990564 on 2016/05/25 by Marc.Audy Undo 4.12 change to DetachFromParent when AttachTo is called with a null parent. #jira UE-00000 #lockdown Cristina.Riveron Change 2990429 on 2016/05/25 by Max.Chen Movie Capture: Fix initialization order warning. Follow up to CL #2990314 #jira UE-31285 #lockdown Nick.Penwarden Change 2990338 on 2016/05/25 by Zabir.Hoque TEMP Fix: On server enqued render thread work is dropped. So on server release Reflection capture resouce immediately instead of trying to defer enque. #jira UE-28838 #lockdown cristina.riveron Change 2990314 on 2016/05/25 by Max.Chen Movie Capture: Flush the viewport when grabbing frames. This fixes more frame accuracy issues. #jira UE-31285 #lockdown Nick.Penwarden Change 2990249 on 2016/05/25 by Max.Chen Sequencer: Fix tick prerequisites getting removed on stop and not re-set on play. This fixes frame accuracies when rendering in a separate process. #jira UE-31285 #lockdown Nick.Penwarden Change 2990243 on 2016/05/25 by Lukasz.Furman Fixed behavior tree observers not being applied correctly #jira UE-31307 #lockdown Cristina.Riveron Change 2990206 on 2016/05/25 by Daniel.Lamb Make sure min number of threads in the large thread pool is at least 2. #jira UE-31253 #lockdown Cristina.Riveron Change 2990182 on 2016/05/25 by Max.Chen Sequencer: Fix null ptr crash on trying to record from current player. This is a regression from the off by one frame fixes. #jira UE-31304 #lockdown Nick.Penwarden Change 2990124 on 2016/05/25 by Chris.Bunner Avoid creating additional inline code fragment casting matching uniform types. #lockdown cristina.riveron #jira UE-29089 Change 2989978 on 2016/05/25 by Uriel.Doyon Merged fix for issue with resolution scale in PostProcessVisualizeComplexity #jira UE-29473 #lockdown cristina.riveron Change 2989970 on 2016/05/25 by Taizyd.Korambayil #lockdown cristina.riveron #jira UE-31293 Added TestMaps Folder and moved all Non-Relevant Maps into it. Change 2989911 on 2016/05/25 by Chris.Babcock Remove warning about Android debugging since CodeWorks for Android Nsight supports VS2015 #jira UE-31292 #ue4 #android #lockdown cristina.riveron Change 2989898 on 2016/05/25 by Robert.Manuszewski Splitting inline shader registration from serialization. Serialization can happen on the async loading thread but registration should only happen on the game thread. Removed a lot of critical section locks. Reimplementing CL #2952596 #jira UE-29245 #lockdown Nick.Penwarden Change 2989849 on 2016/05/25 by Max.Preussner Sequencer: Fixed Crash when playing UMG sequence with audio tracks (UE-31289) #jira UE-31289 #lockdown nick.penwarden Change 2989793 on 2016/05/25 by Max.Chen Sequencer: Change automated capture so it captures in response to a sequence update to fix off by one frames. #jira UE-30755 #lockdown Nick.Penwarden Change 2989792 on 2016/05/25 by Max.Chen Sequencer: Put back setting MaxFPS when forcing fixed frame interval playback to fix motion blur in editor. #jira UE-30755 #lockdown Nick.Penwarden Change 2989774 on 2016/05/25 by Mike.Beach Mirroring CL 2946932 Guarding against invalid EdGraphPins (ones that have been moved to the transient package) when constructing the widget - prevents a crash that we've been unable to repro or determine the cause of (turns it instead into an ensure, so we can collect more contextual information on the issue). #lockdown cristina.riveron #jira UE-26998 Change 2989765 on 2016/05/25 by Olaf.Piesche Moivng CL 2967970 from Dev-Rendering - fix for #jira UE-27297 #lockdown nick.penwarden Change 2989481 on 2016/05/25 by Marc.Audy Properly route AttachToComponent to SetupAttachment if called from the constructor #jira UE-31055 #lockdown Cristina.Riveron Change 2989369 on 2016/05/25 by Robert.Manuszewski Don't create asset import data for archetype TileMap. Propagate component flags to TileMap if the component is an archetype. #jira UE-31033 #lockdown Nick.Penwarden Change 2988975 on 2016/05/24 by Max.Preussner Sequencer: Fixed Cinematic Camera look at tool crashes on auto save (UE-31195) #jira UE-31195 #lockdown nick.penwarden Change 2988834 on 2016/05/24 by Max.Chen Movie Capture: Crash fix - Protect against null encoding filter. #jira UE-31233 #lockdown Nick.Penwarden Change 2988764 on 2016/05/24 by Peter.Sauerbrei fix for exception when deploying to tvOS from PC #jira UE-30318 #lockdown cristina.riveron Change 2988540 on 2016/05/24 by Jeff.Campeau Disable incompatible OpenVR for Windows XP builds. Gut SteamVR and SteamVRController for Windows XP builds (rely on OpenVR). #lockdown Nick.Penwarden #jira UE-30823 Change 2988491 on 2016/05/24 by Zak.Middleton #ue4 - (4.12) Remove version check from serialization logic that fixes up stale transient properties. They would still loaded for archetypes and we always want to prevent that in the future. #lockdown cristina.riveron #jira UE-30625 Change 2988427 on 2016/05/24 by Aaron.McLeran #jira UE-31028 Stop Quietest Concurrency does not remove the quietest sound Fix is to not re-add the sound once its stopped due to max concurrency. #tests ran the QA test map that demonstrated the problem #lockdown cristina.riveron Change 2988391 on 2016/05/24 by Taizyd.Korambayil #lockdown cristina.riveron #jira UE-30301 Rebuilt Ligthing for all Content Example Maps Change 2988315 on 2016/05/24 by Allan.Bentham Re-enabled FLUTBlenderPS on vulkan devices. (it's required for protostar) #jira UE-31079 Change 2988227 on 2016/05/24 by Frank.Fella Sequencer - Add support for forcing editor and runtime evaluation to happen on exact fixed frame intervals. Updated the subway sequencer sample to work with these changes. Change missed in first checkin. #Jira UE-30755 Change 2988200 on 2016/05/24 by Robert.Manuszewski Assert if MaxObjectsInEditor or MaxObjectsInGame are too big and collide with EInternalObjectFlags #jira UE-31218 Change 2988181 on 2016/05/24 by Peter.Sauerbrei revert out the last fix and add more logging as I can't reproduce this bug #jira UE-30813 Change 2988140 on 2016/05/24 by Frank.Fella Sequencer - Add support for forcing editor and runtime evaluation to happen on exact fixed frame intervals. Updated the subway sequencer sample to work with these changes. #Jira UE-30755 Change 2988081 on 2016/05/24 by Jamie.Dale Better fix for UE-29651 that will also work with packages saved from a build without an engine version There was no version bump for the change to FFormatArgumentData, but VER_UE4_K2NODE_VAR_REFERENCEGUIDS was added at almost the same time so testing that should handle the vast majority of packages that we have internally, and will handle all external packages. #jira UE-29651 Change 2987964 on 2016/05/24 by Lee.Clark Fix empty ENV path when compiling PS4 targets. #jira UE-31210 Change 2987721 on 2016/05/23 by Dan.Oconnor Reworking node validation change done in 2910382 so that nodes that are going to spawn other nodes in the expansion step are still validated. #jira UE-31099 Change 2987696 on 2016/05/23 by Chris.Babcock Update AndroidWorks 1R1 to CodeWorks for Android 1R4 #jira UEPLAT-1312 #ue4 #android Change 2987624 on 2016/05/23 by Jeff.Campeau Fix a define protection for WinXP stack walking support. #jira UE-30823 Change 2987607 on 2016/05/23 by Jeff.Campeau Windows Stack Walk fixed to work with Windows XP. Use the ASCII calls where needed. Symbol server is unsupported and is disabled when building for Windows XP. #jira UE-30823 Change 2987593 on 2016/05/23 by Zak.Middleton #ue4 - (4.12) Reject old serialized values of UMovementComponent::UpdatedComponent and UpdatedPrimitive that were saved before those were marked transient. Mark UPawnMovementComponent::PawnOwner and UCharacterMovementComponent::CharacterOwner as transient, and similarly reject old saved values. #jira UE-30625 Change 2987548 on 2016/05/23 by Lukasz.Furman Moved newly added gameplay debugger's code out of perception component #jira UE-31090 Change 2987510 on 2016/05/23 by Lukasz.Furman Restored perception category in old gameplay debugger tool #jira UE-31090 Change 2987278 on 2016/05/23 by Ben.Marsh Rocket: Add Mac GenerateProjectFiles.sh script into installed engine distro. #jira UE-31109 Change 2987156 on 2016/05/23 by Chris.Babcock Added GoogleVR to InstalledEngineFilters.ini #jira UE-31186 #ue4 #android Change 2987129 on 2016/05/23 by Mieszko.Zielinski Fixed FNavigationFilterArea not zeroing its properties in default constuctor #UE4 #jira UE-31185 Change 2987100 on 2016/05/23 by Peter.Sauerbrei fix for crash in DeploymentServer when attempting to copy a file with a space in the path or name #jira UE-30813 Change 2987064 on 2016/05/23 by Dmitry.Rekman PR #2164: [Linux] Fix clang '&&' within '||' error (Contributed by slonopotamus) #jira UE-28537 Change 2987002 on 2016/05/23 by Aaron.McLeran #jira UE-31036 Sound volume does not change when moving past the Non Focus Azimuth range if set to greater than 90 degrees Fix was to remove the clamp on the dot-product #tests ran test map with focus factors greater than 90 degrees Change 2986880 on 2016/05/23 by Mark.Satterthwaite Fix UE-31124 due to bad array iteration logic - amazing that this hadn't been seen earlier. #jira UE-31124 Change 2986873 on 2016/05/23 by Lina.Halper #fix issue with morphtarget importings for LODs - this was caused by option not being set correctly #jira: UE-30955 #code review: Alexis.Matte Change 2986804 on 2016/05/23 by Taizyd.Korambayil #jira UE-31132 Added Missing Function to Blueprint. Change 2986801 on 2016/05/23 by Jamie.Dale SSearchBox will now only delay text changes while it has focus A text changed event when it doesn't have focus is usually triggered by code (rather than the user typing), so we need to process it immediately to avoid other operational ordering issues. #jira UE-31101 Change 2986793 on 2016/05/23 by Martin.Wilson Fix for morph curves not getting applied to meshes in cooked builds (smart names were not being corrected). (brought from dev-rendering 2983747) #Jira UE-31166 Change 2986772 on 2016/05/23 by Benn.Gallagher Fixed montage single node instances with negative rate scales only repeating the final section when looping #jira UE-31164 Change 2986766 on 2016/05/23 by Martin.Wilson Fix for preview not updating when tranform curve flags are changed. #Jira UE-31119 Change 2986569 on 2016/05/23 by Robert.Manuszewski Making hang detection disabled bu default and an opt-in for games. #jira UE-31151 Change 2986564 on 2016/05/23 by Martin.Wilson Fix for being able to set montages on an anim track segment. #jira UE-31039 Change 2986205 on 2016/05/21 by Zabir.Hoque Add new instrumentation to bucketize why we are seeing device lost so often. #jira UE-20434 Change 2986071 on 2016/05/20 by Dan.Oconnor Fix for TRASHCLASS sneaking into property list when recompiling a blueprint that has a dependency that is dirty and requires bytecode recompilation of its dependencies. Make sure that the dirty blueprint itself is part of the bytecode recompilation process and make sure that blueprints compiled in this way are compiled after their parent classes #jira UE-30411 Change 2986068 on 2016/05/20 by Dan.Oconnor Fix for blueprint change/compile delegates leaking #jira UE-31118 Change 2986044 on 2016/05/20 by Zabir.Hoque Make OpenGL VB allocation support alignment (16 by default). Future work should expose this up through the RHI layers. #CodeReview: Olaf.Piesche, Simon.Tovey #jira UE-29231 Change 2985934 on 2016/05/20 by Mark.Satterthwaite Further changes to ensure that UE-30710 really is fixed while also not live-leaking memory in MetalRHI. #jira UE-30710 Change 2985852 on 2016/05/20 by Max.Chen Subway Sequencer: Remove level sequence editor from plugin list since it's on by default. #jira UE-31106 Change 2985821 on 2016/05/20 by Phillip.Kavan [UE-22874] Fix UObject duplication to preserve default subobjects created by the native class ctor when the root object is duplicated. change summary: - added FObjectDuplicationHelperMethods::GatherDefaultSubobjectsForDuplication() - modified StaticDuplicateObjectEx() to map default subobjects created in the duplicated root object's ctor before entering the serialization pass. this preserves those instances instead of causing StaticConstructObject to destroy/recreate them during serialization as part of the UObject reference duplication logic. #jira UE-22874 Change 2985750 on 2016/05/20 by Michael.Gay Default Game map set to SubwaySequencer_P #jira UE-31108 Change 2985660 on 2016/05/20 by Michael.Gay Removing unused track animation #jira UE-30804 Change 2985349 on 2016/05/20 by Dan.Oconnor Fix for crash that occurs when repeatedly pasting and undoing an object with subobjects. We were not clearing the internal flags when recycling an object #jira UE-30954 Change 2985346 on 2016/05/20 by Leslie.Nivison Updating 4.12 credit #jira UEPROD-820 Change 2985297 on 2016/05/20 by Jamie.Dale Fixed VS version detection It was checking the file version (which is 12), rather than the VS version (which is 12 for 2013, and 14 for 2015). #jira UE-30977 Change 2985233 on 2016/05/20 by Gareth.Martin Fixed crash when building lighting when using "Use Landscape Lightmap" on landscape grass #jira UE-30975 Change 2985184 on 2016/05/20 by Chris.Babcock Move audio warning to show proper error result code #jira UE-31085 #ue4 #android Change 2985183 on 2016/05/20 by Chad.Taylor GoogleVR disabled by default #jira UE-30921 Change 2985145 on 2016/05/20 by Jack.Porter Fix for precision issue causing blocky landscape LOD on iPad Pro and several other iOS devices #jira UE-24792 Change 2985124 on 2016/05/20 by Alex.Delesky #jira UE-29794 If the editor cannot find the SSL DLLs when enabling the Perforce source control plugin, it will now display a warning in the Source Control log instead of crashing. Change 2985066 on 2016/05/20 by Lee.Clark Fix r.SelectiveBasePassOutputs so that it defaults to off #jira UE-30133 Change 2985063 on 2016/05/20 by Allan.Bentham Fix for modulated shadow precision issues on low end android hardware. #jira UE-29083 Change 2985061 on 2016/05/20 by Max.Chen Viewport: Fix crash when the viewport widget is null. #jira UE-31050 Change 2985059 on 2016/05/20 by Rolando.Caloca UE4.12 - Workaround for crash trying to track down other crash #jira UE-30875 Change 2984876 on 2016/05/20 by Richard.TalbotWatkin Made SceneOutliner visibility code safer, to avoid a potential crash. #jira UE-30831 - [CrashReport] UE4Editor_SceneOutliner!SceneOutliner::FGetVisibilityVisitor::RecurseChildren() [sceneoutlinergutter.cpp:24] Change 2984873 on 2016/05/20 by Richard.TalbotWatkin Clipped selection box bounds in Matinee viewport to prevent crash when reading outside of the viewport area. #jira UE-30968 - Ctrl+Alt selection drag inside to outside of Matinee window will crash the editor Change 2984844 on 2016/05/20 by Matthew.Griffin Fixing compile error in mono games Change 2984825 on 2016/05/20 by Robert.Manuszewski When the application crashes becaused the GPU driver was disabled, make sure the CrashReporterClient window gets the updated screen metrics after the driver is restored. #jira UE-30556 Change 2984693 on 2016/05/20 by Phillip.Kavan [UE-30495] Fix BP editor crash on component rename following undo of component add action. change summary: - modified USimpleConstructionScript::CreateNode() to create the initial component template object in the transient package, so that subsequent undo actions restore to that state rather than to a valid BPGC-owned state. - modified StaticConstructObject_Internal() to restore the inclusion of RF_ArchetypeObject-flagged objects in the logic that sets new objects to 'PendingKill' state before recording them into the transaction buffer. this ensures that they can be GC'd when construction is undone in the editor. Tested against sample/repro steps in UE-21240 to ensure that it no longer crashes even with the original change from CL# 2832225 reverted (that fix has since been superceded). #jira UE-30495 Change 2984684 on 2016/05/20 by Phillip.Kavan [UE-30852] Fix BPGC custom property list delta generation & post-construct initialization/serialization to properly handle array values that differ from default in length but not inner element values. change summary: - modified UBlueprintGeneratedClass::BuildCustomPropertyListForPostConstruction()/BuildCustomArrayPropertyListForPostConstruction() to return a boolean value indicating whether or not a delta value was detected. - modified UBlueprintGeneratedClass::BuildCustomArrayPropertyListForPostConstruction() and FBlueprintEditorUtils::BuildComponentInstancingData() to ensure that array properties are emitted to delta property lists if the size differs from default, even if none of the elements actually differ from the default value - removed the ensure() for the array property case in FObjectInitializer::InitPropertiesFromCustomList(), as it is now a valid case to encounter an array property delta value without any actual delta element value overrides following it in the custom property stream - restored the bCanUsePostConstructLink optimization for non-native class types in FObjectInitializer::InitProperties() - modified UArrayProperty::SerializeItem() for the ArUseCustomPropertyList case to not empty the array when a resize is needed on load (read) - this fixes an edge case in the cooked BP component data stream when array size differed from default but only one or more of the inner values actually differed, in which case all the array slots were being reset (constructed/zeroed) but only the overridden value was being serialized (loaded) from the template data stream #jira UE-30852 Change 2984651 on 2016/05/19 by Zabir.Hoque Forcing GoogleVR plugin to disabled by default since its causing even non HDM machines to render split foveated viewports. #CodeReview: Chad.Taylor, Nick.Whiting #jira UE-30921 Change 2984636 on 2016/05/19 by Zabir.Hoque Explicitly store the cubemap resolution in encoded reflection data. #CodeReview Daniel.Wright, Marcus.Wassmer #jira UE-30341 Change 2984454 on 2016/05/19 by Rolando.Caloca UE4.12 - Fix for vulkan failing to load shader Integration mirroring changelist 2984432 #jira UE-28140 Change 2984452 on 2016/05/19 by Marcus.Wassmer #jira UE-31054 Remove autocompletion for ToggleRHIThread and ShowMaterialDrawEvents as they no longer do anything Change 2984415 on 2016/05/19 by Dan.Oconnor Fix for crash when we fail to spawn the preview actor because the desired class is deprecated #jira UE-31027 Change 2984376 on 2016/05/19 by Dan.Oconnor Fix for regression in GetClassDefaults - we were not handling the 'None' case #jira UE-31034 Change 2984316 on 2016/05/19 by Aaron.McLeran #jira UE-31049 Updating the Oculus Audio SDK to vs 1.02 #tests Ran updated SDK in several test maps, confirmed HRTF spatialization is working. Change 2984315 on 2016/05/19 by Lina.Halper Fix issue with importing morphtarget LOD when it's missing between #jira: UE-30949 Change 2984237 on 2016/05/19 by Dan.Oconnor Fix for ensure/possible stale memory access in UpdateOverlaps #jira UE-30919 Change 2984170 on 2016/05/19 by Max.Chen Movie Capture: Another pass at texture streaming fix for movie capture. #jira UE-30986 Change 2984134 on 2016/05/19 by Chad.Taylor Mac compiler warning fix #jira UE-30921 Change 2983903 on 2016/05/19 by Taizyd.Korambayil #jira UE-30562 Replaced cube With BSP for Floor Change 2983840 on 2016/05/19 by Taizyd.Korambayil #jira UE-30979 Fixed Typo in one of the Stands Change 2983662 on 2016/05/19 by Ben.Marsh GitHub: Add an exception to allow GoogleVR files to be mirrored to GitHub Change 2983653 on 2016/05/19 by Chris.Bunner Modifed previous change to fixup incorrect ensures. #jira UE-30877 Change 2983599 on 2016/05/19 by Chris.Bunner Added ensure and null ptr check to canvas flush. #jira UE-30877 Change 2983596 on 2016/05/19 by Chad.Taylor FluffyBunny #jira UE-30921 Change 2983534 on 2016/05/19 by Brian.Karis 4.12 fix per pixel translucency #jira UE-30902 Change 2983530 on 2016/05/19 by Chris.Babcock Broadcast EMediaEvent::MediaOpened when media opened successfully #jira UE-31006 #ue4 #android Change 2983427 on 2016/05/19 by Richard.TalbotWatkin Conflated "Import" and "Import Scene" in the File menu; the new action is called "Import Into Level". Limited the allowed file types to .t3d and .fbx. #jira UE-30891 - CRASH: Editor crashes when Importing Actors via File > Import Change 2983386 on 2016/05/19 by Michael.Gay minor last tweaks #jira UE-30804 Change 2983280 on 2016/05/19 by Gil.Gribb UE4 - Fixed crash in FHierarchicalStaticMeshSceneProxy related to reflection captures and foliage. #jira UE-30837 Change 2983079 on 2016/05/18 by Max.Chen Movie Capture: Fix so that texture streaming option for movie capture is set when capturing in editor. #jira UE-30986 Change 2983078 on 2016/05/18 by Dmitriy.Dyomin Added more logging to track UE-30878 #jira UE-30878 Change 2983067 on 2016/05/18 by Dmitriy.Dyomin Fixed: Mobile HDR Path doesn't work on GearVR #jira UE-11846 Change 2983049 on 2016/05/18 by Max.Chen Movie Capture: Fix crash on movie rendering when in HDR mode. #jira UE-30978 Change 2982825 on 2016/05/18 by Mark.Satterthwaite Correctly wait for the dispatch semaphore when clearing the Metal resource free lists. #jira UE-30710 Change 2982697 on 2016/05/18 by Marc.Audy Fix Orion DataProvider use of AddReferencedObjects in light of CL# 2982607 #jira UE-00000 Change 2982546 on 2016/05/18 by Taizyd.Korambayil #jira UE-30862 resaved A bunc hof assets to Fix to attempt to fix Build Warnings Change 2982533 on 2016/05/18 by Daniel.Lamb When you package if you haven't saved the changes will not be reflected in the game. #jira UE-30904 Change 2982415 on 2016/05/18 by Marc.Audy Bring forgotten 4.11 CL# 2928377 to 4.12 Ensure that the compiler will throw an error when passing a non-UObject* TArray to AddReferencedObjects #jira UE-28933 Change 2982358 on 2016/05/18 by Taizyd.Korambayil #jira UE-30546 Updated TP_VehicleAdvPawn Chase Camera Location Change 2982280 on 2016/05/18 by Martin.Mittring UE-26409 Crash when Light Propagation Volume Plugin is disabled on a Project #jira:UE-26409 Change 2982229 on 2016/05/18 by Max.Chen Sequencer: Add tick prerequisites so that the level sequence actor ticks before all of the actors that it controls. This fixes some inconsistencies in the movie rendered frames not matching what's in editor. #jira UE-30755 Change 2982080 on 2016/05/18 by Max.Chen Sequence Recorder: Fix crash when component class to record is null. #jira UE-30944 Change 2982041 on 2016/05/18 by Marcus.Wassmer Protect against crashes reading from a null texture. #jira UE-30834 Change 2981915 on 2016/05/18 by Allan.Bentham Do not mosaic encode for modulate blend operations. Fixes dark 'halos' around mod shadows. #jira UE-29083 Change 2981911 on 2016/05/18 by michael.gay Set framing in sequencer, set start to 200 #jira UE-30633 Change 2981904 on 2016/05/18 by Chase.McAllister #jira UE-30943 Removing unused asset to fix DDC compiling bug Change 2981894 on 2016/05/18 by Michael.Gay removed old cameras, changed start frame to remove black at head of sequence #jira UE-30633 Change 2981827 on 2016/05/18 by Gareth.Martin Fixed crash when entering landscape mode while a landscape is selected while simulating - Landscape infos no longer get created for PIE/Simulate landscapes (they were empty anyway) #jira UE-30917 Change 2981725 on 2016/05/18 by Keith.Judge Xbox One - Fix issues with DFAO/DF Shadowing. Problems were in RHIUpdateTexture3D(). Needed to ensure temp texture had the correct bind flags, etc, and also use the graphics context rather than the DMA context to do the copying, as for some reason the DMA engine corrupts some pixels of the distance field atlas texture. #jira UE-27591 Change 2981466 on 2016/05/17 by Max.Chen Merge from Chris Bunner from Dev-SequencerGDC - Frame state fixes when Sequencer is paused; No velocity in AA, Clamp motion blur scale, Clamp to scatter blur method. #jira UE-30576 Change 2981403 on 2016/05/17 by Dan.Oconnor Fix for overzealous filtering of classes with Within markup #jira UE-29878 Change 2981342 on 2016/05/17 by Dan.Oconnor Removing overzealous check. In Dev-BP this has already been downgraded to an ensure, but no reason to ensure now that we understand why it happens. #jira UE-30792 Change 2981318 on 2016/05/17 by Max.Preussner Sequencer: Fixed crash when scrubbing attached audio tracks; reduced nesting (UE-30923) #jira: UE-30923 Change 2981221 on 2016/05/17 by Dan.Oconnor Preventing spawning components with 'Within' markup specified, it is unsupported by the SCSEditor and Core UObject logic at this time. Likely logic is CoreUObject needs to avoid type checking for RF_ArchetypeObject instances and the SCSEditor needs to be more consistent about using that flag on its template objects #jira UE-29878 Change 2981169 on 2016/05/17 by Marc.Audy Gracefully handle invalid GameSingleton class name in ini file Remove unused DefaultPreviewPawnClass and ClassName from Engine #jira UE-30829 Change 2981104 on 2016/05/17 by Mieszko.Zielinski Made AISenses not send information to listeners that are not registered for given sense #UE4 #jira UE-29939 Change 2981086 on 2016/05/17 by Taizyd.Korambayil #jira UE-30568 Added a check to make sure index being accessed was valid (BP_DemoRoom) Change 2980755 on 2016/05/17 by Taizyd.Korambayil #jira UE-30706 Set material to use Translucent Blend Change 2980753 on 2016/05/17 by Jon.Nabozny Initialize FBox used to store result for CalculateQuatACF96Bounds (bump from //UE4/Dev-Framework). #JIRA UE-30846 Change 2980682 on 2016/05/17 by Taizyd.Korambayil #jira UE-30570, UE-30575 Corrected Some Spellings Change 2980559 on 2016/05/17 by Mieszko.Zielinski Changed UNavigationSystem.AgentToNavDataMap to store weak object pointers rather than raw painters #UE4 This should make it immune to navigation data beging destroyed and not removed from AgentToNavDataMap. #jira UE-30836 Change 2980504 on 2016/05/17 by Daniel.Wright Integrate - Movable skylight now matches stationary for subsurface shading models * Two sided was broken in 4.11, Subsurface had never been handled #jira UE-30855 Change 2980467 on 2016/05/17 by Jamie.Dale Added some checks to avoid temporary worlds being added as favorites #jira UE-30613 Change 2980379 on 2016/05/17 by Jurre.deBaare Fix for static mesh merging, little too eager with changes. #jira UE-30808 Change 2980373 on 2016/05/17 by Gareth.Martin Fixed shader compile errors when applying a speedtree material to a landscape spline #jira UE-25820 Change 2980318 on 2016/05/17 by Gareth.Martin Fixed crash when calling EditorApplySpline with a null spline component Also stopped it doing anything in PIE (it's for blutilities, not runtime) #jira UE-30830 Change 2980300 on 2016/05/17 by Marc.Audy Treat Unreachable components the same as BeginDestroyed for endplay/cleanup purposes #jira UE-30839 Change 2980298 on 2016/05/17 by Gareth.Martin Fixed crash when loading landscape projects that used tessellation #jira UE-30742 Change 2980296 on 2016/05/17 by Martin.Wilson Fix crash accessing sync names from a child anim bp #jira UE-30811 Change 2980289 on 2016/05/17 by Jurre.deBaare Fix for regression with merge actor tab #jira UE-30809 Change 2980272 on 2016/05/17 by Ori.Cohen Make sure that root components do not get attached to non root components in the same actor. Fixes crash in scene outliner and other weird issues. #JIRA UE-30876 Change 2980206 on 2016/05/17 by Keith.Judge Xbox One - Bit the bullet and rewrote the occlusion query buffer handling so that we're not reliant on a finite ring buffer. Instead, each query has a small buffer of its own. removing the dependency of ordering when reading back the results. This should save memory on smaller maps too! #jira UE-30581 #jira UEPLAT-623 Change 2980094 on 2016/05/17 by Matthew.Griffin Added OSVR dlls to InstalledEngineFilters.ini so that they are included in Launcher build even though the plugin is disabled by default #jira UE-30611 Change 2979935 on 2016/05/17 by Aaron.Herzog #jira UE-30619 updating owen sk mesh with proper morph Change 2979816 on 2016/05/16 by Chad.Taylor Fix to address a crash related to multiple player VR Preview #jira UE-20109 Change 2979744 on 2016/05/16 by Mike.Beach Disabling Blueprint spawning, InitProperties() optimization until we can figure out why it is not filling out array properties properly. #jira UE-30745 Change 2979743 on 2016/05/16 by Mike.Beach Mirroring CL 2977497 Clearing property nodes and cached read-addresses when changing the details view object (so any queued actions will not operate on invalid properties). #jira UE-26392 Change 2979544 on 2016/05/16 by Daniel.Wright Fixed crash with RTDF shadows when r.DistanceFieldAO was disabled #jira UE-26319 Change 2979477 on 2016/05/16 by michael.gay Remove errant Play Rate track. #jira UE-30633 Change 2979464 on 2016/05/16 by Mark.Satterthwaite Duplicate CL #2945444: Cache the Metal fallback depth-stencil surface for the canvas tile rendering so that we only ever keep one spare depth-stencil surface around. This costs us a little more permanent memory but reduces churn. #jira UE-30849 Change 2979441 on 2016/05/16 by Rolando.Caloca UE4.12 - vk - Fix quitting taking a long time #jira UE-28239 Change 2979315 on 2016/05/16 by Michael.Trepka Rollback //UE4/Release-4.12/Engine/Source/Programs/UnrealBuildTool/System/XcodeProject.cs to revision 1 #jira UE-28016 Change 2979304 on 2016/05/16 by Jamie.Dale Backing out some changes from CL# 2976673 These caused an issue with Slate hit-testing. The more correct fix here is to make the Slate Windows OS layer treat window positions as relative to the top-left of the window client area, rather than relative to the top-left of the window itself (which includes the OS border). This now matches what other platforms do. To this end, FWindowsWindow::Initialize, FWindowsWindow::MoveWindowTo, and FWindowsWindow::ReshapeWindow all now consider the given window position to be relative to the window client area, and will consistently adjust it to relative to the window before moving/creating the OS window. This only impacts windows with OS borders (aka, non-fullscreen and non-Slate drawn windows). #jira UE-30276 #jira UE-30677 #jira UE-30771 Change 2979077 on 2016/05/16 by Maciej.Mroz #jira UE-28536 Attached Project Crashes on Attempting to Play in Standalone merged from 2979069 Change 2979052 on 2016/05/16 by Chase.McAllister #jira UE-30789 Resaving Maps to fix project warning Change 2978984 on 2016/05/16 by Chase.McAllister #jira UE-30789 Resaving start video assests that contained empty engine version Change 2978806 on 2016/05/16 by Mieszko.Zielinski Fixed EQS tests' scoring equation value getting reset on load #UE4 #jira UE-30470 Change 2978670 on 2016/05/16 by Max.Preussner Media: Workaround for changing Media asset path can cause crash (UE-22691) #jira: UE-22691 Change 2978638 on 2016/05/16 by Michael.Gay Cleanup of old maps in SubwaySequencer project #jira UE-30633 Change 2978636 on 2016/05/16 by Jamie.Dale Added guard against a crash navigating through a menu #jira UE-30698 Change 2978611 on 2016/05/16 by Lee.Clark PS4 - Fix RenderTargetOutputFormat using the wrong output index for velocity rendering when using r.BasePassOutputsVelocity=True #jira UE-30133 Change 2978596 on 2016/05/16 by Allan.Bentham Extend iOS metal Z bias offset to all iOS (metal+gles) depth only shaders. #jira UE-27530 Change 2978566 on 2016/05/16 by Jamie.Dale Downgraded some checks to ensures and added more logging #jira UE-30613 Change 2978399 on 2016/05/16 by Keith.Judge Xbox One - Fix check() firing when we run out of occlusion buffer space. Also added occlusion query result caching (perf gain!). #jira UE-30581 Change 2978323 on 2016/05/16 by Jurre.deBaare Merge actor panel crashes when selecting a mesh component without static mesh #fix display 'No Static Mesh' when none is available #jira UE-30809 Change 2978322 on 2016/05/16 by Jurre.deBaare Issue with merging meshes resulting data saved across different LOD levels #fix use correct target LOD index for all source LODs #jira UE-30808 #lockdown Nick.Penwarden [CL 2999693 by Ben Marsh in Main branch]
2016-06-03 11:49:20 -04:00
ComponentTemplate->ClearInternalFlags(EInternalObjectFlags::AllFlags);
ComponentTemplate->SetFlags(NewFlags);
}
// replace all properties in this subobject outer' class that point to the original subobject with the new subobject
TMap<UObject*, UObject*> ReplacementMap;
if (Archetype)
{
checkSlow(ComponentTemplate->GetArchetype() == Archetype);
ReplacementMap.Add(Archetype, ComponentTemplate);
InstanceGraph.AddNewInstance(ComponentTemplate, Archetype);
}
if (OldComponent)
{
ReplacementMap.Add(OldComponent, ComponentTemplate);
}
FArchiveReplaceObjectRef<UObject> ReplaceAr(SubobjectOuter, ReplacementMap, EArchiveReplaceObjectFlags::IgnoreArchetypeRef);
// import the properties for the subobject
SourceText = ImportObjectProperties(
(uint8*)ComponentTemplate,
SourceText,
TemplateClass,
SubobjectRoot,
ComponentTemplate,
Warn,
Depth+1,
ContextSupplier ? ContextSupplier->CurrentLine : 0,
&InstanceGraph,
ActorRemapper
);
}
}
else if( FParse::Command(&Str,TEXT("CustomProperties")))
{
check(SubobjectOuter);
SubobjectOuter->ImportCustomProperties(Str, Warn);
}
else if( GetEND(&Str,TEXT("Actor")) || GetEND(&Str,TEXT("DefaultProperties")) || GetEND(&Str,TEXT("structdefaultproperties")) || (GetEND(&Str,TEXT("Object")) && Depth) )
{
// End of properties.
break;
}
else if( GetREMOVE(&Str,TEXT("Component")) )
{
checkf(false, TEXT("Remove component is illegal in pasted text"));
}
else
{
// Property.
FProperty::ImportSingleProperty(Str, DestData, ObjectStruct, SubobjectOuter, PortFlags, Warn, DefinedProperties);
}
}
if (ActorRemapper)
{
for (const auto& DefinedProperty : DefinedProperties)
{
RemapProperty(DefinedProperty.Property, DefinedProperty.Index, *ActorRemapper, DestData);
}
}
// Prepare brush.
if( ImportedBrush && ObjectStruct->IsChildOf<ABrush>() && !ObjectStruct->IsChildOf<AVolume>() )
{
check(GIsEditor);
ABrush* Actor = (ABrush*)DestData;
check(Actor->GetBrushComponent());
if( Actor->GetBrushComponent()->Mobility == EComponentMobility::Static )
{
// Prepare static brush.
Actor->SetNotForClientOrServer();
}
else
{
// Prepare moving brush.
FBSPOps::csgPrepMovingBrush( Actor );
}
}
return SourceText;
}
/**
* Parse and import text as property values for the object specified.
*
* @param InParams Parameters for object import; see declaration of FImportObjectParams.
*
* @return NULL if the default values couldn't be imported
*/
const TCHAR* ImportObjectProperties( FImportObjectParams& InParams )
{
FDefaultPropertiesContextSupplier Supplier;
if ( InParams.LineNumber != INDEX_NONE )
{
if ( InParams.SubobjectRoot == NULL )
{
Supplier.PackageName = InParams.ObjectStruct->GetOwnerClass() ? InParams.ObjectStruct->GetOwnerClass()->GetOutermost()->GetName() : InParams.ObjectStruct->GetOutermost()->GetName();
Supplier.ClassName = InParams.ObjectStruct->GetOwnerClass() ? InParams.ObjectStruct->GetOwnerClass()->GetName() : FName(NAME_None).ToString();
Supplier.CurrentLine = InParams.LineNumber;
ContextSupplier = &Supplier; //-V506
}
else
{
if ( ContextSupplier != NULL )
{
ContextSupplier->CurrentLine = InParams.LineNumber;
}
}
InParams.Warn->SetContext(ContextSupplier);
}
if ( InParams.bShouldCallEditChange && InParams.SubobjectOuter != NULL )
{
InParams.SubobjectOuter->PreEditChange(NULL);
}
FObjectInstancingGraph TempGraph;
FObjectInstancingGraph& InstanceGraph = InParams.InInstanceGraph ? *InParams.InInstanceGraph : TempGraph;
if ( InParams.SubobjectRoot && InParams.SubobjectRoot != UObject::StaticClass()->GetDefaultObject() )
{
InstanceGraph.SetDestinationRoot(InParams.SubobjectRoot);
}
// Parse the object properties.
const TCHAR* NewSourceText =
ImportProperties(
InParams.DestData,
InParams.SourceText,
InParams.ObjectStruct,
InParams.SubobjectRoot,
InParams.SubobjectOuter,
InParams.Warn,
InParams.Depth,
InstanceGraph,
InParams.ActorRemapper
);
if ( InParams.SubobjectOuter != NULL )
{
check(InParams.SubobjectRoot);
// Update the object properties to point to the newly imported component objects.
// Templates inside classes never need to have components instanced.
if ( !InParams.SubobjectRoot->HasAnyFlags(RF_ClassDefaultObject) )
{
UObject* SubobjectArchetype = InParams.SubobjectOuter->GetArchetype();
InParams.ObjectStruct->InstanceSubobjectTemplates(InParams.DestData, SubobjectArchetype, SubobjectArchetype->GetClass(),
InParams.SubobjectOuter, &InstanceGraph);
}
if ( InParams.bShouldCallEditChange )
{
// notify the object that it has just been imported
InParams.SubobjectOuter->PostEditImport();
// notify the object that it has been edited
InParams.SubobjectOuter->PostEditChange();
}
InParams.SubobjectRoot->CheckDefaultSubobjects();
}
if ( InParams.LineNumber != INDEX_NONE )
{
if ( ContextSupplier == &Supplier )
{
ContextSupplier = NULL;
InParams.Warn->SetContext(NULL);
}
}
return NewSourceText;
}
/**
* Parse and import text as property values for the object specified.
*
* @param DestData the location to import the property values to
* @param SourceText pointer to a buffer containing the values that should be parsed and imported
* @param ObjectStruct the struct for the data we're importing
* @param SubobjectRoot the original object that ImportObjectProperties was called for.
* if SubobjectOuter is a subobject, corresponds to the first object in SubobjectOuter's Outer chain that is not a subobject itself.
* if SubobjectOuter is not a subobject, should normally be the same value as SubobjectOuter
* @param SubobjectOuter the object corresponding to DestData; this is the object that will used as the outer when creating subobjects from definitions contained in SourceText
* @param Warn ouptut device to use for log messages
* @param Depth current nesting level
* @param LineNumber used when importing defaults during script compilation for tracking which line we're currently for the purposes of printing compile errors
* @param InstanceGraph contains the mappings of instanced objects and components to their templates; used when recursively calling ImportObjectProperties; generally
* not necessary to specify a value when calling this function from other code
*
* @return NULL if the default values couldn't be imported
*/
const TCHAR* ImportObjectProperties(
uint8* DestData,
const TCHAR* SourceText,
UStruct* ObjectStruct,
UObject* SubobjectRoot,
UObject* SubobjectOuter,
FFeedbackContext* Warn,
int32 Depth,
int32 LineNumber,
FObjectInstancingGraph* InInstanceGraph,
Copying //UE4/Dev-Editor to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2756103 on 2015/11/05 by Jamie.Dale Implemented UFont::GetResourceSize to work correctly with the Size Map tool Change 2756104 on 2015/11/05 by Jamie.Dale Changed the font used when a font is missing or invalid to be the last resort font, rather than the localized fallback font The localized fallback font could cause different results based on your culture, and the last resort font makes it clearer that something is set-up incorrectly as it just draws invalid glyph markers for all of the text. Change 2756105 on 2015/11/05 by Jamie.Dale Fixed a crash when using an empty FKey property with a Data Table FKeyStructCustomization was asserting because there were no objects being edited, due to a newly added Data Table containing zero rows. I've removed this assert, and also updated SKeySelector to no longer require a separate argument to say whether multiple keys with different values are selected (this is now calculated from the call to get the current key, which will return an empty TOptional for multiple values). #jira UE-22897 Change 2757015 on 2015/11/06 by Joe.Tidmarsh SSProgressBar marquee tint. Accounts for widget color and opacity. PR #1698 Change 2757156 on 2015/11/06 by Joe.Tidmarsh Implemented "Go to Variable" functionality for widgets in Widget Blueprint Editor. When we switch modes in UMG from Designer to Graph. We select the variable (In "My Blueprint"), if one exists, for the currently selected widget. Additionally we update the details panel. * Added SelectGraphActionItemByName to FBlueprintEditor. This selects an item in My Blueprint and also displays it in the details panel of graph mode. SMyBlueprint is not available to FWidgetBlueprintEditor in UMGEditor module as it's privately implemented within Kismet. #rb Ben.Cosh #jira UE-20170 Change 2757181 on 2015/11/06 by Jamie.Dale Cleaned up some duplication in UMG text widgets, and exposed the text shaping options The common properties used by all text widgets that are text layout based have been moved into a UTextLayoutWidget base class, and all text layout based widgets now derive from this. The options needed to control the text shaping method used by a text based widget have been exposed via the FShapedTextOptions struct. This contains a way to manage these optional (and advanced) overrides. You typically wouldn't change these from the default unless you knew exactly what you were doing (eg, you have a text block containing only numbers). This change also updates SRichTextBlock to work with an invalidation panel in the same way that STextBlock does Change 2757734 on 2015/11/06 by David.Nikdel #UE4 #Editor - Added support for meta=(TitleProperty="StructPropertyNameHere") on properties of type TArray<FSomeStruct>. - This changes the editor rolled-up display of these values from "{0} members" to a stringified version of the specified property (if found). #CodeReview: Matt.Kuhlenschmidt Change 2758786 on 2015/11/09 by Joe.Tidmarsh Border widget now correctly synchronizes padding property #jira UE-23070 Change 2758791 on 2015/11/09 by Joe.Tidmarsh Shadow of FCanvasTextItem should be drawn before the outline color. Consulted with Bruce.N who believes this is not the intended behavior and was an oversight when refactoring FCanvas (CL 1695138) #jira UE-21623 #1608 #rb Simon.Tovey, Bruce.Nesbit Change 2758813 on 2015/11/09 by Joe.Tidmarsh UMG: Attempting to parent multiple widgets (in Hierarchy tree) to a widget that can't have multiple children will notify the user and ignore the operation. [UE-22921] [CrashReport] Parenting multiple actors under border crashes editor #jira UE-22921 Change 2759234 on 2015/11/09 by Nick.Darnell Slate - Improving the way we track references to materials in slate to better keep things alive until they're no longer needed for rendering. Additionally, making it so the we use the material and texture free list when possible when cleaning up things as to not allocate new memory if not required. Concidentually this can help with problems with corrupted memory on destruct as well, because it means the memory isn't really going to become garbage any more. #codereview Matt.Kuhlenschmidt, Bob.Tellez Change 2760954 on 2015/11/10 by Nick.Darnell Slate - A bug in the introduction of custom rendered elements accidentally broke filling out the texture coordinates for standard material usage. Materials should once again tile correctly just like images do. #jira UE-23118 Change 2761129 on 2015/11/10 by Nick.Darnell Slate - Removing the Pre-Multiply alpha path the way it was added, introducing it in a way that doesn't require changes inside the shader. Continuing to improve the SRetainerWidget to no longer have a frame delay between resizes and painting, also working on getting it handle clipping correctly but still not there yet. Change 2761391 on 2015/11/10 by Alexis.Matte jira UE-20281 and UE-22259 Fbx scene Re-import workflow - First draft of the reimport workflow using a reimport asset in the content browser #codereview nick.darnell Change 2762323 on 2015/11/11 by Alexis.Matte fix build compilation Change 2762407 on 2015/11/11 by Jamie.Dale UDataTable::SaveStructData now writes out dummy data when RowStruct is null This didn't used to happen, which would cause a miss-match between what UDataTable::LoadStructData was expecting, and would result in a Data Table that could never be loaded again. This change also improves the error message when editing a Data Table with a null row struct, and adds the editor-only RowStructName property to cache the name of the last used struct (for error reporting). #jira UE-22789 Change 2762508 on 2015/11/11 by Nick.Darnell UMG - Making it more obvious what keys do special stuff with anchors in UMG. Fixing the way snapping to anchors works with Control, it now only zeros out the side you're dragging instead of the entire widget, which was silly. Enhancing the designer message system to no longer be based on an enum and instead let arbitrary systems push and pop FText messages. Fixing animations in the anchor drop down to properly animate, broke when we introduced active timers. Change 2763241 on 2015/11/11 by Nick.Darnell Slate - We no longer allow popup windows to be larger than the primary display window for windows where max width/height is unspecified. This is to prevent accidential creation of tooltip windows that are larger than the driver allows causing crashes. #jira UE-20336
2015-12-12 08:54:23 -05:00
const TMap<AActor*, AActor*>* ActorRemapper
)
{
FImportObjectParams Params;
{
Params.DestData = DestData;
Params.SourceText = SourceText;
Params.ObjectStruct = ObjectStruct;
Params.SubobjectRoot = SubobjectRoot;
Params.SubobjectOuter = SubobjectOuter;
Params.Warn = Warn;
Params.Depth = Depth;
Params.LineNumber = LineNumber;
Params.InInstanceGraph = InInstanceGraph;
Params.ActorRemapper = ActorRemapper;
// This implementation always calls PreEditChange/PostEditChange
Params.bShouldCallEditChange = true;
}
return ImportObjectProperties( Params );
}