Skip to content

Commit 9eedf56

Browse files
committed
Exposed even redistribution on path resample
1 parent 62b6915 commit 9eedf56

File tree

7 files changed

+124
-53
lines changed

7 files changed

+124
-53
lines changed

Config/DefaultPCGExtendedToolkit.ini

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -75,45 +75,10 @@
7575
+EnumRedirects = (OldName="/Script/PCGExtendedToolkit.EPCGExAngularDomain",ValueChanges=(("Amplitude","Scalar")))
7676
+PropertyRedirects = (OldName="/Script/PCGExtendedToolkit.PCGExCopyToPointsSettings.TargetsAttributesToClusterTags",NewName="/Script/PCGExtendedToolkit.PCGExCopyToPointsSettings.TargetsAttributesToCopyTags")
7777
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExRecursionTrackerSettings.Count",NewName="/Script/PCGExtendedToolkit.PCGExRecursionTrackerSettings.MaxCount")
78-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExRefineEdgesSettings.bOutputEdgesOnly",NewName="/Script/PCGExtendedToolkit.PCGExRefineEdgesSettings.bOutputEdgesOnly_DEPRECATED")
79-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExUberFilterSettings.ResultAttributeName",NewName="/Script/PCGExtendedToolkit.PCGExUberFilterSettings.ResultAttributeName_DEPRECATED")
80-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExFilterVtxSettings.ResultAttributeName",NewName="/Script/PCGExtendedToolkit.PCGExFilterVtxSettings.ResultAttributeName_DEPRECATED")
8178
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExFilterProviderSettings.MissingDataPolicy",NewName="/Script/PCGExtendedToolkit.PCGExFilterProviderSettings.MissingDataPolicy")
8279

83-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.SolidificationAxis",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.SolidificationAxis_DEPRECATED")
84-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusX",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusX_DEPRECATED")
85-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXInput",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXInput_DEPRECATED")
86-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXSourceAttribute",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXSourceAttribute_DEPRECATED")
87-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXConstant",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusXConstant_DEPRECATED")
88-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusY",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusY_DEPRECATED")
89-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYInput",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYInput_DEPRECATED")
90-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYSourceAttribute",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYSourceAttribute_DEPRECATED")
91-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYConstant",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusYConstant_DEPRECATED")
92-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusZ",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.bWriteRadiusZ_DEPRECATED")
93-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZInput",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZInput_DEPRECATED")
94-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZSourceAttribute",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZSourceAttribute_DEPRECATED")
95-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZConstant",NewName="/Script/PCGExtendedToolkit.PCGExPathSolidifySettings.RadiusZConstant_DEPRECATED")
96-
97-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_00_08",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_00_08_DEPRECATED")
98-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_08_16",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_08_16_DEPRECATED")
99-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_16_24",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_16_24_DEPRECATED")
100-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_24_32",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_24_32_DEPRECATED")
101-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_32_40",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_32_40_DEPRECATED")
102-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_40_48",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_40_48_DEPRECATED")
103-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_48_56",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_48_56_DEPRECATED")
104-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_56_64",NewName="/Script/PCGExtendedToolkit.PCGExBitmask.Range_56_64_DEPRECATED")
105-
106-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_00_08",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_00_08_DEPRECATED")
107-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_08_16",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_08_16_DEPRECATED")
108-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_16_24",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_16_24_DEPRECATED")
109-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_24_32",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_24_32_DEPRECATED")
110-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_32_40",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_32_40_DEPRECATED")
111-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_40_48",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_40_48_DEPRECATED")
112-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_48_56",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_48_56_DEPRECATED")
113-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_56_64",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Range_56_64_DEPRECATED")
11480

11581
+StructRedirects=(OldName="/Script/PCGExtendedToolkit.ClampedBit",NewName="/Script/PCGExtendedToolkit.PCGExClampedBit")
11682
+StructRedirects=(OldName="/Script/PCGExtendedToolkit.ClampedBitOp",NewName="/Script/PCGExtendedToolkit.PCGExClampedBitOp")
11783

