57 float r_rotation[3][3])
64 bool use_mouse_project =
true;
67 float orient_matrix[3][3];
69 const float dots[3] = {
76 copy_v3_v3(orient_matrix[0], cursor_matrix[(axis + 1) % 3]);
77 copy_v3_v3(orient_matrix[1], cursor_matrix[(axis + 2) % 3]);
78 copy_v3_v3(orient_matrix[2], cursor_matrix[axis]);
84 swap_v3_v3(orient_matrix[0], orient_matrix[1]);
87 if (use_mouse_project) {
146 float *value =
static_cast<float *
>(value_p);
182 C, gzgt,
"MESH_OT_primitive_cube_add_gizmo");
234 if (op ==
nullptr || !
STREQ(op->
type->
idname,
"MESH_OT_primitive_cube_add_gizmo")) {
266 params.range_get_fn =
nullptr;
267 params.user_data =
nullptr;
285 gzgt->
name =
"Mesh Add Bounds";
286 gzgt->
idname =
"MESH_GGT_add_bounds";
320 mul_m4_m4m4(matrix, obedit->world_to_object().ptr(), matrix);
338 "create_cube matrix=%m4 size=%f calc_uvs=%b",
348 params.calc_looptris =
true;
349 params.calc_normals =
false;
350 params.is_destructive =
true;
380 ot->
idname =
"MESH_OT_primitive_cube_add_gizmo";
395 ot->
srna,
"matrix", 4, 4,
nullptr, 0.0f, 0.0f,
"Matrix",
"", 0.0f, 0.0f);
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
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 is_negative_m4(const float mat[4][4])
void negate_mat3_m4(float R[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[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.
@ ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE_SIGNED
bool ED_gizmo_poll_or_unlink_delayed_from_operator(const bContext *C, wmGizmoGroupType *gzgt, const char *idname)
void ED_mesh_uv_ensure(Mesh *mesh, const char *name)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
void EDBM_selectmode_flush_ex(BMEditMesh *em, short selectmode)
bool ED_operator_editmesh_view3d(bContext *C)
int ED_undo_operator_repeat(bContext *C, wmOperator *op)
bool ED_view3d_win_to_3d_on_plane(const 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 *)
static void gizmo_placement_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value)
void MESH_OT_primitive_cube_add_gizmo(wmOperatorType *ot)
static void MESH_GGT_add_bounds(wmGizmoGroupType *gzgt)
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 bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *gzgt)
static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_mesh_placement_draw_prepare(const bContext *, wmGizmoGroup *gzgroup)
bool EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const bool select_extend, const char *fmt,...)
draw_view in_light_buf[] float
void *(* MEM_callocN)(size_t len, const char *str)
void add_generic_props(wmOperatorType *ot, bool do_editmode)
void add_mesh_props(wmOperatorType *ot)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
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, const int rows, const int columns, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
struct GizmoPlacementGroup::@410 data
PropertyRNA * prop_matrix
ObjectRuntimeHandle * runtime
wmGizmoMapType_Params gzmap_params
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnDrawPrepare draw_prepare
wmGizmoMap * parent_gzmap
const wmGizmoPropertyType * type
wmGizmoGroup * parent_gzgroup
float matrix_offset[4][4]
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
struct wmEvent * eventstate
void WM_gizmo_modal_set_from_setup(wmGizmoMap *gzmap, bContext *C, 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(Main *bmain, wmGizmoGroupType *gzgt)
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(wmGizmoGroupType *))
wmGizmoGroupType * WM_gizmogrouptype_find(const char *idname, bool quiet)
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)