Some bit of code I have written in UE4, causes it to freeze when compile thus I have to exit though process manager, and whenever I try to reload the project it freezes at initialisation of 70%.
Solution:
Delete ProjectDir/Binaries
Delete ProjectDir/Intermediate/Build
Comment out the line of offending code (good luck tracking it down)
Reopen the project in UE4, click Yes to rebuild DLLs. If you commented out the offending line, it will build and open the project.
My offending code line is:
CreateNbyMWeldedCubeGridMesh(Vertices, Triangles, 100, 100, 10, 1, 5);
Where the function prototype is:
CreateNbyMWeldedCubeGridMesh(TArray<FVector>* vertices, TArray<int32>* Triangles, float XSize, float YSize, float ZSize, int N, int M)
And the input variables are:
Vertices = new TArray<FVector>();
Triangles = new TArray<int32>();
NB: Every runs fine, I just need to comment out the offending line. Now to work out why this is happening...
____________
My Quest to fix this:
TArray<FVector> v_test = TArray<FVector>();
TArray<int32> t_test = TArray<int32>();
CreateNbyMWeldedCubeGridMesh(&v_test, &t_test, 100, 100, 10, 1, 5);
Another fail...
Changing the function prototype to use class variables i.e. parameter reduction:
CreateNbyMWeldedCubeGridMesh(float XSize, float YSize, float ZSize, int N, int M)
CreateNbyMWeldedCubeGridMesh(100, 100, 10, 1, 5);
Fail...
Renaming function:
CreateCubeGridMesh(100, 100, 10, 1, 5);
Fail...
Commenting it out to check it still works (Yep it does)
Commenting out the function body so it's empty (Works)
Gave up and re-wrote the function differently....
Tidak ada komentar:
Posting Komentar