Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/curves_sculpt_add.cc
| Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | struct AddOperationExecutor { | ||||
| Object *surface_ob_ = nullptr; | Object *surface_ob_ = nullptr; | ||||
| Mesh *surface_ = nullptr; | Mesh *surface_ = nullptr; | ||||
| Span<MLoopTri> surface_looptris_; | Span<MLoopTri> surface_looptris_; | ||||
| Span<float3> corner_normals_su_; | Span<float3> corner_normals_su_; | ||||
| CurvesSculpt *curves_sculpt_ = nullptr; | CurvesSculpt *curves_sculpt_ = nullptr; | ||||
| Brush *brush_ = nullptr; | Brush *brush_ = nullptr; | ||||
| BrushCurvesSculptSettings *brush_settings_ = nullptr; | |||||
| float brush_radius_re_; | float brush_radius_re_; | ||||
| float2 brush_pos_re_; | float2 brush_pos_re_; | ||||
| bool use_front_face_; | bool use_front_face_; | ||||
| bool interpolate_length_; | bool interpolate_length_; | ||||
| bool interpolate_shape_; | bool interpolate_shape_; | ||||
| bool use_interpolation_; | bool use_interpolation_; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | if (!CustomData_has_layer(&surface_->ldata, CD_NORMAL)) { | ||||
| BKE_mesh_calc_normals_split(surface_); | BKE_mesh_calc_normals_split(surface_); | ||||
| } | } | ||||
| corner_normals_su_ = { | corner_normals_su_ = { | ||||
| reinterpret_cast<const float3 *>(CustomData_get_layer(&surface_->ldata, CD_NORMAL)), | reinterpret_cast<const float3 *>(CustomData_get_layer(&surface_->ldata, CD_NORMAL)), | ||||
| surface_->totloop}; | surface_->totloop}; | ||||
| curves_sculpt_ = scene_->toolsettings->curves_sculpt; | curves_sculpt_ = scene_->toolsettings->curves_sculpt; | ||||
| brush_ = BKE_paint_brush(&curves_sculpt_->paint); | brush_ = BKE_paint_brush(&curves_sculpt_->paint); | ||||
| brush_settings_ = brush_->curves_sculpt_settings; | |||||
| brush_radius_re_ = BKE_brush_size_get(scene_, brush_); | brush_radius_re_ = BKE_brush_size_get(scene_, brush_); | ||||
| brush_pos_re_ = stroke_extension.mouse_position; | brush_pos_re_ = stroke_extension.mouse_position; | ||||
| use_front_face_ = brush_->flag & BRUSH_FRONTFACE; | use_front_face_ = brush_->flag & BRUSH_FRONTFACE; | ||||
| const eBrushFalloffShape falloff_shape = static_cast<eBrushFalloffShape>( | const eBrushFalloffShape falloff_shape = static_cast<eBrushFalloffShape>( | ||||
| brush_->falloff_shape); | brush_->falloff_shape); | ||||
| add_amount_ = std::max(0, brush_->curves_sculpt_settings->add_amount); | add_amount_ = std::max(0, brush_settings_->add_amount); | ||||
| interpolate_length_ = curves_sculpt_->flag & CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH; | interpolate_length_ = brush_settings_->flag & BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_LENGTH; | ||||
| interpolate_shape_ = curves_sculpt_->flag & CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE; | interpolate_shape_ = brush_settings_->flag & BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_SHAPE; | ||||
| use_interpolation_ = interpolate_length_ || interpolate_shape_; | use_interpolation_ = interpolate_length_ || interpolate_shape_; | ||||
| new_curve_length_ = curves_sculpt_->curve_length; | new_curve_length_ = brush_settings_->curve_length; | ||||
| tot_old_curves_ = curves_->curves_num(); | tot_old_curves_ = curves_->curves_num(); | ||||
| tot_old_points_ = curves_->points_num(); | tot_old_points_ = curves_->points_num(); | ||||
| if (add_amount_ == 0) { | if (add_amount_ == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 609 Lines • Show Last 20 Lines | |||||