Blender V4.3
transform_gizmo_3d.cc File Reference
#include "BLI_array_utils.h"
#include "BLI_function_ref.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "DNA_armature_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "BKE_armature.hh"
#include "BKE_context.hh"
#include "BKE_crazyspace.hh"
#include "BKE_curve.hh"
#include "BKE_editmesh.hh"
#include "BKE_global.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_grease_pencil.hh"
#include "BKE_layer.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_paint.hh"
#include "BKE_pointcache.h"
#include "BKE_scene.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "ED_armature.hh"
#include "ED_curves.hh"
#include "ED_gizmo_library.hh"
#include "ED_gizmo_utils.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_grease_pencil.hh"
#include "ED_object.hh"
#include "ED_particle.hh"
#include "ED_screen.hh"
#include "UI_resources.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "ANIM_bone_collections.hh"
#include "transform.hh"
#include "transform_convert.hh"
#include "transform_gizmo.hh"
#include "transform_snap.hh"

Go to the source code of this file.

Classes

struct  GizmoGroup
 

Macros

#define MAN_AXIS_RANGE_TRANS_START   MAN_AXIS_TRANS_X
 
#define MAN_AXIS_RANGE_TRANS_END   (MAN_AXIS_TRANS_ZX + 1)
 
#define MAN_AXIS_RANGE_ROT_START   MAN_AXIS_ROT_X
 
#define MAN_AXIS_RANGE_ROT_END   (MAN_AXIS_ROT_T + 1)
 
#define MAN_AXIS_RANGE_SCALE_START   MAN_AXIS_SCALE_X
 
#define MAN_AXIS_RANGE_SCALE_END   (MAN_AXIS_SCALE_ZX + 1)
 
#define FOREACH_EDIT_OBJECT_BEGIN(ob_iter, use_mat_local)
 
#define FOREACH_EDIT_OBJECT_END()
 
#define GIZMO_NEW_ARROW(v)
 
#define GIZMO_NEW_DIAL(v)
 
#define GIZMO_NEW_PRIM(v)
 

Functions

static wmGizmoGroupgizmogroup_xform_find (TransInfo *t)
 
void transform_gizmo_3d_model_from_constraint_and_mode_init (TransInfo *t)
 
void transform_gizmo_3d_model_from_constraint_and_mode_set (TransInfo *t)
 
void transform_gizmo_3d_model_from_constraint_and_mode_restore (TransInfo *t)
 
bool ED_transform_calc_pivot_pos (const bContext *C, const short pivot_type, float r_pivot_pos[3])
 

3D Transform Gizmo

Used for 3D View

#define MAN_TRANS_X   (1 << 0)
 
#define MAN_TRANS_Y   (1 << 1)
 
#define MAN_TRANS_Z   (1 << 2)
 
#define MAN_TRANS_C   (MAN_TRANS_X | MAN_TRANS_Y | MAN_TRANS_Z)
 
#define MAN_ROT_X   (1 << 3)
 
#define MAN_ROT_Y   (1 << 4)
 
#define MAN_ROT_Z   (1 << 5)
 
#define MAN_ROT_C   (MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z)
 
#define MAN_SCALE_X   (1 << 8)
 
#define MAN_SCALE_Y   (1 << 9)
 
#define MAN_SCALE_Z   (1 << 10)
 
#define MAN_SCALE_C   (MAN_SCALE_X | MAN_SCALE_Y | MAN_SCALE_Z)
 
enum  {
  MAN_AXIS_TRANS_X = 0 , MAN_AXIS_TRANS_Y , MAN_AXIS_TRANS_Z , MAN_AXIS_TRANS_C ,
  MAN_AXIS_TRANS_XY , MAN_AXIS_TRANS_YZ , MAN_AXIS_TRANS_ZX , MAN_AXIS_ROT_X ,
  MAN_AXIS_ROT_Y , MAN_AXIS_ROT_Z , MAN_AXIS_ROT_C , MAN_AXIS_ROT_T ,
  MAN_AXIS_SCALE_X , MAN_AXIS_SCALE_Y , MAN_AXIS_SCALE_Z , MAN_AXIS_SCALE_C ,
  MAN_AXIS_SCALE_XY , MAN_AXIS_SCALE_YZ , MAN_AXIS_SCALE_ZX , MAN_AXIS_LAST = MAN_AXIS_SCALE_ZX + 1
}
 
enum  { MAN_AXES_ALL = 0 , MAN_AXES_TRANSLATE , MAN_AXES_ROTATE , MAN_AXES_SCALE }
 
static wmGizmoGroupTypeg_GGT_xform_gizmo = nullptr
 
static wmGizmoGroupTypeg_GGT_xform_gizmo_context = nullptr
 
struct { 
 
   float   min 
 
