Hello community,
I’m trying to modify one of already existing bluprint function library. The porpose is to add new parametr to the function.
I work with CreateGridMeshTriangles from ProceduralMeshComponent library. I use UE4 4.13.0.
Link to the function node (Create Grid Mesh Triangles | Unreal Engine Documentation)
&stc=1&d=1477051368
Here is the original code defenition of it:
UKismetProceduralMeshLibrary.h
UFUNCTION(BlueprintCallable, Category = "Components|ProceduralMesh")
static void CreateGridMeshTriangles(int32 NumX, int32 NumY, bool bWinding, TArray<int32>& Triangles);
UKismetProceduralMeshLibrary.cpp
void UKismetProceduralMeshLibrary::CreateGridMeshTriangles(int32 NumX, int32 NumY, bool bWinding, TArray<int32>& Triangles)
{
Triangles.Reset();
if (NumX >= 2 && NumY >= 2)
{
// Build Quads
for (int XIdx = 0; XIdx < NumX - 1; XIdx++)
{
for (int YIdx = 0; YIdx < NumY - 1; YIdx++)
{
const int32 I0 = (XIdx + 0)*NumY + (YIdx + 0);
const int32 I1 = (XIdx + 1)*NumY + (YIdx + 0);
const int32 I2 = (XIdx + 1)*NumY + (YIdx + 1);
const int32 I3 = (XIdx + 0)*NumY + (YIdx + 1);
if (bWinding)
{
ConvertQuadToTriangles(Triangles, I0, I1, I2, I3);
}
else
{
ConvertQuadToTriangles(Triangles, I0, I3, I2, I1);
}
}
}
}
}
KismetProceduralMeshLibrary.generated.h (i don’t for what it’s need, but anyway for any reason)
DECLARE_FUNCTION(execCreateGridMeshTriangles) \
{ \
P_GET_PROPERTY(UIntProperty,Z_Param_NumX); \
P_GET_PROPERTY(UIntProperty,Z_Param_NumY); \
P_GET_UBOOL(Z_Param_bWinding); \
P_GET_TARRAY_REF(int32,Z_Param_Out_Triangles); \
P_FINISH; \
P_NATIVE_BEGIN; \
UKismetProceduralMeshLibrary::CreateGridMeshTriangles(Z_Param_NumX,Z_Param_NumY,Z_Param_bWinding,Z_Param_Out_Triangles); \
P_NATIVE_END; \
} \
I want to add one more input parametr to it (bRegular here):
UFUNCTION(BlueprintCallable, Category = "Components|ProceduralMesh")
static void CreateGridMeshTriangles(int32 NumX, int32 NumY, bool bWinding,** bool bRegular,** TArray<int32>& Triangles);
I already try it by my own, I’ve change all of the following code, but as you can understand with no result in UE4 Editor.
Is anybody know why my changes doesn’t works, Or how to make this works, please help!!
With Respect,
MisaGu