codecat / godot-tbloader

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

Allow the use of `.tres` in addition to `.material` #15

Closed RomualdDub closed 2 years ago

RomualdDub commented 2 years ago

Hello ! It would be cool if materials (.tres) will be loaded instead of image files (.png). Like Qodot does. It's useful, for example, with Material Maker. When the "albedo" have the same name of the Material file. I coded a script which can be attached to the TBLoader node, in your Godot project... Just for testing purpose : https://pastebin.com/uXdSgYYm

codecat commented 2 years ago

If your material is saved with the extension .material (not .tres) it will use the material as per #12. I have been thinking about supporting .tres with this too though, because it is the default in Godot's dialog when creating a new material. 🤔

It's potentially safer to use .material instead of .tres but maybe its type could be checked and a proper error returned if it's not really a material.

RomualdDub commented 2 years ago

My bad, it works fine with ".material" files ! Thank you :)

codecat commented 2 years ago

I'm gonna keep this issue open because I do wanna look into supporting the .tres extension as well 😄

RomualdDub commented 2 years ago

I figured out we can convert .tres to .material using the Save button in Godot :)