c-d-a / io_export_qmap

.map exporter for Blender
GNU General Public License v3.0
84 stars 18 forks source link

Support for DarkRadiant layers #10

Closed motorsep closed 1 year ago

motorsep commented 1 year ago

I probably overstayed your welcome with all these reports 😅 , but, would it be possible to add support for DarkRadiant layers (using maybe Collections) ?

c-d-a commented 1 year ago

DR layer information is stored externally in .darkradiant file and depends on the order of brushes & entities. So this can't be generalized for other editors and even if it could be, it could interfere with pasting from clipboard. I'm also already using collections for entity (bmodel) grouping in brush mode. Since in DR a brush can belong to multiple layers independently of its parent entity, Blender's view layers could be used instead of collections.

I don't think something this specific belongs in the main addon. Seems simple enough to implement, so I can make a separate unmaintained branch with the feature. Probably not until Sunday though. I'm fine with suggestions/reports, but I'll tell you right away that DR's xml clipboard is out of the question, unless someone comes by with a pull request.

motorsep commented 1 year ago

Oh, I was thinking about organizing scene in Blender using collections and then when I export it to DR, each Collection with its meshes will become a layer. So when I load .map into DR, I won't have a mess. Since .map can't be loaded back to Blender, I don't think it's relevant how each brush can be in every layer.

Blender's layers could be used, but aren't they are limited to only so many?

c-d-a commented 1 year ago

Added in https://github.com/c-d-a/io_export_qmap/commit/7e62fc7da7ca170dc24257107aa16b9eeca9618d as a branch

https://user-images.githubusercontent.com/55441216/212625547-b49954c0-3d93-4654-89a5-925d73b0db1b.mp4

The terminology is a bit weird, what's now called "collections" used to be "layers" in pre-2.8 Blender. And what's now called "view layers" used to be "render layers" (I think). Both used to be limited in number, but not anymore. Anyway, like I said, I'm already using collections for grouping (such as grouping the house and chimney brushes into one entity in the video above).