54 float r_rotation[3][3])
61 bool use_mouse_project =
true;
63 float cursor_matrix[4][4];
64 float orient_matrix[3][3];
67 const float dots[3] = {
74 copy_v3_v3(orient_matrix[0], cursor_matrix[(axis + 1) % 3]);
75 copy_v3_v3(orient_matrix[1], cursor_matrix[(axis + 2) % 3]);
76 copy_v3_v3(orient_matrix[2], cursor_matrix[axis]);
82 swap_v3_v3(orient_matrix[0], orient_matrix[1]);
85 if (use_mouse_project) {
144 float *value = value_p;
179 C, gzgt,
"MESH_OT_primitive_cube_add_gizmo");
264 .value_get_fn = gizmo_placement_prop_matrix_get,
265 .value_set_fn = gizmo_placement_prop_matrix_set,
266 .range_get_fn = NULL,
285 gzgt->
name =
"Mesh Add Bounds";
286 gzgt->
idname =
"MESH_GGT_add_bounds";
338 "create_cube matrix=%m4 size=%f calc_uvs=%b",
348 .calc_looptri = true,
349 .calc_normals = false,
350 .is_destructive = true,
382 ot->
idname =
"MESH_OT_primitive_cube_add_gizmo";
397 ot->
srna,
"matrix", 4, 4,
NULL, 0.0f, 0.0f,
"Matrix",
"", 0.0f, 0.0f);
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
void BKE_scene_cursor_to_mat4(const struct View3DCursor *cursor, float mat[4][4])
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
MINLINE int axis_dominant_v3_single(const float vec[3])
bool is_negative_m3(const float mat[3][3])
void zero_m4(float m[4][4])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void copy_m4_m3(float m1[4][4], const float m2[3][3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
bool is_negative_m4(const float mat[4][4])
void negate_mat3_m4(float R[4][4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void swap_v3_v3(float a[3], float b[3])
#define UNUSED_VARS_NDEBUG(...)
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
@ ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z
@ ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_SIGNED
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const struct bContext *C, struct wmGizmoGroupType *gzgt, const char *idname)
void ED_mesh_uv_ensure(struct Mesh *me, const char *name)
void EDBM_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, short selectmode)
void ED_object_add_generic_props(struct wmOperatorType *ot, bool do_editmode)
void ED_object_add_mesh_props(struct wmOperatorType *ot)
bool ED_operator_editmesh_view3d(struct bContext *C)
int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op)
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region, const float plane[4], const float mval[2], bool do_clip, float r_out[3])
Read Guarded memory(de)allocation.
void UI_GetThemeColor3fv(int colorid, float col[3])
static int add_primitive_cube_gizmo_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void gizmo_placement_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value)
static void gizmo_mesh_placement_draw_prepare(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
void MESH_OT_primitive_cube_add_gizmo(wmOperatorType *ot)
static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op)
static void gizmo_mesh_placement_update_from_op(GizmoPlacementGroup *ggd)
static void calc_initial_placement_point_from_view(bContext *C, const float mval[2], float r_location[3], float r_rotation[3][3])
static void gizmo_placement_exec(GizmoPlacementGroup *ggd)
static void gizmo_mesh_placement_modal_from_setup(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_placement_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
static void MESH_GGT_add_bounds(struct wmGizmoGroupType *gzgt)
static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *gzgt)
static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *gzgroup)
struct GizmoPlacementGroup GizmoPlacementGroup
bool EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const bool select_extend, const char *fmt,...)
void *(* MEM_callocN)(size_t len, const char *str)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int rows, int columns, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
struct GizmoPlacementGroup::@448 data
PropertyRNA * prop_matrix
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
wmGizmoGroupFnDrawPrepare draw_prepare
struct wmGizmoMap * parent_gzmap
const struct wmGizmoPropertyType * type
struct wmGizmoGroup * parent_gzgroup
float matrix_offset[4][4]
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
struct wmEvent * eventstate
void WM_gizmo_modal_set_from_setup(struct wmGizmoMap *gzmap, struct bContext *C, struct wmGizmo *gz, int part_index, const wmEvent *event)
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
bool WM_gizmo_group_type_ensure_ptr(wmGizmoGroupType *gzgt)
void WM_gizmo_group_type_reinit_ptr(struct Main *bmain, wmGizmoGroupType *gzgt)
wmGizmoGroupType * WM_gizmogrouptype_find(const char *idname, bool quiet)
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(struct wmGizmoGroupType *))
void WM_gizmo_target_property_def_func(wmGizmo *gz, const char *idname, const wmGizmoPropertyFnParams *params)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
wmOperator * WM_operator_last_redo(const bContext *C)