Blender Git Loki

Git Commits -> Revision 350e783

September 15, 2021, 21:56 (GMT)
Add skeletal beginnings of C++ sculpt refactor
design study (note that it's #ifdef'd out).

Basic idea is to put all the sculpt brush code
in a single large template. This template
takes a PBVH adaptor class (of which there
would be three, one per PBVH_XXX type)
as a template argument.

Basically we're using the compiler to generate
three complete copies of every brush implementation.
C++20 concepts are used to validate the pbvh classes.

An example brush implementation:

pbvh->forVertsInRange(
{
.brush = ss->cache->brush,
.radius = radius,
.use_threads = true,
.use_original = false
},

[&offset](auto viter, int node_i, void *userdata) {
//add offset to vertex coordinates

madd_v3_v3fl(viter.co, offset, viter.fade);
},

[](PBVHNode *node, int node_i, void *userdata) {
BKE_pbvh_node_mark_update(node);
});

Commit Details:

Full Hash: 350e783668d67592472246bc43e71693b1080820
Parent Commit: 0b2aee5
Lines Changed: +497, -0

2 Added Paths:

/source/blender/editors/sculpt_paint/sculpt.cc (+20, -0) (View)
/source/blender/editors/sculpt_paint/sculpt.hh (+474, -0) (View)

1 Modified Path:

/source/blender/editors/sculpt_paint/CMakeLists.txt (+3, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021