-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Assimp support. #3910
Add Assimp support. #3910
Conversation
Thanks, this looks promising! It currently doesn't build and it needs a bit of work to get it into a mergeable state (style changes and such). Are you up for making such changes yourself? In that case I'd do a proper review and leave comments in the PR. I can also take over and redo the PR myself if you don't to address lots of comments. Oh, and, this depends on #3883, correct? |
Yeah, I'll be looking at this today and see if I can get this fixed.
Nope, my mistake. I only just noticed that commit was accidentally included. |
No worries, git is hard. You're doing a great job and I can help sort out any git history issues before we merge. |
Nice! 👍 |
Alright, I think I've fixed the compile issue.
Thanks, that'd be great. |
#2628 gets solved by this. |
Thank you for the insight into your PR. Looking forward to seeing it merged into main :) |
If in the meantime, IQM support could be added, we're golden. Because for some reason Assimp is just not into it. Then again, for our project we might post our own PR soon enough if you guys are too occupied. No worries. https://github.com/culacant/raylib/blob/1604fa9e475cbfaa1a1fede9d147435548bdf5ef/src/iqml.c |
I'm not sure what the relevance to this PR is? |
My advice would be to make this a separate PR to add .IQM support. My 2 cents though. |
Compile tests should be working now. |
We will. We've already forked TB to do what we got to, of course our schedule is big too but it won't be too long from now. Then it at last has .iqm support :P |
0ec535a
to
50fc69e
Compare
@kduske The compile tests should work now, could you allow them to run, please? |
For some reason the Windows compile seems to be failing to link Assimp. I haven't been able to figure out why from the logs, so I'm gonna try compiling it on Windows myself, but installing QT is going to take ages so this might take a long while. |
Found the link error on Windows: https://stackoverflow.com/questions/64086365/unresolved-external-when-just-adding-an-incomplete-type-in-class-in-header Changing the following in AssimpParser.h fixes it:
|
Thank you so much for the info, I still haven't managed to get TB to compile on Windows so I haven't even been able to try anything myself.
|
Hey, don't worry about all of the conflicts -- I merged a branch that introduces clang-format. Once this branch is ready to merge, it's pretty easy to get it back to a mergeable state. Just let me know when you're ready. |
089c548
to
3bd39a7
Compare
I've finally managed to figure out the problem. I had forgotten to get the Assimp DLL copied at build on Windows. |
Nice! I downloaded the Win64 build from CI, and it's displaying models from Half-Life for me (I'm using the Steam edition). I haven't tested macOS or Linux yet. I'd propose we statically link assimp on Linux. If we don't, our official .rpm/.deb installers are going to have to install our custom (Also, I think we're going the right direction with building our own copy, as opposed to using distro provided copies - as the HL MDL support has only been stabilized in 5.1.0 which is only in prerelease and won't be in distros for a while: see: https://github.com/assimp/assimp/releases ) |
Models were not displaying correctly. Seems like I got some math and some assumptions about Assimp's workings wrong. In any case, it's all fixed now. In my own projects, everything in TB now lines up perfectly with the models in-game. In any case, this is ready for review again. |
This is exciting to see! And looks like it's quite close to being merged. Yay! |
I saw some IQM discussion over here, and I'd like to point out that Garrux added IQM support to Assimp, so any IQM requirements would also get fixed by this. |
Wanted to add another comment of support for merging this PR. 👍 Additionally, does this also successfully load textures from its |
I'm looking at using TB for TFC mapping and would love to see this feature implemented :) |
14b0b31
to
ed511e8
Compare
Maybe you can use this: RobertBeckebans@7bf9e3c |
24d6f10
to
cbff98e
Compare
I have updated the Assimp branch to be even with the master branch. Assimp is now also built with vcpkg, using the work of @RobertBeckebans. One of the MacOS checks is failing for some reason, but everything else seems to work fine. |
Once again, I have updated the Assimp branch to be up to date with |
I think I was finally able to fix the build problem on macOS. Could you rebase onto master one more time? Then it should become green. |
It seems the workflow 'release' routines aren't working. At least they all seem to build okay. |
Hmm, I don't understand this failure at all. It should only attempt to upload release builds when you are pushing a tag. Did you push any tags? |
I did not, as far as I can tell. |
Ok, I have no idea what's wrong with this PR, but it works in my own PR over here: #4048 -- so I will close this one and finalize the commits on the other PR. Hope that's okay with you? |
Sure, though it seems GH says the checks have passed now. |
This PR adds an AssimpParser to Trenchbroom that will load any entity model in a format that Assimp supports if another parser didn't get to import it first.
![image](https://user-images.githubusercontent.com/28099249/141203355-8b5c64b6-9403-4dd3-b69e-54bc85351c9b.png)
assimp
is required as supported model format in the GameConfig.This does not include animation, so all meshes are static.
Assimp supports
mdl
, so that means this includes Half-Life model support.md5mesh
andLWO
are also included, but are untested.Solves #3449.
Helps out #1140.
Solves #719, hopefully.
This code's pretty big and complicated compared to what I usually write so apologies if it's messy.
A fix for #3906 would pair well with this PR as importing 'modern' models will still take a while to do due to building the spatial tree.