118-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Bits",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Mutations")
119-
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExFilterResultDetails.bResultAsIncrement",NewName="/Script/PCGExtendedToolkit.PCGExFilterResultDetails.bResultAsIncrement_DEPRECATED")
84+
+PropertyRedirects=(OldName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Bits",NewName="/Script/PCGExtendedToolkit.PCGExBitmaskWithOperation.Mutations")

Source/PCGExtendedToolkit/Private/Details/PCGExDetailsInputShorthands.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "Details/PCGExDetailsInputShorthands.h"
66

77
#include "PCGEx.h"
8+
#include "Data/PCGExDataHelpers.h"
89
#include "Details/PCGExMacros.h"
910
#include "Details/PCGExDetailsSettings.h"
1011

@@ -13,6 +14,8 @@ MACRO(bool, Boolean, __VA_ARGS__) \
1314
MACRO(int32, Integer32, __VA_ARGS__) \
1415
MACRO(float, Float, __VA_ARGS__) \
1516
MACRO(double, Double, __VA_ARGS__) \
17+
MACRO(double, DoubleAbs, __VA_ARGS__) \
18+
MACRO(double, Double01, __VA_ARGS__) \
1619
MACRO(FVector2D, Vector2, __VA_ARGS__) \
1720
MACRO(FVector, Vector, __VA_ARGS__) \
1821
MACRO(FVector, Direction, __VA_ARGS__) \
@@ -22,8 +25,13 @@ MACRO(FTransform, Transform, __VA_ARGS__) \
2225
MACRO(FString, String, __VA_ARGS__) \
2326
MACRO(FName, Name, __VA_ARGS__)
2427

25-
#define PCGEX_TPL_SHORTHAND_NAME(_TYPE, _NAME, ...) PCGEX_SETTING_VALUE_IMPL(FPCGExInputShorthandName##_NAME, , _TYPE, Input, Attribute, Constant)
26-
#define PCGEX_TPL_SHORTHAND_SELECTOR(_TYPE, _NAME, ...) PCGEX_SETTING_VALUE_IMPL(FPCGExInputShorthandSelector##_NAME, , _TYPE, Input, Attribute, Constant)
28+
#define PCGEX_TPL_SHORTHAND_NAME(_TYPE, _NAME, ...)\
29+
PCGEX_SETTING_VALUE_IMPL(FPCGExInputShorthandName##_NAME, , _TYPE, Input, Attribute, Constant)\
30+
bool FPCGExInputShorthandName##_NAME::TryReadDataValue(const TSharedPtr<PCGExData::FPointIO>& IO, _TYPE& OutValue, const bool bQuiet) const{return PCGExDataHelpers::TryGetSettingDataValue(IO, Input, Attribute, Constant, OutValue, bQuiet);}
31+
32+
#define PCGEX_TPL_SHORTHAND_SELECTOR(_TYPE, _NAME, ...)\
33+
PCGEX_SETTING_VALUE_IMPL(FPCGExInputShorthandSelector##_NAME, , _TYPE, Input, Attribute, Constant)\
34+
bool FPCGExInputShorthandSelector##_NAME::TryReadDataValue(const TSharedPtr<PCGExData::FPointIO>& IO, _TYPE& OutValue, const bool bQuiet) const{return PCGExDataHelpers::TryGetSettingDataValue(IO, Input, Attribute, Constant, OutValue, bQuiet);}
2735

2836
PCGEX_FOREACH_INPUT_SHORTHAND(PCGEX_TPL_SHORTHAND_NAME)
2937
PCGEX_FOREACH_INPUT_SHORTHAND(PCGEX_TPL_SHORTHAND_SELECTOR)

Source/PCGExtendedToolkit/Private/Paths/PCGExPathResample.cpp

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,30 @@
55

66
#include "PCGExRandom.h"
77
#include "Data/PCGExPointIO.h"
8+
#include "Details/PCGExVersion.h"
89
#include "Paths/PCGExPaths.h"
910

1011
#define LOCTEXT_NAMESPACE "PCGExResamplePathElement"
1112
#define PCGEX_NAMESPACE ResamplePath
1213

14+
#if WITH_EDITOR
15+
void UPCGExResamplePathSettings::ApplyDeprecationBeforeUpdatePins(UPCGNode* InOutNode, TArray<TObjectPtr<UPCGPin>>& InputPins, TArray<TObjectPtr<UPCGPin>>& OutputPins)
16+
{
17+
Super::ApplyDeprecationBeforeUpdatePins(InOutNode, InputPins, OutputPins);
18+
InOutNode->RenameOutputPin(FName("Resolution"), FName("Constant"));
19+
}
20+
21+
void UPCGExResamplePathSettings::ApplyDeprecation(UPCGNode* InOutNode)
22+
{
23+
PCGEX_UPDATE_TO_DATA_VERSION(1, 71, 3)
24+
{
25+
SampleLength.Constant = Resolution_DEPRECATED;
26+
}
27+
28+
Super::ApplyDeprecation(InOutNode);
29+
}
30+
#endif
31+
1332
PCGEX_INITIALIZE_ELEMENT(ResamplePath)
1433

1534
PCGExData::EIOInit UPCGExResamplePathSettings::GetMainDataInitializationPolicy() const
@@ -76,6 +95,11 @@ namespace PCGExResamplePath
7695

7796
const UPCGBasePointData* InPoints = PointDataFacade->GetIn();
7897

98+
bPreserveLastPoint = Settings->bPreserveLastPoint;
99+
bAutoSampleSize = true;
100+
101+
if (!Settings->SampleLength.TryReadDataValue(PointDataFacade->Source, SampleLength)) { return false; }
102+
79103
Path = MakeShared<PCGExPaths::FPath>(InPoints, 0);
80104
Path->IOIndex = PointDataFacade->Source->IOIndex;
81105
PathLength = Path->AddExtra<PCGExPaths::FPathEdgeLength>(true); // Force compute length
@@ -84,11 +108,12 @@ namespace PCGExResamplePath
84108
{
85109
if (Settings->ResolutionMode == EPCGExResolutionMode::Fixed)
86110
{
87-
NumSamples = Settings->Resolution;
111+
NumSamples = SampleLength;
88112
}
89113
else
90114
{
91-
NumSamples = PCGExMath::TruncateDbl(PathLength->TotalLength / Settings->Resolution, Settings->Truncate);
115+
NumSamples = PCGExMath::TruncateDbl(PathLength->TotalLength / SampleLength, Settings->Truncate);
116+
bAutoSampleSize = Settings->bRedistributeEvenly;
92117
}
93118

94119
if (Path->IsClosedLoop()) { NumSamples++; }
@@ -105,7 +130,11 @@ namespace PCGExResamplePath
105130
NumSamples = PointDataFacade->GetNum();
106131
}
107132

108-
SampleLength = PathLength->TotalLength / static_cast<double>(NumSamples - 1);
133+
if (bAutoSampleSize)
134+
{
135+
bPreserveLastPoint = false;
136+
SampleLength = PathLength->TotalLength / static_cast<double>(NumSamples - 1);
137+
}
109138

110139
Samples.SetNumUninitialized(NumSamples);
111140
bForceSingleThreadedProcessPoints = true;
@@ -171,7 +200,7 @@ namespace PCGExResamplePath
171200
Sample.Distance = TraversedDistance;
172201
}
173202

174-
if (Settings->bPreserveLastPoint && !Path->IsClosedLoop())
203+
if (bPreserveLastPoint && !Path->IsClosedLoop())
175204
{
176205
FPointSample& LastSample = Samples.Last();
177206
LastSample.Start = InTransforms.Num() - 2;
@@ -205,14 +234,14 @@ namespace PCGExResamplePath
205234

206235
TPCGValueRange<FTransform> OutTransforms = PointDataFacade->GetOut()->GetTransformValueRange(false);
207236
TPCGValueRange<int32> OutSeed = PointDataFacade->GetOut()->GetSeedValueRange(false);
208-
237+
209238
if (Settings->Mode == EPCGExResampleMode::Redistribute)
210239
{
211240
PCGEX_SCOPE_LOOP(Index)
212241
{
213242
const FPointSample& Sample = Samples[Index];
214243
OutTransforms[Index].SetLocation(Sample.Location);
215-
if (Settings->bEnsureUniqueSeeds){ OutSeed[Index] = PCGExRandom::ComputeSpatialSeed(Sample.Location); }
244+
if (Settings->bEnsureUniqueSeeds) { OutSeed[Index] = PCGExRandom::ComputeSpatialSeed(Sample.Location); }
216245
}
217246
}
218247
else
@@ -224,7 +253,7 @@ namespace PCGExResamplePath
224253
{
225254
const FPointSample& Sample = Samples[Index];
226255
OutTransforms[Index].SetLocation(Sample.Location);
227-
if (Settings->bEnsureUniqueSeeds){ OutSeed[Index] = PCGExRandom::ComputeSpatialSeed(Sample.Location); }
256+
if (Settings->bEnsureUniqueSeeds) { OutSeed[Index] = PCGExRandom::ComputeSpatialSeed(Sample.Location); }
228257

229258
//if (SourcesRange == 1)
230259
//{

Source/PCGExtendedToolkit/Public/Details/PCGExDetailsInputShorthands.h

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include "Metadata/PCGAttributePropertySelector.h"
1010
#include "PCGExDetailsInputShorthands.generated.h"
1111

12+
namespace PCGExData
13+
{
14+
class FPointIO;
15+
}
16+
1217
USTRUCT(BlueprintType)
1318
struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandBase
1419
{
@@ -29,6 +34,7 @@ struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandBase
2934
FPCGExInputShorthandName##_NAME() = default; \
3035
explicit FPCGExInputShorthandName##_NAME(const FName DefaultName, PCGEX_ATTRIBUTE_TOGGLE_DECL) { Attribute = DefaultName; PCGEX_ATTRIBUTE_TOGGLE } \
3136
FPCGExInputShorthandName##_NAME(const FName DefaultName, const _TYPE DefaultValue, PCGEX_ATTRIBUTE_TOGGLE_DECL){ Attribute = DefaultName; Constant = DefaultValue; PCGEX_ATTRIBUTE_TOGGLE } \
37+
bool TryReadDataValue(const TSharedPtr<PCGExData::FPointIO>& IO, _TYPE& OutValue, const bool bQuiet = false) const;\
3238
PCGEX_SETTING_VALUE_DECL(, _TYPE)
3339

3440
USTRUCT(BlueprintType)
@@ -40,6 +46,7 @@ struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandNameBase : public FPCGExInputS
4046

4147
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable))
4248
FName Attribute = NAME_None;
49+
4350
};
4451

4552
USTRUCT(BlueprintType)
@@ -51,6 +58,7 @@ struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandNameBoolean : public FPCGExInp
5158

5259
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable))
5360
bool Constant = false;
61+
5462
};
5563

