Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

[UNR-2003] Create CookAndGenerateSchemaCommandlet #1342

Merged
merged 47 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
73d917c
Initial commit of CookAndGenerateSchemaCommandlet, generating correct…
mattyoung-improbable Aug 20, 2019
c54c9a0
Wrap generate call in an async task to avoid blocking.
mattyoung-improbable Aug 21, 2019
1e81ed0
New Implementation using UObjectArray callback instead, catches a lot…
mattyoung-improbable Sep 2, 2019
01a64e9
Avoid adding classes twice during generate. Tidy up
mattyoung-improbable Sep 2, 2019
c39eed9
Only generate schema for explicit spatial types (AActor & UActorCompo…
mattyoung-improbable Sep 4, 2019
e219ba9
Check for explicit Spatial flag, also double check parent class if no…
mattyoung-improbable Sep 5, 2019
6354a23
Downgrade logs to verbose. Add Schema Gen Timer
mattyoung-improbable Sep 5, 2019
1098e5f
Cleanup
mattyoung-improbable Sep 9, 2019
994ba4d
More Cleanup
mattyoung-improbable Sep 9, 2019
8baa1a4
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 9, 2019
7850ac7
Add back in merge error
mattyoung-improbable Sep 10, 2019
ea60fc8
Update UnrealEngine Version for CI
mattyoung-improbable Sep 10, 2019
de65361
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 10, 2019
6181d43
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 10, 2019
62d744d
Remove Newline
mattyoung-improbable Sep 10, 2019
c9bb1a5
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 12, 2019
75dfdba
Fix merge issues
mattyoung-improbable Sep 12, 2019
a666306
Merge remote-tracking branch 'origin/master' into feature/cook-and-ge…
mattyoung-improbable Sep 16, 2019
3a88165
PR Comments
mattyoung-improbable Sep 16, 2019
3595653
Use ClassIterator directly in commandlet to gather supported c++ & in…
mattyoung-improbable Sep 16, 2019
349dd11
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 18, 2019
6fe45b8
Update unreal-engine.version
mattyoung-improbable Sep 18, 2019
d1a2fe9
Merge remote-tracking branch 'origin/master' into feature/cook-and-ge…
mattyoung-improbable Sep 18, 2019
08b5c5a
PR Comments
mattyoung-improbable Sep 18, 2019
2a16bc2
Remove recursive argument to VisitAllObjects
mattyoung-improbable Sep 18, 2019
986abab
Remove newline
mattyoung-improbable Sep 19, 2019
5d4d539
Remove redundant method FilterClasses
mattyoung-improbable Sep 19, 2019
3d85cd2
Put Schema Gen API inside SpatialGDKEditor::Schema namespace
mattyoung-improbable Sep 19, 2019
1daa466
Use GetAllSupportedClasses in Cook Commandlet
mattyoung-improbable Sep 19, 2019
7877833
Make ObjectListener interface cleaner. Sort Set directly
mattyoung-improbable Sep 19, 2019
d06e491
Only return 0 since CookCommandlet can only return 0
mattyoung-improbable Sep 19, 2019
2ca200f
Update Engine Version in CI
mattyoung-improbable Sep 20, 2019
d2d850b
PR Comments
mattyoung-improbable Sep 23, 2019
d3dc19a
Remove recursive check now that blueprint class flags are fixed in th…
mattyoung-improbable Sep 24, 2019
73dc6d9
Update checks for NotSpatialType to include checks for ExplicitSpatia…
mattyoung-improbable Sep 24, 2019
b1f06ff
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 24, 2019
8efafd4
Only check for the absence of SPATIALCLASS_ExplicitSpatialType since …
mattyoung-improbable Sep 24, 2019
fe18624
Merge branch 'feature/cook-and-generate-schema-commandlet' of github.…
mattyoung-improbable Sep 24, 2019
fb7181e
rename SPATIALCLASS_ExplicitSpatialType SPATIALCLASS_SpatialType, rem…
mattyoung-improbable Sep 25, 2019
25b3e64
Merge branch 'master' into feature/cook-and-generate-schema-commandlet
mattyoung-improbable Sep 25, 2019
df40810
Add CHANGELOG
mattyoung-improbable Sep 25, 2019
cee0d59
Increment RequiresSetup
mattyoung-improbable Sep 25, 2019
9c808e1
Better error when no generated schema for class
improbable-valy Sep 25, 2019
fed4611
Update engine-version
mattyoung-improbable Sep 25, 2019
c4fca92
Update SpatialGDK/Source/SpatialGDKEditorCommandlet/Private/Commandle…
mattyoung-improbable Sep 25, 2019
cf916e4
remove newline from engine version
mattyoung-improbable Sep 25, 2019
2fe8e34
Actually remove the newline this time
mattyoung-improbable Sep 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Utils/CodeWriter.h"
#include "Utils/ComponentIdGenerator.h"
#include "Utils/DataTypeUtilities.h"
#include "SpatialGDKEditorSchemaGenerator.h"
mattyoung-improbable marked this conversation as resolved.
Show resolved Hide resolved

DEFINE_LOG_CATEGORY(LogSchemaGenerator);

Expand Down Expand Up @@ -565,7 +566,7 @@ void GenerateSubobjectSchemaForActorIncludes(FCodeWriter& Writer, TSharedPtr<FUn
{
UObject* Value = PropertyTypeInfo->Object;

if (Value != nullptr && !Value->IsEditorOnly())
if (Value != nullptr && IsSupportedClass(Value->GetClass()))
{
UClass* Class = Value->GetClass();
if (!AlreadyImported.Contains(Class) && SchemaGeneratedClasses.Contains(Class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,47 +410,104 @@ bool SaveSchemaDatabase()
return true;
}

TArray<UClass*> GetAllSupportedClasses()
bool IsSupportedClass(UClass* SupportedClass)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool IsSupportedClass(UClass* SupportedClass)
bool IsSupportedClass(const UClass* SupportedClass)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
TSet<UClass*> Classes;
const TArray<FDirectoryPath>& DirectoriesToNeverCook = GetDefault<UProjectPackagingSettings>()->DirectoriesToNeverCook;
if (!IsValid(SupportedClass))
{
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Invalid Class Not supported for schema gen"), *GetPathNameSafe(SupportedClass));
return false;
}

for (TObjectIterator<UClass> ClassIt; ClassIt; ++ClassIt)
if (SupportedClass->IsEditorOnly())
{
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Editor-only Class Not supported for schema gen"), *GetPathNameSafe(SupportedClass));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The capitalization of this message is triggering me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return false;
}

// User told us to ignore this class
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (SupportedClass->HasAnySpatialClassFlags(SPATIALCLASS_NotSpatialType))
{
// User told us to ignore this class
if (ClassIt->HasAnySpatialClassFlags(SPATIALCLASS_NotSpatialType))
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Not Spatial Type, not supported for schema gen"), *GetPathNameSafe(SupportedClass));
return false;
}

if (!SupportedClass->HasAnySpatialClassFlags(SPATIALCLASS_ExplicitSpatialType))
m-samiec marked this conversation as resolved.
Show resolved Hide resolved
{
// Check if parent class is supported.
if (!IsSupportedClass(SupportedClass->GetSuperClass()))
{
continue;
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Not Explicit Spatial Type, parent not supported either, not supported for schema gen."), *GetPathNameSafe(SupportedClass));
return false;
}
}

if (SupportedClass->HasAnyClassFlags(CLASS_LayoutChanging))
{
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Layout changing, not supported"), *GetPathNameSafe(SupportedClass));
return false;
}

// Ensure we don't process transient generated classes for BP
if (SupportedClass->GetName().StartsWith(TEXT("SKEL_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("REINST_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("TRASHCLASS_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("HOTRELOADED_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("PROTO_BP_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("PLACEHOLDER-CLASS_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("ORPHANED_DATA_ONLY_"), ESearchCase::CaseSensitive))
{
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Transient Class not supported for schema gen"), *GetPathNameSafe(SupportedClass));
return false;
}

const TArray<FDirectoryPath>& DirectoriesToNeverCook = GetDefault<UProjectPackagingSettings>()->DirectoriesToNeverCook;
mattyoung-improbable marked this conversation as resolved.
Show resolved Hide resolved

// Avoid processing classes contained in Directories to Never Cook
const FString& ClassPath = SupportedClass->GetPathName();
if (DirectoriesToNeverCook.ContainsByPredicate([&ClassPath](const FDirectoryPath& Directory)
{
return ClassPath.StartsWith(Directory.Path);
}))
{
UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Inside Directory to never cook for schema gen"), *GetPathNameSafe(SupportedClass));
return false;
}

UE_LOG(LogSpatialGDKSchemaGenerator, Verbose, TEXT("[%s] Supported Class"), *GetPathNameSafe(SupportedClass));
return true;
}


TSet<UClass*> GetAllSupportedClasses()
{
TSet<UClass*> Classes;

for (TObjectIterator<UClass> ClassIt; ClassIt; ++ClassIt)
{
UClass* SupportedClass = *ClassIt;

// Ensure we don't process transient generated classes for BP
if (SupportedClass->GetName().StartsWith(TEXT("SKEL_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("REINST_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("TRASHCLASS_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("HOTRELOADED_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("PROTO_BP_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("PLACEHOLDER-CLASS_"), ESearchCase::CaseSensitive)
|| SupportedClass->GetName().StartsWith(TEXT("ORPHANED_DATA_ONLY_"), ESearchCase::CaseSensitive))
if (IsSupportedClass(SupportedClass))
{
continue;
Classes.Add(SupportedClass);
}
}

// Avoid processing classes contained in Directories to Never Cook
const FString& ClassPath = SupportedClass->GetPathName();
if (DirectoriesToNeverCook.ContainsByPredicate([&ClassPath](const FDirectoryPath& Directory)
{
return ClassPath.StartsWith(Directory.Path);
}))
return Classes;
}

TSet<UClass*> FilterClasses(TSet<UClass*> Classes)
Copy link
Collaborator

@m-samiec m-samiec Sep 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TSet<UClass*> FilterClasses(TSet<UClass*> Classes)
TSet<UClass*> FilterClasses(const TSet<UClass*>& Classes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
TSet<UClass*> FilteredClasses;

for (auto Class : Classes)
{
if (IsSupportedClass(Class))
{
continue;
FilteredClasses.Add(Class);
}

Classes.Add(SupportedClass);
}

return Classes.Array();
return FilteredClasses;
}

void CopyWellKnownSchemaFiles()
Expand Down Expand Up @@ -684,21 +741,60 @@ bool RunSchemaCompiler()
}
}

bool SpatialGDKGenerateSchema()
bool SpatialGDKGenerateSchema(bool bSaveSchemaDatabase, bool bRunSchemaCompiler)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering removing parameter options

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
ResetUsedNames();
// Generate Schema for classes loaded in memory.

// Gets the classes currently loaded into memory.
SchemaGeneratedClasses = GetAllSupportedClasses();
SchemaGeneratedClasses.Sort();
if (!SpatialGDKGenerateSchemaForClasses(GetAllSupportedClasses()))
{
return false;
}

if (bSaveSchemaDatabase)
{
if (!SaveSchemaDatabase())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the validity of if SpatialGDKGenerateSchemaForClasses changes the in-memory schema database and we don't save it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I guess a restart would be recommended solution? It should be a pretty rare edge case since we check for write access before we do schema gen (in TryLoadExistingSchemaDatabase) so something funky would have to happen between then and this part.

{
return false;
}
}

if (bRunSchemaCompiler)
{
return RunSchemaCompiler();
}

return true;
}

SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchemaForClasses(TSet<UClass*> Classes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchemaForClasses(TSet<UClass*> Classes)
bool SpatialGDKGenerateSchemaForClasses(TSet<UClass*> Classes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

{
ResetUsedNames();
TSet<UClass*> NewClasses = FilterClasses(Classes);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can just sort the set if you provide a predicate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

TArray<UClass*> SortedClasses = NewClasses.Array();
SortedClasses.Sort();

// Generate Type Info structs for all classes
TArray<TSharedPtr<FUnrealType>> TypeInfos;

for (const auto& Class : SchemaGeneratedClasses)
for (const auto& Class : SortedClasses)
{
if (SchemaGeneratedClasses.Contains(Class)) continue;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: New line please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should SchemaGeneratedClasses get cleared before this loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate Schema is being called in batches, so it's useful to cache generated classes between calls. This code really needs cleaning up to encapsulate this state properly, most likely as part of the testing work.


SchemaGeneratedClasses.Add(Class);
// Parent and static array index start at 0 for checksum calculations.
TypeInfos.Add(CreateUnrealTypeInfo(Class, 0, 0));
TSharedPtr<FUnrealType> TypeInfo = CreateUnrealTypeInfo(Class, 0, 0);
TypeInfos.Add(TypeInfo);
VisitAllObjects(TypeInfo, [&](TSharedPtr<FUnrealType> TypeNode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
VisitAllObjects(TypeInfo, [&](TSharedPtr<FUnrealType> TypeNode) {
VisitAllObjects(TypeInfo, [&](TSharedPtr<FUnrealType> TypeNode)
{

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (UClass* NestedClass = Cast<UClass>(TypeNode->Type))
{
if (!NewClasses.Contains(NestedClass) && !SchemaGeneratedClasses.Contains(NestedClass) && IsSupportedClass(NestedClass))
{
TypeInfos.Add(CreateUnrealTypeInfo(NestedClass, 0, 0));
SchemaGeneratedClasses.Add(NestedClass);
}
}
return true;
}, true);
}

if (!ValidateIdentifierNames(TypeInfos))
Expand All @@ -724,12 +820,8 @@ bool SpatialGDKGenerateSchema()
GenerateSchemaFromClasses(TypeInfos, SchemaOutputPath, IdGenerator);
GenerateSchemaForSublevels(SchemaOutputPath, IdGenerator);
NextAvailableComponentId = IdGenerator.Peek();
if (!SaveSchemaDatabase())
{
return false;
}

return RunSchemaCompiler();
return true;
}

#undef LOCTEXT_NAMESPACE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move outside namespaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ FString GetReplicatedPropertyGroupName(EReplicatedPropertyGroup Group)
return Group == REP_SingleClient ? TEXT("OwnerOnly") : TEXT("");
}

void VisitAllObjects(TSharedPtr<FUnrealType> TypeNode, TFunction<bool(TSharedPtr<FUnrealType>)> Visitor, bool bRecurseIntoSubobjects)
{
bool bShouldRecurseFurther = Visitor(TypeNode);
for (auto& PropertyPair : TypeNode->Properties)
{
if (bShouldRecurseFurther && PropertyPair.Value->Type.IsValid())
{
// Either recurse into subobjects if they're structs or bRecurseIntoSubobjects is true.
if (bRecurseIntoSubobjects || PropertyPair.Value->Property->IsA<UStructProperty>())
{
VisitAllObjects(PropertyPair.Value->Type, Visitor, bRecurseIntoSubobjects);
}
}
}
}

void VisitAllProperties(TSharedPtr<FUnrealType> TypeNode, TFunction<bool(TSharedPtr<FUnrealProperty>)> Visitor)
{
for (auto& PropertyPair : TypeNode->Properties)
Expand Down Expand Up @@ -465,7 +481,7 @@ FSubobjectMap GetAllSubobjects(TSharedPtr<FUnrealType> TypeInfo)
{
UObject* Value = PropertyTypeInfo->Object;

if (Value != nullptr && !Value->IsEditorOnly())
if (Value != nullptr && IsSupportedClass(Value->GetClass()))
{
if (!SeenComponents.Contains(Value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ TArray<EReplicatedPropertyGroup> GetAllReplicatedPropertyGroups();
// Convert a replicated property group to a string. Used to generate component names.
FString GetReplicatedPropertyGroupName(EReplicatedPropertyGroup Group);

// Given an AST, this applies the function 'Visitor' to all FUnrealType's contained transitively within the properties. bRecurseIntoObjects will control
// whether this function will recurse into a UObject's properties, which may not always be desirable. However, it will always recurse into substructs.
// If the Visitor function returns false, it will not recurse any further into that part of the tree. // If the Visitor function returns false, it will not recurse any further into that part of the tree.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the formatting is a bit off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If the Visitor function returns false, it will not recurse any further into that part of the tree. // If the Visitor function returns false, it will not recurse any further into that part of the tree.
// If the Visitor function returns false, it will not recurse any further into that part of the tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

void VisitAllObjects(TSharedPtr<FUnrealType> TypeNode, TFunction<bool(TSharedPtr<FUnrealType>)> Visitor, bool bRecurseIntoSubobjects);
Copy link
Contributor

@improbable-valy improbable-valy Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only use case passes bRecurseIntoSubobjects = true, so my preference would be to remove the argument for now and add it back in the future if the other use case becomes necessary again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


// Given an AST, this applies the function 'Visitor' to all properties contained transitively within the type. This will recurse into substructs.
// If the Visitor function returns false, it will not recurse any further into that part of the tree.
void VisitAllProperties(TSharedPtr<FUnrealType> TypeNode, TFunction<bool(TSharedPtr<FUnrealProperty>)> Visitor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ void FCodeWriter::WriteToFile(const FString& Filename)
void FCodeWriter::Dump()
{
UE_LOG(LogTemp, Warning, TEXT("%s"), *OutputSource);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

DECLARE_LOG_CATEGORY_EXTERN(LogSpatialGDKSchemaGenerator, Log, All);
improbable-valy marked this conversation as resolved.
Show resolved Hide resolved

SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchema();
SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchema(bool bSaveSchemaDatabase = true, bool bRunSchemaCompiler = true);
Copy link
Contributor

@aleximprobable aleximprobable Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the order of declarations seems random.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to tidy them up a bit to make them grouped better.


SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchemaForClasses(TSet<UClass*> Classes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that the TSet of Classes is copied?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchemaForClasses(TSet<UClass*> Classes);
SPATIALGDKEDITOR_API bool SpatialGDKGenerateSchemaForClasses(const TSet<UClass*>& Classes);


SPATIALGDKEDITOR_API bool SaveSchemaDatabase();

SPATIALGDKEDITOR_API bool RunSchemaCompiler();

SPATIALGDKEDITOR_API void ClearGeneratedSchema();

Expand All @@ -21,3 +27,5 @@ SPATIALGDKEDITOR_API bool GeneratedSchemaFolderExists();
SPATIALGDKEDITOR_API bool DeleteSchemaDatabase();

SPATIALGDKEDITOR_API bool GeneratedSchemaDatabaseExists();

SPATIALGDKEDITOR_API bool IsSupportedClass(UClass* SupportedClass);
Loading