   float   max 
 
g_tw_axis_range [2] 
 
static void gizmogroup_refresh_from_matrix (wmGizmoGroup *gzgroup, const float twmat[4][4], const float scale[3], const bool ignore_hidden)
 

Utilities

#define MAN_ITER_AXES_BEGIN(axis, axis_idx)
 
#define MAN_ITER_AXES_END
 
static wmGizmogizmo_get_axis_from_index (const GizmoGroup *ggd, const short axis_idx)
 
static short gizmo_get_axis_type (const int axis_idx)
 
static uint gizmo_orientation_axis (const int axis_idx, bool *r_is_plane)
 
static bool gizmo_is_axis_visible (const RegionView3D *rv3d, const int twtype, const float idot[3], const int axis_type, const int axis_idx)
 
static void gizmo_get_axis_color (const int axis_idx, const float idot[3], float r_col[4], float r_col_hi[4])
 
static void gizmo_get_axis_constraint (const int axis_idx, bool r_axis[3])
 
static void reset_tw_center (TransformBounds *tbounds)
 
static void calc_tw_center (TransformBounds *tbounds, const float co[3])
 
static void protectflag_to_drawflags (short protectflag, short *drawflags)
 
static Objectgizmo_3d_transform_space_object_get (Scene *scene, ViewLayer *view_layer)
 
static int gizmo_3d_foreach_selected (const bContext *C, const short orient_index, const bool use_curve_handles, const bool use_only_center, FunctionRef< void(const float3 &)> user_fn, const float(**r_mat)[4], short *r_drawflags)
 
int ED_transform_calc_gizmo_stats (const bContext *C, const TransformCalcParams *params, TransformBounds *tbounds, RegionView3D *rv3d)
 
static void gizmo_get_idot (const RegionView3D *rv3d, float r_idot[3])
 
static bool gizmo_3d_calc_pos (const bContext *C, const Scene *scene, const TransformBounds *tbounds, const short pivot_type, float r_pivot_pos[3])
 
void gizmo_prepare_mat (const bContext *C, RegionView3D *rv3d, const TransformBounds *tbounds)
 
static void gizmo_line_range (const int twtype, const short axis_type, float *r_start, float *r_end)
 
void gizmo_xform_message_subscribe (wmGizmoGroup *gzgroup, wmMsgBus *mbus, Scene *scene, bScreen *screen, ScrArea *area, ARegion *region, void(*type_fn)(wmGizmoGroupType *))
 
static void gizmo_3d_dial_matrixbasis_calc (const ARegion *region, const float axis[3], const float center_global[3], const float mval_init[2], float r_mat_basis[4][4])
 

Transform Gizmo

#define MAN_AXIS_SCALE_PLANE_SCALE   0.7f
 
static void rotation_get_fn (const wmGizmo *, wmGizmoProperty *gz_prop, void *value)
 
static void rotation_set_fn (const wmGizmo *, wmGizmoProperty *gz_prop, const void *value)
 
static void gizmo_3d_setup_default_matrix (wmGizmo *axis, const int axis_idx)
 
static void gizmo_3d_setup_draw_default (wmGizmo *axis, const int axis_idx)
 
static void gizmo_3d_setup_draw_from_twtype (wmGizmo *axis, const int axis_idx, const int twtype)
 
static void gizmo_3d_setup_draw_modal (wmGizmo *axis, const int axis_idx, const int twtype)
 
static GizmoGroupgizmogroup_init (wmGizmoGroup *gzgroup)
 
static int gizmo_modal (bContext *C, wmGizmo *widget, const wmEvent *event, eWM_GizmoFlagTweak)
 
static void gizmogroup_init_properties_from_twtype (wmGizmoGroup *gzgroup)
 
static void WIDGETGROUP_gizmo_setup (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_refresh_from_matrix (wmGizmo *axis, const int axis_idx, const int twtype, const float twmat[4][4], const float scale[3])
 
static void WIDGETGROUP_gizmo_refresh (const bContext *C, wmGizmoGroup *gzgroup)
 
static void WIDGETGROUP_gizmo_message_subscribe (const bContext *C, wmGizmoGroup *gzgroup, wmMsgBus *mbus)
 
static void gizmogroup_hide_all (GizmoGroup *ggd)
 
static void WIDGETGROUP_gizmo_draw_prepare (const bContext *C, wmGizmoGroup *gzgroup)
 
static void gizmo_3d_draw_invoke (wmGizmoGroup *gzgroup, const ARegion *region, const int axis_idx_active, const float mval[2])
 
static void WIDGETGROUP_gizmo_invoke_prepare (const bContext *C, wmGizmoGroup *gzgroup, wmGizmo *gz, const wmEvent *event)
 
static bool WIDGETGROUP_gizmo_poll_generic (View3D *v3d)
 
static bool WIDGETGROUP_gizmo_poll_context (const bContext *C, wmGizmoGroupType *)
 
static bool WIDGETGROUP_gizmo_poll_tool (const bContext *C, wmGizmoGroupType *gzgt)
 
void VIEW3D_GGT_xform_gizmo (wmGizmoGroupType *gzgt)
 
void VIEW3D_GGT_xform_gizmo_context (wmGizmoGroupType *gzgt)
 

Macro Definition Documentation

◆ FOREACH_EDIT_OBJECT_BEGIN

#define FOREACH_EDIT_OBJECT_BEGIN ( ob_iter,
use_mat_local )
Value:
{ \
invert_m4_m4(obedit->runtime->world_to_object.ptr(), obedit->object_to_world().ptr()); \
scene, view_layer, CTX_wm_view3d(C)); \
for (Object * ob_iter : objects) { \
const bool use_mat_local = (ob_iter != obedit);
View3D * CTX_wm_view3d(const bContext *C)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)

Referenced by gizmo_3d_foreach_selected().

◆ FOREACH_EDIT_OBJECT_END

#define FOREACH_EDIT_OBJECT_END ( )
Value:
} \
} \
((void)0)

