Render through python command wait until shaders have been compiled

Hi,
We are wanting to render a level sequence through a command but have that command wait until all the shaders have been complied. What would be the best way to do this? We are using game mode to render.

Should we simply be using a derived data cache? Or is there another way?

I can’t help you with pyton, but it sounds like it is all possible with just the commandline! Have look in the wiki A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums and in the docs https://docs.unrealengine.com/en-US/Engine/Sequencer/Workflow/RenderingCmdLine/index.html
to filling up the derived data cache use “UE4Editor.exe ProjectName -run=DerivedDataCache -fill” - I guess if you daisy chain those to commands it makes what you want.

ot, would be curious how your game mode looks like when you use it for render

Hi Andoh,
Thanks for the tips. We had run the -fill and had the derived data cache set but still the shaders needed to compile. I’m thinking that having the -fill command run before every render might guarantee that it always works.

yes that sounds strange. normally shaders compile once, not every time you load the project. if it recompiles every time at your side something is wrong. do you have any logs? (Project/saved/logs folder)

The following commands should do the trick

unreal.MaterialEditingLibrary.update_material_instance(unreal.EditorAssetLibrary.load_asset('some/path/mat_inst_const.mat_inst_const'))
unreal.MaterialEditingLibrary.update_material_function(unreal.EditorAssetLibrary.load_asset('some/path/mat_func.mat_func'))

My experience is; in order for the above code to take effect… the following command also also needs to be called.

unreal.EditorAssetLibrary.save_loaded_asset(loaded_asset)

which the above seems to be pointless.