5664
USTRUCT(BlueprintType)
@@ -72,7 +80,29 @@ struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandNameDouble : public FPCGExInpu
7280
PCGEX_SHORTHAND_NAME_CTR(Double, double)
7381

7482
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable))
75-
float Constant = 0;
83+
double Constant = 0;
84+
};
85+
86+
USTRUCT(BlueprintType)
87+
struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandNameDoubleAbs : public FPCGExInputShorthandNameBase
88+
{
89+
GENERATED_BODY()
90+
91+
PCGEX_SHORTHAND_NAME_CTR(DoubleAbs, double)
92+
93+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable, ClampMin=0, UIMin=0))
94+
double Constant = 0;
95+
};
96+
97+
USTRUCT(BlueprintType)
98+
struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandNameDouble01 : public FPCGExInputShorthandNameBase
99+
{
100+
GENERATED_BODY()
101+
102+
PCGEX_SHORTHAND_NAME_CTR(Double01, double)
103+
104+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable, ClampMin=0, UIMin=0, ClampMax=0, UIMax=0))
105+
double Constant = 0;
76106
};
77107

78108
USTRUCT(BlueprintType)
@@ -184,6 +214,7 @@ explicit FPCGExInputShorthandSelector##_NAME(const FString& DefaultSelection, PC
184214
explicit FPCGExInputShorthandSelector##_NAME(const FName& DefaultSelection, PCGEX_ATTRIBUTE_TOGGLE_DECL) { Attribute.SetAttributeName(DefaultSelection); PCGEX_ATTRIBUTE_TOGGLE } \
185215
FPCGExInputShorthandSelector##_NAME(const FString& DefaultSelection, const _TYPE DefaultValue, PCGEX_ATTRIBUTE_TOGGLE_DECL){ Attribute.Update(DefaultSelection); Constant = DefaultValue; PCGEX_ATTRIBUTE_TOGGLE } \
186216
FPCGExInputShorthandSelector##_NAME(const FName& DefaultSelection, const _TYPE DefaultValue, PCGEX_ATTRIBUTE_TOGGLE_DECL){ Attribute.Update(DefaultSelection.ToString()); Constant = DefaultValue; PCGEX_ATTRIBUTE_TOGGLE } \
217+
bool TryReadDataValue(const TSharedPtr<PCGExData::FPointIO>& IO, _TYPE& OutValue, const bool bQuiet = false) const;\
187218
PCGEX_SETTING_VALUE_DECL(, _TYPE)
188219

