Skip to content

Instantly share code, notes, and snippets.

@DannyGoodayle
DannyGoodayle / KismetReinstanceUtilities.cpp
Created February 22, 2024 18:21
Potential fix for reinstancing issue on Smart Objects
static void ReplaceActorHelper(AActor* OldActor, UClass* OldClass, UObject*& NewUObject, UClass* NewClass, TMap<UObject*, UObject*>& OldToNewInstanceMap, const TMap<UClass*, UClass*>& InOldToNewClassMap, TMap<FSoftObjectPath, UObject*>& ReinstancedObjectsWeakReferenceMap, TMap<UObject*, FActorAttachmentData>& ActorAttachmentData, TArray<FActorReplacementHelper>& ReplacementActors, bool bPreserveRootComponent, bool& bSelectionChanged)
{
FVector Location = FVector::ZeroVector;
FRotator Rotation = FRotator::ZeroRotator;
if (USceneComponent* OldRootComponent = OldActor->GetRootComponent())
{
// We need to make sure that the GetComponentTransform() transform is up to date, but we don't want to run any initialization logic
// so we silence the update, cache it off, revert the change (so no events are raised), and then directly update the transform
// with the value calculated in ConditionalUpdateComponentToWorld:
FScopedMovementUpdate SilenceMovement(OldRootComponent);
@DannyGoodayle
DannyGoodayle / ue-main.stream.json
Last active July 18, 2023 11:13 — forked from regner/BuildProject.xml
A sample BuildGraph script for building, cooking, and packaging an Unreal project.
{
"name": "//ue/Main",
"ClusterName": "Default",
"NotificationChannel": "#ue",
"NotificationChannelFilter": "Failure",
"TriageChannel": "#ue-triage",
"DefaultPreflight": {
"TemplateID": "pre-flight"
},
"Tabs": [