Skip to content

Commit 0c496a4

Browse files
committed
Unreal: Version 2
backport of r371985-r371995 - Fixed bug when changing "tuple" uproperties (i.e.: vector, color, etc.) via the generic attributes. The values were incorrectly read from the generic property attribute value arrays. On behalf of mchamberlain: - Linux/Clang build fixes: Fixed a text case issue in a #include file path and commented out unused expressions. - BGEO / Async import commandlet: initialize slate: Unreal Engine 4.25 and older needs Slate to be initialized in order to tick the EditorEngine. - PDG: Fixed a crash when disabling the TOP node filter: Fixed a crash when disabling the TOP node filter when there was no results in the TOP node combo box. Clicking on or hovering over the TOP node combo box after disabling the filter would result in a crash. This was a null pointer exception (no selected FTOPNode). - PDG: Fixed enabling/disabling of TOP node load work items, show work items and cook / dirty buttons.
1 parent 655a705 commit 0c496a4

File tree

7 files changed

+78
-38
lines changed

7 files changed

+78
-38
lines changed

Source/HoudiniEngine/HoudiniEngine.Build.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ public HoudiniEngine( ReadOnlyTargetRules Target ) : base( Target )
331331
"MeshDescription",
332332
"MeshDescriptionOperations",
333333
"WorldBrowser",
334-
"Messaging"
334+
"Messaging",
335+
"SlateNullRenderer"
335336
}
336337
);
337338
}

Source/HoudiniEngine/Private/HoudiniGeoImportCommandlet.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929

3030
#include "DirectoryWatcherModule.h"
31+
#include "Modules/ModuleManager.h"
3132
#include "Misc/Guid.h"
3233
#include "EditorFramework/AssetImportData.h"
3334

@@ -40,14 +41,19 @@
4041

4142
#include "IDirectoryWatcher.h"
4243

44+
#include "Internationalization/Regex.h"
45+
46+
#include "Interfaces/ISlateNullRendererModule.h"
47+
#include "Rendering/SlateRenderer.h"
48+
#include "Framework/Application/SlateApplication.h"
49+
4350
#include "HoudiniPackageParams.h"
4451
#include "HoudiniGeoImporter.h"
4552
#include "HoudiniEngineRuntime.h"
4653
#include "HoudiniEngineUtils.h"
4754
#include "HoudiniOutput.h"
4855
#include "HoudiniPDGImporterMessages.h"
4956
#include "HoudiniMeshTranslator.h"
50-
#include "Internationalization/Regex.h"
5157

5258

5359
UHoudiniGeoImportCommandlet::UHoudiniGeoImportCommandlet()
@@ -209,6 +215,16 @@ int32 UHoudiniGeoImportCommandlet::MainLoop()
209215
FEvent* ComWrapperShutdownEvent = FPlatformProcess::GetSynchEventFromPool(true);
210216
#endif
211217

218+
// In UnrealEngine 4.25 and older we cannot tick the editor engine without slate being initialized.
219+
// TODO: do we necessarily need to tick the engine in the loop? Could we perhaps just tick the directory watcher,
220+
// TODO: messaging system and process the task graph and deferred commands?
221+
FSlateApplication::InitHighDPI(false);
222+
FSlateApplication::Create();
223+
TSharedPtr<FSlateRenderer> SlateRenderer = FModuleManager::Get().LoadModuleChecked<ISlateNullRendererModule>("SlateNullRenderer").CreateSlateNullRenderer();
224+
TSharedRef<FSlateRenderer> SlateRendererSharedRef = SlateRenderer.ToSharedRef();
225+
FSlateApplication& SlateApp = FSlateApplication::Get();
226+
SlateApp.InitializeRenderer(SlateRendererSharedRef);
227+
212228
// main loop
213229
while (GIsRunning && !IsEngineExitRequested())
214230
{
@@ -233,6 +249,8 @@ int32 UHoudiniGeoImportCommandlet::MainLoop()
233249
}
234250

235251
GEngine->DeferredCommands.Empty();
252+
253+
SlateApp.Tick();
236254

237255
// flush log
238256
GLog->FlushThreadedLogs();
@@ -262,6 +280,8 @@ int32 UHoudiniGeoImportCommandlet::MainLoop()
262280
DirectoryWatcher->UnregisterDirectoryChangedCallback_Handle(DirectoryToWatch, DirectoryWatcherHandle);
263281
}
264282

283+
FSlateApplication::Shutdown();
284+
265285
GIsRunning = false;
266286

267287
return 0;

