Skip to content

Commit 563fcef

Browse files
committed
Cleanup
1 parent cd4a8e3 commit 563fcef

File tree

5 files changed

+58
-22
lines changed

5 files changed

+58
-22
lines changed

Source/PCGExtendedToolkit/Private/Data/Blending/PCGExDataBlending.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,25 @@ void FPCGExBlendingDetails::GetBlendingParams(
264264
}
265265
else
266266
{
267-
const EPCGExDataBlendingType* TypePtr = AttributesOverrides.Find(Identity.Identifier.Name);
268-
// TODO : Support global defaults (or ditch support)
269-
Param.SetBlending(TypePtr ? *TypePtr : DefaultBlending);
267+
if (const EPCGExDataBlendingType* TypePtr = AttributesOverrides.Find(Identity.Identifier.Name))
268+
{
269+
Param.SetBlending(*TypePtr);
270+
}
271+
else
272+
{
273+
EPCGExDataBlendingType DesiredBlending = DefaultBlending;
274+
275+
#define PCGEX_GET_GLOBAL_BLENDMODE(_TYPE, _NAME, ...)\
276+
if (Identity.UnderlyingType == EPCGMetadataTypes::Boolean){\
277+
if (GetDefault<UPCGExGlobalSettings>()->DefaultBooleanBlendMode != EPCGExDataBlendingTypeDefault::Default){\
278+
DesiredBlending = static_cast<EPCGExDataBlendingType>(GetDefault<UPCGExGlobalSettings>()->DefaultBooleanBlendMode);}}
279+
280+
PCGEX_FOREACH_SUPPORTEDTYPES(PCGEX_GET_GLOBAL_BLENDMODE)
281+
282+
#undef PCGEX_GET_GLOBAL_BLENDMODE
283+
284+
Param.SetBlending(DesiredBlending);
285+
}
270286
}
271287

272288
if (Param.Blending == EPCGExABBlendingType::None) { continue; }

Source/PCGExtendedToolkit/Private/PCGExBroadcast.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,20 @@ template PCGEXTENDEDTOOLKIT_API void FSubSelection::Set<_TYPE_A, _TYPE_B>(_TYPE_
12131213
PCGEX_FOREACH_SUPPORTEDTYPES_PAIRS(PCGEX_TPL)
12141214
#undef PCGEX_TPL
12151215

1216+
template <typename T>
1217+
template <typename T_VALUE>
1218+
void TValueBuffer<T>::Set(const FSubSelection& SubSelection, const int32 Index, const T_VALUE& Value) { *(Values->GetData() + Index) = SubSelection.Get<T_VALUE, T>(Value); }
1219+
1220+
template <typename T>
1221+
template <typename T_VALUE>
1222+
T_VALUE TValueBuffer<T>::Get(const FSubSelection& SubSelection, const int32 Index) const{ return SubSelection.Get<T, T_VALUE>(*(Values->GetData() + Index)); }
1223+
1224+
#define PCGEX_TPL(_TYPE_A, _NAME_A, _TYPE_B, _NAME_B, ...) \
1225+
template PCGEXTENDEDTOOLKIT_API void TValueBuffer<_TYPE_A>::Set<_TYPE_B>(const FSubSelection& SubSelection, const int32 Index, const _TYPE_B& Value); \
1226+
template PCGEXTENDEDTOOLKIT_API _TYPE_B TValueBuffer<_TYPE_A>::Get(const FSubSelection& SubSelection, const int32 Index) const;
1227+
PCGEX_FOREACH_SUPPORTEDTYPES_PAIRS(PCGEX_TPL)
1228+
#undef PCGEX_TPL
1229+
12161230
bool TryGetType(const FPCGAttributePropertyInputSelector& InputSelector, const UPCGData* InData, EPCGMetadataTypes& OutType)
12171231
{
12181232
OutType = EPCGMetadataTypes::Unknown;

Source/PCGExtendedToolkit/Public/PCGExBroadcast.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,18 @@ extern template void FSubSelection::Set<_TYPE_A, _TYPE_B>(_TYPE_A& Target, const
210210
TValueBuffer() = default;
211211

212212
template <typename T_VALUE>
213-
void Set(const FSubSelection& SubSelection, const int32 Index, const T_VALUE& Value) { *(Values->GetData() + Index) = SubSelection.Get<T>(Value); }
213+
void Set(const FSubSelection& SubSelection, const int32 Index, const T_VALUE& Value);
214214

215215
template <typename T_VALUE>
216-
T_VALUE Get(const FSubSelection& SubSelection, const int32 Index) { return SubSelection.Get<T_VALUE, T>(*(Values->GetData() + Index)); }
216+
T_VALUE Get(const FSubSelection& SubSelection, const int32 Index) const;
217217
};
218218

219+
#define PCGEX_TPL(_TYPE_A, _NAME_A, _TYPE_B, _NAME_B, ...) \
220+
extern template void TValueBuffer<_TYPE_A>::Set<_TYPE_B>(const FSubSelection& SubSelection, const int32 Index, const _TYPE_B& Value); \
221+
extern template _TYPE_B TValueBuffer<_TYPE_A>::Get(const FSubSelection& SubSelection, const int32 Index) const;
222+
PCGEX_FOREACH_SUPPORTEDTYPES_PAIRS(PCGEX_TPL)
223+
#undef PCGEX_TPL
224+
219225
class FValueBufferMap : public TSharedFromThis<FValueBufferMap>
220226
{
221227
public:

Source/PCGExtendedToolkit/Public/PCGExCommon.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ namespace PCGExData
7676

7777
enum class EIOInit : uint8
7878
{
79-
NoInit UMETA(DisplayName = "No Output"),
80-
New UMETA(DisplayName = "Create Empty Output Object"),
81-
Duplicate UMETA(DisplayName = "Duplicate Input Object"),
82-
Forward UMETA(DisplayName = "Forward Input Object")
79+
NoInit, // No Output
80+
New, // Create Empty Output Object
81+
Duplicate, // Duplicate Input Object
82+
Forward, //Forward Input Object
8383
};
8484

8585
enum class EIOSide : uint8

Source/PCGExtendedToolkit/Public/PCGExPointsProcessor.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,26 @@ class PCGEXTENDEDTOOLKIT_API UPCGExPointsProcessorSettings : public UPCGSettings
104104

105105
bool SupportsPointFilters() const { return !GetPointFilterPin().IsNone(); }
106106

107-
/** If enabled, will pre-instanciate all data on a single thread to avoid contention. Not all nodes support this. */
108-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable, AdvancedDisplay))
107+
/** If enabled, will pre-allocate all data on a single thread to avoid contention. Not all nodes support this. */
108+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable))
109109
EPCGExOptionState BulkInitData = EPCGExOptionState::Default;
110110

