codecat / godot-tbloader

TrenchBroom Loader for Godot 4. (Alternative to Qodot)
MIT License
240 stars 30 forks source link

feat(builder): should be able to set a custom textures path #44

Closed Levrault closed 1 year ago

Levrault commented 1 year ago

Proposal

Hi,

I never use tbloader or TrenchBroom before this morning and I barely coded in c++ in the last 12 years.

But this seems like exactly what I needed for my projects. The only con (after 1h of use) was the static res::textures/ folder path. So I made a quick edit to setup a custom textures path.

This should also close the following issue https://github.com/codecat/godot-tbloader/issues/41.

Trenchboom config

image image

Workflow

https://user-images.githubusercontent.com/1162446/203404239-9f63fc37-29fe-46cc-a423-5fae73c2d503.mp4

codecat commented 1 year ago

Thanks for the PR! I think you should be using m_loader->m_texture_path instead of passing the path to all the relevant functions in the Builder class. (texture_path, material_path, material_from_name)

Otherwise this looks good!

Levrault commented 1 year ago

Thanks! I was too shy to edit the static function 😅 Should be good now

codecat commented 1 year ago

I didn't realize they were static actually 😅 changing them to not be static is the right call though. 👍

codecat commented 1 year ago

Thank you! 🎉