Source/HoudiniEngineEditor/Private/HoudiniPDGDetails.cpp

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,15 +1165,25 @@ FHoudiniPDGDetails::AddTOPNodeWidget(
11651165
SNew(STextBlock)
11661166
.Text_Lambda([InPDGAssetLink, ComboBoxTOPNode, Options = TOPNodesPtr]()
11671167
{
1168-
return FText::FromString(InPDGAssetLink->GetSelectedTOPNodeName());
1168+
if (IsValid(InPDGAssetLink))
1169+
return FText::FromString(InPDGAssetLink->GetSelectedTOPNodeName());
1170+
else
1171+
return FText();
11691172
})
11701173
.ToolTipText_Lambda([InPDGAssetLink]()
11711174
{
11721175
FTOPNode const * const TOPNode = InPDGAssetLink->GetSelectedTOPNode();
11731176
if (TOPNode)
1174-
return FText::FromString(TOPNode->NodePath);
1177+
{
1178+
if (!TOPNode->NodePath.IsEmpty())
1179+
return FText::FromString(TOPNode->NodePath);
1180+
else
1181+
return FText::FromString(TOPNode->NodeName);
1182+
}
11751183
else
1176-
return FText::FromString(TOPNode->NodeName);
1184+
{
1185+
return FText();
1186+
}
11771187
})
11781188
.Font(FEditorStyle::GetFontStyle(TEXT("PropertyWindow.NormalFont")))
11791189
]
@@ -1298,13 +1308,13 @@ FHoudiniPDGDetails::AddTOPNodeWidget(
12981308
// FHoudiniPDGDetails::RefreshUI(InPDGAssetLink);
12991309
})
13001310
.ToolTipText(Tooltip)
1311+
.IsEnabled_Lambda([InPDGAssetLink]()
1312+
{
1313+
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1314+
return true;
1315+
return false;
1316+
})
13011317
];
1302-
1303-
bool bEnabled = false;
1304-
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1305-
bEnabled = true;
1306-
1307-
AutoLoadCheckBox->SetEnabled(bEnabled);
13081318
}
13091319

13101320
// Checkbox: Work Item Output Files Visible
@@ -1364,13 +1374,13 @@ FHoudiniPDGDetails::AddTOPNodeWidget(
13641374
// FHoudiniPDGDetails::RefreshUI(InPDGAssetLink);
13651375
})
13661376
.ToolTipText(Tooltip)
1377+
.IsEnabled_Lambda([InPDGAssetLink]()
1378+
{
1379+
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1380+
return true;
1381+
return false;
1382+
})
13671383
];
1368-
1369-
bool bEnabled = false;
1370-
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1371-
bEnabled = true;
1372-
1373-
ShowResCheckBox->SetEnabled(bEnabled);
13741384
}
13751385

13761386
// Buttons: DIRTY NODE / DIRTY ALL TASKS / COOK NODE
@@ -1417,6 +1427,12 @@ FHoudiniPDGDetails::AddTOPNodeWidget(
14171427

14181428
return FReply::Handled();
14191429
})
1430+
.IsEnabled_Lambda([InPDGAssetLink]()
1431+
{
1432+
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1433+
return true;
1434+
return false;
1435+
})
14201436
]
14211437
]
14221438
// + SHorizontalBox::Slot()
@@ -1466,17 +1482,16 @@ FHoudiniPDGDetails::AddTOPNodeWidget(
14661482
}
14671483
return FReply::Handled();
14681484
})
1485+
.IsEnabled_Lambda([InPDGAssetLink]()
1486+
{
1487+
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1488+
return true;
1489+
return false;
1490+
})
14691491
]
14701492
]
14711493
];
14721494
DisableIfPDGNotLinked(PDGDirtyCookRow, InPDGAssetLink);
1473-
1474-
bool bEnabled = false;
1475-
if (InPDGAssetLink->GetSelectedTOPNode() && !InPDGAssetLink->GetSelectedTOPNode()->bHidden)
1476-
bEnabled = true;
1477-
1478-
DirtyButton->SetEnabled(bEnabled);
1479-
CookButton->SetEnabled(bEnabled);
14801495
}
14811496

14821497
// TOP Node WorkItem Status

