I'm bombing this thread with questions.
When editing a plugin, land textures are not shown on land textures table. How should the user select texture brushes in plugins? Is command CSMWorld::ImportLandTexturesCommand related to that - essentially, does user need to click somewhere to import land textures for use?
edit: I was able to create a plugin that alters land textures. I created two new textures, pointed them to random Morrowind texture filenames, and chose texture with id 1 and painted all over with that (I knew index 1 would be translated to 0 because texture indexing reserves 0 for default texture). Game log says "cant miss texture this and that, using default texture". That is probably because altered cells try to load textures from plugin, and as there are none, it reverts back to default. It's pretty much expected result. I wonder what's the correct way to do handle landtexture-data in plugins though? E.g. should opencs go through modified texture grid's and then copy all land textures not specified by user from morrowind.esm, or is it okay to have this "Unable to find land texture index" error behavior, or is it "modders responsibility" to do whatever they wish with the data?
1. Transient changes: For example if we deform a piece of terrain via a drag operation these changes are not translated into changed content data directly. That only happens when the user releases the mouse button and the drag ends.
Unfortunately our terrain component does not support this function and there is no way around that. Bypassing the command interface by making direct changes to the terrain data during the drag would break things horribly.
There are two possible solutions:
a) Work with a copy of the terrain data. Not very memory efficient, but it should get the job done.
b) Implement some kind of layer between the terrain data and the terrain renderer that inserts the transient changes without actually touching the terrain data.
Texture editing new game based on Morrowind seems to work fine even through straight data editing, bypassing command system. Obviously this should go through command system, and through direct data editing there's the issue with drag-like painting, when every drag-event would need to have an undo, and one stroke would likely result in something like dozens of undo-events. Working with a copy is possible, but without the layer, painted terrain won't be rendered until the drag is finished. For alpha version, I think this might be tolerable (I'd be happy if something like this was available in 0.44), but are there also other things hidden behind the data layers that I'm not picking up?
edit: Hmm.. mBase and mModified. With one file it's all the same, but more than one file.. hmm..
Below is a screenshot from Seyda Neen. There's one texture that fails in both opencs and openmw: textures/tx_lavacrust00.dds (86 as brush, it's probably 85 by real id number). Other textures work fine.
https://imgur.com/i7DEWnD
Here's an early PR for feedback.
https://github.com/OpenMW/openmw/pull/1680
edit: Here's what the PR does,
https://youtu.be/caN1x3Mdy7Y?t=23s