c-d-a / io_export_qmap

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

Feature Request - Structural vs Detail Brushes from VertexGroups #4

Closed MoritzJT closed 1 year ago

MoritzJT commented 2 years ago

Would it be feasible to use vertex groups to assign detail vs structural to the exported brushwork in face export mode?

Would require splitting all faces into tris prior to this and hoping the vertex group assignments still cary over in this process.

Paired with https://github.com/SomaZ/Blender_BSP_Importer this tool would be very handy in slowly carrying over the idtech3 toolkits to Blender.

c-d-a commented 2 years ago

Initial thoughts: vertex groups seem totally counter-intuitive for the task. They need extra steps to modify and need splitting to work per-face. Even vertex colors would be better. I have not tried the linked addon yet though, maybe it makes sense somehow.

I've had another idea for this that seems more flexible: when exporting as faces, group all faces belonging to an object as a brush entity based on the object's name. So e.g. "func_detail" and "func_detail.003" become separate func_detail entities, while "worldspawn" and "worldspawn.001" remain ungrouped. Should be trivial to implement, but there's a good chance it's going to break some editor compatibility. No promises yet. If I end up doing it my way, there's probably a way to split and rename objects based on their vertex groups, so interoperability with that plugin is still possible (again, haven't tied it yet).

MoritzJT commented 1 year ago

Nearly a year has passed since I checked this place, sorry for the long delay.

Maybe using attributes would be an option?

c-d-a commented 1 year ago

The delay is on me, of course. Back when I wrote the reply, I didn't know how idtech3 handles detail. I'll try to get around to updating the addon next week, the plan is: bmodel grouping, extrusion option, some basic idtech3 & idtech4 support, Radiant clipboard, and maybe some barebones light entity export.

I still haven't looked at your linked addon, but my understanding is that your mention of it wasn't specific to handling detail brushes.

c-d-a commented 1 year ago

I have added the Q2/Q3 flag format in https://github.com/c-d-a/io_export_qmap/commit/43904401adc861a85c6973c63264bf95fbadb5ac Currently, the exporter will assign the detail flag to faces that belong to objects or collections with "detail" in their name.

I could also add per-face detail flagging through Face Maps (essentially Vertex Groups but for faces). Same logic: faces belonging to a face map with "detail" in name get flagged. But I'm unconvinced that it would be very useful, splitting details off seems easier and allows quick preview through the outliner. For now I'm closing this, let me know if face maps would be preferrable over the current implementation.

c-d-a commented 1 year ago

Ended up adding detail by face maps anyway.