|
Blender V5.3
|
Public Member Functions | |
| CutOperationExecutor (const PaintStroke &stroke) | |
| void | execute (CutOperation &self, const StrokeExtension &stroke_extension) |
| void | find_projected_points_in_stroke_with_symmetry (MutableSpan< BrushProjectionInfo > r_brush_projection_info) |
| void | find_projected_points_in_stroke (const float4x4 &brush_transform_inv, const int brush_transform_index, MutableSpan< BrushProjectionInfo > r_brush_projection_info) |
| void | find_spherical_points_in_stroke_with_symmetry (MutableSpan< BrushProjectionInfo > r_brush_projection_info) |
| void | find_spherical_points_in_stroke (const int brush_transform_index, const float3 &brush_pos_cu, MutableSpan< BrushProjectionInfo > r_brush_projection_info) |
| bool | should_point_be_cut (const int point_i, const uint32_t stroke_hash) |
| float3 | find_projected_cut_boundary (const float3 &point_outside_cu, const float3 &point_inside_cu, const float2 &brush_pos_re, const float brush_radius_re, const float4x4 &transform_cu_to_re) |
| float | intersect_line_segment_sphere_2d (const float2 &line_segment_start, const float2 &line_segment_end, const float2 &sphere_position, const float sphere_radius) |
| float3 | find_spherical_cut_boundary (const float3 &point_outside_cu, const float3 &point_inside_cu, const float3 &brush_pos_cu, const float brush_radius_cu) |
| void | cut_curves (const Span< BrushProjectionInfo > brush_projection_info, MutableSpan< bool > r_curves_to_keep, MutableSpan< float > r_ends) |
Utility class that actually executes the update when the stroke is updated. That's useful because it avoids passing a very large number of parameters between functions.
Definition at line 56 of file sculpt_cut.cc.
|
inline |
Definition at line 77 of file sculpt_cut.cc.
References ctx_.
|
inline |
cu or re, depending on falloff shape
Only used for sphere falloff.
Definition at line 357 of file sculpt_cut.cc.
References blender::IndexRange::begin(), blender::Span< T >::begin(), BLI_assert_unreachable, brush_, brush_pos_re_, brush_radius_base_re_, brush_radius_factor_, blender::ed::sculpt_paint::BrushProjectionInfo::brush_transform_index, ctx_, curve_selection_, curves_, curves_id_, blender::bke::CurvesSurfaceTransforms::curves_to_world, blender::ed::sculpt_paint::CurvesSculptCommonContext::depsgraph, blender::ed::sculpt_paint::BrushProjectionInfo::distance, blender::math::distance(), blender::ED_view3d_ob_project_mat_get(), blender::ED_view3d_win_to_3d(), blender::IndexRange::end(), blender::Span< T >::end(), blender::Brush::falloff_shape, find_projected_cut_boundary(), find_spherical_cut_boundary(), blender::index_mask::IndexMask::foreach_index(), blender::index_mask::IndexMask::foreach_segment(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::ed::sculpt_paint::get_symmetry_brush_transforms(), blender::exec_mode::grain_size(), blender::noise::hash(), blender::VecBase< T, Size >::hash(), blender::noise::hash_float(), blender::IndexRange::index_range(), blender::math::invert(), object_, blender::PAINT_FALLOFF_SHAPE_SPHERE, blender::PAINT_FALLOFF_SHAPE_TUBE, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::ed::sculpt_paint::CurvesBrush3D::position_cu, blender::bke::crazyspace::GeometryDeformation::positions, blender::bke::CurvesGeometry::positions(), blender::pow2f(), blender::ed::sculpt_paint::CurvesBrush3D::radius_cu, blender::ed::sculpt_paint::CurvesSculptCommonContext::region, blender::ed::sculpt_paint::CurvesSculptCommonContext::rv3d, self_, should_point_be_cut(), blender::Span< T >::slice(), blender::math::transform_point(), transforms_, blender::ed::sculpt_paint::CurvesSculptCommonContext::v3d, and blender::bke::CurvesSurfaceTransforms::world_to_curves.
Referenced by execute().
|
inline |
Definition at line 79 of file sculpt_cut.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::CurvesGeometry::attributes(), blender::BKE_brush_radius_get(), blender::BKE_paint_brush_for_read(), BLI_assert_unreachable, brush_, brush_pos_re_, brush_radius_base_re_, blender::ed::sculpt_paint::brush_radius_factor(), brush_radius_factor_, brush_strength_, blender::ed::sculpt_paint::brush_strength_get(), ctx_, curve_selection_, curves_, blender::bke::curves_copy_curve_selection(), curves_id_, blender::bke::CurvesGeometry::curves_num(), blender::ToolSettings::curves_sculpt, curves_sculpt_, blender::ed::sculpt_paint::CurvesSurfaceTransforms::CurvesSurfaceTransforms(), cut_curves(), blender::bke::CurvesGeometry::cyclic(), blender::Object::data, blender::DEG_id_tag_update(), blender::ed::sculpt_paint::CurvesSculptCommonContext::depsgraph, blender::ED_region_tag_redraw(), blender::Brush::falloff_shape, find_projected_points_in_stroke_with_symmetry(), find_spherical_points_in_stroke_with_symmetry(), blender::IndexMask::from_bools(), blender::IndexMask::from_bools_inverse(), blender::VArray< T >::from_single(), blender::VArray< T >::from_span(), blender::array_utils::gather(), blender::GEO_NODE_CURVE_SAMPLE_LENGTH, blender::ID_RECALC_GEOMETRY, blender::IndexMask::IndexMask(), blender::bke::CurvesGeometry::is_empty(), blender::index_mask::IndexMask::is_empty(), blender::ed::sculpt_paint::StrokeExtension::is_first, blender::bke::AttributeAccessor::lookup_or_default(), blender::ed::sculpt_paint::StrokeExtension::mouse_position, NC_GEOM, ND_DATA, blender::ed::sculpt_paint::CurvesSculptCommonContext::object, object_, blender::CurvesSculpt::paint, blender::PAINT_FALLOFF_SHAPE_SPHERE, blender::PAINT_FALLOFF_SHAPE_TUBE, blender::bke::Point, point_factors_, blender::bke::CurvesGeometry::points_num(), blender::ed::sculpt_paint::CurvesBrush3D::position_cu, blender::ed::sculpt_paint::CurvesSculptCommonContext::region, blender::ed::sculpt_paint::remember_stroke_position(), blender::ed::sculpt_paint::report_cyclic_not_supported(), blender::ed::sculpt_paint::StrokeExtension::reports, blender::ed::curves::retrieve_selected_curves(), blender::ed::sculpt_paint::CurvesSculptCommonContext::rv3d, blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::CurvesSculptCommonContext::scene, selected_curve_memory_, self_, blender::index_mask::IndexMask::size(), blender::Scene::toolsettings, blender::math::transform_point(), transforms_, blender::geometry::trim_curves(), blender::U, blender::USER_ORBIT_SELECTION, blender::ed::sculpt_paint::CurvesSculptCommonContext::v3d, and blender::WM_main_add_notifier().
Referenced by blender::ed::sculpt_paint::CutOperation::on_stroke_extended().
|
inline |
Finds the position where the brush (represented as an infinite cylinder aligned with the view) intersects with a line segment. This code works under the assumption that there is going to be an intersection.
Definition at line 280 of file sculpt_cut.cc.
References ctx_, blender::ED_view3d_project_float_v2_m4(), intersect_line_segment_sphere_2d(), and blender::ed::sculpt_paint::CurvesSculptCommonContext::region.
Referenced by cut_curves().
|
inline |
Definition at line 183 of file sculpt_cut.cc.
References brush_pos_re_, ctx_, curve_selection_, curves_, blender::ed::sculpt_paint::CurvesSculptCommonContext::depsgraph, distance(), blender::math::distance_squared(), blender::ED_view3d_ob_project_mat_get(), blender::ED_view3d_project_float_v2_m4(), blender::index_mask::IndexMask::foreach_index(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::IndexRange::IndexRange(), object_, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::crazyspace::GeometryDeformation::positions, blender::ed::sculpt_paint::CurvesSculptCommonContext::region, blender::ed::sculpt_paint::CurvesSculptCommonContext::rv3d, blender::IndexRange::size(), and blender::math::transform_point().
Referenced by find_projected_points_in_stroke_with_symmetry().
|
inline |
Definition at line 171 of file sculpt_cut.cc.
References curves_id_, find_projected_points_in_stroke(), blender::ed::sculpt_paint::get_symmetry_brush_transforms(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), and blender::math::invert().
Referenced by execute().
|
inline |
Finds the position where the brush (represented as a sphere) intersects with a line segment. This code works under the assumption that there is going to be an intersection.
Definition at line 332 of file sculpt_cut.cc.
References b, blender::math::dot(), blender::math::max(), and sqrtf.
Referenced by cut_curves().
|
inline |
Definition at line 232 of file sculpt_cut.cc.
References ctx_, curve_selection_, curves_, blender::ed::sculpt_paint::CurvesSculptCommonContext::depsgraph, distance(), blender::math::distance_squared(), blender::index_mask::IndexMask::foreach_index(), blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::IndexRange::IndexRange(), object_, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::crazyspace::GeometryDeformation::positions, and blender::IndexRange::size().
Referenced by find_spherical_points_in_stroke_with_symmetry().
|
inline |
Definition at line 210 of file sculpt_cut.cc.
References brush_pos_re_, ctx_, curves_id_, blender::bke::CurvesSurfaceTransforms::curves_to_world, blender::ED_view3d_win_to_3d(), find_spherical_points_in_stroke(), blender::ed::sculpt_paint::get_symmetry_brush_transforms(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::ed::sculpt_paint::CurvesBrush3D::position_cu, blender::ed::sculpt_paint::CurvesSculptCommonContext::region, self_, blender::math::transform_point(), transforms_, blender::ed::sculpt_paint::CurvesSculptCommonContext::v3d, and blender::bke::CurvesSurfaceTransforms::world_to_curves.
Referenced by execute().
|
inline |
Finds the position where a line segment intersects a sphere, as seen in 2d space. Returns the factor "t" that describes how far along the line segment to travel (where 0 is the line segment's start and 1 is its end). This code works under the assumption that there is going to be an intersection.
Definition at line 306 of file sculpt_cut.cc.
References b, blender::math::dot(), blender::math::max(), and sqrtf.
Referenced by find_projected_cut_boundary().
|
inline |
| stroke_hash | A hash which should try to return different results for each iteration of the cut. Used for "blunt scissors" mode, based on brush strength. |
Definition at line 259 of file sculpt_cut.cc.
References brush_strength_, blender::noise::hash_to_float(), and point_factors_.
Referenced by cut_curves().
Definition at line 69 of file sculpt_cut.cc.
Referenced by cut_curves(), and execute().
| float2 blender::ed::sculpt_paint::CutOperationExecutor::brush_pos_re_ |
Definition at line 72 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), find_projected_points_in_stroke(), and find_spherical_points_in_stroke_with_symmetry().
| float blender::ed::sculpt_paint::CutOperationExecutor::brush_radius_base_re_ |
Definition at line 70 of file sculpt_cut.cc.
Referenced by cut_curves(), and execute().
| float blender::ed::sculpt_paint::CutOperationExecutor::brush_radius_factor_ |
Definition at line 71 of file sculpt_cut.cc.
Referenced by cut_curves(), and execute().
| float blender::ed::sculpt_paint::CutOperationExecutor::brush_strength_ |
Definition at line 73 of file sculpt_cut.cc.
Referenced by execute(), and should_point_be_cut().
| CurvesSculptCommonContext blender::ed::sculpt_paint::CutOperationExecutor::ctx_ |
Definition at line 58 of file sculpt_cut.cc.
Referenced by cut_curves(), CutOperationExecutor(), execute(), find_projected_cut_boundary(), find_projected_points_in_stroke(), find_spherical_points_in_stroke(), and find_spherical_points_in_stroke_with_symmetry().
| IndexMask blender::ed::sculpt_paint::CutOperationExecutor::curve_selection_ |
Definition at line 66 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), find_projected_points_in_stroke(), and find_spherical_points_in_stroke().
| CurvesGeometry* blender::ed::sculpt_paint::CutOperationExecutor::curves_ = nullptr |
Definition at line 62 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), find_projected_points_in_stroke(), and find_spherical_points_in_stroke().
Definition at line 61 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), find_projected_points_in_stroke_with_symmetry(), and find_spherical_points_in_stroke_with_symmetry().
| CurvesSculpt* blender::ed::sculpt_paint::CutOperationExecutor::curves_sculpt_ = nullptr |
Definition at line 68 of file sculpt_cut.cc.
Referenced by execute().
Definition at line 60 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), find_projected_points_in_stroke(), and find_spherical_points_in_stroke().
Definition at line 64 of file sculpt_cut.cc.
Referenced by execute(), and should_point_be_cut().
| IndexMaskMemory blender::ed::sculpt_paint::CutOperationExecutor::selected_curve_memory_ |
Definition at line 65 of file sculpt_cut.cc.
Referenced by execute().
| CutOperation* blender::ed::sculpt_paint::CutOperationExecutor::self_ = nullptr |
Definition at line 57 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), and find_spherical_points_in_stroke_with_symmetry().
| CurvesSurfaceTransforms blender::ed::sculpt_paint::CutOperationExecutor::transforms_ |
Definition at line 75 of file sculpt_cut.cc.
Referenced by cut_curves(), execute(), and find_spherical_points_in_stroke_with_symmetry().