98 ot->
name =
"View Lock Clear";
100 ot->
idname =
"VIEW3D_OT_view_lock_clear";
155 ot->
name =
"View Lock to Active";
157 ot->
idname =
"VIEW3D_OT_view_lock_to_active";
193 xfac =
float(region->winx) /
float(size[0] + 4);
194 yfac =
float(region->winy) /
float(size[1] + 4);
207 ot->
name =
"Frame Camera Bounds";
208 ot->
description =
"Center the camera view, resizing the view to fit its bounds";
209 ot->
idname =
"VIEW3D_OT_view_center_camera";
239 ot->
name =
"View Lock Center";
241 ot->
idname =
"VIEW3D_OT_view_center_lock";
280 vb.
xmax = region->winx;
281 vb.
ymax = region->winy;
296 scene->r.border = border;
309 scene->r.mode &= ~R_BORDER;
312 v3d->
flag2 &= ~V3D_RENDER_BORDER;
334 ot->
name =
"Set Render Region";
335 ot->
description =
"Set the boundaries of the border render and enable border render";
336 ot->
idname =
"VIEW3D_OT_render_border";
367 rctf *border =
nullptr;
370 scene->r.mode &= ~R_BORDER;
371 border = &scene->r.border;
376 v3d->
flag2 &= ~V3D_RENDER_BORDER;
397 ot->
name =
"Clear Render Region";
398 ot->
description =
"Clear the boundaries of the border render and disable border render";
399 ot->
idname =
"VIEW3D_OT_clear_render_border";
427 int im_width, im_height;
457 ot->
name =
"Zoom Camera 1:1";
458 ot->
description =
"Match the camera to 1:1 to the render output";
459 ot->
idname =
"VIEW3D_OT_zoom_camera_1_to_1";
502 ot->
name =
"View Perspective/Orthographic";
503 ot->
description =
"Switch the current view from perspective/orthographic projection";
504 ot->
idname =
"VIEW3D_OT_view_persportho";
542 ot->
name =
"View Navigation (Walk/Fly)";
544 "Interactively navigate around the scene (uses the mode (walk/fly) preference)";
562 if (v3d !=
nullptr) {
600 ot->
name =
"Add Camera Background Image";
601 ot->
description =
"Add a new background image to the active camera";
602 ot->
idname =
"VIEW3D_OT_camera_background_image_add";
613 ot->
srna,
"filepath",
nullptr,
FILE_MAX,
"Filepath",
"Path to image file");
619 "Select the file relative to the blend file");
643 "Cannot remove background image %d from camera '%s', as it is from the linked "
666 ot->
name =
"Remove Camera Background Image";
667 ot->
description =
"Remove a background image from the camera";
668 ot->
idname =
"VIEW3D_OT_camera_background_image_remove";
679 ot->
srna,
"index", 0, 0, INT_MAX,
"Index",
"Background image index to remove", 0, INT_MAX);
695 if (world ==
nullptr) {
701 scene->world =
world;
721 ot->
idname =
"VIEW3D_OT_drop_world";
744 const float mat[4][4])
751 for (
int i = 0; i < 8; i++) {
788 rv3d->
rflag &= ~RV3D_CLIPPING;
800 ot->
name =
"Clipping Region";
802 ot->
idname =
"VIEW3D_OT_clip_border";
827 const bool use_depth,
828 float r_cursor_co[3])
834 bool depth_used =
false;
838 if (rv3d ==
nullptr) {
864 if (depth_used ==
false) {
873 const bool use_depth,
875 float r_cursor_co[3],
876 float r_cursor_quat[4])
884 if (rv3d ==
nullptr) {
895 r_cursor_quat[0] *= -1.0f;
904 r_cursor_quat[0] *= -1.0f;
906 const float mval_fl[2] = {
float(mval[0]),
float(mval[1])};
913 const Object *ob_dummy =
nullptr;
943 float z_src[3] = {0, 0, 1};
951 const float ortho_axis_dot[3] = {
959 float angle_best = -1.0f;
968 for (
int axis = 0; axis < 2; axis++) {
969 float tan_src[3] = {0, 0, 0};
970 tan_src[axis] = 1.0f;
973 for (
int axis_sign = 0; axis_sign < 2; axis_sign++) {
977 if (angle_test < angle_best || angle_best == -1.0f) {
978 angle_best = angle_test;
984 mul_qt_qtqt(r_cursor_quat, tquat_best, r_cursor_quat);
993 const bool use_depth,
1006 quat = cursor_curr->rotation();
1009 C, mval, use_depth, orientation, cursor_curr->
location, &quat.
w);
1013 float tmat[3][3], cmat[3][3];
1021 cursor_curr->set_rotation(quat,
true);
1030 float co_2d_curr[2], co_2d_prev[2];
1037 rv3d->
ofs_lock[0] += (co_2d_curr[0] - co_2d_prev[0]) / (region->winx * 0.5f);
1038 rv3d->
ofs_lock[1] += (co_2d_curr[1] - co_2d_prev[1]) / (region->winy * 0.5f);
1088 ot->
name =
"Set 3D Cursor";
1108 "Orient to the current transform setting"},
1110 {0,
nullptr, 0,
nullptr,
nullptr},
1114 ot->
srna,
"use_depth",
true,
"Surface Project",
"Project onto the surface");
1122 "Preset viewpoint to use");
1133 {
OB_WIRE,
"WIREFRAME", 0,
"Wireframe",
"Toggle wireframe shading"},
1134 {
OB_SOLID,
"SOLID", 0,
"Solid",
"Toggle solid shading"},
1135 {
OB_MATERIAL,
"MATERIAL", 0,
"Material Preview",
"Toggle material preview shading"},
1136 {
OB_RENDER,
"RENDERED", 0,
"Rendered",
"Toggle rendered shading"},
1137 {0,
nullptr, 0,
nullptr,
nullptr},
1183 ot->
name =
"Toggle Shading Type";
1185 ot->
idname =
"VIEW3D_OT_toggle_shading";
1237 ot->
name =
"Toggle X-Ray";
1238 ot->
idname =
"VIEW3D_OT_toggle_xray";
1239 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 struct 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(dst, src)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL
@ USER_LOCK_CURSOR_ADJUST
#define RV3D_VIEW_IS_AXIS(view)
#define RV3D_LOCK_FLAGS(rv3d)
@ V3D_OVERLAY_BONE_SELECT
@ V3D_SHADING_XRAY_WIREFRAME
@ RV3D_LOCK_ANY_TRANSFORM
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)
eSnapMode ED_transform_snap_object_project_view3d_ex(SnapObjectContext *sctx, Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const eSnapMode snap_to, const SnapObjectParams *params, const float init_co[3], const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3], int *r_index, const Object **r_ob, float r_obmat[4][4], float r_face_nor[3])
SnapObjectContext * ED_transform_snap_object_context_create(Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
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_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_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, ViewDepths **r_depths)
void ED_view3d_lock_clear(View3D *v3d)
void view3d_operator_needs_opengl(const bContext *C)
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 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.
#define ND_RENDER_OPTIONS
#define NS_VIEW3D_SHADING
#define ND_DRAW_RENDER_VIEWPORT
const Depsgraph * depsgraph
draw_view in_light_buf[] float
void *(* MEM_callocN)(size_t len, const char *str)
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(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)
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
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) 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
void(* cancel)(bContext *C, wmOperator *op)
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 int toggle_xray_exec(bContext *C, wmOperator *op)
static int view3d_clipping_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int view3d_center_camera_exec(bContext *C, wmOperator *)
static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *)
static int camera_background_image_remove_exec(bContext *C, wmOperator *op)
static int view3d_clipping_exec(bContext *C, wmOperator *op)
static int view_lock_to_active_exec(bContext *C, wmOperator *)
static int view3d_cursor3d_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void VIEW3D_OT_view_persportho(wmOperatorType *ot)
static const EnumPropertyItem prop_shading_type_items[]
static int drop_world_exec(bContext *C, wmOperator *op)
static bool view3d_camera_user_poll(bContext *C)
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 int viewpersportho_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 int toggle_shading_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_view_lock_to_active(wmOperatorType *ot)
static void view3d_set_1_to_1_viewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region, View3D *v3d)
static int camera_background_image_add_exec(bContext *C, wmOperator *op)
void VIEW3D_OT_cursor3d(wmOperatorType *ot)
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 int view_lock_clear_exec(bContext *C, wmOperator *)
void VIEW3D_OT_navigate(wmOperatorType *ot)
static void calc_local_clipping(float clip_local[6][4], const BoundBox *clipbb, const float mat[4][4])
static int render_border_exec(bContext *C, wmOperator *op)
static int view3d_center_lock_exec(bContext *C, wmOperator *)
static int view3d_navigate_invoke(bContext *C, wmOperator *, const wmEvent *event)
static Camera * background_image_camera_from_context(bContext *C)
void VIEW3D_OT_camera_background_image_remove(wmOperatorType *ot)
static int clear_render_border_exec(bContext *C, wmOperator *op)
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)
void VIEW3D_OT_drop_world(wmOperatorType *ot)
void VIEW3D_OT_camera_background_image_add(wmOperatorType *ot)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(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)