111111
/** Async work priority for this node.*/
112-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable, AdvancedDisplay))
112+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable), AdvancedDisplay)
113113
EPCGExAsyncPriority WorkPriority = EPCGExAsyncPriority::Default;
114114

115115
/** Cache the results of this node. */
116-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable, AdvancedDisplay))
116+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable))
117117
EPCGExOptionState CacheData = EPCGExOptionState::Default;
118118

119-
/** Flatten the output of this node.*/
120-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable, AdvancedDisplay))
121-
bool bFlattenOutput = false;
122-
123119
/** Whether scoped attribute read is enabled or not. Disabling this on small dataset may greatly improve performance. It's enabled by default for legacy reasons. */
124-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable, AdvancedDisplay))
120+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Performance, meta=(PCG_NotOverridable))
125121
EPCGExOptionState ScopedAttributeGet = EPCGExOptionState::Default;
126122

123+
/** Flatten the output of this node. */
124+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Cleanup", meta=(PCG_NotOverridable))
125+
bool bFlattenOutput = false;
126+
127127
/** If the node registers consumable attributes, these will be deleted from the output data. */
128128
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Cleanup", meta=(PCG_NotOverridable))
129129
bool bCleanupConsumableAttributes = false;
@@ -137,19 +137,19 @@ class PCGEXTENDEDTOOLKIT_API UPCGExPointsProcessorSettings : public UPCGSettings
137137
TArray<FName> ProtectedAttributes;
138138

139139
/** Whether the execution of the graph should be cancelled if this node execution is cancelled internally */
140-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable, AdvancedDisplay))
140+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable))
141141
bool bPropagateAbortedExecution = false;
142142

143143
/** */
144-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable, AdvancedDisplay))
144+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable))
145145
bool bQuietInvalidInputWarning = false;
146146

147147
/** */
148-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable, AdvancedDisplay))
148+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable))
149149
bool bQuietMissingInputError = false;
150150

151151
/** */
152-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable, AdvancedDisplay))
152+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Warnings and Errors", meta=(PCG_NotOverridable))
153153
bool bQuietCancellationError = false;
154154

155155
//~End UPCGExPointsProcessorSettings

0 commit comments

Comments
 (0)