76 if (properties && properties->
data) {
125 const float color_default[4] = {1.0f, 1.0f, 1.0f, 1.0f};
226 if (gz->
op_data && ((part_index >= 0) && (part_index < gz->op_data_len))) {
227 return &gz->
op_data[part_index];
276 const float z_axis[3])
280 const float z_global[3] = {0.0f, 0.0f, 1.0f};
294 const float y_axis[3],
295 const float z_axis[3])
311 const float y_axis[3],
312 const float z_axis[3])
329 const float y_axis[3],
330 const float z_axis[3])
400 bool changed =
false;
423 if (use_callback && changed) {
486 scale *=
U.gizmo_size;
489 float matrix_world[4][4];
491 float matrix_basis[4][4];
553 const float(*
const matrix_space)[4] =
params->matrix_space ?
params->matrix_space :
555 const float(*
const matrix_basis)[4] =
params->matrix_basis ?
params->matrix_basis :
557 const float(*
const matrix_offset)[4] =
params->matrix_offset ?
params->matrix_offset :
561 float final_matrix[4][4];
570 mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
575 mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
578 mul_m4_m4m4(final_matrix, final_matrix, matrix_offset);
588 float mat_identity[4][4];
593 .matrix_space =
NULL,
594 .matrix_basis =
NULL,
595 .matrix_offset = mat_identity,
605 .matrix_space =
NULL,
606 .matrix_basis =
NULL,
607 .matrix_offset =
NULL,
641 if (*properties ==
NULL) {
651 (*ptr)->data = *properties;
693 bool changed =
false;
typedef float(TangentPoint)[2]
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
void IDP_FreeProperty(struct IDProperty *prop)
void IDP_MergeGroup(struct IDProperty *dest, const struct IDProperty *src, const bool do_overwrite) ATTR_NONNULL()
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_ClearProperty(struct IDProperty *prop)
struct IDProperty * IDP_CopyProperty(const struct IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mul_mat3_m4_fl(float R[4][4], float f)
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float normalize_v3(float r[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void ortho_basis_v3v3_v3(float r_n1[3], float r_n2[3], const float n[3])
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3])
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
#define RNA_STRUCT_BEGIN(sptr, prop)
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
StructRNA RNA_GizmoProperties
@ WM_GIZMOMAP_DRAWSTEP_3D
@ WM_GIZMOMAP_DRAWSTEP_2D
@ WM_GIZMO_OPERATOR_TOOL_INIT
@ WM_GIZMO_DRAW_OFFSET_SCALE
@ WM_GIZMOGROUPTYPE_SCALE
@ WM_GIZMO_STATE_HIGHLIGHT
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
const char * RNA_property_identifier(const PropertyRNA *prop)
bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
PropertyRNA * RNA_struct_iterator_property(StructRNA *type)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoGroupType * type
struct wmGizmoMap::@1146 gzmap_context
Gizmo map runtime context.
struct wmGizmo * highlight
struct wmOperatorType * type
struct wmGizmoProperty::@1149 custom_func
wmGizmoPropertyFnFree free_fn
wmGizmoFnSelectRefresh select_refresh
int target_property_defs_len
wmGizmoFnMatrixBasisGet matrix_basis_get
wmGizmoFnPropertyUpdate property_update
struct wmGizmoGroup * parent_gzgroup
float matrix_offset[4][4]
wmGizmoFnModal custom_modal
const struct wmGizmoType * type
struct IDProperty * properties
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
bool wm_gizmo_select_set_ex(wmGizmoMap *gzmap, wmGizmo *gz, bool select, bool use_array, bool use_callback)
void WM_gizmo_set_matrix_offset_location(wmGizmo *gz, const float offset[3])
bool WM_gizmo_context_check_drawstep(const struct bContext *C, eWM_GizmoFlagMapDrawStep step)
static void wm_gizmo_register(wmGizmoGroup *gzgroup, wmGizmo *gz)
void WM_gizmo_set_fn_custom_modal(struct wmGizmo *gz, wmGizmoFnModal fn)
static void gizmo_update_prop_data(wmGizmo *gz)
void WM_gizmo_calc_matrix_final_params(const wmGizmo *gz, const struct WM_GizmoMatrixParams *params, float r_mat[4][4])
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
void WM_gizmo_set_color_highlight(wmGizmo *gz, const float color_hi[4])
void WM_gizmo_set_line_width(wmGizmo *gz, const float line_width)
bool wm_gizmo_select_and_highlight(bContext *C, wmGizmoMap *gzmap, wmGizmo *gz)
int WM_gizmo_operator_invoke(bContext *C, wmGizmo *gz, wmGizmoOpElem *gzop)
void WM_gizmo_get_color_highlight(const wmGizmo *gz, float color_hi[4])
void WM_gizmo_modal_set_from_setup(struct wmGizmoMap *gzmap, struct bContext *C, struct wmGizmo *gz, int part_index, const wmEvent *event)
void WM_gizmo_free(wmGizmo *gz)
void WM_gizmo_set_matrix_offset_rotation_from_yz_axis(wmGizmo *gz, const float y_axis[3], const float z_axis[3])
void WM_gizmo_calc_matrix_final(const wmGizmo *gz, float r_mat[4][4])
void WM_gizmo_set_matrix_rotation_from_yz_axis(wmGizmo *gz, const float y_axis[3], const float z_axis[3])
void WM_gizmo_properties_create_ptr(PointerRNA *ptr, wmGizmoType *gzt)
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
static void wm_gizmo_set_matrix_rotation_from_yz_axis__internal(float matrix[4][4], const float y_axis[3], const float z_axis[3])
void WM_gizmo_get_color(const wmGizmo *gz, float color[4])
void WM_gizmo_calc_matrix_final_no_offset(const wmGizmo *gz, float r_mat[4][4])
void wm_gizmo_update(wmGizmo *gz, const bContext *C, const bool refresh_map)
bool WM_gizmo_highlight_set(wmGizmoMap *gzmap, wmGizmo *gz)
void WM_gizmo_set_matrix_offset_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
static void gizmo_init(wmGizmo *gz)
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
bool WM_gizmo_select_unlink(wmGizmoMap *gzmap, wmGizmo *gz)
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
static wmGizmo * wm_gizmo_create(const wmGizmoType *gzt, PointerRNA *properties)
static void wm_gizmo_set_matrix_rotation_from_z_axis__internal(float matrix[4][4], const float z_axis[3])
struct wmGizmoOpElem * WM_gizmo_operator_get(wmGizmo *gz, int part_index)
bool WM_gizmo_select_set(wmGizmoMap *gzmap, wmGizmo *gz, bool select)
void WM_gizmo_properties_sanitize(PointerRNA *ptr, const bool no_context)
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
void WM_gizmo_properties_free(PointerRNA *ptr)
void WM_gizmo_properties_reset(wmGizmo *gz)
void WM_gizmo_properties_clear(PointerRNA *ptr)
void wm_gizmo_calculate_scale(wmGizmo *gz, const bContext *C)
bool WM_gizmo_properties_default(PointerRNA *ptr, const bool do_update)
void WM_gizmo_properties_create(PointerRNA *ptr, const char *gtstring)
void WM_gizmo_set_color(wmGizmo *gz, const float color[4])
int wm_gizmo_is_visible(wmGizmo *gz)
void WM_gizmo_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *gtstring)
void WM_gizmo_unlink(ListBase *gizmolist, wmGizmoMap *gzmap, wmGizmo *gz, bContext *C)
int(* wmGizmoFnModal)(struct bContext *, struct wmGizmo *, const struct wmEvent *, eWM_GizmoFlagTweak)
void wm_gizmogroup_gizmo_register(wmGizmoGroup *gzgroup, wmGizmo *gz)
@ WM_GIZMO_IS_VISIBLE_DRAW
@ WM_GIZMO_IS_VISIBLE_UPDATE
void wm_gizmomap_select_array_remove(struct wmGizmoMap *gzmap, wmGizmo *gz)
void wm_gizmomap_select_array_push_back(struct wmGizmoMap *gzmap, wmGizmo *gz)
void wm_gizmomap_modal_set(wmGizmoMap *gzmap, bContext *C, wmGizmo *gz, const wmEvent *event, bool enable)
bool wm_gizmomap_highlight_set(wmGizmoMap *gzmap, const bContext *C, wmGizmo *gz, int part)
bool WM_gizmo_target_property_is_valid(const wmGizmoProperty *gz_prop)
wmGizmoProperty * WM_gizmo_target_property_array(wmGizmo *gz)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)