Sculpt: Add global automasking propagation steps #117316

Merged
Hans Goudey merged 8 commits from Sean-Kim/blender:102377-auto-masking into main 2024-01-29 15:39:50 +01:00
4 changed files with 8 additions and 27 deletions
Showing only changes of commit 4aed7e3b00 - Show all commits

View File

@ -2667,16 +2667,12 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 14)) {
if (!DNA_struct_member_exists(
fd->filesdna, "Sculpt", "int", "automasking_boundary_edges_propagation_steps"))
{
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Sculpt *sculpt = scene->toolsettings->sculpt;
if (sculpt != nullptr) {
Sculpt default_sculpt = *(DNA_struct_default_get(Sculpt));
sculpt->automasking_boundary_edges_propagation_steps =
default_sculpt.automasking_boundary_edges_propagation_steps;
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Sean-Kim marked this conversation as resolved Outdated

The DNA_struct_member_exists check can be removed here, it should be redundant with the file subversion bump

The `DNA_struct_member_exists` check can be removed here, it should be redundant with the file subversion bump

Whoops, thought I removed this in the previous commit

Whoops, thought I removed this in the previous commit
Sculpt *sculpt = scene->toolsettings->sculpt;
if (sculpt != nullptr) {
Sculpt default_sculpt = *DNA_struct_default_get(Sculpt);
sculpt->automasking_boundary_edges_propagation_steps =
default_sculpt.automasking_boundary_edges_propagation_steps;
}
Sean-Kim marked this conversation as resolved Outdated

Unnecessary parentheses here

Unnecessary parentheses here
}
}

View File

@ -1284,17 +1284,7 @@ float factor_get(Cache *automasking,
* brushes and filter. */
Cache *active_cache_get(SculptSession *ss);
/**
* Creates and initializes an automasking cache.
*
* For automasking modes that cannot be calculated in real time,
* data is also stored at the vertex level prior to the stroke starting.
*
* \param sd: the sculpt tool
* \param brush: the brush being used (optional)
* \param ob: the object being operated on
* \return the automask cache
*/
/* Brush can be null. */
std::unique_ptr<Cache> cache_init(Sculpt *sd, Brush *brush, Object *ob);
Sean-Kim marked this conversation as resolved Outdated

This comment change is still unrelated to the goal of the path, it should be remove from this PR

This comment change is still unrelated to the goal of the path, it should be remove from this PR
void cache_free(Cache *automasking);

View File

@ -315,9 +315,7 @@ typedef struct Brush {
int deform_target;
/* Automasking mode flags
* See rna_brush.cc#rna_enum_brush_automasking_flag_items
*/
/* automasking */
int automasking_flags;
Sean-Kim marked this conversation as resolved Outdated

Unrelated change

Unrelated change
int automasking_boundary_edges_propagation_steps;

View File

@ -1087,9 +1087,6 @@ typedef struct Sculpt {
/** Transform tool. */
int transform_mode;
/* Automasking mode flags
* See rna_brush.cc#rna_enum_brush_automasking_flag_items
*/
int automasking_flags;
Sean-Kim marked this conversation as resolved Outdated

Unrelated change

Unrelated change
// /* Control tablet input. */