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";
196 xfac = float(region->
winx) / float(
size[0] + 4);
197 yfac = float(region->
winy) / float(
size[1] + 4);
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";
510 ot->name =
"View Perspective/Orthographic";
511 ot->description =
"Switch the current view from perspective/orthographic projection";
512 ot->idname =
"VIEW3D_OT_view_persportho";
552 ot->name =
"View Navigation (Walk/Fly)";
554 "Interactively navigate around the scene (uses the mode (walk/fly) preference)";
555 ot->idname =
"VIEW3D_OT_navigate";
572 if (v3d !=
nullptr) {
610 ot->name =
"Add Camera Background Image";
611 ot->description =
"Add a new background image to the active camera";
612 ot->idname =
"VIEW3D_OT_camera_background_image_add";
623 ot->srna,
"filepath",
nullptr,
FILE_MAX,
"Filepath",
"Path to image file");
630 "Select the file relative to the blend file");
654 "Cannot remove background image %d from camera '%s', as it is from the linked "
677 ot->name =
"Remove Camera Background Image";
678 ot->description =
"Remove a background image from the camera";
679 ot->idname =
"VIEW3D_OT_camera_background_image_remove";
690 ot->srna,
"index", 0, 0, INT_MAX,
"Index",
"Background image index to remove", 0, INT_MAX);
706 if (world ==
nullptr) {
712 scene->
world = world;
730 ot->name =
"Drop World";
731 ot->description =
"Drop a world into the scene";
732 ot->idname =
"VIEW3D_OT_drop_world";
755 const float mat[4][4])
762 for (
int i = 0;
i < 8;
i++) {
811 ot->name =
"Clipping Region";
812 ot->description =
"Set the view clipping region";
813 ot->idname =
"VIEW3D_OT_clip_border";
838 const bool use_depth,
839 float r_cursor_co[3])
845 bool depth_used =
false;
849 if (rv3d ==
nullptr) {
875 if (depth_used ==
false) {
884 const bool use_depth,
886 float r_cursor_co[3],
887 float r_cursor_quat[4])
895 if (rv3d ==
nullptr) {
906 r_cursor_quat[0] *= -1.0f;
915 r_cursor_quat[0] *= -1.0f;
917 const float mval_fl[2] = {float(mval[0]), float(mval[1])};
925 const Object *ob_dummy =
nullptr;
956 float z_src[3] = {0, 0, 1};
964 const float ortho_axis_dot[3] = {
972 float angle_best = -1.0f;
981 for (
int axis = 0; axis < 2; axis++) {
982 float tan_src[3] = {0, 0, 0};
983 tan_src[axis] = 1.0f;
986 for (
int axis_sign = 0; axis_sign < 2; axis_sign++) {
990 if (angle_test < angle_best || angle_best == -1.0f) {
991 angle_best = angle_test;
997 mul_qt_qtqt(r_cursor_quat, tquat_best, r_cursor_quat);
1006 const bool use_depth,
1019 quat = cursor_curr->rotation();
1022 C, mval, use_depth, orientation, cursor_curr->
location, &quat.
w);
1026 float tmat[3][3], cmat[3][3];
1034 cursor_curr->set_rotation(quat,
true);
1043 float co_2d_curr[2], co_2d_prev[2];
1050 rv3d->
ofs_lock[0] += (co_2d_curr[0] - co_2d_prev[0]) / (region->
winx * 0.5f);
1051 rv3d->
ofs_lock[1] += (co_2d_curr[1] - co_2d_prev[1]) / (region->
winy * 0.5f);
1072 &scene->
id, &RNA_View3DCursor, &scene->
cursor);
1102 ot->name =
"Set 3D Cursor";
1103 ot->description =
"Set the location of the 3D cursor";
1104 ot->idname =
"VIEW3D_OT_cursor3d";
1122 "Orient to the current transform setting"},
1124 {0,
nullptr, 0,
nullptr,
nullptr},
1128 ot->srna,
"use_depth",
true,
"Surface Project",
"Project onto the surface");
1136 "Preset viewpoint to use");
1147 {
OB_WIRE,
"WIREFRAME", 0,
"Wireframe",
"Toggle wireframe shading"},
1148 {
OB_SOLID,
"SOLID", 0,
"Solid",
"Toggle solid shading"},
1149 {
OB_MATERIAL,
"MATERIAL", 0,
"Material Preview",
"Toggle material preview shading"},
1150 {
OB_RENDER,
"RENDERED", 0,
"Rendered",
"Toggle rendered shading"},
1151 {0,
nullptr, 0,
nullptr,
nullptr},
1197 ot->name =
"Toggle Shading Type";
1198 ot->description =
"Toggle shading type in 3D viewport";
1199 ot->idname =
"VIEW3D_OT_toggle_shading";
1251 ot->name =
"Toggle X-Ray";
1252 ot->idname =
"VIEW3D_OT_toggle_xray";
1253 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)
char * STRNCPY(char(&dst)[N], const char *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)
@ CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL
@ USER_LOCK_CURSOR_ADJUST
#define RV3D_VIEW_IS_AXIS(view)
@ RV3D_LOCK_ANY_TRANSFORM
#define RV3D_LOCK_FLAGS(rv3d)
@ V3D_SHADING_XRAY_WIREFRAME
@ 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)
#define ID_IS_OVERRIDE_LIBRARY(_id)
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)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
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)