|
Blender V5.0
|
Classes | |
| class | CurvesPenToolOperation |
| struct | ClosestElement |
| class | PenToolOperation |
Enumerations | |
| enum class | PenModal : int8_t { MoveHandle = 0 , MoveEntire = 1 , SnapAngle = 2 } |
| enum class | ElementMode : int8_t { None = 0 , Point = 1 , Edge = 2 , HandleLeft = 3 , HandleRight = 4 } |
Variables | |
| static const EnumPropertyItem | prop_handle_types [] |
| constexpr float | selection_distance_factor = 0.9f |
| constexpr float | selection_distance_factor_edge = 0.5f |
| constexpr float | default_handle_px_distance = 16.0f |
| constexpr int | CURVE_HANDLE_TYPES_NUM = 4 |
| constexpr float | selection_edge_priority_factor = 0.1f |
| constexpr float | selection_point_overwrite_edge_distance_factor = 0.7f |
| constexpr float | selection_point_overwrite_edge_distance_factor_sq |
|
strong |
| Enumerator | |
|---|---|
| None | |
| Point | |
| Edge | |
| HandleLeft | |
| HandleRight | |
Definition at line 50 of file ED_curves.hh.
|
strong |
| Enumerator | |
|---|---|
| MoveHandle | |
| MoveEntire | |
| SnapAngle | |
Definition at line 45 of file curves_pen.cc.
|
static |
Definition at line 801 of file curves_pen.cc.
References Object::actcol, blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::ed::greasepencil::add_single_curve(), blender::bke::attribute_filter_from_skip_ref(), blender::bke::Bool, blender::bke::Curve, CURVE_TYPE_BEZIER, default_handle_px_distance, blender::ed::curves::ensure_selection_attribute(), blender::ed::curves::pen_tool::PenToolOperation::extrude_handle, blender::bke::fill_attribute_range_default(), blender::ed::curves::fill_selection_true(), blender::bke::GSpanAttributeWriter::finish(), blender::bke::SpanAttributeWriter< T >::finish(), blender::IndexRange::from_single(), blender::VArray< T >::from_single(), blender::ed::curves::get_curves_selection_attribute_names(), blender::MutableSpan< T >::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::ed::curves::pen_tool::PenToolOperation::mouse_co, ViewContext::obact, blender::bke::Point, blender::ed::curves::pen_tool::PenToolOperation::project(), blender::ed::curves::pen_tool::PenToolOperation::radius, blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), blender::bke::GSpanAttributeWriter::span, blender::bke::SpanAttributeWriter< T >::span, and blender::ed::curves::pen_tool::PenToolOperation::vc.
|
static |
Definition at line 923 of file curves_pen.cc.
References blender::ed::curves::pen_tool::PenToolOperation::all_selected_points(), blender::ed::curves::pen_tool::PenToolOperation::curves_range(), blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), blender::ed::curves::pen_tool::PenToolOperation::get_curves(), blender::IndexRange::last(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_object_per_curves, blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), num, pos, and blender::IndexRange::size().
Referenced by invoke_curves(), and blender::ed::curves::pen_tool::PenToolOperation::modal().
|
static |
Definition at line 871 of file curves_pen.cc.
References blender::bke::Bool, blender::ed::curves::pen_tool::PenToolOperation::closest_element, blender::ed::curves::pen_tool::ClosestElement::curve_index, blender::ed::curves::pen_tool::ClosestElement::element_mode, blender::ed::curves::ensure_selection_attribute(), blender::ed::curves::fill_selection_false(), blender::ed::curves::fill_selection_true(), blender::bke::GSpanAttributeWriter::finish(), blender::IndexRange::first(), blender::IndexRange::from_single(), blender::ed::curves::get_curves_selection_attribute_names(), HandleLeft, HandleRight, blender::ed::curves::has_anything_selected(), blender::IndexRange::last(), blender::bke::Point, Point, blender::ed::curves::pen_tool::ClosestElement::point_index, blender::ed::curves::pen_tool::PenToolOperation::select_point, blender::GMutableSpan::slice(), and blender::bke::GSpanAttributeWriter::span.
|
static |
Definition at line 1387 of file curves_pen.cc.
References C, curves_pen_exit(), wmOperator::customdata, ED_workspace_status_text(), blender::ed::curves::pen_tool::CurvesPenToolOperation::update_view(), blender::ed::curves::pen_tool::PenToolOperation::vc, ViewContext::win, and WM_cursor_modal_restore().
Referenced by curves_pen_exit(), curves_pen_invoke(), and curves_pen_modal().
|
static |
Definition at line 1404 of file curves_pen.cc.
References C, curves_pen_exit(), curves_pen_invoke(), wmOperator::customdata, blender::ed::curves::pen_tool::PenToolOperation::invoke(), OPERATOR_RUNNING_MODAL, and result.
Referenced by blender::ed::curves::CURVES_OT_pen(), and curves_pen_invoke().
|
static |
Definition at line 1419 of file curves_pen.cc.
References C, curves_pen_exit(), curves_pen_modal(), wmOperator::customdata, blender::ed::curves::pen_tool::PenToolOperation::modal(), OPERATOR_RUNNING_MODAL, and result.
Referenced by blender::ed::curves::CURVES_OT_pen(), and curves_pen_modal().
| wmKeyMap * blender::ed::curves::pen_tool::ensure_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 1460 of file curves_pen.cc.
References ensure_keymap(), wmKeyMap::modal_items, MoveEntire, MoveHandle, SnapAngle, WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by blender::ed::curves::ED_curves_pentool_modal_keymap(), ED_grease_pencil_pentool_modal_keymap(), and ensure_keymap().
|
static |
Definition at line 538 of file curves_pen.cc.
References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::attribute_filter_from_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), BKE_defgroup_copy_list(), blender::bke::Bool, blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), blender::ed::curves::pen_tool::PenToolOperation::center_of_mass_co, blender::index_mask::IndexMask::complement(), blender::array_utils::copy(), blender::bke::copy_attributes(), blender::GMutableSpan::copy_from(), blender::offset_indices::copy_group_sizes(), blender::bke::Curve, CURVE_TYPE_BEZIER, CURVE_TYPE_NURBS, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::bke::CurvesGeometry::cyclic(), blender::bke::CurvesGeometry::cyclic_for_write(), blender::MutableSpan< T >::drop_back(), blender::ed::curves::ensure_selection_attribute(), blender::ed::curves::pen_tool::PenToolOperation::extrude_handle, blender::array_utils::fill_index_range(), blender::bke::GSpanAttributeWriter::finish(), blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_predicate(), blender::bke::gather_attributes(), blender::bke::curves::nurbs::gather_custom_knots(), blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right_for_write(), i, blender::Vector< T, InlineBufferCapacity, Allocator >::insert(), blender::IndexRange::last(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), blender::bke::AttributeAccessor::lookup_or_default(), blender::ed::curves::pen_tool::PenToolOperation::mouse_co, blender::bke::CurvesGeometry::nurbs_has_custom_knots(), NURBS_KNOT_MODE_CUSTOM, NURBS_KNOT_MODE_ENDPOINT, NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::nurbs_knots_modes(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::point_to_curve_map(), blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), pos, blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::ed::curves::pen_tool::PenToolOperation::project(), blender::ed::curves::pen_tool::PenToolOperation::radius, blender::bke::CurvesGeometry::radius_for_write(), blender::IndexRange::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::bke::GSpanAttributeWriter::span, types, blender::bke::CurvesGeometry::update_curve_types(), blender::bke::curves::nurbs::update_custom_knot_modes(), and CurvesGeometry::vertex_group_names.
|
static |
Definition at line 301 of file curves_pen.cc.
References blender::ed::curves::pen_tool::PenToolOperation::curves_range(), blender::ed::curves::pen_tool::PenToolOperation::editable_curves(), blender::ed::curves::pen_tool::ClosestElement::element_mode, blender::ed::curves::pen_tool::PenToolOperation::get_curves(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_object_per_curves, None, pen_find_closest_edge_point(), pen_find_closest_handle(), pen_find_closest_point(), and blender::ed::curves::pen_tool::PenToolOperation::visible_bezier_handle_points().
Referenced by invoke_curves().
|
static |
Definition at line 695 of file curves_pen.cc.
References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::attribute_filter_from_skip_ref(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_FREE, BKE_defgroup_copy_list(), blender::bke::Bool, blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), blender::ed::curves::pen_tool::PenToolOperation::closest_element, blender::index_mask::IndexMask::complement(), blender::array_utils::copy(), blender::bke::copy_attributes(), blender::offset_indices::copy_group_sizes(), blender::bke::Curve, blender::ed::curves::pen_tool::ClosestElement::curve_index, CURVE_TYPE_NURBS, blender::bke::CurvesGeometry::curve_types(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::MutableSpan< T >::drop_back(), blender::ed::curves::pen_tool::ClosestElement::edge_t, blender::ed::curves::ensure_selection_attribute(), blender::array_utils::fill_index_range(), blender::ed::curves::fill_selection_false(), blender::ed::curves::fill_selection_true(), blender::bke::GSpanAttributeWriter::finish(), blender::IndexRange::first(), blender::IndexMask::from_predicate(), blender::IndexRange::from_single(), blender::bke::gather_attributes(), blender::bke::curves::nurbs::gather_custom_knots(), blender::ed::curves::get_curves_selection_attribute_names(), blender::bke::curves::bezier::Insertion::handle_next, blender::bke::CurvesGeometry::handle_positions_left(), blender::bke::CurvesGeometry::handle_positions_left_for_write(), blender::bke::CurvesGeometry::handle_positions_right(), blender::bke::CurvesGeometry::handle_positions_right_for_write(), blender::bke::curves::bezier::Insertion::handle_prev, blender::bke::CurvesGeometry::handle_types_left_for_write(), blender::bke::CurvesGeometry::handle_types_right_for_write(), blender::bke::curves::bezier::insert(), blender::Vector< T, InlineBufferCapacity, Allocator >::insert(), blender::bke::curves::bezier::Insertion::left_handle, blender::bke::CurvesGeometry::nurbs_has_custom_knots(), NURBS_KNOT_MODE_CUSTOM, NURBS_KNOT_MODE_ENDPOINT, NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::nurbs_knots_modes(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::ed::curves::pen_tool::ClosestElement::point_index, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_num(), blender::bke::curves::bezier::Insertion::position, blender::bke::CurvesGeometry::positions(), blender::bke::CurvesGeometry::positions_for_write(), blender::bke::curves::bezier::Insertion::right_handle, blender::IndexRange::size(), blender::offset_indices::OffsetIndices< T >::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::GSpanAttributeWriter::span, blender::bke::CurvesGeometry::update_curve_types(), blender::bke::curves::nurbs::update_custom_knot_modes(), and CurvesGeometry::vertex_group_names.
|
static |
Definition at line 964 of file curves_pen.cc.
References C, calculate_center_of_mass(), blender::ed::curves::pen_tool::PenToolOperation::center_of_mass_co, blender::ed::curves::pen_tool::PenToolOperation::closest_element, blender::ed::curves::pen_tool::PenToolOperation::curves_range(), blender::ed::curves::pen_tool::PenToolOperation::extrude_point, find_closest_element(), blender::ed::curves::pen_tool::PenToolOperation::mouse_co, and blender::threading::parallel_for().
Referenced by blender::ed::curves::pen_tool::PenToolOperation::invoke().
|
static |
Definition at line 202 of file curves_pen.cc.
References blender::math::clamp(), blender::math::dot(), and pos.
Referenced by pen_find_closest_edge_point().
|
static |
Definition at line 416 of file curves_pen.cc.
References BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_AUTO, BEZIER_HANDLE_FREE, BEZIER_HANDLE_VECTOR, blender::ed::curves::pen_tool::PenToolOperation::center_of_mass_co, blender::index_mask::IndexMask::foreach_index(), blender::ed::curves::pen_tool::PenToolOperation::handle_moved, blender::index_mask::IndexMask::is_empty(), is_left(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), blender::bke::AttributeAccessor::lookup_or_default(), blender::ed::curves::pen_tool::PenToolOperation::mouse_co, blender::ed::curves::pen_tool::PenToolOperation::move_entire, blender::ed::curves::pen_tool::PenToolOperation::move_handle, blender::ed::curves::pen_tool::PenToolOperation::move_point, blender::bke::Point, blender::ed::curves::pen_tool::PenToolOperation::point_added, pos, blender::ed::curves::pen_tool::PenToolOperation::prev_xy, blender::ed::curves::pen_tool::PenToolOperation::project(), blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), snap_8_angles(), blender::ed::curves::pen_tool::PenToolOperation::snap_angle, and blender::ed::curves::pen_tool::PenToolOperation::xy.
Referenced by blender::ed::curves::pen_tool::PenToolOperation::modal().
|
static |
Equation of the starting Bezier Curve: => b(t) = (1-t)^3 * p0 + 3(1-t)^2 * t * p1 + 3(1-t) * t^2 * p2 + t^3 * p3
Equation of the moved Bezier Curve: => B(t) = (1-t)^3 * P0 + 3(1-t)^2 * t * P1 + 3(1-t) * t^2 * P2 + t^3 * P3
The moved Bezier curve has four unknowns: P0, P1, P2 and P3 We want the end points to stay the same so: P0 = p0 and P3 = p3
Mouse location (Pm) should satisfy the equation Pm = B(t). The last constraint used is that the vector between P1 and P2 doesn't change after moving. Therefore: => k2 = p1 - p2 = P1 - P2
Using all four equations we can solve for P1 as: => P1 = (Pm - (1-t)^3 * P0 - t^3 * P3) / (3(1-t) * t) + k2 * t And P2 as: => P2 = P1 - k2
Definition at line 340 of file curves_pen.cc.
References BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_FREE, blender::ed::curves::pen_tool::PenToolOperation::closest_element, blender::ed::curves::pen_tool::ClosestElement::curve_index, blender::ed::curves::pen_tool::ClosestElement::edge_t, blender::IndexRange::first(), blender::ed::curves::pen_tool::PenToolOperation::mouse_co, blender::ed::curves::pen_tool::ClosestElement::point_index, blender::ed::curves::pen_tool::PenToolOperation::screen_to_layer(), and blender::IndexRange::size().
|
static |
Definition at line 217 of file curves_pen.cc.
References blender::ed::curves::pen_tool::ClosestElement::curve_index, CURVE_TYPE_BEZIER, blender::ed::curves::pen_tool::ClosestElement::distance_squared, blender::math::distance_squared(), blender::ed::curves::pen_tool::ClosestElement::drawing_index, blender::IndexRange::drop_back(), Edge, blender::ed::curves::pen_tool::ClosestElement::edge_t, blender::ed::curves::pen_tool::ClosestElement::element_mode, blender::IndexRange::first(), blender::index_mask::IndexMask::foreach_index(), blender::IndexRange::from_begin_end_inclusive(), blender::IndexRange::index_range(), blender::ed::curves::pen_tool::ClosestElement::is_closer(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), line_segment_closest_point(), blender::ed::curves::pen_tool::ClosestElement::point_index, blender::IndexRange::shift(), blender::IndexRange::size(), blender::ed::curves::pen_tool::PenToolOperation::threshold_distance_edge, and types.
Referenced by find_closest_element().
|
static |
Definition at line 157 of file curves_pen.cc.
References blender::ed::curves::pen_tool::ClosestElement::curve_index, blender::ed::curves::pen_tool::ClosestElement::distance_squared, blender::math::distance_squared(), blender::ed::curves::pen_tool::ClosestElement::drawing_index, blender::ed::curves::pen_tool::ClosestElement::element_mode, blender::index_mask::IndexMask::foreach_index(), HandleLeft, HandleRight, blender::ed::curves::pen_tool::ClosestElement::is_closer(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), blender::ed::curves::pen_tool::ClosestElement::point_index, and blender::ed::curves::pen_tool::PenToolOperation::threshold_distance.
Referenced by find_closest_element().
|
static |
Definition at line 125 of file curves_pen.cc.
References blender::ed::curves::pen_tool::ClosestElement::curve_index, blender::ed::curves::pen_tool::ClosestElement::distance_squared, blender::math::distance_squared(), blender::ed::curves::pen_tool::ClosestElement::drawing_index, blender::ed::curves::pen_tool::ClosestElement::element_mode, blender::index_mask::IndexMask::foreach_index(), blender::ed::curves::pen_tool::ClosestElement::is_closer(), blender::ed::curves::pen_tool::PenToolOperation::layer_to_screen(), Point, blender::ed::curves::pen_tool::ClosestElement::point_index, and blender::ed::curves::pen_tool::PenToolOperation::threshold_distance.
Referenced by find_closest_element().
|
static |
Definition at line 324 of file curves_pen.cc.
References C, IFACE_, MoveEntire, MoveHandle, SnapAngle, status, and wmOperator::type.
Referenced by blender::ed::curves::pen_tool::PenToolOperation::modal().
| void blender::ed::curves::pen_tool::pen_tool_common_props | ( | wmOperatorType * | ot | ) |
Definition at line 1430 of file curves_pen.cc.
References BEZIER_HANDLE_VECTOR, FLT_MAX, ot, pen_tool_common_props(), prop_handle_types, RNA_def_boolean(), RNA_def_enum(), RNA_def_float_distance(), and WM_operator_properties_mouse_select().
Referenced by blender::ed::curves::CURVES_OT_pen(), blender::ed::greasepencil::GREASE_PENCIL_OT_pen(), and pen_tool_common_props().
|
static |
Definition at line 1099 of file curves_pen.cc.
References CURVE_HANDLE_ALL, CURVE_HANDLE_NONE, CURVE_TYPE_BEZIER, blender::IndexMask::from_predicate(), blender::bke::Point, retrieve_visible_bezier_handle_points(), and types.
Referenced by retrieve_visible_bezier_handle_points(), and blender::ed::curves::pen_tool::CurvesPenToolOperation::visible_bezier_handle_points().
Definition at line 333 of file curves_pen.cc.
References abs, length(), normalize, sign(), and sin.
Referenced by move_handles_in_curve().
|
constexpr |
Definition at line 68 of file curves_pen.cc.
|
constexpr |
Definition at line 65 of file curves_pen.cc.
Referenced by add_single_point_and_curve().
|
static |
Definition at line 54 of file curves_pen.cc.
Referenced by pen_tool_common_props().
|
constexpr |
Definition at line 61 of file curves_pen.cc.
Referenced by blender::ed::curves::pen_tool::PenToolOperation::invoke().
|
constexpr |
Definition at line 62 of file curves_pen.cc.
Referenced by blender::ed::curves::pen_tool::PenToolOperation::invoke().
|
constexpr |
Definition at line 71 of file curves_pen.cc.
Referenced by blender::ed::curves::pen_tool::ClosestElement::is_closer().
|
constexpr |
Definition at line 73 of file curves_pen.cc.
|
constexpr |
Definition at line 75 of file curves_pen.cc.
Referenced by blender::ed::curves::pen_tool::ClosestElement::is_closer().