Change HDRI cubemap on the fly

Hi all,
I am trying to take multiple automated snapshots of mesh assets with different HDRI backdrops in the background.
I did not manage to find a way to switch the cubemap of my backdrop actor into a different one in mid-game.
Tried both of the available functions shown in the snapshot, but both do nothing at all. The name is printed when I press F so I know that the flow does work.
What am I missing here? Is there another function or maybe a re-initialization to be done after switching the asset?
Many thanks,
Tim

1 Like

I don’t know how you’re doing the HDR, but if you use the UE plugin, you can change it like this:

PS: You didn’t leave any pictures.

EDIT: I take that back, it doesn’t work…

This forum has always been super weird. I did leave a comment after the questions but it seems to have disappeared…

I think the only way you can get it to work is preconfigure a bunch of skies, and spawn them one after another ( destroy the old one ).

Thanks, what I did was put a few of them in the world and toggle their “visible” or “hidden in game” depending on the script. just seemed like the wrong way to go about.

To anyone encountering this in the future, I have found the solution.
When I saw that the same issue arises when rotating the HDRI, I opened up the HDRI BP and looked at the constructor.
Apparently, there is an additional “post edit” step needed to be done, see attachment.

9 Likes

Ah, I was missing the Create Material node. Thanks!

1 Like

Can you please share your blueprint code here? I’m still not able to change hdri background. It show the error trying to read “hdri variable’s” property and found none.