Can I set a texture param in a landscape material from a data table?

Title sums it up:

I want to use a universal master material instanced through several levels, and for each instance I want to customize the look of each landscape object using textures generated using data tables.

So far, any attempt at accessing the landscape object ither via the level bp or a free standing actor on the level have not worked. I tried enabling the dynamic material option in details for the landscape, and still no dice.

This is where I’m feeding texture 2d data into each macro for each material category:

This is what each macro does, and somehow I can’t figure out why the landscape material completely ignores it. I tried a version of this in the level blueprint, and still no dice.

The auto material works fine by itself, and I can change the textures manually, but this way I’m going to drive myself insane, which is the point of trying to automate the process using data tables. Any help is appreciated! thanks.

Hello @ExopackVFX how are you?

I think the problem here is that Landscapes in UE5 don’t work the same way as static meshes when it comes to runtime material modifications. Even with “Enable Dynamic Material” checked, landscapes have special restrictions because of how they handle material layers and LODs.

I think your code is ok, but your are probably running it in “Begin Play”, which is not allowed by Landscapes.

You should be able to avoid that issue by moving your code execution to an actor’s Construction Script, making the logic run before the game start.

Let me know if that approach solves the issue or if you need more help!

Thanks BRG, sorry about the delay in responding, but I had to shift my focus onto other modules of my project temporarily.

I tried to create an actor and placed it in world with a similar “portable” version of my blueprint in the actor’s construction script, but it still gets ignored as in the landscape does not change textures when changing the actor’s values in editor. I think that’s along the lines of what you were suggesting, correct?