189220
USTRUCT(BlueprintType)
@@ -227,7 +258,29 @@ struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandSelectorDouble : public FPCGEx
227258
PCGEX_SHORTHAND_SELECTOR_CTR(Double, double)
228259

229260
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable))
230-
float Constant = 0;
261+
double Constant = 0;
262+
};
263+
264+
USTRUCT(BlueprintType)
265+
struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandSelectorDoubleAbs : public FPCGExInputShorthandSelectorBase
266+
{
267+
GENERATED_BODY()
268+
269+
PCGEX_SHORTHAND_SELECTOR_CTR(DoubleAbs, double)
270+
271+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable, ClampMin=0, UIMin=0))
272+
double Constant = 0;
273+
};
274+
275+
USTRUCT(BlueprintType)
276+
struct PCGEXTENDEDTOOLKIT_API FPCGExInputShorthandSelectorDouble01 : public FPCGExInputShorthandSelectorBase
277+
{
278+
GENERATED_BODY()
279+
280+
PCGEX_SHORTHAND_SELECTOR_CTR(Double01, double)
281+
282+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable, ClampMin=0, UIMin=0, ClampMax=0, UIMax=0))
283+
double Constant = 0;
231284
};
232285

233286
USTRUCT(BlueprintType)

Source/PCGExtendedToolkit/Public/Details/PCGExVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ if (PCGEX_VERSION_BOOL(_MAJOR, _MINOR, _PATCH))
1717

