[4.6.0 prev] Landscape.h

#include “Landscape/Landscape.h”
does not work anymore. File not found.

I am upgrading from UE 4.5.1 to 4.6.0. and I know 4.6 is only a preview right now but this change seems to be a technical decision.
How am I supposed to get a Landscape Actor pointer without that header?

PS I tried #include "Runtime/Landscape/Classes/Landscape.h" but I cannot compile because no LandscapeProxy.generated.h file can be found.
Is this an issue related to the upgrade or something else?

same issue here

I added Landscape to:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","AIModule","RenderCore","Landscape" });

It seems that Landscape is separated module now.

Thanks. It worked also for me with 4.6.0 release.

#include "Runtime/Landscape/Classes/Landscape.h"

must be used and the new Landscape module included.

@Pierdek If you post your solution as an Answer I’ll accept it.

warning

if you, mystical reader of this comment, you think you are a genius and you tried to copy-paste Landscape (or any other package give you a similar problem) source files from the previous version in order to keep the same path to headers, like I did when I was not knowing what I didn’t try yet, the only thing you’re gonna have is a couple of hours trying to figure out why there are duplicated class names even if you have removed all headers include…
…well, that’s because you forgot to remove that crap from the source.

[just stating here in case someone will have the same very bad idea I had a couple of weeks ago]

I was having this problem trying to figure out a way to get the Landscapes height map.

First I tried using #include "Landscape/Landscape.h" but the library wasn’t found.

Then I added Landscape to the dependency list.

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","AIModule","RenderCore","Landscape" });

Still nothing…

Then when I changed

#include "Landscape/Landscape.h"

to

#include "Runtime/Landscape/Classes/Landscape.h"

the code compiled, and my ALandscape pointer was getting assigned, but I could not access it because of an incomplete class error. I noticed that ALandscape inherits from ALandscapeProxy so I changed:

#include "Runtime/Landscape/Classes/Landscape.h"

to

#include "Runtime/Landscape/Classes/LandscapeProxy.h"
#include "Runtime/Landscape/Classes/Landscape.h"

and it worked. I have so far printed the name of my landscape i’m working with in the output log.


I used the following code to get the Landscape

	UWorld* world = GetWorld();
	ALandscape* landscape = nullptr;
	if (world != nullptr) {
		// Find the active landscape
		TActorIterator<ALandscape> landscapeIterator(world);
		landscape = *landscapeIterator;	
	}
	if (landscape != nullptr)
	{
		FString lsName = landscape->GetName();
		//landscape->LandscapeMaterial->GetName();
		UE_LOG(LogTemp, Warning, TEXT("%s"), *lsName);
	}

Late answer, but hope this helps. Still just barely dabbling in trying learning the Unreal engine.

-Mitch

Thanks man!
This helped me out. =)

Bless you, random developer from distant past. You solved all my struggles.