Referenced by gizmo_3d_foreach_selected().

◆ GIZMO_NEW_ARROW

#define GIZMO_NEW_ARROW ( v)
Value:
{ \
ggd->gizmos[v] = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr); \
} \
((void)0)
ATTR_WARN_UNUSED_RESULT const BMVert * v
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:81

Referenced by gizmogroup_init().

◆ GIZMO_NEW_DIAL

#define GIZMO_NEW_DIAL ( v)
Value:
{ \
ggd->gizmos[v] = WM_gizmo_new_ptr(gzt_dial, gzgroup, nullptr); \
WM_gizmo_target_property_def_func(ggd->gizmos[v], "offset", &params); \
} \
((void)0)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]

Referenced by gizmogroup_init().

◆ GIZMO_NEW_PRIM

#define GIZMO_NEW_PRIM ( v)
Value:
{ \
ggd->gizmos[v] = WM_gizmo_new_ptr(gzt_prim, gzgroup, nullptr); \
} \
((void)0)

Referenced by gizmogroup_init().

◆ MAN_AXIS_RANGE_ROT_END

#define MAN_AXIS_RANGE_ROT_END   (MAN_AXIS_ROT_T + 1)

◆ MAN_AXIS_RANGE_ROT_START

#define MAN_AXIS_RANGE_ROT_START   MAN_AXIS_ROT_X

◆ MAN_AXIS_RANGE_SCALE_END

#define MAN_AXIS_RANGE_SCALE_END   (MAN_AXIS_SCALE_ZX + 1)

Definition at line 131 of file transform_gizmo_3d.cc.

Referenced by gizmo_get_axis_type().

◆ MAN_AXIS_RANGE_SCALE_START

#define MAN_AXIS_RANGE_SCALE_START   MAN_AXIS_SCALE_X

Definition at line 130 of file transform_gizmo_3d.cc.

Referenced by gizmo_get_axis_type().

◆ MAN_AXIS_RANGE_TRANS_END

#define MAN_AXIS_RANGE_TRANS_END   (MAN_AXIS_TRANS_ZX + 1)

Definition at line 113 of file transform_gizmo_3d.cc.

Referenced by gizmo_get_axis_type().

◆ MAN_AXIS_RANGE_TRANS_START

#define MAN_AXIS_RANGE_TRANS_START   MAN_AXIS_TRANS_X

Definition at line 112 of file transform_gizmo_3d.cc.

Referenced by gizmo_get_axis_type().

◆ MAN_AXIS_SCALE_PLANE_SCALE

#define MAN_AXIS_SCALE_PLANE_SCALE   0.7f

Scale of the two-axis planes.

Definition at line 1278 of file transform_gizmo_3d.cc.

Referenced by gizmo_3d_setup_draw_default(), and gizmo_refresh_from_matrix().

◆ MAN_ITER_AXES_BEGIN

