Age | Commit message (Collapse) | Author |
|
Reference struct members by name instead relying on their order.
This also simplifies moving back to named members when all compilers
we use support them.
|
|
|
|
Because mesh vertex and face normals are just derived data, they can
be calculated lazily instead of eagerly. Often normal calculation is
a relatively expensive task, and the calculation is often redundant
if the mesh is deformed afterwards anyway.
Instead, normals should be calculated only when they are needed. This
commit moves in that direction by adding a new function to tag a mesh's
normals dirty and replacing normal calculation with it in some places.
Differential Revision: https://developer.blender.org/D12107
|
|
This commit uses OpenVDB more directly for the voxel remesher, without
the extra indirection of copying to a Blender API. This makes the code
simpler, shorter, and easier to understand (though I didn't observe any
performance improvement).
This also removes the rest of the unused and undocumented OpenVDB C API,
which was written when Blender's code didn't really use C++, and doesn't
serve a purpose anymore. Those features will be implemented as nodes in
the future anyway (see D12100).
Differential Revision: https://developer.blender.org/D12097
|
|
|
|
These functions do not change their source or input mesh, so it can
be passed with const, which means in one case that a function doesn't
have to be responsible for freeing its argument mesh, which is a clearly
better separation of concerns.
|
|
|
|
- Remove BKE prefix for static functions
- Make specific intermediate functions static
- Avoid unecessary "_to_mesh_nomain" suffix
|
|
The Quadriflow remeshing was in the middle of the voxel remesh code.
|
|
- Use `int` instead of `unsigned int` for mesh indices
- Use C++ types (Array, float3, IndexRange)
- Use range based for loops
|
|
This BMesh iterator hadn't been used in C++ code yet, and needed
a macro for a proper cast. The parameter structs need to be initialized
when declared without designated initializers.
|
|
This will be helpful for some cleanups I'd like to do, including
removing the unecessary C API for OpenVDB and unifying some
attribute transfer code.
|