This changes the two tangent-related files in BKE to C++ in preparation for the C++ Mikktspace port in D15589.
For now, they still use the original Mikktspace.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- tangent-cpp (branched from master)
- Build Status
Buildable 23278 Build 23278: arc lint + arc unit
Event Timeline
Please follow the patch submission guidelines: https://wiki.blender.org/wiki/Process/Contributing_Code#Guidelines specifically the description section of it.
It might also be good idea to use buildbot to verify such changes which deeply affect the build process are fine on all platforms.
| source/blender/blenkernel/intern/editmesh_tangent.cc | ||
|---|---|---|
| 246 | Not sure why initialization from NULL got replaced with 0. I'd imagine it would be something SMikkTSpaceContext sContext = {nullptr};, or, even SMikkTSpaceContext sContext = {};, | |
| 394 | Clang gives the following error: editmesh_tangent.cc:394:34: error: static_cast from 'struct BMLoop *(*)[3]' to 'const BMLoop *(*)[3]' is not allowed | |
| source/blender/blenkernel/intern/editmesh_tangent.cc | ||
|---|---|---|
| 246 | My logic was that {nullptr} is misleading since this doesn't really have anything to do with pointers, we're just zero-initializing the object. The structs in question come from Mikktspace, so I can't just do the clean thing and add default values to the entries. For now until D15589 is done, explicitly setting all elements is good enough, there's only one that wasn't set already anyways. | |
| source/blender/blenkernel/intern/editmesh_tangent.cc | ||
|---|---|---|
| 246–248 | SMikkTSpaceContext sContext{};
SMikkTSpaceInterface sInterface{}; | |
The const_cast compilation error is still there on Linux: https://builder.blender.org/admin/#/builders/136/builds/17
Might be caused by an older GCC used in the release environment since I am unable to reproduce the issue locally.
Replaced the const_cast with a C-style cast, seems to work in source/blender/blenkernel/intern/bvhutils.cc so I'm hopeful.
I'll poke Buildbot.
Here's the buildbot run for completeness: https://builder.blender.org/admin/#/builders/136/builds/20