|
Blender V4.3
|
#include "BLI_math_matrix.h"#include "BLI_string.h"#include "BKE_editmesh.hh"#include "BKE_editmesh_bvh.hh"#include "BKE_unit.hh"#include "GPU_immediate.hh"#include "GPU_matrix.hh"#include "DEG_depsgraph_query.hh"#include "ED_mesh.hh"#include "ED_screen.hh"#include "WM_api.hh"#include "RNA_access.hh"#include "UI_interface.hh"#include "UI_view2d.hh"#include "BLT_translation.hh"#include "transform.hh"#include "transform_constraints.hh"#include "transform_convert.hh"#include "transform_mode.hh"#include "transform_snap.hh"Go to the source code of this file.
Classes | |
| struct | EdgeSlideData |
| struct | EdgeSlideParams |
Functions | |
Transform (Edge Slide) | |
| static TransDataContainer * | edge_slide_container_first_ok (TransInfo *t) |
| static EdgeSlideData * | edgeSlideFirstGet (TransInfo *t) |
| static void | calcEdgeSlideCustomPoints (TransInfo *t) |
| static void | interp_line_v3_v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], float t) |
| static void | edge_slide_data_init_mval (MouseInput *mi, EdgeSlideData *sld, float *mval_dir) |
| static bool | is_vert_slide_visible_bmesh (TransInfo *t, TransDataContainer *tc, const View3D *v3d, const BMBVHTree *bmbvh, TransDataEdgeSlideVert *sv) |
| static void | calcEdgeSlide_mval_range (TransInfo *t, TransDataContainer *tc, EdgeSlideData *sld, const int loop_nr, const float2 &mval, const bool use_calc_direction) |
| static EdgeSlideData * | createEdgeSlideVerts (TransInfo *t, TransDataContainer *tc, const bool use_double_side) |
| static void | freeEdgeSlideVerts (TransInfo *, TransDataContainer *, TransCustomData *custom_data) |
| static eRedrawFlag | handleEventEdgeSlide (TransInfo *t, const wmEvent *event) |
| static void | drawEdgeSlide (TransInfo *t) |
| static void | edge_slide_snap_apply (TransInfo *t, float *value) |
| static void | edge_slide_apply_elem (const TransDataEdgeSlideVert &sv, const float fac, const float curr_length_fac, const int curr_side_unclamp, const bool use_clamp, const bool use_even, const bool use_flip, float r_co[3]) |
| static void | doEdgeSlide (TransInfo *t, float perc) |
| static void | applyEdgeSlide (TransInfo *t) |
| static void | edge_slide_transform_matrix_fn (TransInfo *t, float mat_xform[4][4]) |
| static void | initEdgeSlide_ex (TransInfo *t, wmOperator *op, bool use_double_side, bool use_even, bool flipped, bool use_clamp) |
| static void | initEdgeSlide (TransInfo *t, wmOperator *op) |
Mouse Input Utilities | |
| void | transform_mode_edge_slide_reproject_input (TransInfo *t) |
Variables | |
| TransModeInfo | TransMode_edgeslide |
|
static |
Definition at line 758 of file transform_mode_edge_slide.cc.
References applyNumInput(), TransInfo::area, BLI_snprintf_rlen(), BLI_strncpy_rlen(), CLAMP, TransInfo::context, TransInfo::custom, TransCustomData::data, doEdgeSlide(), ED_area_status_text(), TransInfo::flag, EdgeSlideParams::flipped, hasNumInput(), IFACE_, WorkspaceStatus::item_bool(), MOD_PRECISION, MOD_SNAP, MOD_SNAP_INVERT, TransCustomDataContainer::mode, TransInfo::modifiers, TransInfo::num, NUM_STR_REP_LEN, EdgeSlideParams::op, WorkspaceStatus::opmodal(), outputNumInput(), recalc_data(), RPT_, TransInfo::scene, str, T_ALT_TRANSFORM, TFM_MODAL_CONFIRM, TFM_MODAL_EDIT_SNAP_SOURCE_ON, TFM_MODAL_PRECISION, TFM_MODAL_RESIZE, TFM_MODAL_ROTATE, TFM_MODAL_SNAP_INV_ON, TFM_MODAL_SNAP_TOGGLE, TFM_MODAL_TRANSLATE, transform_snap_increment(), transform_snap_mixed_apply(), wmOperator::type, UI_MAX_DRAW_STR, Scene::unit, EdgeSlideParams::use_even, validSnap(), TransInfo::values, TransInfo::values_final, and TransInfo::values_modal_offset.
|
static |
Calculate screen-space mval_start / mval_end, optionally slide direction.
Definition at line 213 of file transform_mode_edge_slide.cc.
References TransInfo::area, BKE_bmbvh_free(), BKE_bmbvh_new_from_editmesh(), BKE_editmesh_from_object(), BKE_editmesh_vert_coords_when_deformed(), BMBVH_RESPECT_HIDDEN, copy_vn_fl(), EdgeSlideData::curr_sv_index, blender::Span< T >::data(), DEG_get_evaluated_id(), DEG_get_evaluated_object(), TransInfo::depsgraph, dist_squared_to_line_segment_v2(), blender::math::dot(), Object::dt, edge_slide_data_init_mval(), ListBase::first, FLT_MAX, Scene::id, blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::Span< T >::is_empty(), is_vert_slide_visible_bmesh(), len_squared_v2v2(), TransDataEdgeSlideVert::loop_nr, MEM_callocN, MEM_freeN(), MEM_mallocN, TransInfo::mouse, OB_MESH, OB_WIRE, TransDataContainer::obedit, EdgeSlideData::project(), TransInfo::scene, SPACE_VIEW3D, ScrArea::spacedata, TransInfo::spacetype, EdgeSlideData::sv, swap_v3_v3(), Object::type, and XRAY_ENABLED.
Referenced by createEdgeSlideVerts().
|
static |
Definition at line 120 of file transform_mode_edge_slide.cc.
References applyMouseInput(), edgeSlideFirstGet(), TransInfo::mouse, TransInfo::mval, EdgeSlideData::mval_end, EdgeSlideData::mval_start, setCustomPoints(), and TransInfo::values.
Referenced by handleEventEdgeSlide(), and initEdgeSlide_ex().
|
static |
Definition at line 338 of file transform_mode_edge_slide.cc.
References calcEdgeSlide_mval_range(), count, EdgeSlideData::curr_sv_index, TransInfo::data_type, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::math::length(), TransInfo::mval, EdgeSlideData::sv, TransConvertType_MeshUV, transform_mesh_edge_slide_data_create(), transform_mesh_uv_edge_slide_data_create(), and EdgeSlideData::update_proj_mat().
Referenced by initEdgeSlide_ex().
Definition at line 723 of file transform_mode_edge_slide.cc.
References EdgeSlideParams::curr_side_unclamp, EdgeSlideData::curr_sv_index, TransInfo::custom, TransCustomData::data, TransDataEdgeSlideVert::edge_len, edge_slide_apply_elem(), edgeSlideFirstGet(), TransInfo::flag, EdgeSlideParams::flipped, FOREACH_TRANS_DATA_CONTAINER, TransCustomDataContainer::mode, EdgeSlideParams::perc, EdgeSlideData::sv, T_ALT_TRANSFORM, and EdgeSlideParams::use_even.
Referenced by applyEdgeSlide().
|
static |
Definition at line 446 of file transform_mode_edge_slide.cc.
References add_v3_v3(), add_v3_v3v3(), b, copy_v3_v3(), EdgeSlideParams::curr_side_unclamp, EdgeSlideData::curr_sv_index, TransInfo::custom, TransCustomData::data, TransDataEdgeSlideVert::dir_side, edgeSlideFirstGet(), TransInfo::flag, EdgeSlideParams::flipped, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_FETCH_FLOAT, GPU_line_width(), GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), GPU_point_size(), GPU_PRIM_LINES, GPU_PRIM_POINTS, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformThemeColorShadeAlpha(), immVertex3fv(), immVertexFormat(), interp_line_v3_v3v3v3(), blender::math::is_zero(), is_zero_v3(), TransCustomDataContainer::mode, mul_v3_fl(), negate_v3_v3(), EdgeSlideParams::perc, pos, blender::Array< T, InlineBufferCapacity, Allocator >::size(), SPACE_VIEW3D, TransInfo::spacetype, EdgeSlideData::sv, T_ALT_TRANSFORM, TH_EDGE_SELECT, TH_FACEDOT_SIZE, TH_OUTLINE_WIDTH, TH_SELECT, TRANS_DATA_CONTAINER_FIRST_OK, UI_GetThemeValuef(), EdgeSlideParams::use_even, and TransDataEdgeSlideVert::v_co_orig().
|
static |
NOTE(@ideasman42): Implementation note, even mode ignores the starting positions and uses only the a/b verts, this could be changed/improved so the distance is still met but the verts are moved along their original path (which may not be straight), however how it works now is OK and matches 2.4x.
len_v3v3(curr_sv->dir_side[0], curr_sv->dir_side[1]) is the same as the distance between the original vert locations, same goes for the lines below.Definition at line 669 of file transform_mode_edge_slide.cc.
References add_v3_v3v3(), copy_v3_v3(), TransDataEdgeSlideVert::dir_side, TransDataEdgeSlideVert::edge_len, fabsf, int, interp_line_v3_v3v3v3(), is_zero_v3(), madd_v3_v3fl(), min_ff(), and TransDataEdgeSlideVert::v_co_orig().
Referenced by doEdgeSlide(), and edge_slide_transform_matrix_fn().
|
static |
Get the first valid TransDataContainer *.
Note we cannot trust TRANS_DATA_CONTAINER_FIRST_OK because of multi-object that may leave items with invalid custom data in the transform data container.
Definition at line 103 of file transform_mode_edge_slide.cc.
References BLI_assert_msg, and FOREACH_TRANS_DATA_CONTAINER.
Referenced by edge_slide_snap_apply(), edge_slide_transform_matrix_fn(), and edgeSlideFirstGet().
|
static |
Definition at line 163 of file transform_mode_edge_slide.cc.
References copy_v2_v2(), MouseInput::imval, len_squared_v2(), mul_v2_fl(), EdgeSlideData::mval_end, EdgeSlideData::mval_start, UNLIKELY, and zero_v2().
Referenced by calcEdgeSlide_mval_range(), and transform_mode_edge_slide_reproject_input().
Definition at line 583 of file transform_mode_edge_slide.cc.
References add_v3_v3v3(), EdgeSlideParams::curr_side_unclamp, EdgeSlideData::curr_sv_index, TransDataContainer::custom, TransInfo::custom, TransCustomData::data, TransDataEdgeSlideVert::dir_side, edge_slide_container_first_ok(), TransInfo::flag, EdgeSlideParams::flipped, getSnapPoint(), int, blender::math::is_zero(), line_point_factor_v3(), TransDataContainer::mat, TransCustomDataContainer::mode, mul_m4_v3(), normalize_v3(), SCE_SNAP_TO_EDGE, SCE_SNAP_TO_FACE, TransSnap::snap_source, sub_v3_v3(), sub_v3_v3v3(), EdgeSlideData::sv, T_ALT_TRANSFORM, TransSnap::target_type, transform_constraint_snap_axis_to_edge(), transform_constraint_snap_axis_to_face(), TransInfo::tsnap, EdgeSlideParams::use_even, TransDataContainer::use_local_mat, and TransDataEdgeSlideVert::v_co_orig().
Definition at line 829 of file transform_mode_edge_slide.cc.
References add_v3_v3(), copy_v3_v3(), EdgeSlideParams::curr_side_unclamp, EdgeSlideData::curr_sv_index, TransDataContainer::custom, TransInfo::custom, TransCustomData::data, TransDataEdgeSlideVert::edge_len, edge_slide_apply_elem(), edge_slide_container_first_ok(), TransInfo::flag, EdgeSlideParams::flipped, TransDataContainer::mat, TransCustomDataContainer::mode, mul_m4_v3(), sub_v3_v3v3(), EdgeSlideData::sv, T_ALT_TRANSFORM, EdgeSlideParams::use_even, TransDataContainer::use_local_mat, TransDataEdgeSlideVert::v_co_orig(), and TransInfo::values_final.
|
static |
Definition at line 114 of file transform_mode_edge_slide.cc.
References TransDataContainer::custom, TransCustomData::data, edge_slide_container_first_ok(), and TransCustomDataContainer::mode.
Referenced by calcEdgeSlideCustomPoints(), doEdgeSlide(), drawEdgeSlide(), and transform_mode_edge_slide_reproject_input().
|
static |
Definition at line 393 of file transform_mode_edge_slide.cc.
References TransCustomData::data.
Referenced by initEdgeSlide_ex().
|
static |
Definition at line 408 of file transform_mode_edge_slide.cc.
References calcEdgeSlideCustomPoints(), TransInfo::custom, TransCustomData::data, EVT_CKEY, EVT_EKEY, EVT_FKEY, TransInfo::flag, EdgeSlideParams::flipped, KM_PRESS, TransCustomDataContainer::mode, MOUSEMOVE, T_ALT_TRANSFORM, TREDRAW_HARD, TREDRAW_NOTHING, wmEvent::type, EdgeSlideParams::use_even, and wmEvent::val.
|
static |
Definition at line 923 of file transform_mode_edge_slide.cc.
References initEdgeSlide_ex(), wmOperator::ptr, RNA_property_boolean_get(), and RNA_struct_find_property().
|
static |
Definition at line 864 of file transform_mode_edge_slide.cc.
References B_UNIT_NONE, calcEdgeSlideCustomPoints(), copy_v3_fl(), createEdgeSlideVerts(), TransInfo::custom, TransCustomData::data, TransInfo::flag, EdgeSlideParams::flipped, FOREACH_TRANS_DATA_CONTAINER, freeEdgeSlideVerts(), NumInput::idx_max, TransInfo::idx_max, initMouseInputMode(), INPUT_CUSTOM_RATIO_FLIP, MEM_callocN, TransCustomDataContainer::mode, TransInfo::mode, TransInfo::mouse, TransInfo::num, EdgeSlideParams::op, EdgeSlideParams::perc, TransInfo::scene, TransInfo::snap, TransInfo::state, UnitSettings::system, T_ALT_TRANSFORM, TFM_EDGE_SLIDE, TRANS_CANCEL, Scene::unit, NumInput::unit_sys, NumInput::unit_type, EdgeSlideParams::use_even, TransCustomData::use_free, and NumInput::val_inc.
Referenced by initEdgeSlide().
|
static |
Definition at line 133 of file transform_mode_edge_slide.cc.
References copy_v3_v3(), fabsf, interp_v3_v3v3(), line_point_factor_v3(), UNLIKELY, and v2.
Referenced by drawEdgeSlide(), and edge_slide_apply_elem().
|
static |
Definition at line 187 of file transform_mode_edge_slide.cc.
References BM_EDGES_OF_VERT, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ITER_ELEM, BMBVH_EdgeVisible(), TransInfo::depsgraph, e, TransDataContainer::obedit, TransInfo::region, TransDataEdgeSlideVert::td, and v.
Referenced by calcEdgeSlide_mval_range().
| void transform_mode_edge_slide_reproject_input | ( | TransInfo * | t | ) |
Definition at line 952 of file transform_mode_edge_slide.cc.
References EdgeSlideData::curr_sv_index, edge_slide_data_init_mval(), edgeSlideFirstGet(), FOREACH_TRANS_DATA_CONTAINER, TransInfo::mouse, EdgeSlideData::mval_end, EdgeSlideData::mval_start, EdgeSlideData::project(), setCustomPoints(), EdgeSlideData::sv, and EdgeSlideData::update_proj_mat().
Referenced by transform_input_update().
| TransModeInfo TransMode_edgeslide |
Definition at line 973 of file transform_mode_edge_slide.cc.
Referenced by mode_info_get().