Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_editmesh.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_gizmo_utils.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "UI_resources.h"
#include "mesh_intern.h"
#include "ED_gizmo_library.h"
#include "ED_undo.h"
Go to the source code of this file.
Classes | |
struct | BisectData |
struct | GizmoGroup |
Macros | |
#define | USE_GIZMO |
Functions | |
static int | mesh_bisect_exec (bContext *C, wmOperator *op) |
static void | mesh_bisect_interactive_calc (bContext *C, wmOperator *op, float plane_co[3], float plane_no[3]) |
static int | mesh_bisect_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
static void | edbm_bisect_exit (BisectData *opdata) |
static int | mesh_bisect_modal (bContext *C, wmOperator *op, const wmEvent *event) |
void | MESH_OT_bisect (struct wmOperatorType *ot) |
#define USE_GIZMO |
Definition at line 37 of file editmesh_bisect.c.
typedef struct GizmoGroup GizmoGroup |
|
static |
Definition at line 173 of file editmesh_bisect.c.
References BisectData::backup, BisectData::backup_len, EDBM_redo_state_free(), G, BisectData::is_valid, MEM_freeN, and BisectData::mesh_backup.
Referenced by mesh_bisect_modal().
|
static |
XXX. calling redo from property updates is not great. This is needed because changing the RNA doesn't cause a redo and we're not using operator UI which does just this.
Definition at line 494 of file editmesh_bisect.c.
References GizmoGroup::context, GizmoGroup::data, ED_undo_operator_repeat(), GizmoGroup::op, and WM_operator_last_redo().
Referenced by gizmo_bisect_prop_angle_set(), gizmo_bisect_prop_depth_set(), and gizmo_bisect_prop_translate_set().
|
static |
Definition at line 615 of file editmesh_bisect.c.
References angle(), angle_signed_on_axis_v3v3_v3(), wmGizmoPropertyType::array_length, BLI_assert, wmGizmoGroup::customdata, GizmoGroup::data, is_zero_v3(), normalize_v3(), GizmoGroup::op, wmGizmo::parent_gzgroup, project_plane_normalized_v3_v3v3(), GizmoGroup::prop_plane_no, wmOperator::ptr, RNA_property_float_get_array(), GizmoGroup::rotate_axis, GizmoGroup::rotate_up, wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 641 of file editmesh_bisect.c.
References angle(), angle_compat_rad(), angle_signed_on_axis_v3v3_v3(), wmGizmoPropertyType::array_length, axis_angle_normalized_to_mat3(), BLI_assert, wmGizmoGroup::customdata, GizmoGroup::data, gizmo_bisect_exec(), is_zero_v3(), mul_m3_v3(), normalize_v3(), GizmoGroup::op, wmGizmo::parent_gzgroup, project_plane_normalized_v3_v3v3(), GizmoGroup::prop_plane_no, wmOperator::ptr, RNA_property_float_get_array(), RNA_property_float_set_array(), GizmoGroup::rotate_axis, GizmoGroup::rotate_up, wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 543 of file editmesh_bisect.c.
References wmGizmoPropertyType::array_length, BLI_assert, wmGizmoGroup::customdata, GizmoGroup::data, dot_v3v3(), wmGizmo::matrix_basis, GizmoGroup::op, wmGizmo::parent_gzgroup, GizmoGroup::prop_plane_co, GizmoGroup::prop_plane_no, wmOperator::ptr, RNA_property_float_get_array(), wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 559 of file editmesh_bisect.c.
References wmGizmoPropertyType::array_length, BLI_assert, closest_to_plane_normalized_v3(), wmGizmoGroup::customdata, GizmoGroup::data, dot_v3v3(), gizmo_bisect_exec(), wmGizmo::matrix_basis, normalize_v3(), GizmoGroup::op, wmGizmo::parent_gzgroup, GizmoGroup::prop_plane_co, GizmoGroup::prop_plane_no, wmOperator::ptr, RNA_property_float_get_array(), RNA_property_float_set_array(), wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 586 of file editmesh_bisect.c.
References wmGizmoPropertyType::array_length, BLI_assert, wmGizmoGroup::customdata, GizmoGroup::data, GizmoGroup::op, wmGizmo::parent_gzgroup, GizmoGroup::prop_plane_co, wmOperator::ptr, RNA_property_float_get_array(), wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 599 of file editmesh_bisect.c.
References wmGizmoPropertyType::array_length, BLI_assert, wmGizmoGroup::customdata, GizmoGroup::data, gizmo_bisect_exec(), GizmoGroup::op, wmGizmo::parent_gzgroup, GizmoGroup::prop_plane_co, wmOperator::ptr, RNA_property_float_set_array(), wmGizmoProperty::type, and UNUSED_VARS_NDEBUG.
|
static |
Definition at line 750 of file editmesh_bisect.c.
References GizmoGroup::context, wmGizmoGroup::customdata, GizmoGroup::data, gizmo_mesh_bisect_update_from_op(), wmOperator::next, GizmoGroup::op, and WM_operator_last_redo().
Referenced by MESH_GGT_bisect().
|
static |
Definition at line 676 of file editmesh_bisect.c.
References C, and ED_gizmo_poll_or_unlink_delayed_from_operator().
Referenced by MESH_GGT_bisect().
|
static |
Definition at line 681 of file editmesh_bisect.c.
References C, wmGizmo::color, GizmoGroup::context, wmGizmoGroup::customdata, GizmoGroup::data, ED_GIZMO_ARROW_STYLE_NORMAL, ED_GIZMO_MOVE_STYLE_RING_2D, gizmo_mesh_bisect_update_from_op(), wmOperatorType::idname, MEM_callocN, NULL, GizmoGroup::op, GizmoGroup::prop_plane_co, GizmoGroup::prop_plane_no, wmOperator::ptr, wmGizmo::ptr, RNA_enum_set(), RNA_struct_find_property(), GizmoGroup::rotate_c, STREQ, TH_GIZMO_PRIMARY, TH_GIZMO_SECONDARY, GizmoGroup::translate_c, GizmoGroup::translate_z, wmOperator::type, UI_GetThemeColor3fv(), WM_GIZMO_DRAW_VALUE, WM_gizmo_new_ptr(), WM_gizmo_set_flag(), WM_gizmo_target_property_def_func(), WM_gizmotype_find(), and WM_operator_last_redo().
Referenced by MESH_GGT_bisect().
|
static |
Definition at line 502 of file editmesh_bisect.c.
References GizmoGroup::context, cross_v3_v3v3(), GizmoGroup::data, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR, ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y, ED_view3d_context_rv3d(), normalize_v3(), normalize_v3_v3(), GizmoGroup::op, project_plane_normalized_v3_v3v3(), GizmoGroup::prop_plane_co, GizmoGroup::prop_plane_no, wmOperator::ptr, wmGizmo::ptr, RNA_enum_set(), RNA_property_float_get_array(), GizmoGroup::rotate_axis, GizmoGroup::rotate_c, GizmoGroup::rotate_up, GizmoGroup::translate_c, GizmoGroup::translate_z, RegionView3D::viewinv, WM_gizmo_set_matrix_location(), WM_gizmo_set_matrix_offset_rotation_from_yz_axis(), WM_gizmo_set_matrix_rotation_from_z_axis(), and WM_gizmo_set_scale().
Referenced by gizmo_mesh_bisect_draw_prepare(), and gizmo_mesh_bisect_setup().
|
static |
Definition at line 224 of file editmesh_bisect.c.
References BisectData::backup, BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BMEditMesh::bm, bm, BM_EDGE, BM_ELEM_SELECT, BM_FACE, BM_VERT, BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_buffer_hflag_enable(), C, copy_v3_v3(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Scene::cursor, wmOperator::customdata, Object::data, wmGenericUserData::data, ED_view3d_context_rv3d(), EDBM_flag_disable_all(), EDBM_op_finish(), EDBM_op_init(), EDBM_redo_state_restore(), EDBM_selectmode_flush(), EDBM_update(), if(), invert_m4_m4(), BisectData::is_dirty, BisectData::is_valid, View3DCursor::location, MEM_freeN, BisectData::mesh_backup, mesh_bisect_interactive_calc(), mul_m4_v3(), mul_transposed_mat3_m4_v3(), normalize_v3_v3(), NULL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, ret, RNA_boolean_get(), RNA_float_get(), RNA_property_float_get_array(), RNA_property_float_set_array(), RNA_property_is_set(), RNA_struct_find_property(), scene, BMOperator::slots_out, BMesh::totedgesel, wmGesture::user_data, and RegionView3D::viewinv.
Referenced by mesh_bisect_invoke(), and MESH_OT_bisect().
|
static |
Definition at line 61 of file editmesh_bisect.c.
References C, cross_v3_v3v3(), CTX_wm_region(), CTX_wm_view3d(), ED_view3d_calc_zfac(), ED_view3d_win_to_3d(), ED_view3d_win_to_delta(), ED_view3d_win_to_vector(), negate_v3(), normalize_v3(), RegionView3D::ofs, wmOperator::ptr, ARegion::regiondata, RNA_boolean_get(), RNA_int_get(), and sub_v2_v2v2().
Referenced by mesh_bisect_exec().
|
static |
Definition at line 100 of file editmesh_bisect.c.
References BisectData::backup, BisectData::backup_len, BKE_editmesh_from_object(), BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BMEditMesh::bm, C, CTX_data_view_layer(), CTX_wm_region_view3d(), CTX_wm_view3d(), wmOperator::customdata, wmGenericUserData::data, ED_workspace_status_text(), EDBM_redo_state_store(), G, G_TRANSFORM_EDIT, BisectData::is_valid, MEM_callocN, MEM_freeN, MEM_mallocN, BisectData::mesh_backup, mesh_bisect_exec(), NULL, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, wmOperator::reports, ret, RNA_boolean_get(), RNA_struct_property_is_set(), RPT_ERROR, TIP_, BMesh::totedgesel, wmGesture::user_data, WM_gesture_straightline_active_side_invoke(), and WM_gesture_straightline_invoke().
Referenced by MESH_OT_bisect().
|
static |
Definition at line 185 of file editmesh_bisect.c.
References C, CTX_wm_view3d(), wmOperator::customdata, wmGenericUserData::data, ED_workspace_status_text(), edbm_bisect_exit(), EVT_MODAL_MAP, GESTURE_MODAL_BEGIN, View3D::gizmo_flag, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ret, TIP_, wmEvent::type, wmGesture::user_data, V3D_GIZMO_HIDE, wmEvent::val, WM_gesture_straightline_modal(), and WM_gizmo_group_type_ensure().
Referenced by MESH_OT_bisect().
|
static |
Definition at line 759 of file editmesh_bisect.c.
References wmGizmoGroupType::draw_prepare, wmGizmoGroupType::flag, gizmo_mesh_bisect_draw_prepare(), gizmo_mesh_bisect_poll(), gizmo_mesh_bisect_setup(), wmGizmoGroupType::gzmap_params, wmGizmoGroupType::idname, wmGizmoGroupType::name, wmGizmoGroupType::poll, wmGizmoMapType_Params::regionid, RGN_TYPE_WINDOW, wmGizmoGroupType::setup, SPACE_VIEW3D, wmGizmoMapType_Params::spaceid, WM_GIZMOGROUPTYPE_3D, and WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE.
Referenced by MESH_OT_bisect().
void MESH_OT_bisect | ( | struct wmOperatorType * | ot | ) |
Definition at line 396 of file editmesh_bisect.c.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_editmesh(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, mesh_bisect_exec(), mesh_bisect_invoke(), mesh_bisect_modal(), MESH_GGT_bisect(), wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_float(), RNA_def_float_vector(), RNA_def_float_vector_xyz(), RNA_def_property_flag(), RNA_def_property_ui_range(), wmOperatorType::srna, WM_CURSOR_EDIT, WM_gesture_straightline_cancel(), WM_gizmogrouptype_append(), and WM_operator_properties_gesture_straightline().
Referenced by ED_operatortypes_mesh().