101 ot->name =
"View Lock Clear";
102 ot->description =
"Clear all view locking";
103 ot->idname =
"VIEW3D_OT_view_lock_clear";
158 ot->name =
"View Lock to Active";
159 ot->description =
"Lock the view to the active object/bone";
160 ot->idname =
"VIEW3D_OT_view_lock_to_active";
210 ot->name =
"Frame Camera Bounds";
211 ot->description =
"Center the camera view, resizing the view to fit its bounds";
212 ot->idname =
"VIEW3D_OT_view_center_camera";
242 ot->name =
"View Lock Center";
243 ot->description =
"Center the view lock offset";
244 ot->idname =
"VIEW3D_OT_view_center_lock";
337 ot->name =
"Set Render Region";
338 ot->description =
"Set the boundaries of the border render and enable border render";
339 ot->idname =
"VIEW3D_OT_render_border";
370 rctf *border =
nullptr;
400 ot->name =
"Clear Render Region";
401 ot->description =
"Clear the boundaries of the border render and disable border render";
402 ot->idname =
"VIEW3D_OT_clear_render_border";
430 int im_width, im_height;
463 ot->name =
"Zoom Camera 1:1";
464 ot->description =
"Match the camera to 1:1 to the render output";
465 ot->idname =
"VIEW3D_OT_zoom_camera_1_to_1";
511 ot->name =
"View Perspective/Orthographic";
512 ot->description =
"Switch the current view from perspective/orthographic projection";
513 ot->idname =
"VIEW3D_OT_view_persportho";
555 ot->name =
"View Navigation (Walk/Fly)";
557 "Interactively navigate around the scene (uses the mode (walk/fly) preference)";
558 ot->idname =
"VIEW3D_OT_navigate";
575 if (v3d !=
nullptr) {
613 ot->name =
"Add Camera Background Image";
614 ot->description =
"Add a new background image to the active camera";
615 ot->idname =
"VIEW3D_OT_camera_background_image_add";
626 ot->srna,
"filepath",
nullptr,
FILE_MAX,
"Filepath",
"Path to image file");
633 "Select the file relative to the blend file");
657 "Cannot remove background image %d from camera '%s', as it is from the linked "
680 ot->name =
"Remove Camera Background Image";
681 ot->description =
"Remove a background image from the camera";
682 ot->idname =
"VIEW3D_OT_camera_background_image_remove";
693 ot->srna,
"index", 0, 0, INT_MAX,
"Index",
"Background image index to remove", 0, INT_MAX);
709 if (world ==
nullptr) {
715 scene->
world = world;
733 ot->name =
"Drop World";
734 ot->description =
"Drop a world into the scene";
735 ot->idname =
"VIEW3D_OT_drop_world";
758 const float mat[4][4])
765 for (
int i = 0;
i < 8;
i++) {
814 ot->name =
"Clipping Region";
815 ot->description =
"Set the view clipping region";
816 ot->idname =
"VIEW3D_OT_clip_border";
841 const bool use_depth,
842 float r_cursor_co[3])
848 bool depth_used =
false;
852 if (rv3d ==
nullptr) {
878 if (depth_used ==
false) {
887 const bool use_depth,
889 float r_cursor_co[3],
890 float r_cursor_quat[4])
898 if (rv3d ==
nullptr) {
909 r_cursor_quat[0] *= -1.0f;
918 r_cursor_quat[0] *= -1.0f;
920 const float mval_fl[2] = {
float(mval[0]),
float(mval[1])};
928 const Object *ob_dummy =
nullptr;
959 float z_src[3] = {0, 0, 1};
967 const float ortho_axis_dot[3] = {
975 float angle_best = -1.0f;
984 for (
int axis = 0; axis < 2; axis++) {
985 float tan_src[3] = {0, 0, 0};
986 tan_src[axis] = 1.0f;
989 for (
int axis_sign = 0; axis_sign < 2; axis_sign++) {
993 if (angle_test < angle_best || angle_best == -1.0f) {
994 angle_best = angle_test;
1000 mul_qt_qtqt(r_cursor_quat, tquat_best, r_cursor_quat);
1009 const bool use_depth,
1022 quat = cursor_curr->rotation();
1025 C, mval, use_depth, orientation, cursor_curr->
location, &quat.
w);
1029 float tmat[3][3], cmat[3][3];
1037 cursor_curr->set_rotation(quat,
true);
1046 float co_2d_curr[2], co_2d_prev[2];
1053 rv3d->
ofs_lock[0] += (co_2d_curr[0] - co_2d_prev[0]) / (region->
winx * 0.5f);
1054 rv3d->
ofs_lock[1] += (co_2d_curr[1] - co_2d_prev[1]) / (region->
winy * 0.5f);
1075 &scene->
id, &RNA_View3DCursor, &scene->
cursor);
1105 ot->name =
"Set 3D Cursor";
1106 ot->description =
"Set the location of the 3D cursor";
1107 ot->idname =
"VIEW3D_OT_cursor3d";
1125 "Orient to the current transform setting"},
1127 {0,
nullptr, 0,
nullptr,
nullptr},
1131 ot->srna,
"use_depth",
true,
"Surface Project",
"Project onto the surface");
1139 "Preset viewpoint to use");
1150 {
OB_WIRE,
"WIREFRAME", 0,
"Wireframe",
"Toggle wireframe shading"},
1151 {
OB_SOLID,
"SOLID", 0,
"Solid",
"Toggle solid shading"},
1152 {
OB_MATERIAL,
"MATERIAL", 0,
"Material Preview",
"Toggle material preview shading"},
1153 {
OB_RENDER,
"RENDERED", 0,
"Rendered",
"Toggle rendered shading"},
1154 {0,
nullptr, 0,
nullptr,
nullptr},
1200 ot->name =
"Toggle Shading Type";
1201 ot->description =
"Toggle shading type in 3D viewport";
1202 ot->idname =
"VIEW3D_OT_toggle_shading";
1254 ot->name =
"Toggle X-Ray";
1255 ot->idname =
"VIEW3D_OT_toggle_xray";
1256 ot->description =
"Transparent scene display. Allow selecting through items";
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_active_if_bonecoll_visible(Object *ob) ATTR_WARN_UNUSED_RESULT
Camera data-block and utility functions.
struct CameraBGImage * BKE_camera_background_image_new(struct Camera *cam)
void BKE_camera_background_image_remove(struct Camera *cam, struct CameraBGImage *bgpic)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
float BKE_screen_view3d_zoom_from_fac(float zoomfac)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE int axis_dominant_v3_ortho_single(const float vec[3])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool is_negative_m4(const float mat[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void rotation_between_vecs_to_quat(float q[4], const float v1[3], const float v2[3])
float angle_normalized_qt(const float q[4])
void quat_to_mat3(float m[3][3], const float q[4])
void mat3_to_quat(float q[4], const float mat[3][3])
void mul_qt_v3(const float q[4], float r[3])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void copy_qt_qt(float q[4], const float a[4])
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
float angle_signed_on_axis_v3v3_v3(const float v1[3], const float v2[3], const float axis[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void zero_v2(float r[2])
MINLINE float normalize_v3(float n[3])
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define STRNCPY_UTF8(dst, src)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL
@ USER_LOCK_CURSOR_ADJUST
#define RV3D_VIEW_IS_AXIS(view)
@ V3D_SHADING_XRAY_WIREFRAME
#define RV3D_LOCK_FLAGS(rv3d)
@ RV3D_LOCK_ANY_TRANSFORM
@ V3D_OVERLAY_BONE_SELECT
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_scene_editable(bContext *C)
bool ED_operator_view3d_active(bContext *C)
bool ED_operator_region_view3d_active(bContext *C)
bool ED_operator_camera_poll(bContext *C)
void ED_region_tag_redraw(ARegion *region)
void ED_undo_push(bContext *C, const char *str)
void ED_view3d_calc_camera_border_size(const Scene *scene, Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, float r_size[2])
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, bool is_flip)
RegionView3D * ED_view3d_context_rv3d(bContext *C)
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
void ED_view3d_win_to_3d_int(const View3D *v3d, const ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region)
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
bool ED_view3d_autodist(ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3])
void ED_view3d_lock_clear(View3D *v3d)
float ED_view3d_calc_zfac_ex(const RegionView3D *rv3d, const float co[3], bool *r_flip)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
@ V3D_CURSOR_ORIENT_XFORM
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
void view3d_operator_needs_gpu(const bContext *C)
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area)
bool ED_operator_rv3d_user_region_poll(bContext *C)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
Read Guarded memory(de)allocation.
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
#define ND_RENDER_OPTIONS
#define NS_VIEW3D_SHADING
#define ND_DRAW_RENDER_VIEWPORT
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static wmOperatorStatus render_border_exec(bContext *C, wmOperator *op)
static wmOperatorStatus clear_render_border_exec(bContext *C, wmOperator *)
void * MEM_callocN(size_t len, const char *str)
QuaternionBase< float > Quaternion
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
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_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
struct ListBase bg_images
struct Object * ob_center
struct ReportList * reports
struct wmOperatorType * type
void ED_view3d_cursor3d_update(bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation)
static wmOperatorStatus toggle_xray_exec(bContext *C, wmOperator *op)
static wmOperatorStatus camera_background_image_add_exec(bContext *C, wmOperator *op)
static wmOperatorStatus view3d_clipping_exec(bContext *C, wmOperator *op)
static wmOperatorStatus view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *)
void VIEW3D_OT_view_persportho(wmOperatorType *ot)
static wmOperatorStatus view3d_center_lock_exec(bContext *C, wmOperator *)
static const EnumPropertyItem prop_shading_type_items[]
static bool view3d_camera_user_poll(bContext *C)
static wmOperatorStatus toggle_shading_exec(bContext *C, wmOperator *op)
void ED_view3d_cursor3d_position_rotation(bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4])
void VIEW3D_OT_toggle_xray(wmOperatorType *ot)
static wmOperatorStatus view3d_center_camera_exec(bContext *C, wmOperator *)
void VIEW3D_OT_view_center_camera(wmOperatorType *ot)
static bool camera_background_image_add_poll(bContext *C)
void VIEW3D_OT_view_center_lock(wmOperatorType *ot)
void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot)
void VIEW3D_OT_clip_border(wmOperatorType *ot)
static wmOperatorStatus clear_render_border_exec(bContext *C, wmOperator *op)
static wmOperatorStatus viewpersportho_exec(bContext *C, wmOperator *)
void VIEW3D_OT_view_lock_to_active(wmOperatorType *ot)
static wmOperatorStatus drop_world_exec(bContext *C, wmOperator *op)
static void view3d_set_1_to_1_viewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region, View3D *v3d)
void VIEW3D_OT_cursor3d(wmOperatorType *ot)
static wmOperatorStatus view3d_navigate_invoke(bContext *C, wmOperator *, const wmEvent *event)
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
void VIEW3D_OT_clear_render_border(wmOperatorType *ot)
void VIEW3D_OT_view_lock_clear(wmOperatorType *ot)
static wmOperatorStatus view_lock_clear_exec(bContext *C, wmOperator *)
static wmOperatorStatus camera_background_image_remove_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_navigate(wmOperatorType *ot)
static wmOperatorStatus render_border_exec(bContext *C, wmOperator *op)
static void calc_local_clipping(float clip_local[6][4], const BoundBox *clipbb, const float mat[4][4])
static wmOperatorStatus view3d_clipping_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static Camera * background_image_camera_from_context(bContext *C)
void VIEW3D_OT_camera_background_image_remove(wmOperatorType *ot)
void ED_view3d_cursor3d_position(bContext *C, const int mval[2], const bool use_depth, float r_cursor_co[3])
void VIEW3D_OT_render_border(wmOperatorType *ot)
static bool drop_world_poll(bContext *C)
static bool view3d_lock_poll(bContext *C)
void VIEW3D_OT_toggle_shading(wmOperatorType *ot)
static wmOperatorStatus view_lock_to_active_exec(bContext *C, wmOperator *)
void VIEW3D_OT_drop_world(wmOperatorType *ot)
static wmOperatorStatus view3d_cursor3d_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void VIEW3D_OT_camera_background_image_add(wmOperatorType *ot)
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_msg_publish_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_rect)
ID * WM_operator_properties_id_lookup_from_name_or_session_uid(Main *bmain, PointerRNA *ptr, const ID_Type type)
void WM_operator_properties_border(wmOperatorType *ot)
void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_prop)
ID * WM_operator_drop_load_path(bContext *C, wmOperator *op, const short idcode)