Source/HoudiniEngineRuntime/Private/HoudiniAssetBlueprintComponent.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ UHoudiniAssetBlueprintComponent::CopyStateToTemplateComponent()
321321
{
322322
// We found a reusable SCS node. Just copy the component instance
323323
// properties over to the existing template.
324-
check(ComponentNode->ComponentTemplate);
324+
check(ComponentNode->ComponentTemplate);
325325

326326
// UEngine::FCopyPropertiesForUnrelatedObjectsParams Params;
327327
// //Params.bReplaceObjectClassReferences = false;
@@ -396,7 +396,7 @@ UHoudiniAssetBlueprintComponent::CopyStateToTemplateComponent()
396396
USceneComponent* TemplateComponent = Cast<USceneComponent>(OutputObj.OutputComponent);
397397

398398
if (TemplateComponent)
399-
{
399+
{
400400
USCS_Node* StaleNode = FindSCSNodeForTemplateComponentInClassHierarchy(TemplateComponent);
401401
if (StaleNode)
402402
{
@@ -512,7 +512,7 @@ UHoudiniAssetBlueprintComponent::CopyStateFromTemplateComponent(UHoudiniAssetBlu
512512
for (USceneComponent* Child : Children)
513513
{
514514
if (!Child)
515-
continue;
515+
continue;
516516
}
517517
}
518518
*/

Source/HoudiniEngineRuntime/Private/HoudiniAssetComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ void UHoudiniAssetComponent::HoudiniEngineTick()
17881788
if (!IsFullyLoaded())
17891789
{
17901790
OnFullyLoaded();
1791-
}
1791+
}
17921792
}
17931793

17941794

Source/HoudiniEngineRuntime/Private/HoudiniCompatibilityHelpers.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "HoudiniParameterFolderList.h"
4040
#include "HoudiniParameterInt.h"
4141
#include "HoudiniParameterLabel.h"
42-
#include "HoudiniParameterMultiparm.h"
42+
#include "HoudiniParameterMultiParm.h"
4343
#include "HoudiniParameterRamp.h"
4444
#include "HoudiniParameterSeparator.h"
4545
#include "HoudiniParameterString.h"
@@ -370,7 +370,7 @@ FHoudiniGeoPartObject_V1::ConvertLegacyData()
370370
FHoudiniGeoPartObject NewHGPO;
371371

372372
NewHGPO.AssetId = AssetId;
373-
NewHGPO.AssetName;
373+
// NewHGPO.AssetName;
374374

375375
NewHGPO.ObjectId = ObjectId;
376376
NewHGPO.ObjectName = ObjectName;
@@ -386,18 +386,18 @@ FHoudiniGeoPartObject_V1::ConvertLegacyData()
386386
NewHGPO.TransformMatrix = TransformMatrix;
387387
NewHGPO.NodePath = NodePath;
388388

389-
NewHGPO.VolumeName;
390-
NewHGPO.VolumeTileIndex;
389+
// NewHGPO.VolumeName;
390+
// NewHGPO.VolumeTileIndex;
391391

392392
NewHGPO.bIsVisible = bIsVisible;
393393
NewHGPO.bIsEditable = bIsEditable;
394-
NewHGPO.bIsTemplated;
395-
NewHGPO.bIsInstanced;
394+
// NewHGPO.bIsTemplated;
395+
// NewHGPO.bIsInstanced;
396396

397397
NewHGPO.bHasGeoChanged = bHasGeoChanged;
398-
NewHGPO.bHasPartChanged;
399-
NewHGPO.bHasTransformChanged;
400-
NewHGPO.bHasMaterialsChanged;
398+
// NewHGPO.bHasPartChanged;
399+
// NewHGPO.bHasTransformChanged;
400+
// NewHGPO.bHasMaterialsChanged;
401401
NewHGPO.bLoaded = true; //bIsLoaded;
402402

403403
// Hamdle Part Type

Source/HoudiniEngineRuntime/Private/HoudiniGenericAttribute.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ FHoudiniGenericAttribute::ModifyPropertyValueOnObject(
502502
FHoudiniGenericAttribute InGenericAttribute,
503503
FProperty* FoundProperty,
504504
void* InContainer,
505-
const int32& AtIndex)
505+
const int32& InAtIndex)
506506
{
507507
if (!InObject || InObject->IsPendingKill() || !FoundProperty)
508508
return false;
@@ -531,6 +531,10 @@ FHoudiniGenericAttribute::ModifyPropertyValueOnObject(
531531
}
532532
}
533533

534+
// Get the "proper" AtIndex in the flat array by using the attribute tuple size
535+
// TODO: fix the issue when changing array of tuple properties!
536+
int32 AtIndex = InAtIndex * InGenericAttribute.AttributeTupleSize;
537+
534538
for (int32 nPropIdx = 0; nPropIdx < NumberOfProperties; nPropIdx++)
535539
{
536540
if (FFloatProperty* FloatProperty = CastField<FFloatProperty>(InnerProperty))

0 commit comments

Comments
 (0)