Merge branch 'blender-v4.4-release'

This commit is contained in:
Sean Kim
2025-02-10 09:55:13 -08:00
2 changed files with 13 additions and 10 deletions

View File

@@ -2957,9 +2957,14 @@ void calc_brush_plane(const Depsgraph &depsgraph,
zero_v3(r_area_co);
zero_v3(r_area_no);
const bool use_original_plane = (brush.flag & BRUSH_ORIGINAL_PLANE) &&
brush.sculpt_brush_type != SCULPT_BRUSH_TYPE_PLANE;
const bool use_original_normal = (brush.flag & BRUSH_ORIGINAL_NORMAL) &&
brush.sculpt_brush_type != SCULPT_BRUSH_TYPE_PLANE;
if (SCULPT_stroke_is_main_symmetry_pass(*ss.cache) &&
(SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) ||
!(brush.flag & BRUSH_ORIGINAL_PLANE) || !(brush.flag & BRUSH_ORIGINAL_NORMAL)))
(SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) || !use_original_plane ||
!use_original_normal))
{
switch (brush.sculpt_plane) {
case SCULPT_DISP_DIR_VIEW:
@@ -2994,9 +2999,7 @@ void calc_brush_plane(const Depsgraph &depsgraph,
}
/* For area normal. */
if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) &&
(brush.flag & BRUSH_ORIGINAL_NORMAL))
{
if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && use_original_normal) {
copy_v3_v3(r_area_no, ss.cache->sculpt_normal);
}
else {
@@ -3004,9 +3007,7 @@ void calc_brush_plane(const Depsgraph &depsgraph,
}
/* For flatten center. */
if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) &&
(brush.flag & BRUSH_ORIGINAL_PLANE))
{
if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && use_original_plane) {
copy_v3_v3(r_area_co, ss.cache->last_center);
}
else {

View File

@@ -1016,10 +1016,12 @@ wmKeyMap *node_resize_modal_keymap(wmKeyConfig *keyconf)
return keymap;
}
/* Compute the nearest 1D coordinate corresponding to the nearest grid in node. */
/* Compute the nearest 1D coordinate corresponding to the nearest grid in node editors. */
static float nearest_node_grid_coord(float co)
{
float grid_size = grid_size_get();
/* Size and location of nodes are independent of UI scale, so grid size should be independent of
* UI scale as well. */
float grid_size = grid_size_get() / UI_SCALE_FAC;
float rest = fmod(co, grid_size);
float offset = rest - grid_size / 2 >= 0 ? grid_size : 0;