Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BKE_context.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_select.h"
#include "GPU_state.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_gizmo_library.h"
#include "ED_screen.h"
#include "ED_transform_snap_object_context.h"
#include "ED_view3d.h"
#include "../gizmo_geometry.h"
#include "../gizmo_library_intern.h"
Go to the source code of this file.
Classes | |
struct | MoveGizmo3D |
struct | MoveInteraction |
Functions | |
Move Gizmo API | |
static void | GIZMO_GT_move_3d (wmGizmoType *gzt) |
void | ED_gizmotypes_move_3d (void) |
Move Gizmo | |
Simple gizmo to move and translate. 3D Gizmo, also works in 2D views.
| |
#define | MVAL_MAX_PX_DIST 12.0f |
#define | DIAL_RESOLUTION 32 |
typedef struct MoveGizmo3D | MoveGizmo3D |
typedef struct MoveInteraction | MoveInteraction |
static void | gizmo_move_matrix_basis_get (const wmGizmo *gz, float r_matrix[4][4]) |
static int | gizmo_move_modal (bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag) |
static void | move_geom_draw (const wmGizmo *gz, const float color[4], const bool select, const int draw_options) |
static void | move3d_get_translate (const wmGizmo *gz, const wmEvent *event, const ARegion *region, float co_delta[3]) |
static void | move3d_draw_intern (const bContext *C, wmGizmo *gz, const bool select, const bool highlight) |
static void | gizmo_move_draw_select (const bContext *C, wmGizmo *gz, int select_id) |
static void | gizmo_move_draw (const bContext *C, wmGizmo *gz) |
static void | gizmo_move_exit (bContext *C, wmGizmo *gz, const bool cancel) |
static int | gizmo_move_invoke (bContext *C, wmGizmo *gz, const wmEvent *event) |
static int | gizmo_move_test_select (bContext *C, wmGizmo *gz, const int mval[2]) |
static void | gizmo_move_property_update (wmGizmo *gz, wmGizmoProperty *gz_prop) |
static int | gizmo_move_cursor_get (wmGizmo *UNUSED(gz)) |
#define DIAL_RESOLUTION 32 |
Definition at line 81 of file move3d_gizmo.c.
#define MVAL_MAX_PX_DIST 12.0f |
Definition at line 44 of file move3d_gizmo.c.
typedef struct MoveGizmo3D MoveGizmo3D |
typedef struct MoveInteraction MoveInteraction |
Definition at line 467 of file move3d_gizmo.c.
References GIZMO_GT_move_3d(), and WM_gizmotype_append().
Referenced by ED_spacetypes_init().
|
static |
Definition at line 428 of file move3d_gizmo.c.
References wmGizmoType::cursor_get, wmGizmoType::draw, wmGizmoType::draw_select, ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW, ED_GIZMO_MOVE_DRAW_FLAG_FILL, ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT, ED_GIZMO_MOVE_STYLE_CROSS_2D, ED_GIZMO_MOVE_STYLE_RING_2D, wmGizmoType::exit, gizmo_move_cursor_get(), gizmo_move_draw(), gizmo_move_draw_select(), gizmo_move_exit(), gizmo_move_invoke(), gizmo_move_matrix_basis_get(), gizmo_move_modal(), gizmo_move_property_update(), gizmo_move_test_select(), wmGizmoType::idname, wmGizmoType::invoke, wmGizmoType::matrix_basis_get, wmGizmoType::modal, NULL, PROP_FLOAT, wmGizmoType::property_update, RNA_def_boolean(), RNA_def_enum(), RNA_def_enum_flag(), wmGizmoType::srna, wmGizmoType::struct_size, wmGizmoType::test_select, and WM_gizmotype_target_property_def().
Referenced by ED_gizmotypes_move_3d().
|
static |
Definition at line 419 of file move3d_gizmo.c.
References WM_CURSOR_NSEW_SCROLL.
Referenced by GIZMO_GT_move_3d().
Definition at line 223 of file move3d_gizmo.c.
References C, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, move3d_draw_intern(), wmGizmo::state, void, WM_GIZMO_STATE_HIGHLIGHT, and WM_GIZMO_STATE_MODAL.
Referenced by GIZMO_GT_move_3d().
Definition at line 217 of file move3d_gizmo.c.
References C, GPU_select_load_id(), and move3d_draw_intern().
Referenced by GIZMO_GT_move_3d().
Definition at line 316 of file move3d_gizmo.c.
References C, ED_transform_snap_object_context_destroy(), MoveInteraction::init, wmGizmo::interaction_data, NULL, MoveInteraction::prop_co, MoveInteraction::snap_context_v3d, WM_gizmo_target_property_anim_autokey(), WM_gizmo_target_property_find(), WM_gizmo_target_property_float_set_array(), and WM_gizmo_target_property_is_valid().
Referenced by GIZMO_GT_move_3d().
Definition at line 350 of file move3d_gizmo.c.
References blender::compositor::area(), BLI_assert, C, copy_v3_v3(), CTX_data_scene(), CTX_wm_area(), ED_transform_snap_object_context_create(), MoveInteraction::init, wmGizmo::interaction_data, MoveInteraction::matrix_final, MEM_callocN, MoveInteraction::mval, OPERATOR_RUNNING_MODAL, MoveInteraction::prop_co, wmGizmo::ptr, RNA_boolean_get(), MoveInteraction::snap_context_v3d, SPACE_VIEW3D, WM_gizmo_calc_matrix_final(), WM_gizmo_target_property_find(), WM_gizmo_target_property_float_get_array(), and WM_gizmo_target_property_is_valid().
Referenced by GIZMO_GT_move_3d().
Definition at line 52 of file move3d_gizmo.c.
References add_v3_v3(), copy_m4_m4(), MoveGizmo3D::gizmo, wmGizmo::matrix_basis, and MoveGizmo3D::prop_co.
Referenced by GIZMO_GT_move_3d().
|
static |
Definition at line 235 of file move3d_gizmo.c.
References add_v3_v3v3(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_area(), CTX_wm_region(), CTX_wm_view3d(), ED_region_tag_redraw_editor_overlays(), ED_transform_snap_object_project_view3d(), wmGizmo::flag, gizmo_window_project_2d(), MoveInteraction::init, wmGizmo::interaction_data, invert_m4_m4(), wmGizmo::matrix_space, MOUSEMOVE, move3d_get_translate(), mul_v2_fl(), mul_v3_fl(), mul_v3_m4v3(), MoveInteraction::mval, wmEvent::mval, MVAL_MAX_PX_DIST, NULL, OPERATOR_RUNNING_MODAL, MoveInteraction::prev, MoveGizmo3D::prop_co, MoveInteraction::prop_co, SnapObjectContext::region, wmGizmo::scale_final, SCE_SNAP_MODE_EDGE, SCE_SNAP_MODE_FACE_RAYCAST, SCE_SNAP_MODE_VERTEX, SCE_SNAP_TARGET_ALL, MoveInteraction::snap_context_v3d, SNAP_GEOM_EDIT, SPACE_VIEW3D, sub_v2_v2v2(), MoveInteraction::tweak_flag, wmEvent::type, UNPACK2, WM_GIZMO_DRAW_NO_SCALE, WM_gizmo_target_property_find(), WM_gizmo_target_property_float_set_array(), WM_gizmo_target_property_is_valid(), WM_GIZMO_TWEAK_PRECISE, WM_GIZMO_TWEAK_SNAP, and zero_v3().
Referenced by GIZMO_GT_move_3d().
|
static |
Definition at line 408 of file move3d_gizmo.c.
References MoveGizmo3D::prop_co, WM_gizmo_target_property_float_get_array(), WM_gizmo_target_property_is_valid(), and zero_v3().
Referenced by GIZMO_GT_move_3d().
Definition at line 389 of file move3d_gizmo.c.
References C, wmGizmo::flag, gizmo_window_project_2d(), if(), len_squared_v2(), SnapObjectContext::mval, wmGizmo::scale_final, UNPACK2, and WM_GIZMO_DRAW_NO_SCALE.
Referenced by GIZMO_GT_move_3d().
|
static |
Definition at line 169 of file move3d_gizmo.c.
References C, color, CTX_wm_region_view3d(), ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW, gizmo_color_get(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), MoveInteraction::init, wmGizmo::interaction_data, MoveInteraction::matrix_final, move_geom_draw(), mul_m4_m4m4(), normalize_m4_m4(), wmGizmo::ptr, RNA_enum_get(), select(), transpose_m4(), RegionView3D::viewmat, WM_gizmo_calc_matrix_final(), and zero_v3().
Referenced by gizmo_move_draw(), and gizmo_move_draw_select().
|
static |
Definition at line 145 of file move3d_gizmo.c.
References copy_m3_m4(), ED_view3d_calc_zfac(), ED_view3d_win_to_delta(), MoveInteraction::init, wmGizmo::interaction_data, invert_m3(), wmGizmo::matrix_space, mul_m3_v3(), mul_v3_mat3_m4v3(), MoveInteraction::mval, MoveInteraction::prop_co, SnapObjectContext::region, and ARegion::regiondata.
Referenced by gizmo_move_modal().
|
static |
Definition at line 85 of file move3d_gizmo.c.
References BLI_assert, col, color, DIAL_RESOLUTION, ED_GIZMO_MOVE_DRAW_FLAG_FILL, ED_GIZMO_MOVE_DRAW_FLAG_FILL_SELECT, ED_GIZMO_MOVE_STYLE_CROSS_2D, ED_GIZMO_MOVE_STYLE_RING_2D, wmGizmo::flag, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), if(), imm_draw_circle_fill_3d(), imm_draw_circle_wire_3d(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immUniformColor4fv(), immVertex3f(), immVertexFormat(), wmGizmo::line_width, M_SQRT1_2, pos, wmGizmo::ptr, RNA_enum_get(), wmGizmo::scale_final, select(), UNUSED_VARS, WM_GIZMO_DRAW_NO_SCALE, and wm_gizmo_geometryinfo_draw().
Referenced by move3d_draw_intern().