Merge branch 'blender-v3.3-release'

This commit is contained in:
Jacques Lucke 2022-07-28 11:42:46 +02:00
commit d034c28f51
6 changed files with 37 additions and 1 deletions

View File

@ -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);

View File

@ -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"));

View File

@ -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_); });

View File

@ -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);

View File

@ -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_ =

View File

@ -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: