35 {
RV3D_VIEW_LEFT,
"LEFT", ICON_TRIA_LEFT,
"Left",
"View from the left"},
36 {
RV3D_VIEW_RIGHT,
"RIGHT", ICON_TRIA_RIGHT,
"Right",
"View from the right"},
37 {
RV3D_VIEW_BOTTOM,
"BOTTOM", ICON_TRIA_DOWN,
"Bottom",
"View from the bottom"},
38 {
RV3D_VIEW_TOP,
"TOP", ICON_TRIA_UP,
"Top",
"View from the top"},
41 {0,
nullptr, 0,
nullptr,
nullptr},
62 float align_quat_buf[4];
63 float *align_quat =
nullptr;
68 if (obact !=
nullptr) {
76 align_quat = align_quat_buf;
112 int view_axis_roll_best = -1;
121 if (angle_best > angle_test) {
122 angle_best = angle_test;
124 view_axis_roll_best = j;
128 if (view_best == -1) {
142 view_axis_roll = view_axis_roll_best;
150 C, v3d, region, quat, viewnum, view_axis_roll, nextperspo, align_quat, smooth_viewtx);
152 perspo = rv3d->
persp;
178 ot->
srna,
"align_active",
false,
"Align Active",
"Align to the active object's axis");
181 ot->
srna,
"relative",
false,
"Relative",
"Rotate relative to the current orientation");
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void invert_qt_normalized(float q[4])
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void mat3_to_quat(float q[4], const float mat[3][3])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
float angle_signed_qtqt(const float q1[4], const float q2[4])
#define BLT_I18NCONTEXT_EDITOR_VIEW3D
@ RV3D_VIEW_AXIS_ROLL_270
bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region)
bool ED_view3d_quat_from_axis_view(char view, char view_axis_roll, float r_quat[4])
bool ED_operator_rv3d_user_region_poll(bContext *C)
Read Guarded memory(de)allocation.
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void axis_set_view(bContext *C, View3D *v3d, ARegion *region, const float quat_[4], char view, char view_axis_roll, int perspo, const float *align_to_quat, const int smooth_viewtx)
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
void VIEW3D_OT_view_axis(wmOperatorType *ot)
static int view_axis_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_view_items[]
int WM_operator_smooth_viewtx_get(const wmOperator *op)