Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_filter.c118
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c3
-rw-r--r--source/blender/editors/armature/armature_select.c7
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c25
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c7
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_weight_paint.c18
-rw-r--r--source/blender/editors/include/UI_interface.h3
-rw-r--r--source/blender/editors/interface/interface_handlers.c7
-rw-r--r--source/blender/editors/interface/interface_intern.h8
-rw-r--r--source/blender/editors/interface/interface_query.c34
-rw-r--r--source/blender/editors/mesh/editmesh_mask_extract.c2
-rw-r--r--source/blender/editors/mesh/meshtools.c2
-rw-r--r--source/blender/editors/render/render_shading.c14
-rw-r--r--source/blender/editors/scene/scene_edit.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c28
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c8
-rw-r--r--source/blender/editors/space_console/console_draw.c37
-rw-r--r--source/blender/editors/space_info/info_draw.c65
-rw-r--r--source/blender/editors/space_info/info_intern.h14
-rw-r--r--source/blender/editors/space_info/info_report.c2
-rw-r--r--source/blender/editors/space_info/textview.h36
-rw-r--r--source/blender/editors/space_node/space_node.c1
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c20
-rw-r--r--source/blender/editors/transform/transform_convert_gpencil.c5
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_mode_mirror.c8
30 files changed, 261 insertions, 232 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index dcf0377ffc0..4b0a4bcf46b 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1790,81 +1790,63 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
bDopeSheet *ads = ac->ads;
size_t items = 0;
- if (ads->filterflag & ADS_FILTER_GP_3DONLY) {
- Scene *scene = (Scene *)ads->source;
- ViewLayer *view_layer = (ViewLayer *)ac->view_layer;
- Base *base;
-
- /* Active scene's GPencil block first - No parent item needed... */
- if (scene->gpd) {
- items += animdata_filter_gpencil_data(anim_data, ads, scene->gpd, filter_mode);
- }
-
- /* Objects in the scene */
- for (base = view_layer->object_bases.first; base; base = base->next) {
- /* Only consider this object if it has got some GP data (saving on all the other tests) */
- if (base->object && (base->object->type == OB_GPENCIL)) {
- Object *ob = base->object;
-
- /* firstly, check if object can be included, by the following factors:
- * - if only visible, must check for layer and also viewport visibility
- * --> while tools may demand only visible, user setting takes priority
- * as user option controls whether sets of channels get included while
- * tool-flag takes into account collapsed/open channels too
- * - if only selected, must check if object is selected
- * - there must be animation data to edit (this is done recursively as we
- * try to add the channels)
- */
- if ((filter_mode & ANIMFILTER_DATA_VISIBLE) &&
- !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
- /* Layer visibility - we check both object and base,
- * since these may not be in sync yet. */
- if ((base->flag & BASE_VISIBLE_DEPSGRAPH) == 0) {
- continue;
- }
-
- /* outliner restrict-flag */
- if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
- continue;
- }
+ Scene *scene = (Scene *)ads->source;
+ ViewLayer *view_layer = (ViewLayer *)ac->view_layer;
+ Base *base;
+
+ /* Active scene's GPencil block first - No parent item needed... */
+ if (scene->gpd) {
+ items += animdata_filter_gpencil_data(anim_data, ads, scene->gpd, filter_mode);
+ }
+
+ /* Objects in the scene */
+ for (base = view_layer->object_bases.first; base; base = base->next) {
+ /* Only consider this object if it has got some GP data (saving on all the other tests) */
+ if (base->object && (base->object->type == OB_GPENCIL)) {
+ Object *ob = base->object;
+
+ /* firstly, check if object can be included, by the following factors:
+ * - if only visible, must check for layer and also viewport visibility
+ * --> while tools may demand only visible, user setting takes priority
+ * as user option controls whether sets of channels get included while
+ * tool-flag takes into account collapsed/open channels too
+ * - if only selected, must check if object is selected
+ * - there must be animation data to edit (this is done recursively as we
+ * try to add the channels)
+ */
+ if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
+ /* Layer visibility - we check both object and base,
+ * since these may not be in sync yet. */
+ if ((base->flag & BASE_VISIBLE_DEPSGRAPH) == 0) {
+ continue;
}
- /* check selection and object type filters only for Object mode */
- if (ob->mode == OB_MODE_OBJECT) {
- if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & BASE_SELECTED))) {
- /* only selected should be shown */
- continue;
- }
- }
- /* check if object belongs to the filtering group if option to filter
- * objects by the grouped status is on
- * - used to ease the process of doing multiple-character choreographies
- */
- if (ads->filter_grp != NULL) {
- if (BKE_collection_has_object_recursive(ads->filter_grp, ob) == 0) {
- continue;
- }
+ /* outliner restrict-flag */
+ if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
+ continue;
}
-
- /* finally, include this object's grease pencil data-block. */
- /* XXX: Should we store these under expanders per item? */
- items += animdata_filter_gpencil_data(anim_data, ads, ob->data, filter_mode);
}
- }
- }
- else {
- bGPdata *gpd;
- /* Grab all Grease Pencil data-blocks directly from main,
- * but only those that seem to be useful somewhere */
- for (gpd = ac->bmain->gpencils.first; gpd; gpd = gpd->id.next) {
- /* only show if gpd is used by something... */
- if (ID_REAL_USERS(gpd) < 1) {
- continue;
+ /* check selection and object type filters only for Object mode */
+ if (ob->mode == OB_MODE_OBJECT) {
+ if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & BASE_SELECTED))) {
+ /* only selected should be shown */
+ continue;
+ }
+ }
+ /* check if object belongs to the filtering group if option to filter
+ * objects by the grouped status is on
+ * - used to ease the process of doing multiple-character choreographies
+ */
+ if (ads->filter_grp != NULL) {
+ if (BKE_collection_has_object_recursive(ads->filter_grp, ob) == 0) {
+ continue;
+ }
}
- /* add GP frames from this data-block. */
- items += animdata_filter_gpencil_data(anim_data, ads, gpd, filter_mode);
+ /* finally, include this object's grease pencil data-block. */
+ /* XXX: Should we store these under expanders per item? */
+ items += animdata_filter_gpencil_data(anim_data, ads, ob->data, filter_mode);
}
}
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index 5b729c856c0..f631d08f3e4 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -177,8 +177,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
icon = RNA_struct_ui_icon(ptr.type);
/* valid path - remove the invalid tag since we now know how to use it saving
- * users manual effort to reenable using "Revive Disabled FCurves" [#29629]
- */
+ * users manual effort to re-enable using "Revive Disabled FCurves" T29629. */
fcu->flag &= ~FCURVE_DISABLED;
}
else {
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 0f288c0d8b8..47eb09cdf3d 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -1461,6 +1461,13 @@ static void select_similar_data_pchan(bContext *C, const size_t bytes_size, cons
EditBone *ebone_act = CTX_data_active_bone(C);
const bPoseChannel *pchan_active = BKE_pose_channel_find_name(obedit->pose, ebone_act->name);
+
+ /* This will mostly happen for corner cases where the user tried to access this
+ * before having any valid pose data for the armature. */
+ if (pchan_active == NULL) {
+ return;
+ }
+
const char *data_active = (const char *)POINTER_OFFSET(pchan_active, offset);
for (EditBone *ebone = arm->edbo->first; ebone; ebone = ebone->next) {
if (EBONE_SELECTABLE(arm, ebone)) {
diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
index d8cd4d20579..f7d22223b55 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
@@ -119,21 +119,25 @@ static void move_geom_draw(const wmGizmo *gz,
immUniformColor4fv(color);
+ /* Use the final scale as a radius if it's not already applied to the final matrix. */
+ const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
+
if (draw_style == ED_GIZMO_MOVE_STYLE_RING_2D) {
if (filled) {
- imm_draw_circle_fill_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
+ imm_draw_circle_fill_2d(pos, 0, 0, radius, DIAL_RESOLUTION);
}
else {
- imm_draw_circle_wire_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
+ imm_draw_circle_wire_2d(pos, 0, 0, radius, DIAL_RESOLUTION);
}
}
else if (draw_style == ED_GIZMO_MOVE_STYLE_CROSS_2D) {
+ const float radius_diag = M_SQRT1_2 * radius;
immBegin(GPU_PRIM_LINES, 4);
- immVertex2f(pos, 1.0f, 1.0f);
- immVertex2f(pos, -1.0f, -1.0f);
+ immVertex2f(pos, radius_diag, radius_diag);
+ immVertex2f(pos, -radius_diag, -radius_diag);
- immVertex2f(pos, -1.0f, 1.0f);
- immVertex2f(pos, 1.0f, -1.0f);
+ immVertex2f(pos, -radius_diag, radius_diag);
+ immVertex2f(pos, radius_diag, -radius_diag);
immEnd();
}
else {
@@ -260,6 +264,9 @@ static int gizmo_move_modal(bContext *C,
return OPERATOR_RUNNING_MODAL;
}
sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init);
+ if ((gz->flag & WM_GIZMO_DRAW_NO_SCALE) == 0) {
+ mul_v2_fl(prop_delta, gz->scale_final);
+ }
prop_delta[2] = 0.0f;
}
@@ -394,8 +401,10 @@ static int gizmo_move_test_select(bContext *C, wmGizmo *gz, const int mval[2])
return -1;
}
- /* The 'gz->scale_final' is already applied when projecting. */
- if (len_squared_v2(point_local) < 1.0f) {
+ /* The 'gz->scale_final' is already applied to the projection
+ * when #WM_GIZMO_DRAW_NO_SCALE isn't set. */
+ const float radius = (gz->flag & WM_GIZMO_DRAW_NO_SCALE) ? gz->scale_final : 1.0f;
+ if (len_squared_v2(point_local) < radius) {
return 0;
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 56351fbfb9a..46788eba370 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3280,8 +3280,10 @@ static void gpencil_add_guide_points(const tGPsdata *p,
}
}
-/* Add fake points for missing mouse movements when the artist draw very fast creating an arc
- * with the vertice in the midle of the segment and using the angle of the previous segment. */
+/**
+ * Add fake points for missing mouse movements when the artist draw very fast creating an arc
+ * with the vertex in the middle of the segment and using the angle of the previous segment.
+ */
static void gpencil_add_fake_points(const wmEvent *event, tGPsdata *p)
{
Brush *brush = p->brush;
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index adc009efd16..5db331280f8 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -231,8 +231,8 @@ static GP_Sculpt_Settings *gpsculpt_get_settings(Scene *scene)
static bool gp_brush_invert_check(tGP_BrushEditData *gso)
{
/* The basic setting is the brush's setting (from the panel) */
- bool invert = ((gso->brush->gpencil_settings->sculpt_flag & GP_SCULPT_FLAG_INVERT) != 0);
-
+ bool invert = ((gso->brush->gpencil_settings->sculpt_flag & GP_SCULPT_FLAG_INVERT) != 0) ||
+ (gso->brush->gpencil_settings->sculpt_flag & BRUSH_DIR_IN);
/* During runtime, the user can hold down the Ctrl key to invert the basic behavior */
if (gso->flag & GP_SCULPT_FLAG_INVERT) {
invert ^= true;
@@ -1744,7 +1744,8 @@ static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso)
if ((gpf == gpl->actframe) || (gpf->flag & GP_FRAME_SELECT)) {
/* compute multiframe falloff factor */
if (gso->use_multiframe_falloff) {
- /* Faloff depends on distance to active frame (relative to the overall frame range) */
+ /* Falloff depends on distance to active frame
+ * (relative to the overall frame range). */
gso->mf_falloff = BKE_gpencil_multiframe_falloff_calc(
gpf, gpl->actframe->framenum, f_init, f_end, ts->gp_sculpt.cur_falloff);
}
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 5b5a306aa25..c730d1b493e 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -1099,10 +1099,9 @@ static bool gp_vertexpaint_brush_apply_to_layers(bContext *C, tGP_BrushVertexpai
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
/* Always do active frame; Otherwise, only include selected frames */
if ((gpf == gpl->actframe) || (gpf->flag & GP_FRAME_SELECT)) {
- /* compute multiframe falloff factor */
+ /* Compute multi-frame falloff factor. */
if (gso->use_multiframe_falloff) {
- /* Faloff depends on distance to active frame (relative to the overall frame range)
- */
+ /* Falloff depends on distance to active frame (relative to the overall frame range) */
gso->mf_falloff = BKE_gpencil_multiframe_falloff_calc(
gpf, gpl->actframe->framenum, f_init, f_end, ts->gp_sculpt.cur_falloff);
}
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index 6b337afa559..c519129cdf7 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -110,7 +110,7 @@ typedef struct tGP_BrushWeightpaintData {
/* Start of new paint */
bool first;
- /* Is multiframe editing enabled, and are we using falloff for that? */
+ /* Is multi-frame editing enabled, and are we using falloff for that? */
bool is_multiframe;
bool use_multiframe_falloff;
@@ -127,10 +127,10 @@ typedef struct tGP_BrushWeightpaintData {
/* - Effect 2D vector */
float dvec[2];
- /* - multiframe falloff factor */
+ /* - multi-frame falloff factor. */
float mf_falloff;
- /* brush geometry (bounding box) */
+ /* brush geometry (bounding box). */
rcti brush_rect;
/* Temp data to save selected points */
@@ -206,7 +206,7 @@ static float brush_influence_calc(tGP_BrushWeightpaintData *gso, const int radiu
float brush_fallof = BKE_brush_curve_strength(brush, distance, (float)radius);
influence *= brush_fallof;
- /* apply multiframe falloff */
+ /* apply multi-frame falloff */
influence *= gso->mf_falloff;
/* return influence */
@@ -585,7 +585,7 @@ static bool gp_weightpaint_brush_apply_to_layers(bContext *C, tGP_BrushWeightpai
/* Active Frame or MultiFrame? */
if (gso->is_multiframe) {
- /* init multiframe falloff options */
+ /* init multi-frame falloff options */
int f_init = 0;
int f_end = 0;
@@ -596,10 +596,10 @@ static bool gp_weightpaint_brush_apply_to_layers(bContext *C, tGP_BrushWeightpai
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
/* Always do active frame; Otherwise, only include selected frames */
if ((gpf == gpl->actframe) || (gpf->flag & GP_FRAME_SELECT)) {
- /* compute multiframe falloff factor */
+ /* Compute multi-frame falloff factor. */
if (gso->use_multiframe_falloff) {
- /* Faloff depends on distance to active frame (relative to the overall frame range)
- */
+ /* Falloff depends on distance to active frame
+ * (relative to the overall frame range). */
gso->mf_falloff = BKE_gpencil_multiframe_falloff_calc(
gpf, gpl->actframe->framenum, f_init, f_end, ts->gp_sculpt.cur_falloff);
}
@@ -656,7 +656,7 @@ static void gp_weightpaint_brush_apply(bContext *C, wmOperator *op, PointerRNA *
gso->brush_rect.xmax = mouse[0] + radius;
gso->brush_rect.ymax = mouse[1] + radius;
- /* Calc 2D direction vector and relative angle. */
+ /* Calculate 2D direction vector and relative angle. */
brush_calc_dvec_2d(gso);
changed = gp_weightpaint_brush_apply_to_layers(C, gso);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 277f330ad50..dba95c5106e 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -2382,6 +2382,9 @@ struct ID *UI_context_active_but_get_tab_ID(struct bContext *C);
uiBut *UI_region_active_but_get(struct ARegion *region);
uiBut *UI_region_but_find_rect_over(const struct ARegion *region, const struct rcti *isect);
+uiBlock *UI_region_block_find_mouse_over(const struct ARegion *region,
+ const int xy[2],
+ bool only_clip);
/* uiFontStyle.align */
typedef enum eFontStyle_Align {
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 6da9bacd865..833631f871d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8268,6 +8268,13 @@ uiBut *UI_region_but_find_rect_over(const ARegion *region, const rcti *rect_px)
return ui_but_find_rect_over(region, rect_px);
}
+uiBlock *UI_region_block_find_mouse_over(const struct ARegion *region,
+ const int xy[2],
+ bool only_clip)
+{
+ return ui_block_find_mouse_over_ex(region, xy[0], xy[1], only_clip);
+}
+
/**
* Version of #UI_context_active_but_get that also returns RNA property info.
* Helper function for insert keyframe, reset to default, etc operators.
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 24977848ae4..a2e239884a3 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -951,6 +951,14 @@ bool ui_block_is_popover(const uiBlock *block) ATTR_WARN_UNUSED_RESULT;
bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT;
bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT;
+uiBlock *ui_block_find_mouse_over_ex(const struct ARegion *region,
+ const int x,
+ const int y,
+ bool only_clip);
+uiBlock *ui_block_find_mouse_over(const struct ARegion *region,
+ const struct wmEvent *event,
+ bool only_clip);
+
uiBut *ui_region_find_first_but_test_flag(struct ARegion *region,
int flag_include,
int flag_exclude);
diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c
index 03434b12ddb..52488027662 100644
--- a/source/blender/editors/interface/interface_query.c
+++ b/source/blender/editors/interface/interface_query.c
@@ -505,6 +505,40 @@ bool UI_block_can_add_separator(const uiBlock *block)
/** \} */
/* -------------------------------------------------------------------- */
+/** \name Block (#uiBlock) Spatial
+ * \{ */
+
+uiBlock *ui_block_find_mouse_over_ex(const ARegion *region,
+ const int x,
+ const int y,
+ bool only_clip)
+{
+ if (!ui_region_contains_point_px(region, x, y)) {
+ return NULL;
+ }
+ for (uiBlock *block = region->uiblocks.first; block; block = block->next) {
+ if (only_clip) {
+ if ((block->flag & UI_BLOCK_CLIP_EVENTS) == 0) {
+ continue;
+ }
+ }
+ float mx = x, my = y;
+ ui_window_to_block_fl(region, block, &mx, &my);
+ if (BLI_rctf_isect_pt(&block->rect, mx, my)) {
+ return block;
+ }
+ }
+ return NULL;
+}
+
+uiBlock *ui_block_find_mouse_over(const ARegion *region, const wmEvent *event, bool only_clip)
+{
+ return ui_block_find_mouse_over_ex(region, event->x, event->y, only_clip);
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
/** \name Region (#ARegion) State
* \{ */
diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c
index d688e2cb658..1c4bc33240a 100644
--- a/source/blender/editors/mesh/editmesh_mask_extract.c
+++ b/source/blender/editors/mesh/editmesh_mask_extract.c
@@ -349,7 +349,7 @@ static int paint_mask_slice_exec(bContext *C, wmOperator *op)
if (ob->mode == OB_MODE_SCULPT) {
ED_sculpt_undo_geometry_begin(ob, "mask slice");
/* TODO: The ideal functionality would be to preserve the current face sets and add a new one
- * for the new triangles, but this datalayer needs to be rebuild in order to make sculpt mode
+ * for the new triangles, but this data-layer needs to be rebuild in order to make sculpt mode
* not crash when modifying the geometry. */
CustomData_free_layers(&mesh->pdata, CD_SCULPT_FACE_SETS, mesh->totpoly);
}
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index dc825871bb7..8f31fa0a1fa 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -943,7 +943,7 @@ BMVert *editbmesh_get_x_mirror_vert(Object *ob,
}
/**
- * Wrapper for objectmode/editmode.
+ * Wrapper for object-mode/edit-mode.
*
* call #BM_mesh_elem_table_ensure first for editmesh.
*/
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 94e210b7243..95d044554f1 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -890,14 +890,14 @@ enum {
static void light_cache_bake_tag_cache(Scene *scene, wmOperator *op)
{
- if (scene->eevee.light_cache != NULL) {
+ if (scene->eevee.light_cache_data != NULL) {
int subset = RNA_enum_get(op->ptr, "subset");
switch (subset) {
case LIGHTCACHE_SUBSET_ALL:
- scene->eevee.light_cache->flag |= LIGHTCACHE_UPDATE_GRID | LIGHTCACHE_UPDATE_CUBE;
+ scene->eevee.light_cache_data->flag |= LIGHTCACHE_UPDATE_GRID | LIGHTCACHE_UPDATE_CUBE;
break;
case LIGHTCACHE_SUBSET_CUBE:
- scene->eevee.light_cache->flag |= LIGHTCACHE_UPDATE_CUBE;
+ scene->eevee.light_cache_data->flag |= LIGHTCACHE_UPDATE_CUBE;
break;
case LIGHTCACHE_SUBSET_DIRTY:
/* Leave tag untouched. */
@@ -1046,7 +1046,7 @@ static bool light_cache_free_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
- return scene->eevee.light_cache;
+ return scene->eevee.light_cache_data;
}
static int light_cache_free_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1057,12 +1057,12 @@ static int light_cache_free_exec(bContext *C, wmOperator *UNUSED(op))
wmWindowManager *wm = CTX_wm_manager(C);
WM_jobs_kill_type(wm, scene, WM_JOB_TYPE_LIGHT_BAKE);
- if (!scene->eevee.light_cache) {
+ if (!scene->eevee.light_cache_data) {
return OPERATOR_CANCELLED;
}
- EEVEE_lightcache_free(scene->eevee.light_cache);
- scene->eevee.light_cache = NULL;
+ EEVEE_lightcache_free(scene->eevee.light_cache_data);
+ scene->eevee.light_cache_data = NULL;
EEVEE_lightcache_info_update(&scene->eevee);
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index ad940a8e87d..114cb54636a 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -182,6 +182,8 @@ bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, Rep
}
}
+ BKE_scene_free_view_layer_depsgraph(scene, layer);
+
BKE_view_layer_free(layer);
DEG_id_tag_update(&scene->id, 0);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 6fe1ba0b817..fed3c2f03a4 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -377,17 +377,6 @@ static void PALETTE_OT_extract_from_image(wmOperatorType *ot)
}
/* Sort Palette color by Hue and Saturation. */
-static bool palette_sort_poll(bContext *C)
-{
- Paint *paint = BKE_paint_get_active_from_context(C);
- Palette *palette = paint->palette;
- if (palette) {
- return true;
- }
-
- return false;
-}
-
static int palette_sort_exec(bContext *C, wmOperator *op)
{
const int type = RNA_enum_get(op->ptr, "type");
@@ -477,7 +466,7 @@ static void PALETTE_OT_sort(wmOperatorType *ot)
/* api callbacks */
ot->exec = palette_sort_exec;
- ot->poll = palette_sort_poll;
+ ot->poll = palette_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -522,7 +511,7 @@ static void PALETTE_OT_color_move(wmOperatorType *ot)
/* api callbacks */
ot->exec = palette_color_move_exec;
- ot->poll = palette_sort_poll;
+ ot->poll = palette_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -531,17 +520,6 @@ static void PALETTE_OT_color_move(wmOperatorType *ot)
}
/* Join Palette swatches. */
-static bool palette_join_poll(bContext *C)
-{
- Paint *paint = BKE_paint_get_active_from_context(C);
- Palette *palette = paint->palette;
- if (palette) {
- return true;
- }
-
- return false;
-}
-
static int palette_join_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
@@ -599,7 +577,7 @@ static void PALETTE_OT_join(wmOperatorType *ot)
/* api callbacks */
ot->exec = palette_join_exec;
- ot->poll = palette_join_poll;
+ ot->poll = palette_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b25cdbe39c1..5a830a90092 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7030,7 +7030,9 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, Po
if (cache->first_time ||
!((brush->flag & BRUSH_ANCHORED) || (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK) ||
- (brush->sculpt_tool == SCULPT_TOOL_ROTATE))) {
+ (brush->sculpt_tool == SCULPT_TOOL_ROTATE) ||
+ (brush->sculpt_tool == SCULPT_TOOL_CLOTH &&
+ brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_GRAB))) {
RNA_float_get_array(ptr, "location", cache->true_location);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
index 038d0e5a08c..f2671b66f7f 100644
--- a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
+++ b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
@@ -58,7 +58,6 @@
#include <math.h>
#include <stdlib.h>
-
typedef struct MultiplaneScrapeSampleData {
float area_cos[2][3];
float area_nos[2][3];
@@ -223,7 +222,6 @@ static void do_multiplane_scrape_brush_task_cb_ex(void *__restrict userdata,
BKE_pbvh_vertex_iter_end;
}
-
/* Public functions. */
/* Main Brush Function. */
@@ -400,9 +398,9 @@ void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes,
}
void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr,
- SculptSession *ss,
- const float outline_col[3],
- const float outline_alpha)
+ SculptSession *ss,
+ const float outline_col[3],
+ const float outline_alpha)
{
float local_mat_inv[4][4];
invert_m4_m4(local_mat_inv, ss->cache->stroke_local_mat);
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 7e32c3d2b5f..ee1496c96bb 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -38,14 +38,14 @@
#include "../space_info/textview.h"
-static int console_line_data(struct TextViewContext *tvc,
- uchar fg[4],
- uchar UNUSED(bg[4]),
- int *UNUSED(icon),
- uchar UNUSED(icon_fg[4]),
- uchar UNUSED(icon_bg[4]))
+static enum eTextViewContext_LineFlag console_line_data(TextViewContext *tvc,
+ uchar fg[4],
+ uchar UNUSED(bg[4]),
+ int *UNUSED(icon),
+ uchar UNUSED(icon_fg[4]),
+ uchar UNUSED(icon_bg[4]))
{
- ConsoleLine *cl_iter = (ConsoleLine *)tvc->iter;
+ const ConsoleLine *cl_iter = tvc->iter;
int fg_id = TH_TEXT;
switch (cl_iter->type) {
@@ -67,7 +67,7 @@ static int console_line_data(struct TextViewContext *tvc,
return TVC_LINE_FG;
}
-void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy)
+void console_scrollback_prompt_begin(SpaceConsole *sc, ConsoleLine *cl_dummy)
{
/* fake the edit line being in the scroll buffer */
ConsoleLine *cl = sc->history.last;
@@ -81,7 +81,7 @@ void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_du
memcpy(cl_dummy->line + prompt_len, cl->line, cl->len + 1);
BLI_addtail(&sc->scrollback, cl_dummy);
}
-void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dummy)
+void console_scrollback_prompt_end(SpaceConsole *sc, ConsoleLine *cl_dummy)
{
MEM_freeN(cl_dummy->line);
BLI_remlink(&sc->scrollback, cl_dummy);
@@ -112,14 +112,13 @@ static int console_textview_step(TextViewContext *tvc)
return ((tvc->iter = (void *)((Link *)tvc->iter)->prev) != NULL);
}
-static int console_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
+static void console_textview_line_get(TextViewContext *tvc, const char **r_line, int *r_len)
{
- ConsoleLine *cl = (ConsoleLine *)tvc->iter;
- *line = cl->line;
- *len = cl->len;
+ const ConsoleLine *cl = tvc->iter;
+ *r_line = cl->line;
+ *r_len = cl->len;
// printf("'%s' %d\n", *line, cl->len);
BLI_assert(cl->line[cl->len] == '\0' && (cl->len == 0 || cl->line[cl->len - 1] != '\0'));
- return 1;
}
static void console_cursor_wrap_offset(
@@ -144,7 +143,7 @@ static void console_cursor_wrap_offset(
return;
}
-static void console_textview_draw_cursor(struct TextViewContext *tvc,
+static void console_textview_draw_cursor(TextViewContext *tvc,
int cwidth,
int columns,
int descender)
@@ -201,7 +200,7 @@ static void console_textview_draw_rect_calc(const ARegion *region,
r_draw_rect_outer->ymax = region->winy;
}
-static int console_textview_main__internal(struct SpaceConsole *sc,
+static int console_textview_main__internal(SpaceConsole *sc,
const ARegion *region,
const bool do_draw,
const int mval[2],
@@ -243,19 +242,19 @@ static int console_textview_main__internal(struct SpaceConsole *sc,
return ret;
}
-void console_textview_main(struct SpaceConsole *sc, const ARegion *region)
+void console_textview_main(SpaceConsole *sc, const ARegion *region)
{
const int mval[2] = {INT_MAX, INT_MAX};
console_textview_main__internal(sc, region, true, mval, NULL, NULL);
}
-int console_textview_height(struct SpaceConsole *sc, const ARegion *region)
+int console_textview_height(SpaceConsole *sc, const ARegion *region)
{
const int mval[2] = {INT_MAX, INT_MAX};
return console_textview_main__internal(sc, region, false, mval, NULL, NULL);
}
-int console_char_pick(struct SpaceConsole *sc, const ARegion *region, const int mval[2])
+int console_char_pick(SpaceConsole *sc, const ARegion *region, const int mval[2])
{
int r_mval_pick_offset = 0;
void *mval_pick_item = NULL;
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index 4d5f59cdb7c..0a5ca81484c 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -39,14 +39,14 @@
#include "textview.h"
#include "GPU_framebuffer.h"
-static int report_line_data(struct TextViewContext *tvc,
- uchar fg[4],
- uchar bg[4],
- int *icon,
- uchar icon_fg[4],
- uchar icon_bg[4])
+static enum eTextViewContext_LineFlag report_line_data(TextViewContext *tvc,
+ uchar fg[4],
+ uchar bg[4],
+ int *r_icon,
+ uchar r_icon_fg[4],
+ uchar r_icon_bg[4])
{
- Report *report = (Report *)tvc->iter;
+ const Report *report = tvc->iter;
/* Same text color no matter what type of report. */
UI_GetThemeColor4ubv((report->flag & SELECT) ? TH_INFO_SELECTED_TEXT : TH_TEXT, fg);
@@ -64,35 +64,35 @@ static int report_line_data(struct TextViewContext *tvc,
if (report->type & RPT_ERROR_ALL) {
icon_fg_id = TH_INFO_ERROR_TEXT;
icon_bg_id = TH_INFO_ERROR;
- *icon = ICON_CANCEL;
+ *r_icon = ICON_CANCEL;
}
else if (report->type & RPT_WARNING_ALL) {
icon_fg_id = TH_INFO_WARNING_TEXT;
icon_bg_id = TH_INFO_WARNING;
- *icon = ICON_ERROR;
+ *r_icon = ICON_ERROR;
}
else if (report->type & RPT_INFO_ALL) {
icon_fg_id = TH_INFO_INFO_TEXT;
icon_bg_id = TH_INFO_INFO;
- *icon = ICON_INFO;
+ *r_icon = ICON_INFO;
}
else if (report->type & RPT_DEBUG_ALL) {
icon_fg_id = TH_INFO_DEBUG_TEXT;
icon_bg_id = TH_INFO_DEBUG;
- *icon = ICON_SYSTEM;
+ *r_icon = ICON_SYSTEM;
}
else if (report->type & RPT_PROPERTY) {
icon_fg_id = TH_INFO_PROPERTY_TEXT;
icon_bg_id = TH_INFO_PROPERTY;
- *icon = ICON_OPTIONS;
+ *r_icon = ICON_OPTIONS;
}
else if (report->type & RPT_OPERATOR) {
icon_fg_id = TH_INFO_OPERATOR_TEXT;
icon_bg_id = TH_INFO_OPERATOR;
- *icon = ICON_CHECKMARK;
+ *r_icon = ICON_CHECKMARK;
}
else {
- *icon = ICON_NONE;
+ *r_icon = ICON_NONE;
}
if (report->flag & SELECT) {
@@ -100,9 +100,9 @@ static int report_line_data(struct TextViewContext *tvc,
icon_bg_id = TH_INFO_SELECTED_TEXT;
}
- if (*icon != ICON_NONE) {
- UI_GetThemeColor4ubv(icon_fg_id, icon_fg);
- UI_GetThemeColor4ubv(icon_bg_id, icon_bg);
+ if (*r_icon != ICON_NONE) {
+ UI_GetThemeColor4ubv(icon_fg_id, r_icon_fg);
+ UI_GetThemeColor4ubv(icon_bg_id, r_icon_bg);
return TVC_LINE_FG | TVC_LINE_BG | TVC_LINE_ICON | TVC_LINE_ICON_FG | TVC_LINE_ICON_BG;
}
else {
@@ -113,7 +113,7 @@ static int report_line_data(struct TextViewContext *tvc,
/* reports! */
static void report_textview_init__internal(TextViewContext *tvc)
{
- Report *report = (Report *)tvc->iter;
+ const Report *report = tvc->iter;
const char *str = report->message;
const char *next_str = strchr(str + tvc->iter_char, '\n');
@@ -127,9 +127,9 @@ static void report_textview_init__internal(TextViewContext *tvc)
static int report_textview_skip__internal(TextViewContext *tvc)
{
- SpaceInfo *sinfo = (SpaceInfo *)tvc->arg1;
+ const SpaceInfo *sinfo = tvc->arg1;
const int report_mask = info_report_mask(sinfo);
- while (tvc->iter && (((Report *)tvc->iter)->type & report_mask) == 0) {
+ while (tvc->iter && (((const Report *)tvc->iter)->type & report_mask) == 0) {
tvc->iter = (void *)((Link *)tvc->iter)->prev;
}
return (tvc->iter != NULL);
@@ -137,7 +137,7 @@ static int report_textview_skip__internal(TextViewContext *tvc)
static int report_textview_begin(TextViewContext *tvc)
{
- ReportList *reports = (ReportList *)tvc->arg2;
+ const ReportList *reports = tvc->arg2;
tvc->lheight = 14 * UI_DPI_FAC;
tvc->sel_start = 0;
@@ -170,7 +170,7 @@ static void report_textview_end(TextViewContext *UNUSED(tvc))
static int report_textview_step(TextViewContext *tvc)
{
/* simple case, but no newline support */
- Report *report = (Report *)tvc->iter;
+ const Report *report = tvc->iter;
if (report->len <= tvc->iter_char_next) {
tvc->iter = (void *)((Link *)tvc->iter)->prev;
@@ -195,12 +195,11 @@ static int report_textview_step(TextViewContext *tvc)
}
}
-static int report_textview_line_get(struct TextViewContext *tvc, const char **line, int *len)
+static void report_textview_line_get(TextViewContext *tvc, const char **r_line, int *r_len)
{
- Report *report = (Report *)tvc->iter;
- *line = report->message + tvc->iter_char;
- *len = tvc->iter_char_next - tvc->iter_char;
- return 1;
+ const Report *report = tvc->iter;
+ *r_line = report->message + tvc->iter_char;
+ *r_len = tvc->iter_char_next - tvc->iter_char;
}
static void info_textview_draw_rect_calc(const ARegion *region,
@@ -220,9 +219,9 @@ static void info_textview_draw_rect_calc(const ARegion *region,
r_draw_rect_outer->ymax = region->winy;
}
-static int info_textview_main__internal(struct SpaceInfo *sinfo,
+static int info_textview_main__internal(const SpaceInfo *sinfo,
const ARegion *region,
- ReportList *reports,
+ const ReportList *reports,
const bool do_draw,
const int mval[2],
void **r_mval_pick_item,
@@ -259,9 +258,9 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo,
return ret;
}
-void *info_text_pick(struct SpaceInfo *sinfo,
+void *info_text_pick(const SpaceInfo *sinfo,
const ARegion *region,
- ReportList *reports,
+ const ReportList *reports,
int mval_y)
{
void *mval_pick_item = NULL;
@@ -271,13 +270,13 @@ void *info_text_pick(struct SpaceInfo *sinfo,
return (void *)mval_pick_item;
}
-int info_textview_height(struct SpaceInfo *sinfo, const ARegion *region, ReportList *reports)
+int info_textview_height(const SpaceInfo *sinfo, const ARegion *region, const ReportList *reports)
{
int mval[2] = {INT_MAX, INT_MAX};
return info_textview_main__internal(sinfo, region, reports, false, mval, NULL, NULL);
}
-void info_textview_main(struct SpaceInfo *sinfo, const ARegion *region, ReportList *reports)
+void info_textview_main(const SpaceInfo *sinfo, const ARegion *region, const ReportList *reports)
{
int mval[2] = {INT_MAX, INT_MAX};
info_textview_main__internal(sinfo, region, reports, true, mval, NULL, NULL);
diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h
index 443a1659690..79bfb1fa047 100644
--- a/source/blender/editors/space_info/info_intern.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -45,19 +45,19 @@ void FILE_OT_find_missing_files(struct wmOperatorType *ot);
void INFO_OT_reports_display_update(struct wmOperatorType *ot);
/* info_draw.c */
-void *info_text_pick(struct SpaceInfo *sinfo,
+void *info_text_pick(const struct SpaceInfo *sinfo,
const struct ARegion *region,
- ReportList *reports,
+ const struct ReportList *reports,
int mouse_y);
-int info_textview_height(struct SpaceInfo *sinfo,
+int info_textview_height(const struct SpaceInfo *sinfo,
const struct ARegion *region,
- struct ReportList *reports);
-void info_textview_main(struct SpaceInfo *sinfo,
+ const struct ReportList *reports);
+void info_textview_main(const struct SpaceInfo *sinfo,
const struct ARegion *region,
- struct ReportList *reports);
+ const struct ReportList *reports);
/* info_report.c */
-int info_report_mask(struct SpaceInfo *sinfo);
+int info_report_mask(const struct SpaceInfo *sinfo);
void INFO_OT_select_pick(struct wmOperatorType *ot); /* report selection */
void INFO_OT_select_all(struct wmOperatorType *ot);
void INFO_OT_select_box(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 1b01ac95866..303e2bbaec9 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -72,7 +72,7 @@ static void reports_select_all(ReportList *reports, int report_mask, int action)
}
}
-int info_report_mask(SpaceInfo *UNUSED(sinfo))
+int info_report_mask(const SpaceInfo *UNUSED(sinfo))
{
#if 0
int report_mask = 0;
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index a33ed91570d..54b7c477791 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -21,6 +21,14 @@
#ifndef __TEXTVIEW_H__
#define __TEXTVIEW_H__
+enum eTextViewContext_LineFlag {
+ TVC_LINE_FG = (1 << 0),
+ TVC_LINE_BG = (1 << 1),
+ TVC_LINE_ICON = (1 << 2),
+ TVC_LINE_ICON_FG = (1 << 3),
+ TVC_LINE_ICON_BG = (1 << 4)
+};
+
typedef struct TextViewContext {
/** Font size scaled by the interface size. */
int lheight;
@@ -40,22 +48,22 @@ typedef struct TextViewContext {
/* callbacks */
int (*begin)(struct TextViewContext *tvc);
void (*end)(struct TextViewContext *tvc);
- void *arg1;
- void *arg2;
+ const void *arg1;
+ const void *arg2;
/* iterator */
int (*step)(struct TextViewContext *tvc);
- int (*line_get)(struct TextViewContext *tvc, const char **, int *);
- int (*line_data)(struct TextViewContext *tvc,
- unsigned char fg[4],
- unsigned char bg[4],
- int *icon,
- unsigned char icon_fg[4],
- unsigned char icon_bg[4]);
+ void (*line_get)(struct TextViewContext *tvc, const char **r_line, int *r_len);
+ enum eTextViewContext_LineFlag (*line_data)(struct TextViewContext *tvc,
+ uchar fg[4],
+ uchar bg[4],
+ int *r_icon,
+ uchar r_icon_fg[4],
+ uchar r_icon_bg[4]);
void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns, int descender);
/* constant theme colors */
void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);
- void *iter;
+ const void *iter;
int iter_index;
/** Char index, used for multi-line report display. */
int iter_char;
@@ -72,12 +80,4 @@ int textview_draw(struct TextViewContext *tvc,
void **r_mval_pick_item,
int *r_mval_pick_offset);
-enum {
- TVC_LINE_FG = (1 << 0),
- TVC_LINE_BG = (1 << 1),
- TVC_LINE_ICON = (1 << 2),
- TVC_LINE_ICON_FG = (1 << 3),
- TVC_LINE_ICON_BG = (1 << 4)
-};
-
#endif /* __TEXTVIEW_H__ */
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index d3c7374e782..951c26b69e0 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -981,6 +981,7 @@ void ED_spacetype_node(void)
art->listener = node_region_listener;
art->cursor = node_cursor;
art->event_cursor = true;
+ art->clip_gizmo_events_by_ui = true;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 8c884783913..8ec7d5a166b 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1422,7 +1422,7 @@ static void space_view3d_listener(wmWindow *UNUSED(win),
static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(sa))
{
Scene *scene = CTX_data_scene(C);
- LightCache *lcache = scene->eevee.light_cache;
+ LightCache *lcache = scene->eevee.light_cache_data;
if (lcache && (lcache->flag & LIGHTCACHE_UPDATE_AUTO) != 0) {
lcache->flag &= ~LIGHTCACHE_UPDATE_AUTO;
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index bd92193206f..bfbc9b6825b 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1987,7 +1987,7 @@ static bool ed_object_select_pick(bContext *C,
is_obedit = (vc.obedit != NULL);
if (object) {
- /* signal for view3d_opengl_select to skip editmode objects */
+ /* Signal for #view3d_opengl_select to skip edit-mode objects. */
vc.obedit = NULL;
}
@@ -2003,7 +2003,7 @@ static bool ed_object_select_pick(bContext *C,
/* This block uses the control key to make the object selected
* by its center point rather than its contents */
- /* in editmode do not activate */
+ /* In edit-mode do not activate. */
if (obcenter) {
/* note; shift+alt goes to group-flush-selecting */
@@ -2337,11 +2337,11 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
bool toggle = RNA_boolean_get(op->ptr, "toggle");
bool center = RNA_boolean_get(op->ptr, "center");
bool enumerate = RNA_boolean_get(op->ptr, "enumerate");
- /* only force object select for editmode to support vertex parenting,
- * or paint-select to allow pose bone select with vert/face select */
+ /* Only force object select for edit-mode to support vertex parenting,
+ * or paint-select to allow pose bone select with vert/face select. */
bool object = (RNA_boolean_get(op->ptr, "object") &&
(obedit || BKE_paint_select_elem_test(obact) ||
- /* so its possible to select bones in weightpaint mode (LMB select) */
+ /* so its possible to select bones in weight-paint mode (LMB select) */
(obact && (obact->mode & OB_MODE_WEIGHT_PAINT) &&
BKE_object_pose_armature_get(obact))));
@@ -2358,8 +2358,8 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
obact = NULL;
/* ack, this is incorrect but to do this correctly we would need an
- * alternative editmode/objectmode keymap, this copies the functionality
- * from 2.4x where Ctrl+Select in editmode does object select only */
+ * alternative edit-mode/object-mode keymap, this copies the functionality
+ * from 2.4x where Ctrl+Select in edit-mode does object select only. */
center = false;
}
@@ -2493,12 +2493,12 @@ void VIEW3D_OT_select(wmOperatorType *ot)
"center",
0,
"Center",
- "Use the object center when selecting, in editmode used to extend object selection");
+ "Use the object center when selecting, in edit-mode used to extend object selection");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only)");
+ prop = RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (edit-mode only)");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_int_vector(ot->srna,
@@ -3286,7 +3286,7 @@ static int view3d_box_select_exec(bContext *C, wmOperator *op)
}
FOREACH_OBJECT_IN_MODE_END;
}
- else { /* no editmode, unified for bones and objects */
+ else { /* No edit-mode, unified for bones and objects. */
if (vc.obact && vc.obact->mode & OB_MODE_SCULPT) {
/* XXX, this is not selection, could be it's own operator. */
changed_multi = ED_sculpt_mask_box_select(
diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c
index 17e69ff38b8..efd7879c8b2 100644
--- a/source/blender/editors/transform/transform_convert_gpencil.c
+++ b/source/blender/editors/transform/transform_convert_gpencil.c
@@ -228,10 +228,11 @@ void createTransGPencil(bContext *C, TransInfo *t)
for (gpf = init_gpf; gpf; gpf = gpf->next) {
if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) {
- /* if multiframe and falloff, recalculate and save value */
+ /* If multi-frame and falloff, recalculate and save value. */
float falloff = 1.0f; /* by default no falloff */
if ((is_multiedit) && (use_multiframe_falloff)) {
- /* Faloff depends on distance to active frame (relative to the overall frame range) */
+ /* Falloff depends on distance to active frame
+ * (relative to the overall frame range). */
falloff = BKE_gpencil_multiframe_falloff_calc(
gpf, gpl->actframe->framenum, f_init, f_end, ts->gp_sculpt.cur_falloff);
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index bb4d50fcf54..716df24f195 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1102,7 +1102,7 @@ static void recalcData_objects(TransInfo *t)
if (motionpath_update) {
/* Update motion paths once for all transformed objects. */
- ED_objects_recalculate_paths(t->context, t->scene, OBJECT_PATH_CALC_RANGE_CHANGED);
+ ED_objects_recalculate_paths(t->context, t->scene, OBJECT_PATH_CALC_RANGE_CURRENT_FRAME);
}
if (t->options & CTX_OBMODE_XFORM_SKIP_CHILDREN) {
diff --git a/source/blender/editors/transform/transform_mode_mirror.c b/source/blender/editors/transform/transform_mode_mirror.c
index 752d482fae2..2f305989f82 100644
--- a/source/blender/editors/transform/transform_mode_mirror.c
+++ b/source/blender/editors/transform/transform_mode_mirror.c
@@ -50,11 +50,9 @@ static void applyMirror(TransInfo *t, const int UNUSED(mval[2]))
char str[UI_MAX_DRAW_STR];
copy_v3_v3(t->values_final, t->values);
- /*
- * OPTIMIZATION:
- * This still recalcs transformation on mouse move
- * while it should only recalc on constraint change
- * */
+ /* OPTIMIZATION:
+ * This still recalculates transformation on mouse move
+ * while it should only recalculate on constraint change. */
/* if an axis has been selected */
if (t->con.mode & CON_APPLY) {