1818
namespace PCGExVersion
1919
{
20-
PCGEX_VERSION_DECL_LATEST(1, 71, 2)
20+
PCGEX_VERSION_DECL_LATEST(1, 71, 3)
2121
}

Source/PCGExtendedToolkit/Public/Paths/PCGExPathResample.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "PCGExPathProcessor.h"
99
#include "Data/Blending/PCGExDataBlending.h"
1010
#include "Data/Blending/PCGExMetadataBlender.h"
11+
#include "Details/PCGExDetailsInputShorthands.h"
1112

1213

1314
#include "Shapes/PCGExShapes.h"
@@ -38,6 +39,8 @@ class UPCGExResamplePathSettings : public UPCGExPathProcessorSettings
3839
public:
3940
//~Begin UPCGSettings
4041
#if WITH_EDITOR
42+
virtual void ApplyDeprecationBeforeUpdatePins(UPCGNode* InOutNode, TArray<TObjectPtr<UPCGPin>>& InputPins, TArray<TObjectPtr<UPCGPin>>& OutputPins) override;
43+
virtual void ApplyDeprecation(UPCGNode* InOutNode) override;
4144
PCGEX_NODE_INFOS(ResamplePath, "Path : Resample", "Resample path to enforce equally spaced points.");
4245
#endif
4346

@@ -54,16 +57,23 @@ class UPCGExResamplePathSettings : public UPCGExPathProcessorSettings
5457

5558
/** */
5659
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta=(PCG_Overridable, EditCondition="Mode == EPCGExResampleMode::Sweep"))
57-
bool bPreserveLastPoint = true;
60+
bool bRedistributeEvenly = true;
61+
62+
/** */
63+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta=(PCG_Overridable, EditCondition="!bRedistributeEvenly && Mode == EPCGExResampleMode::Sweep"))
64+
bool bPreserveLastPoint = false;
5865

5966
/** Resolution mode */
6067
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_NotOverridable, EditCondition="Mode == EPCGExResampleMode::Sweep"))
6168
EPCGExResolutionMode ResolutionMode = EPCGExResolutionMode::Distance;
6269

63-
/** Resolution Constant. */
64-
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta=(PCG_Overridable, EditCondition="Mode == EPCGExResampleMode::Sweep", EditConditionHides, ClampMin=0))
65-
double Resolution = 10;
66-
70+
UPROPERTY()
71+
double Resolution_DEPRECATED = 10;
72+
73+
/** Resolution */
74+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta=(PCG_Overridable, DisplayName="Resolution", EditCondition="Mode == EPCGExResampleMode::Sweep", EditConditionHides))
75+
FPCGExInputShorthandNameDoubleAbs SampleLength = FPCGExInputShorthandNameDoubleAbs(NAME_None, Resolution_DEPRECATED, false);
76+
6777
/** */
6878
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings, meta = (PCG_Overridable, EditCondition="Mode == EPCGExResampleMode::Sweep", EditConditionHides))
6979
EPCGExTruncateMode Truncate = EPCGExTruncateMode::Round;
@@ -106,6 +116,8 @@ namespace PCGExResamplePath
106116

107117
class FProcessor final : public PCGExPointsMT::TProcessor<FPCGExResamplePathContext, UPCGExResamplePathSettings>
108118
{
119+
bool bPreserveLastPoint = false;
120+
bool bAutoSampleSize = false;
109121
int32 NumSamples = 0;
110122
double SampleLength = 0;
111123
TArray<FPointSample> Samples;

0 commit comments

Comments
 (0)