Live Update Refresh Assets In Play Mode - 2.02.20

I currently have a workflow where i edit assets and render them directly into the fmod assets folder so that i can test and edit them while the game is running. Currently I have Refresh Modified Assets assigned to a hotkey so i can quickly refresh the modified assets and have them update in the game, however, I seem to have to select the modified assets directly and Right Click > Refresh Selected Assets for this to actually work.

This feels like a bug to me but im not sure if this is by design. I would imagine that Refresh Modified Assets would automatically detect when these files are rerendered into the project. Im also currently on Studio v2.02.20 in Unity but im looking at upgrating to 2.03 soon. Has this been fixed in 2.03? And if not am i doing something wrong?

Just to clarify, is the issue that the modified assets are only sent to the game via Live Update when you do Right Click → Refresh Selected Assets, and not when you use File → Refresh Modified Assets?

Yeah that’s right

Unfortunately, I haven’t been able to reproduce the issue with either 2.02.20 or 2.02.22 - I’m able to refresh edited assets and have them hotswap via Live Update using File → Refresh Modified Assets without any problems.

Can I get you to provide a short list of steps (including how you’ve hotkeyed refreshing assets) that reproduce the issue for you, as well as what file format you’re using when you experience the issue?

Heya, sure thing Leah!

I can reproduce it in my project 100% of the time where i have Live Update enabled with the Unity project in playmode.

  • Change asset in Reaper and render out into fmod project assets folder, overwriting the existing asset.
  • Use hotkey Ctrl+R to call File > Refresh Modified Assets (which i know works in FMOD Studio normally outside of Live Update) - this also doesnt work for me when pressing the button with the mouse manually either.
  • Note that the audio event sound hasnt changed in-game (testing with a simple click and swapping it with a distinct beep)
  • Proceed to select the asset(s) in the Assets Browser, then Right Click > Refresh Selected Assets
  • Note that the audio event sound has now updated in-game.

Here’s a screenshot of the hotkey being assigned properly.
image

If it’s helpful at all my hunch is that potentially the assets that are being overwritten arent being detected as having been modified by Studio? It may also be relevant that the duration of the audio file isnt changing when modifying the asset, simply the audio content within it - im not sure what parameters Studio looks for to detect that an asset has been modified.

Thanks for the detailed repro steps - I’ve been able to reproduce the issue on my end, and I’ve passed it along to the development team for further investigation.

As a workaround, you can use the following script to iterate over all of your assets, and do the scripting API equivalent of executing Right Click → Refresh Selected Assets:

studio.menu.addMenuItem({
    name: "Force Refresh All Assets",
    keySequence: "Ctrl+R",
    execute: function() {
        console.log("Forcibly refreshing all assets");
        studio.project.workspace.masterAssetFolder.assets.forEach(function(asset) {
		    if (asset.isOfExactType("AudioFile")) {
			    asset.refreshAudio();
		    }
	    });
    }
});

Add it to a .js file in a Studio script directory (either in your Studio install’s “./scripts” directory, or in a “Scripts” folder in your project’s directory. It’s set up to execute on Ctrl+R, so if you unbind the existing shortcut, you should be able to follow the same workflow you’ve been using already.

1 Like

Fab im glad that it was reproable on your end too and it’s not just me.

Thanks very much for the workaround too, that’ll be very handy for saving time!