tonihele / OpenKeeper

Dungeon Keeper II remake
GNU General Public License v3.0
428 stars 41 forks source link

provide option to load models from KMFs directly #429

Open Trass3r opened 1 year ago

Trass3r commented 1 year ago

https://github.com/tonihele/OpenKeeper/pull/409#discussion_r917633682 https://github.com/tonihele/OpenKeeper/pull/409#discussion_r917675108

The ModelViewer class already does this when directly given a kmf file: https://github.com/tonihele/OpenKeeper/blob/d21dd2a154efed71a1e90393ad88ce8c4a975ac8/src/toniarts/openkeeper/tools/modelviewer/ModelViewer.java#L259-L265 But not when loading from the list of models. Would also be helpful for development to skip the whole conversion process on every iteration.

Trass3r commented 8 months ago

@tonihele Maybe it should simply fall back to loading the KMF if the converted model is missing (and the cache is considered to be "up-to-date"). That would allow deleting them locally for faster iteration on the implementation.

One could also allow other model formats like gltf with the same model basename. That would be more useful for asset replacement than .j3o for the reasons laid out in https://github.com/tonihele/OpenKeeper/pull/409#discussion_r917633682. Should probably be combined with a kmf->gltf exporter. The .j3o is not useful in general it seems. Also when it comes to speeding up the loading.