TrenchBroom icon indicating copy to clipboard operation
TrenchBroom copied to clipboard

Previewing external .map files in editor

Open bstordeur opened this issue 5 years ago • 8 comments

Ericw's qbsp has supported using external .map files via a "misc_external_map" entity for a while now. I'm not sure if this possible (but I think one of you said it was a while back), but it would be really great if when using this entity, we could actually see the contents of the external .map in the currently open map, like if it was a model (so also be able to rotate it).

This would serve as a kind of basic instanced object system, and would alow to place and rotate instanced props much more naturally.

bstordeur avatar Sep 11 '19 20:09 bstordeur

Please!

dumptruckDS avatar Sep 11 '19 21:09 dumptruckDS

Yes, please!

ComradeBeep avatar Sep 11 '19 22:09 ComradeBeep

So basically asking for map browser window like Entity Browser window? I am all for it - this way I can build modular pieces and keep them in the individual .map files, then work on actual master level picking modules from the preview windows.

motorsep avatar Oct 17 '19 01:10 motorsep

No, I'm not asking for a new browser window, just the functionality to see external maps in the viewers rather than just a point entity.

bstordeur avatar Oct 17 '19 06:10 bstordeur

I would absolutely adore this feature.

Zungrysoft avatar Feb 13 '20 20:02 Zungrysoft

It sounds like this would fit nicely into TB as fgd files already provide a way to present bsp files in the map. Just needs some convention on where in the filesystem to load the compiled version dynamically from based on what the entity refers to, and then as a further development adding this prefab directory content to the entity browser so you can just drag in properly configured _external_map's into the map. Perhaps right-click on such an ent provides a way to open a TB session for the corresponding .map.

dsvensson avatar Jan 18 '23 08:01 dsvensson

For reference, adding a misc_external_map description in FGD with the following:

model({    
    "path": {{ _external_map }},    
    "scale": {{ _external_map_scale }}    
})

And setting _external_map on the entity to foo.bsp correctly renders the external asset. This will not compile as qbsp needs that string to be set to foo.map, but that's a smaller issue. Something more relevant is that there doesn't seem to be any way of connecting _external_map_angle(s) to angle(s) such that it dictates the rendered orientation, and interacts with the rotate operation.

dsvensson avatar Jan 18 '23 17:01 dsvensson

See linked PR for a starting point.

dsvensson avatar Jan 22 '23 16:01 dsvensson