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!

Hi, I just found this topic and I’m having the same issue with FMOD 2.03.09.

@Leah_FMOD Was this fixed already fixed?

Unfortunately, a fix for this hasn’t been implemented yet. I’ve noted your interest internally.

For now, feel free to give the workaround script I posted earlier in the thread a shot and let me know whether or not it works for you!

Hi, Leah!

I tried the script but unfortunatelly it doesn’t make any difference.. The assets were updated in FMOD but in Unity it was still playing the old one.

Live update is a big deal and not being able to changing assets in real time slows down the process so much. Is there anything else I can try?

Does manually right clicking on the asset in FMOD Studio and selecting “Refresh Selected Assets” cause the asset to update?

Also, FMOD Studio’s file watcher specifically checks for differences in length/format/channel count, not content - are you able to reproduce the issue both when the updated asset has a different format/channel count/length and exactly the same format/channel count/length? Or just one of the two cases?

Hiya Leah,

Sorry to open this back up again, but im trying both the script that worked previously as well as right clicking the assets and refreshing after reimporting the new files during live update in Studio v2.03.10 and it’s not working.

The files are identical in length, format and channels when reimporting which makes sense why it wouldnt detect them, but im lost as to why this has stopped working when it was working fine before. Any ideas would be much appreciated! :slight_smile:

@Leah_FMOD Just bumping this, but also wanted to say that ive also recently found that refreshing all assets is stopping me from being able to play the event containing the refreshed assets in FMOD Studio (unity still plays the old sound fine tho) until i stop live update at which point i can play it in Studio again. However, I do still need to stop Unity’s play mode, rebuild the banks, and then restart Unity play mode to actually update the sounds.

Just to confirm are you reimporting the files by directly overwriting them on disk? Or by dragging them into FMOD Studio? These are two slightly different cases, and the right click → refresh/script methods should only work on the former.

I unfortunately haven’t been able to reproduce this on my end. Could I get you to share a short series of steps that consistently reproduces the issue for you?

@Leah_FMOD Yeah directly overwriting them on disk, then running the refresh all assets script.

As for the repro steps i realised that this was actually in 2.03.09, but the above issue is still present in 2.03.10 too.

  • I have the game running with live update on
  • then overwrite the files by exporting them from reaper directly to the fmod project assets folder
  • then use a keyboard shortcut to run the script to refresh all assets in fmod
  • then test in game to notice the sounds not having updated
  • then finally go back into fmod and try to play an event to test if the sounds in fmod have changed but notice that the event wouldnt play.
    The events specifically were a multi instrument in an action sheet if that’s helpful.