#define MAN_ITER_AXES_BEGIN ( axis,
axis_idx )
Value:
{ \
wmGizmo *axis; \
int axis_idx; \
for (axis_idx = 0; axis_idx < MAN_AXIS_LAST; axis_idx++) { \
axis = gizmo_get_axis_from_index(ggd, axis_idx);
static wmGizmo * gizmo_get_axis_from_index(const GizmoGroup *ggd, const short axis_idx)
@ MAN_AXIS_LAST

Definition at line 169 of file transform_gizmo_3d.cc.

Referenced by gizmogroup_hide_all(), gizmogroup_init(), gizmogroup_init_properties_from_twtype(), gizmogroup_refresh_from_matrix(), transform_gizmo_3d_model_from_constraint_and_mode_restore(), and WIDGETGROUP_gizmo_draw_prepare().

◆ MAN_ITER_AXES_END

◆ MAN_ROT_C

#define MAN_ROT_C   (MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z)

Definition at line 84 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_ROT_X

#define MAN_ROT_X   (1 << 3)

Definition at line 81 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_ROT_Y

#define MAN_ROT_Y   (1 << 4)

Definition at line 82 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_ROT_Z

#define MAN_ROT_Z   (1 << 5)

Definition at line 83 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_SCALE_C

#define MAN_SCALE_C   (MAN_SCALE_X | MAN_SCALE_Y | MAN_SCALE_Z)

Definition at line 89 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_SCALE_X

#define MAN_SCALE_X   (1 << 8)

Definition at line 86 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_SCALE_Y

#define MAN_SCALE_Y   (1 << 9)

Definition at line 87 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_SCALE_Z

#define MAN_SCALE_Z   (1 << 10)

Definition at line 88 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_TRANS_C

#define MAN_TRANS_C   (MAN_TRANS_X | MAN_TRANS_Y | MAN_TRANS_Z)

Definition at line 79 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_TRANS_X

#define MAN_TRANS_X   (1 << 0)

Definition at line 76 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_TRANS_Y

#define MAN_TRANS_Y   (1 << 1)

Definition at line 77 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

◆ MAN_TRANS_Z

#define MAN_TRANS_Z   (1 << 2)

Definition at line 78 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAN_AXIS_TRANS_X 
MAN_AXIS_TRANS_Y 
MAN_AXIS_TRANS_Z 
MAN_AXIS_TRANS_C 
MAN_AXIS_TRANS_XY 
MAN_AXIS_TRANS_YZ 
MAN_AXIS_TRANS_ZX 
MAN_AXIS_ROT_X 
MAN_AXIS_ROT_Y 
MAN_AXIS_ROT_Z 
MAN_AXIS_ROT_C 
MAN_AXIS_ROT_T 
MAN_AXIS_SCALE_X 
MAN_AXIS_SCALE_Y 
MAN_AXIS_SCALE_Z 
MAN_AXIS_SCALE_C 
MAN_AXIS_SCALE_XY 
MAN_AXIS_SCALE_YZ 
MAN_AXIS_SCALE_ZX 
MAN_AXIS_LAST 

Definition at line 103 of file transform_gizmo_3d.cc.

◆ anonymous enum

anonymous enum
Enumerator
MAN_AXES_ALL 
MAN_AXES_TRANSLATE 
MAN_AXES_ROTATE 
MAN_AXES_SCALE 

Definition at line 137 of file transform_gizmo_3d.cc.

Function Documentation

◆ calc_tw_center()

static void calc_tw_center ( TransformBounds * tbounds,
const float co[3] )
static

◆ ED_transform_calc_gizmo_stats()

◆ ED_transform_calc_pivot_pos()

bool ED_transform_calc_pivot_pos ( const bContext * C,
const short pivot_type,
float r_pivot_pos[3] )

Definition at line 2433 of file transform_gizmo_3d.cc.

References CTX_data_scene(), and gizmo_3d_calc_pos().

Referenced by view3d_orbit_calc_center().

◆ gizmo_3d_calc_pos()

◆ gizmo_3d_dial_matrixbasis_calc()

static void gizmo_3d_dial_matrixbasis_calc ( const ARegion * region,
const float axis[3],
const float center_global[3],
const float mval_init[2],
float r_mat_basis[4][4] )
static

◆ gizmo_3d_draw_invoke()

◆ gizmo_3d_foreach_selected()

static int gizmo_3d_foreach_selected ( const bContext * C,
const short orient_index,
const bool use_curve_handles,
const bool use_only_center,
FunctionRef< void(const float3 &)> user_fn,
const float(**) r_mat[4],
short * r_drawflags )
static

Run user_fn for each coordinate of elements selected in View3D (vertices, particles...).

Note
Each coordinate has the space matrix of the active object.
Parameters
orient_indexA TransformOrientationSlot.type. Here used for calculating r_drawflags.
use_curve_handlesIf true, the handles of curves are traversed.
use_only_centerFor objects in object mode, defines whether the corners of the bounds or just the center are traversed.
user_fnCallback that runs on each coordinate.
r_matReturns the space matrix of the coordinates.
r_drawflagsDrawing flags for gizmos. Usually stored in #RegionView3D::drawflags.

Definition at line 519 of file transform_gizmo_3d.cc.

References BASE_SELECTED, BASE_SELECTED_EDITABLE, Nurb::bezt, BKE_boundbox_init_from_minmax(), BKE_curve_editNurbs_get(), BKE_editmesh_from_object(), BKE_object_boundbox_get(), BKE_object_pose_array_get(), BKE_view_layer_active_base_get(), BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), bm, BMEditMesh::bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ITER_MESH, BM_VERTS_OF_MESH, BONE_CONNECTED, BONE_EDITMODE_LOCKED, BONE_ROOTSEL, BONE_SELECTED, BONE_TIPSEL, BONE_TRANSFORM, Nurb::bp, BMVert::co, PTCacheEditKey::co, CTX_data_expect_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CU_BEZIER, CURVE_HANDLE_NONE, Lattice::def, depsgraph, blender::ed::greasepencil::MutableDrawingInfo::drawing, EBONE_VISIBLE, bArmature::edbo, MetaBall::editelems, Lattice::editlatt, ELEM, BezTriple::f1, BPoint::f1, BezTriple::f2, BezTriple::f3, ListBase::first, Base::flag, PTCacheEditKey::flag, FOREACH_EDIT_OBJECT_BEGIN, FOREACH_EDIT_OBJECT_END, blender::index_mask::IndexMask::foreach_index(), blender::ed::greasepencil::MutableDrawingInfo::frame_number, Curves::geometry, blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(), gizmo_3d_transform_space_object_get(), View3DOverlay::handle_display, invert_m4_m4(), EditLatt::latt, blender::ed::greasepencil::MutableDrawingInfo::layer_index, LISTBASE_FOREACH, Object::mode, mul_m4_m4m4(), mul_v3_m4v3(), Nurb::next, OB_ARMATURE, OB_CURVES, OB_CURVES_LEGACY, OB_GREASE_PENCIL, OB_LATTICE, OB_LOCK_LOC, OB_LOCK_ROT, OB_LOCK_SCALE, OB_MBALL, OB_MESH, OB_MODE_ALL_PAINT, OB_MODE_PARTICLE_EDIT, OB_MODE_POSE, OB_MODE_SCULPT, OB_SURF, OBEDIT_FROM_OBACT, Base::object, View3D::overlay, blender::threading::parallel_for_each(), PE_get_current(), PEK_SELECT, PEK_USE_WCO, PEP_HIDE, SculptSession::pivot_pos, Lattice::pntsu, Nurb::pntsu, Lattice::pntsv, Nurb::pntsv, Lattice::pntsw, point, PTCacheEdit::points, protectflag_to_drawflags(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::ed::greasepencil::retrieve_editable_drawings(), blender::ed::curves::retrieve_selected_points(), Object::runtime, Object::sculpt, SELECT, blender::index_mask::IndexMask::size(), blender::bke::greasepencil::Drawing::strokes(), TFM_ROTATION, PTCacheEdit::totpoint, BMesh::totvertsel, transform_convert_pose_transflags_update(), Nurb::type, V3D_AROUND_CENTER_BOUNDS, V3D_ORIENT_GIMBAL, V3D_ORIENT_GLOBAL, V3D_ORIENT_LOCAL, BezTriple::vec, BPoint::vec, and PTCacheEditKey::world_co.

Referenced by ED_transform_calc_gizmo_stats(), and gizmo_3d_calc_pos().

◆ gizmo_3d_setup_default_matrix()

◆ gizmo_3d_setup_draw_default()

◆ gizmo_3d_setup_draw_from_twtype()

◆ gizmo_3d_setup_draw_modal()

◆ gizmo_3d_transform_space_object_get()

◆ gizmo_get_axis_color()

◆ gizmo_get_axis_constraint()

◆ gizmo_get_axis_from_index()

static wmGizmo * gizmo_get_axis_from_index ( const GizmoGroup * ggd,
const short axis_idx )
static

◆ gizmo_get_axis_type()

◆ gizmo_get_idot()

static void gizmo_get_idot ( const RegionView3D * rv3d,
float r_idot[3] )
static

◆ gizmo_is_axis_visible()

◆ gizmo_line_range()

static void gizmo_line_range ( const int twtype,
const short axis_type,
float * r_start,
float * r_end )
static

Sets up r_start and r_len to define arrow line range. Needed to adjust line drawing for combined gizmo axis types.

Definition at line 1099 of file transform_gizmo_3d.cc.

References MAN_AXES_SCALE, MAN_AXES_TRANSLATE, V3D_GIZMO_SHOW_OBJECT_ROTATE, V3D_GIZMO_SHOW_OBJECT_SCALE, and V3D_GIZMO_SHOW_OBJECT_TRANSLATE.

Referenced by gizmo_3d_setup_draw_from_twtype(), gizmo_3d_setup_draw_modal(), and gizmo_refresh_from_matrix().

◆ gizmo_modal()

◆ gizmo_orientation_axis()

◆ gizmo_prepare_mat()

void gizmo_prepare_mat ( const bContext * C,
RegionView3D * rv3d,
const TransformBounds * tbounds )

◆ gizmo_refresh_from_matrix()

◆ gizmo_xform_message_subscribe()

◆ gizmogroup_hide_all()

static void gizmogroup_hide_all ( GizmoGroup * ggd)
static

◆ gizmogroup_init()

◆ gizmogroup_init_properties_from_twtype()

◆ gizmogroup_refresh_from_matrix()

static void gizmogroup_refresh_from_matrix ( wmGizmoGroup * gzgroup,
const float twmat[4][4],
const float scale[3],
const bool ignore_hidden )
static

◆ gizmogroup_xform_find()

◆ protectflag_to_drawflags()

static void protectflag_to_drawflags ( short protectflag,
short * drawflags )
static

◆ reset_tw_center()

◆ rotation_get_fn()

static void rotation_get_fn ( const wmGizmo * ,
wmGizmoProperty * gz_prop,
void * value )
static

◆ rotation_set_fn()

static void rotation_set_fn ( const wmGizmo * ,
wmGizmoProperty * gz_prop,
const void * value )
static

◆ transform_gizmo_3d_model_from_constraint_and_mode_init()

void transform_gizmo_3d_model_from_constraint_and_mode_init ( TransInfo * t)

Set the T_NO_GIZMO flag.

Note
This maintains the conventional behavior of not displaying the gizmo if the operator has been triggered by shortcuts.

Definition at line 2305 of file transform_gizmo_3d.cc.

References ELEM, TransInfo::flag, g_GGT_xform_gizmo, g_GGT_xform_gizmo_context, ARegion::gizmo_map, wmGizmo::parent_gzgroup, TransInfo::region, T_NO_GIZMO, wmGizmoGroup::type, and WM_gizmomap_get_modal().

Referenced by initTransInfo().

◆ transform_gizmo_3d_model_from_constraint_and_mode_restore()

void transform_gizmo_3d_model_from_constraint_and_mode_restore ( TransInfo * t)

◆ transform_gizmo_3d_model_from_constraint_and_mode_set()

void transform_gizmo_3d_model_from_constraint_and_mode_set ( TransInfo * t)

Change the gizmo and its orientation to match the transform state.

Note
This used while the modal operator is running so changes to the constraint or mode show the gizmo associated with that state, as if it had been the initial gizmo dragged.

Definition at line 2318 of file transform_gizmo_3d.cc.

References BLI_assert_msg, BLI_STATIC_ASSERT, TransInfo::center_global, TransInfo::con, CON_APPLY, CON_AXIS0, CON_AXIS1, CON_AXIS2, TransInfo::context, copy_m4_m3(), copy_v2_v2_int(), copy_v3_v3(), wmGizmoGroup::customdata, ELEM, equals_v3v3(), TransInfo::flag, float, ARegion::gizmo_map, gizmo_refresh_from_matrix(), gizmogroup_xform_find(), GizmoGroup::gizmos, wmGizmo::highlight_part, MouseInput::imval, MAN_AXIS_ROT_C, MAN_AXIS_ROT_X, MAN_AXIS_ROT_Y, MAN_AXIS_ROT_Z, MAN_AXIS_SCALE_C, MAN_AXIS_SCALE_X, MAN_AXIS_SCALE_XY, MAN_AXIS_SCALE_Y, MAN_AXIS_SCALE_YZ, MAN_AXIS_SCALE_Z, MAN_AXIS_SCALE_ZX, MAN_AXIS_TRANS_C, MAN_AXIS_TRANS_X, MAN_AXIS_TRANS_XY, MAN_AXIS_TRANS_Y, MAN_AXIS_TRANS_YZ, MAN_AXIS_TRANS_Z, MAN_AXIS_TRANS_ZX, TransInfo::matrix, TransCon::mode, TransInfo::mode, TransInfo::mouse, O_DEFAULT, O_SCENE, TransInfo::orient, TransInfo::orient_curr, TransInfo::region, ARegion::regiondata, T_NO_GIZMO, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL, TFM_TRANSLATION, RegionView3D::twmat, GizmoGroup::twtype, WM_gizmo_highlight_set(), WM_gizmo_modal_set_while_modal(), and WM_gizmomap_get_modal().

Referenced by setNearestAxis(), snapsource_end(), transform_event_modal_constraint(), and transform_mode_init().

◆ VIEW3D_GGT_xform_gizmo()

◆ VIEW3D_GGT_xform_gizmo_context()

◆ WIDGETGROUP_gizmo_draw_prepare()

◆ WIDGETGROUP_gizmo_invoke_prepare()

◆ WIDGETGROUP_gizmo_message_subscribe()

static void WIDGETGROUP_gizmo_message_subscribe ( const bContext * C,
wmGizmoGroup * gzgroup,
wmMsgBus * mbus )
static

◆ WIDGETGROUP_gizmo_poll_context()

◆ WIDGETGROUP_gizmo_poll_generic()

static bool WIDGETGROUP_gizmo_poll_generic ( View3D * v3d)
static

◆ WIDGETGROUP_gizmo_poll_tool()

static bool WIDGETGROUP_gizmo_poll_tool ( const bContext * C,
wmGizmoGroupType * gzgt )
static

◆ WIDGETGROUP_gizmo_refresh()

◆ WIDGETGROUP_gizmo_setup()

Variable Documentation

◆ g_GGT_xform_gizmo

◆ g_GGT_xform_gizmo_context

wmGizmoGroupType* g_GGT_xform_gizmo_context = nullptr
static

◆ [struct]

struct { ... } g_tw_axis_range[2]
Initial value:
= {
{0.02f, 0.1f},
{0.175f, 0.25f},
}

Referenced by gizmo_get_axis_color(), and gizmo_is_axis_visible().

◆ max

float max

Definition at line 93 of file transform_gizmo_3d.cc.

Referenced by actkeys_previewrange_exec(), actkeys_viewall(), GHOST_WindowWin32::adjustWindowRectForClosestMonitor(), AdaptiveSampling::align_samples(), PathTraceWorkGPU::alloc_integrator_soa(), PathTraceWorkGPU::alloc_integrator_sorting(), FallbackTransform::applyRGB(), area_light_rect_sample(), area_light_spread_attenuation(), area_light_spread_clamp_light(), Freestyle::OccluderSource::averageOccluderArea(), background_map_sample(), bake_offset_towards_center(), bevelinside(), BKE_editmesh_cache_calc_minmax(), BKE_fcurve_calc_range(), BKE_gpencil_data_minmax(), BKE_object_evaluated_geometry_bounds(), BKE_object_minmax_empty_drawtype(), BKE_pchan_minmax(), BKE_pose_minmax(), blender_camera_from_object(), Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer(), blf_charcode_to_unicode_block(), BLI_str_utf32_char_to_lower(), BLI_str_utf32_char_to_upper(), bm_corners_to_loops_ex(), bmo_average_vert_facedata_exec(), bmo_collapsecon_do_layer(), Hair::Curve::bounds_grow(), Hair::Curve::bounds_grow(), Hair::Curve::bounds_grow(), Hair::Curve::bounds_grow(), brush_edit_init(), bsdf_alloc(), bsdf_hair_chiang_sample(), bsdf_hair_huang_eval(), bsdf_hair_huang_eval_trrt(), bsdf_hair_huang_sample(), bsdf_oren_nayar_get_intensity(), bsdf_oren_nayar_setup(), bssrdf_setup(), blender::deg::DepsgraphNodeBuilder::build_object(), bvh_aligned_node_intersect(), bvh_unaligned_node_intersect_child(), Subpatch::calc_num_inner_verts(), Subpatch::calc_num_triangles(), calc_nurblist_bounds(), calculate_collision_balls(), RenderScheduler::calculate_num_samples_per_update(), calculate_resolution_divider_for_resolution(), Hair::Curve::cardinal_keys_for_step(), Clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp(), clamp_axis_max_v3(), clamp_f(), clampis_uint(), SVMCompiler::CompilerState::CompilerState(), btConvexHullInternal::compute(), BVHUnaligned::compute_node_transform(), BlackbodyNode::constant_fold(), blender::gpu::convert(), BVHBuild::create_leaf_node(), BVHBuild::create_object_leaf_nodes(), create_subd_mesh(), GeometryManager::create_volume_mesh(), Freestyle::crossesProscenium(), CubeTriangleIsect::CubeTriangleIsect(), curvebounds(), curvemap_minmax_curve(), device_only_memory< T >::device_only_memory(), LightManager::device_update_background(), QuadDice::dice(), direction_to_mirrorball(), do_2d_mapping(), ED_gizmo_arrow3d_set_ui_range(), ED_markers_get_minmax(), edge_pan_speed(), PathTraceWorkGPU::enqueue_work_tiles(), PathTraceWorkGPU::enqueue_work_tiles(), blender::bke::pbvh::pixels::Rows::find_copy_source(), float4_to_half4_display(), float_uint(), foreach_sliced_buffer_params(), Integrator::get_adaptive_sampling(), BlenderSync::get_buffer_params(), Session::get_estimated_remaining_time(), Scene::get_max_closure_count(), Device::get_multi_device(), RenderScheduler::get_num_samples_during_navigation(), RenderScheduler::get_num_samples_to_path_trace(), Progress::get_progress(), RenderScheduler::get_render_work(), BlenderSync::get_session_params(), slim::get_smallest_pos_quad_zero(), TileManager::get_tile_for_index(), Subpatch::get_vert_along_grid_edge(), BVHNode::getSubtreeSize(), DisplayGPUTexture::gpu_resources_ensure(), graphkeys_previewrange_exec(), blender::ed::sculpt_paint::pose::grow_factors_bmesh(), blender::ed::sculpt_paint::pose::grow_factors_grids(), blender::ed::sculpt_paint::pose::grow_factors_mesh(), RenderScheduler::guess_display_update_interval_in_seconds_for_num_samples(), idprop_ui_data_update_float(), idprop_ui_data_update_int(), initTimeSlide(), InnerNode::InnerNode(), Freestyle::Grid::insertOccluder(), integrate_shadow_max_transparent_hits(), intersect(), invert_m4_m4_fallback(), isect_tri_tri_v3_ex(), kernel_embree_filter_occluded_shadow_all_func_impl(), kernel_ies_interp(), Hair::Curve::keys_for_step(), OIIOImageLoader::load_metadata(), GHOST_Wintab::loadWintab(), markers_selectkeys_between(), markers_selectkeys_between(), math_trimatrix_cholesky(), math_vector_max(), mathutils_rna_vector_set(), blender::nodes::decl::VectorBuilder::max(), max(), max(), max(), max(), max(), max(), max(), max4(), max4(), blender::gpu::GLTexture::mip_range_set(), blender::gpu::MTLTexture::mip_range_set(), blender::gpu::VKTexture::mip_range_set(), mirrorball_to_direction(), nlaedit_previewrange_exec(), blender::ed::space_node::node_group_make_from_nodes(), blender::ed::space_node::node_group_make_insert_selected(), node_mix_exclusion(), node_mix_light(), node_shader_gpu_tex_mapping(), object_motion_steps(), blender::ed::object::object_warp_transverts(), blender::ed::object::object_warp_verts_exec(), Freestyle::BoxGrid::OccluderData::OccluderData(), osl_blackbody_vf(), osl_wavelength_color_vf(), Freestyle::GeomUtils::overlapTriangleBox(), blender::ed::sculpt_paint::paint_stroke_integrate_overlap(), particle_intersect_mesh(), phase_fournier_forand_newton(), point_density_texture_space(), DiagSplit::post_split(), radial_control_invoke(), BVHBuild::range_within_max_leaf_size(), ray_aabb_intersect(), ray_triangle_intersect(), ray_triangle_intersect_self(), blender::eevee::IrradianceBake::raylists_build(), rect_clip(), reduce_max(), reduce_max(), reduce_max(), reduce_max(), btAxisSweep3Internal< BP_FP_INT_TYPE >::removeHandle(), RenderScheduler::render_work_reschedule_on_idle(), rgb_to_hsl(), rgb_to_hsv(), RNA_property_float_clamp(), RNA_property_int_clamp(), Session::run_update_for_next_iteration(), safe_sqrtf(), scale_buffer_params(), QuadDice::scale_factor(), screen_geom_area_map_find_active_scredge(), session_print(), shadow_ray_smooth_surface_offset(), shift_cos_in(), smoothmin(), space_text_cursor_set_to_pos_wrapped(), space_text_get_cursor_rel(), SVMCompiler::stack_find_offset(), EdgeDice::stitch_triangles(), blender::eevee::IrradianceBake::surfel_raster_views_sync(), svm_brightness_contrast(), svm_mix_exclusion(), svm_mix_light(), svm_node_blackbody(), svm_node_closure_bsdf(), svm_node_closure_volume(), svm_node_hsv(), svm_node_min_max(), svm_node_normal_map(), svm_node_principled_volume(), svm_node_set_bump(), svm_node_tex_gabor(), svm_node_wavelength(), svm_vector_math(), Mesh::tessellate(), blender::bke::tests::TEST(), blender::tests::TEST(), TEST(), transform_decompose(), triangle_light_pdf(), triangle_light_sample(), blender::nodes::try_dispatch_float_math_fl3_fl3_to_fl3(), txt_wrap_move_bol(), txt_wrap_move_eol(), ui_def_but(), ui_draw_but_WAVEFORM(), ui_handle_list_event(), ui_selectcontext_apply(), blender::ed::sculpt_paint::expand::update_max_vert_falloff_value(), blender::compositor::KuwaharaAnisotropicOperation::update_memory_buffer_partial(), blender::compositor::KuwaharaAnisotropicStructureTensorOperation::update_memory_buffer_partial(), RenderScheduler::update_start_resolution_divider(), BVHNode::update_time(), util_hash_to_float(), util_image_resize_pixels(), view3d_boundbox_clip_m4(), view3d_localview_init(), Camera::viewplane_bounds_get(), viewselected_exec(), volume_fournier_forand_setup(), voronoi_distance(), voronoi_distance(), voronoi_distance(), WIDGETGROUP_camera_refresh(), wm_software_cursor_draw(), RenderScheduler::work_adaptive_threshold(), Camera::world_to_raster_size(), and xyz_to_rgb_clamped().

◆ min

float min

Definition at line 93 of file transform_gizmo_3d.cc.

Referenced by gizmo_is_axis_visible().