Feature Discussion: Reload Data Files

Involved development of the OpenMW construction set.
aesylwinn
Posts: 243
Joined: 14 Dec 2015, 20:30

Feature Discussion: Reload Data Files

Post by aesylwinn »

I was thinking of working on feature#3530, which involves reloading asset files when they are added or modified. This feature, as mentioned in the request, can be implemented several ways.

1. Track changes to the underlying files, and reload them as necessary.

This would be easiest for the user assuming it could be done. However, there may be some issues with implementing it, especially since it is platform dependent. Some minor research shows there is a Qt class for this purpose called QFileSystemWatcher. However, that page mentions limitations on the number of files being watched, which in my opinion is unacceptable.

2. Allow the user to manually reload asset files.

This isn't nearly as user friendly, but it should work. The downside is that it may take a while to process. This could potentially be accelerated using timestamps.

Your thoughts and opinions?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Feature Discussion: Reload Data Files

Post by DestinedToDie »

The legend is back!

I think manual reload is fine. Something like File->Reload Assets. Tracking assets would probably be a little too intense and from the sound of it too over-complicated implement for the small payoff in comfort.
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Feature Discussion: Reload Data Files

Post by Lamoot »

The main requirement I see for reloading assets is that it's fast enough for iteration.

Let's say you're concepting and still exploring how an asset should look, or you forgot a certain setting when exporting. In both cases, you go back to the asset creation app, do the changes, and you're interested in seeing the result in the editor with as little delay as possible.

Automatic reloading of assets is nice, but doing it manually isn't bad either (even more so if automatic reloading takes longer to import the changed asset). Manual reloading can be streamlined by adding an easily accesible button and definitelly with a shortcut key.

Thank you for considering implementing this feature.
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Feature Discussion: Reload Data Files

Post by lysol »

I am also in favor of having a manual reload button. Not having a button for it could be frustrating if you don't know if the editor has imported the new data file yet or not.
aesylwinn
Posts: 243
Joined: 14 Dec 2015, 20:30

Re: Feature Discussion: Reload Data Files

Post by aesylwinn »

Those were some excellent arguments. Manual reloading it is!
DestinedToDie wrote: 14 Aug 2017, 19:44 Something like File->Reload Assets.
A good idea. I was considering a context menu, but this is much better. Would File->Reload Assets be more intuitive than Assets->Reload though?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Feature Discussion: Reload Data Files

Post by DestinedToDie »

Now that I think of it, it makes more sense for it to be in Assets-> Reload
aesylwinn
Posts: 243
Joined: 14 Dec 2015, 20:30

Re: Feature Discussion: Reload Data Files

Post by aesylwinn »

The feature has now been merged into master.
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Feature Discussion: Reload Data Files

Post by DestinedToDie »

Awesome. I need to try this out next time I download a nightly.
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Feature Discussion: Reload Data Files

Post by Lamoot »

That was fast, I hope to find time this weekend to test it out.
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Feature Discussion: Reload Data Files

Post by Lamoot »

And found time I did.

Reloading works fine here, single or multiple assets get updated through the menu entry or via the shortcut key. For comparison, reloading takes around 6 seconds, while closing and opening OpenMW-CS everytime (along with setting the window layout from before) takes around 30 seconds.

I wonder though, is there a way to further speed up reloading? I've tested with a few simple meshes and 6 seconds (on an admitedly older laptop, on windows) still feels longer than desired.

In any case it's a definite workflow improvement, thank you for implementing it.
Post Reply