Page 1 of 2

Feature Discussion: Reload Data Files

Posted: 14 Aug 2017, 19:13
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?

Re: Feature Discussion: Reload Data Files

Posted: 14 Aug 2017, 19:44
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.

Re: Feature Discussion: Reload Data Files

Posted: 15 Aug 2017, 10:24
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.

Re: Feature Discussion: Reload Data Files

Posted: 15 Aug 2017, 13:58
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.

Re: Feature Discussion: Reload Data Files

Posted: 15 Aug 2017, 15:51
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?

Re: Feature Discussion: Reload Data Files

Posted: 15 Aug 2017, 19:28
by DestinedToDie
Now that I think of it, it makes more sense for it to be in Assets-> Reload

Re: Feature Discussion: Reload Data Files

Posted: 22 Aug 2017, 23:29
by aesylwinn
The feature has now been merged into master.

Re: Feature Discussion: Reload Data Files

Posted: 23 Aug 2017, 11:42
by DestinedToDie
Awesome. I need to try this out next time I download a nightly.

Re: Feature Discussion: Reload Data Files

Posted: 24 Aug 2017, 20:28
by Lamoot
That was fast, I hope to find time this weekend to test it out.

Re: Feature Discussion: Reload Data Files

Posted: 26 Aug 2017, 15:21
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.