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
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-07-28 12:42:46 +0300
committerJacques Lucke <jacques@blender.org>2022-07-28 12:42:46 +0300
commitd034c28f5107d2f829f6fcb769c974c151a77592 (patch)
tree6d2ff3435f5509a6442befa47da319d268bd2246 /source
parent6ae9565d067fb8b371c42e84508c025bbbb02eb2 (diff)
parentccb9d5d30763920348817c4c460500d0834827de (diff)
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_add.cc8
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_brush.cc10
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_density.cc8
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_intern.hh2
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_slide.cc8
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c2
6 files changed, 37 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
index 6c693376ad3..f6539284f74 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc
@@ -126,12 +126,20 @@ struct AddOperationExecutor {
Object &surface_ob_orig = *curves_id_orig_->surface;
Mesh &surface_orig = *static_cast<Mesh *>(surface_ob_orig.data);
+ if (surface_orig.totpoly == 0) {
+ report_empty_original_surface(stroke_extension.reports);
+ return;
+ }
surface_ob_eval_ = DEG_get_evaluated_object(ctx_.depsgraph, &surface_ob_orig);
if (surface_ob_eval_ == nullptr) {
return;
}
surface_eval_ = BKE_object_get_evaluated_mesh(surface_ob_eval_);
+ if (surface_eval_->totpoly == 0) {
+ report_empty_evaluated_surface(stroke_extension.reports);
+ return;
+ }
curves_sculpt_ = ctx_.scene->toolsettings->curves_sculpt;
brush_ = BKE_paint_brush_for_read(&curves_sculpt_->paint);
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc
index a180a232189..95261f29914 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc
@@ -391,6 +391,16 @@ CurvesSculptCommonContext::CurvesSculptCommonContext(const bContext &C)
this->rv3d = CTX_wm_region_view3d(&C);
}
+void report_empty_original_surface(ReportList *reports)
+{
+ BKE_report(reports, RPT_WARNING, TIP_("Original surface mesh is empty"));
+}
+
+void report_empty_evaluated_surface(ReportList *reports)
+{
+ BKE_report(reports, RPT_WARNING, TIP_("Evaluated surface mesh is empty"));
+}
+
void report_missing_surface(ReportList *reports)
{
BKE_report(reports, RPT_WARNING, TIP_("Missing surface mesh"));
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc
index e1ac941eb2b..2e03e907e34 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_density.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_density.cc
@@ -115,12 +115,20 @@ struct DensityAddOperationExecutor {
surface_ob_orig_ = curves_id_orig_->surface;
surface_orig_ = static_cast<Mesh *>(surface_ob_orig_->data);
+ if (surface_orig_->totpoly == 0) {
+ report_empty_original_surface(stroke_extension.reports);
+ return;
+ }
surface_ob_eval_ = DEG_get_evaluated_object(ctx_.depsgraph, surface_ob_orig_);
if (surface_ob_eval_ == nullptr) {
return;
}
surface_eval_ = BKE_object_get_evaluated_mesh(surface_ob_eval_);
+ if (surface_eval_->totpoly == 0) {
+ report_empty_evaluated_surface(stroke_extension.reports);
+ return;
+ }
BKE_bvhtree_from_mesh_get(&surface_bvh_eval_, surface_eval_, BVHTREE_FROM_LOOPTRI, 2);
BLI_SCOPED_DEFER([&]() { free_bvhtree_from_mesh(&surface_bvh_eval_); });
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh b/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
index 7d40ed80a65..5c8c0cedc6f 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
@@ -128,6 +128,8 @@ float transform_brush_radius(const float4x4 &transform,
const float3 &brush_position,
const float old_radius);
+void report_empty_original_surface(ReportList *reports);
+void report_empty_evaluated_surface(ReportList *reports);
void report_missing_surface(ReportList *reports);
void report_missing_uv_map_on_original_surface(ReportList *reports);
void report_missing_uv_map_on_evaluated_surface(ReportList *reports);
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc
index 443fbcb883c..ebdff8a6c4b 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc
@@ -166,6 +166,10 @@ struct SlideOperationExecutor {
surface_ob_orig_ = curves_id_orig_->surface;
surface_orig_ = static_cast<Mesh *>(surface_ob_orig_->data);
+ if (surface_orig_->totpoly == 0) {
+ report_empty_original_surface(stroke_extension.reports);
+ return;
+ }
surface_looptris_orig_ = {BKE_mesh_runtime_looptri_ensure(surface_orig_),
BKE_mesh_runtime_looptri_len(surface_orig_)};
surface_uv_map_orig_ =
@@ -189,6 +193,10 @@ struct SlideOperationExecutor {
if (surface_eval_ == nullptr) {
return;
}
+ if (surface_eval_->totpoly == 0) {
+ report_empty_evaluated_surface(stroke_extension.reports);
+ return;
+ }
surface_looptris_eval_ = {BKE_mesh_runtime_looptri_ensure(surface_eval_),
BKE_mesh_runtime_looptri_len(surface_eval_)};
surface_uv_map_eval_ =
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index 984a8ef41d0..8b11eebf145 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -705,7 +705,7 @@ static const char *toolsystem_default_tool(const bToolKey *tkey)
case CTX_MODE_VERTEX_GPENCIL:
return "builtin_brush.Draw";
case CTX_MODE_SCULPT_CURVES:
- return "builtin_brush.Comb";
+ return "builtin_brush.density";
/* end temporary hack. */
case CTX_MODE_PARTICLE: