|
Blender V4.5
|
#include <cmath>#include "BLI_listbase.h"#include "BLI_math_geom.h"#include "BLI_math_half.hh"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_threads.h"#include "BKE_armature.hh"#include "BKE_camera.h"#include "BKE_collection.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_global.hh"#include "BKE_grease_pencil.hh"#include "BKE_image.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_object.hh"#include "BKE_paint.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "BKE_unit.hh"#include "BKE_viewer_path.hh"#include "BLF_api.hh"#include "BLT_translation.hh"#include "DNA_armature_types.h"#include "DNA_camera_types.h"#include "DNA_key_types.h"#include "DNA_object_types.h"#include "DNA_view3d_types.h"#include "DNA_windowmanager_types.h"#include "DRW_engine.hh"#include "DRW_select_buffer.hh"#include "ED_gpencil_legacy.hh"#include "ED_info.hh"#include "ED_scene.hh"#include "ED_screen.hh"#include "ED_view3d_offscreen.hh"#include "ED_viewer_path.hh"#include "ANIM_bone_collections.hh"#include "DEG_depsgraph_query.hh"#include "GPU_framebuffer.hh"#include "GPU_immediate.hh"#include "GPU_immediate_util.hh"#include "GPU_matrix.hh"#include "GPU_state.hh"#include "GPU_viewport.hh"#include "MEM_guardedalloc.h"#include "UI_interface.hh"#include "UI_resources.hh"#include "RE_engine.h"#include "WM_api.hh"#include "WM_types.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "ANIM_keyframing.hh"#include "view3d_intern.hh"Go to the source code of this file.
Classes | |
| struct | RV3DMatrixStore |
Macros | |
| #define | M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f |
| #define | VIEW3D_OVERLAY_LINEHEIGHT (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f) |
Typedefs | |
| using | float4 |
Functions | |
General Functions | |
| void | ED_view3d_update_viewmat (const Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect, bool offscreen) |
| static void | view3d_main_region_setup_view (Depsgraph *depsgraph, Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect) |
| static void | view3d_main_region_setup_offscreen (Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4]) |
| static bool | view3d_stereo3d_active (wmWindow *win, const Scene *scene, View3D *v3d, RegionView3D *rv3d) |
| static void | view3d_stereo3d_setup (Depsgraph *depsgraph, Scene *scene, View3D *v3d, ARegion *region, const rcti *rect) |
| void | ED_view3d_draw_setup_view (const wmWindowManager *wm, wmWindow *win, Depsgraph *depsgraph, Scene *scene, ARegion *region, View3D *v3d, const float viewmat[4][4], const float winmat[4][4], const rcti *rect) |
Draw View Border | |
| static void | view3d_camera_border (const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, rctf *r_viewborder, const bool no_shift, const bool no_zoom) |
| 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_calc_camera_border (const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, const bool no_shift, rctf *r_viewborder) |
| static void | drawviewborder_grid3 (uint shdr_pos, float x1, float x2, float y1, float y2, float fac) |
| static void | drawviewborder_triangle (uint shdr_pos, float x1, float x2, float y1, float y2, const char golden, const char dir) |
| static void | drawviewborder (Scene *scene, Depsgraph *depsgraph, ARegion *region, View3D *v3d) |
| static void | drawrenderborder (ARegion *region, View3D *v3d) |
Draw Text & Info | |
| static void | view3d_draw_grease_pencil (const bContext *) |
| static const char * | view3d_get_name (View3D *v3d, RegionView3D *rv3d) |
| static void | draw_viewport_name (ARegion *region, View3D *v3d, int xoffset, int *yoffset) |
| static bool | is_grease_pencil_with_layer_keyframe (const Object &ob) |
| static void | draw_selected_name (const View3D *v3d, Scene *scene, ViewLayer *view_layer, Object *ob, int xoffset, int *yoffset) |
| static void | draw_grid_unit_name (Scene *scene, ARegion *region, View3D *v3d, int xoffset, int *yoffset) |
| void | view3d_draw_region_info (const bContext *C, ARegion *region) |
Draw Viewport Contents | |
| static void | view3d_draw_view (const bContext *C, ARegion *region) |
| RenderEngineType * | ED_view3d_engine_type (const Scene *scene, int drawtype) |
| static void | view3d_update_viewer_path (const bContext *C) |
| void | view3d_main_region_draw (const bContext *C, ARegion *region) |
Off-screen Drawing | |
| static void | view3d_stereo3d_setup_offscreen (Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float winmat[4][4], const char *viewname) |
| void | ED_view3d_draw_offscreen (Depsgraph *depsgraph, const Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int winx, int winy, const float viewmat[4][4], const float winmat[4][4], bool is_image_render, bool draw_background, const char *viewname, const bool do_color_management, const bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport) |
| void | ED_view3d_draw_offscreen_simple (Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, int object_type_exclude_viewport_override, int object_type_exclude_select_override, int winx, int winy, uint draw_flags, const float viewmat[4][4], const float winmat[4][4], float clip_start, float clip_end, bool is_xr_surface, bool is_image_render, bool draw_background, const char *viewname, const bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport) |
| ImBuf * | ED_view3d_draw_offscreen_imbuf (Depsgraph *depsgraph, Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const char *viewname, const bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport, const bool use_camera_view_bounds, char err_out[256]) |
| ImBuf * | ED_view3d_draw_offscreen_imbuf_simple (Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, eImBufFlags imbuf_flag, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256]) |
| bool | ED_view3d_draw_offscreen_check_nested () |
Viewport Clipping | |
| static bool | view3d_clipping_test (const float co[3], const float clip[6][4]) |
| bool | ED_view3d_clipping_test (const RegionView3D *rv3d, const float co[3], const bool is_local) |
Back-Draw for Selection | |
| static void | validate_object_select_id (Depsgraph *depsgraph, const Scene *scene, ViewLayer *view_layer, ARegion *region, View3D *v3d, Object *obact) |
| static void | view3d_gpu_read_Z_pixels (GPUViewport *viewport, rcti *rect, void *data) |
| void | ED_view3d_select_id_validate (const ViewContext *vc) |
| int | ED_view3d_backbuf_sample_size_clamp (ARegion *region, const float dist) |
Z-Depth Utilities | |
| void | view3d_depths_rect_create (ARegion *region, rcti *rect, ViewDepths *r_d) |
| static ViewDepths * | view3d_depths_create (ARegion *region) |
| float | view3d_depth_near (ViewDepths *d) |
| void | ED_view3d_depth_override (Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths) |
| void | ED_view3d_depths_free (ViewDepths *depths) |
| bool | ED_view3d_has_depth_buffer_updated (const Depsgraph *depsgraph, const View3D *v3d) |
Custom-data Utilities | |
| void | ED_view3d_datamask (const Scene *scene, ViewLayer *view_layer, const View3D *v3d, CustomData_MeshMasks *r_cddata_masks) |
| void | ED_view3d_screen_datamask (const Scene *scene, ViewLayer *view_layer, const bScreen *screen, CustomData_MeshMasks *r_cddata_masks) |
Region View Matrix Backup/Restore | |
| RV3DMatrixStore * | ED_view3d_mats_rv3d_backup (RegionView3D *rv3d) |
| void | ED_view3d_mats_rv3d_restore (RegionView3D *rv3d, RV3DMatrixStore *rv3dmat_pt) |
| void | ED_view3D_mats_rv3d_free (RV3DMatrixStore *rv3d_mat) |
FPS Drawing | |
| void | ED_scene_draw_fps (const Scene *scene, int xoffset, int *yoffset) |
Calculate Render Border | |
| static bool | view3d_main_region_do_render_draw (const Scene *scene) |
| bool | ED_view3d_calc_render_border (const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *r_rect) |
Other Elements | |
| #define | STEPS_LEN 8 |
| float | ED_scene_grid_scale (const Scene *scene, const char **r_grid_unit) |
| float | ED_view3d_grid_scale (const Scene *scene, const View3D *v3d, const char **r_grid_unit) |
| static void | view3d_grid_steps_ex (const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[STEPS_LEN], void const **r_usys_pt, int *r_len) |
| void | ED_view3d_grid_steps (const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[STEPS_LEN]) |
| float | ED_view3d_grid_view_scale (const Scene *scene, const View3D *v3d, const ARegion *region, const char **r_grid_unit) |
| static void | draw_view_axis (RegionView3D *rv3d, const rcti *rect) |
| static void | view3d_draw_border (const bContext *C, ARegion *region) |
| #define M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f |
Definition at line 90 of file view3d_draw.cc.
Referenced by drawviewborder(), and drawviewborder_triangle().
| #define STEPS_LEN 8 |
Definition at line 861 of file view3d_draw.cc.
Referenced by ED_view3d_grid_steps(), ED_view3d_grid_view_scale(), and view3d_grid_steps_ex().
| #define VIEW3D_OVERLAY_LINEHEIGHT (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f) |
Definition at line 92 of file view3d_draw.cc.
Referenced by draw_grid_unit_name(), draw_selected_name(), draw_viewport_name(), ED_scene_draw_fps(), and view3d_draw_region_info().
| using blender::float4 |
Definition at line 620 of file BLI_math_vector_types.hh.
|
static |
Definition at line 1487 of file view3d_draw.cc.
References BLF_draw_default(), BLI_STR_UTF8_MULTIPLICATION_SIGN, ED_view3d_grid_view_scale(), View3D::grid, RegionView3D::is_persp, ARegion::regiondata, RV3D_VIEW_IS_AXIS, SNPRINTF, RegionView3D::view, and VIEW3D_OVERLAY_LINEHEIGHT.
Referenced by view3d_draw_region_info().
|
static |
Draw info beside axes in top-left corner: frame-number, collection, object name, bone name (if available), marker name (if available).
Definition at line 1348 of file view3d_draw.cc.
References bArmature::act_bone, bArmature::act_edbone, ANIM_bonecoll_is_visible_actbone(), ARRAY_SIZE, BKE_collection_ui_name_get(), BKE_key_from_object(), BKE_object_pose_armature_get(), BKE_scene_find_marker_name(), BKE_view_layer_active_collection_get(), BKE_view_layer_synced_ensure(), BLF_default(), BLF_draw_default(), BLI_assert, BLI_findlink(), BLI_listbase_is_empty(), BLI_string_join_array(), BLI_string_len_array(), Key::block, RenderData::cfra, LayerCollection::collection, Object::data, bArmature::edbo, ELEM, View3D::flag2, i, Object::id, blender::animrig::id_frame_has_keyframe(), IFACE_, is_grease_pencil_with_layer_keyframe(), Object::mode, Bone::name, EditBone::name, ID::name, KeyBlock::name, OB_ARMATURE, OB_CURVES_LEGACY, OB_LATTICE, OB_MESH, OB_MODE_OBJECT, OB_MODE_POSE, OB_MODE_WEIGHT_PAINT, OB_SHAPE_LOCK, ViewerPath::path, Scene::r, Object::shapeflag, Object::shapenr, SNPRINTF, TH_TIME_GP_KEYFRAME, TH_TIME_KEYFRAME, Object::type, UI_FontThemeColor(), V3D_SHOW_VIEWER, VIEW3D_OVERLAY_LINEHEIGHT, and View3D::viewer_path.
Referenced by view3d_draw_region_info().
|
static |
Definition at line 959 of file view3d_draw.cc.
References axis_sort_v3(), BLF_color4fv(), BLF_default(), BLF_draw_default(), col, GPU_blend(), GPU_BLEND_ALPHA, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_FLAT_COLOR, GPU_vertformat_attr_add(), hypotf, i, immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex2f(), immVertex2fv(), immVertexFormat(), mul_qt_v3(), pos, TH_AXIS_X, U, UI_GetThemeColorShade3fv(), UI_SCALE_FAC, UI_UNIT_X, UI_UNIT_Y, RegionView3D::viewinv, RegionView3D::viewquat, rcti::xmax, and rcti::ymax.
Referenced by view3d_draw_region_info().
Definition at line 1284 of file view3d_draw.cc.
References BLF_draw_default(), BLI_string_join_array(), IFACE_, View3D::localvd, ARegion::regiondata, RegionView3D::rflag, RV3D_CLIPPING, RV3D_VIEW_AXIS_ROLL_0, RV3D_VIEW_AXIS_ROLL_180, RV3D_VIEW_AXIS_ROLL_90, RV3D_VIEW_IS_AXIS, RegionView3D::view, view3d_get_name(), VIEW3D_OVERLAY_LINEHEIGHT, and RegionView3D::view_axis_roll.
Referenced by view3d_draw_region_info().
Definition at line 801 of file view3d_draw.cc.
References GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_draw_box_wire_2d(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immVertexFormat(), View3D::render_border, ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by view3d_draw_border().
Definition at line 533 of file view3d_draw.cc.
References DisplaySafeAreas::action, DisplaySafeAreas::action_center, BKE_camera_sensor_fit(), BLF_default(), BLF_draw_default(), RenderData::border, CAM_DTX_CENTER, CAM_DTX_CENTER_DIAG, CAM_DTX_GOLDEN, CAM_DTX_GOLDEN_TRI_A, CAM_DTX_GOLDEN_TRI_B, CAM_DTX_HARMONY_TRI_A, CAM_DTX_HARMONY_TRI_B, CAM_DTX_THIRDS, CAM_SHOW_SAFE_CENTER, CAM_SHOW_SAFE_MARGINS, CAM_SHOWNAME, CAM_SHOWPASSEPARTOUT, CAM_SHOWSENSOR, View3D::camera, CAMERA_SENSOR_FIT_AUTO, CAMERA_SENSOR_FIT_HOR, Object::data, depsgraph, drawviewborder_grid3(), drawviewborder_triangle(), Camera::dtx, ED_view3d_calc_camera_border(), Camera::flag, View3DOverlay::flag, View3D::flag2, floorf, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), Object::id, imm_draw_box_wire_2d(), immBegin(), immBindBuiltinProgram(), immEnd(), immRectf(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniformColor3f(), immUniformColor3ubv(), immUniformThemeColor(), immUniformThemeColor3(), immUniformThemeColorAlpha(), immUniformThemeColorShadeAlpha(), immVertex2f(), immVertexFormat(), M_GOLDEN_RATIO_CONJUGATE, RenderData::mode, ID::name, OB_CAMERA, View3D::overlay, Camera::passepartalpha, Scene::r, R_BORDER, ARegion::regiondata, Scene::safe_areas, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, TH_BACK, TH_CAMERA_PASSEPARTOUT, TH_REDALERT, TH_TEXT_HI, TH_VIEW_OVERLAY, DisplaySafeAreas::title, DisplaySafeAreas::title_center, Object::type, U, UI_draw_safe_areas(), UI_FontThemeColor(), V3D_HIDE_OVERLAYS, V3D_LOCK_CAMERA, V3D_OVERLAY_HIDE_TEXT, V3D_SHOW_CAMERA_GUIDES, V3D_SHOW_CAMERA_PASSEPARTOUT, view3d_camera_border_hack_col, view3d_camera_border_hack_test, ARegion::winx, ARegion::winy, RenderData::xasp, rctf::xmax, rctf::xmin, RenderData::xsch, RenderData::yasp, rctf::ymax, rctf::ymin, and RenderData::ysch.
Referenced by view3d_draw_border().
|
static |
Definition at line 453 of file view3d_draw.cc.
References GPU_PRIM_LINES, immBegin(), immEnd(), and immVertex2f().
Referenced by drawviewborder().
|
static |
Definition at line 480 of file view3d_draw.cc.
References GPU_PRIM_LINES, immBegin(), immEnd(), immVertex2f(), M_GOLDEN_RATIO_CONJUGATE, and w().
Referenced by drawviewborder().
| void ED_scene_draw_fps | ( | const Scene * | scene, |
| int | xoffset, | ||
| int * | yoffset ) |
Definition at line 2732 of file view3d_draw.cc.
References BLF_color4fv(), BLF_default(), BLF_draw_default(), ED_scene_fps_average_calc(), hsv_to_rgb_v(), IFACE_, rgb_to_hsv_v(), SNPRINTF, state, TH_REDALERT, UI_GetThemeColor4fv(), and VIEW3D_OVERLAY_LINEHEIGHT.
Referenced by blender::ed::vse::sequencer_preview_draw_overlays(), and view3d_draw_region_info().
| float ED_scene_grid_scale | ( | const Scene * | scene, |
| const char ** | r_grid_unit ) |
Could move this elsewhere, but tied into ED_view3d_grid_scale
Definition at line 835 of file view3d_draw.cc.
References B_UNIT_LENGTH, BKE_unit_base_get(), BKE_unit_display_name_get(), BKE_unit_scalar_get(), BKE_unit_system_get(), i, IFACE_, len, UnitSettings::scale_length, UnitSettings::system, and Scene::unit.
Referenced by ED_view3d_grid_scale(), blender::ed::object::new_primitive_matrix(), blender::ed::object::object_camera_add_exec(), and WM_operator_view3d_unit_defaults().
| int ED_view3d_backbuf_sample_size_clamp | ( | ARegion * | region, |
| float | dist ) |
allow for small values [0.5 - 2.5], and large values, FLT_MAX by clamping by the area size
Definition at line 2376 of file view3d_draw.cc.
References ceilf, max_ii(), min_ff(), and ARegion::winx.
Referenced by EDBM_edge_find_nearest_ex(), EDBM_face_find_nearest_ex(), and EDBM_vert_find_nearest_ex().
| void ED_view3d_calc_camera_border | ( | const Scene * | scene, |
| const Depsgraph * | depsgraph, | ||
| const ARegion * | region, | ||
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| const bool | no_shift, | ||
| rctf * | r_viewborder ) |
Definition at line 442 of file view3d_draw.cc.
References depsgraph, and view3d_camera_border().
Referenced by annotation_paint_initstroke(), drawFlyPixel(), drawviewborder(), drawWalkPixel(), ED_annotation_draw_view3d(), ED_view3d_calc_render_border(), ED_view3d_update_viewmat(), blender::draw::compositor_engine::Context::get_compositing_region(), blender::eevee::Instance::init(), initFlyInfo(), blender::io::grease_pencil::GreasePencilExporter::prepare_render_params(), blender::ed::transform::projectFloatViewCenterFallback(), render_border_exec(), view_zoom_to_window_xy_camera(), and WIDGETGROUP_camera_view_draw_prepare().
| 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] ) |
Definition at line 428 of file view3d_draw.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), depsgraph, and view3d_camera_border().
Referenced by view3d_center_camera_exec(), and view3d_set_1_to_1_viewborder().
| bool ED_view3d_calc_render_border | ( | const Scene * | scene, |
| Depsgraph * | depsgraph, | ||
| View3D * | v3d, | ||
| ARegion * | region, | ||
| rcti * | r_rect ) |
Definition at line 2786 of file view3d_draw.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_isect(), BLI_rcti_translate(), RenderData::border, depsgraph, ED_view3d_calc_camera_border(), View3D::flag2, RenderData::mode, OB_RENDER, RegionView3D::persp, Scene::r, R_BORDER, ARegion::regiondata, View3D::render_border, RV3D_CAMOB, View3D::shading, View3DShading::type, V3D_RENDER_BORDER, view3d_main_region_do_render_draw(), ARegion::winrct, ARegion::winx, ARegion::winy, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by wm_region_test_render_do_draw().
| bool ED_view3d_clipping_test | ( | const RegionView3D * | rv3d, |
| const float | co[3], | ||
| bool | is_local ) |
Return true when co is hidden by the 3D views clipping planes.
| is_local | When true use local (object-space) ED_view3d_clipping_local must run first, then all comparisons can be done in local-space. |
Definition at line 2286 of file view3d_draw.cc.
References RegionView3D::clip, RegionView3D::clip_local, and view3d_clipping_test().
Referenced by ed_view3d_project__internal(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::filter_region_clip_factors(), find_nearest_edge__doClosest(), knife_bvh_raycast_cb(), knife_find_closest_edge_of_face(), knife_find_closest_vert_of_edge(), knife_sample_screen_density_from_closest_face(), point_is_visible(), project_paint_face_init(), and project_paint_occlude_ptv_clip().
| void ED_view3d_datamask | ( | const Scene * | scene, |
| ViewLayer * | view_layer, | ||
| const View3D * | v3d, | ||
| CustomData_MeshMasks * | r_cddata_masks ) |
Definition at line 2615 of file view3d_draw.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), CD_MASK_MDEFORMVERT, CD_MASK_ORCO, CD_MASK_PROP_BYTE_COLOR, CD_MASK_PROP_COLOR, CD_MASK_PROP_FLOAT2, View3DShading::color_type, View3DOverlay::edit_flag, ELEM, CustomData_MeshMasks::lmask, Object::mode, OB_MATERIAL, OB_MESH, OB_MODE_EDIT, OB_RENDER, OB_SOLID, OB_TEXTURE, View3D::overlay, View3D::shading, Object::type, View3DShading::type, V3D_OVERLAY_EDIT_WEIGHT, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, and CustomData_MeshMasks::vmask.
Referenced by ED_view3d_screen_datamask(), and screen_opengl_render_init().
| void ED_view3d_depth_override | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| Object * | obact, | ||
| eV3DDepthOverrideMode | mode, | ||
| bool | use_overlay, | ||
| ViewDepths ** | r_depths ) |
Redraw the viewport depth buffer. Call ED_view3d_has_depth_buffer_updated if you want to check if the viewport already has depth buffer updated.
| use_overlay | When enabled and the v3d has overlays enabled, show overlays. A rule of thumb for this value is:
|
Definition at line 2475 of file view3d_draw.cc.
References DEG_get_evaluated_scene(), depsgraph, DRW_draw_depth_loop(), ED_view3d_depths_free(), ED_view3d_draw_setup_view(), flag, View3D::flag, View3D_Runtime::flag, View3D::flag2, G_MAIN, ARegion::regiondata, RegionView3D::rflag, RGN_TYPE_WINDOW, View3D::runtime, RV3D_ZOFFSET_DISABLED, SPACE_VIEW3D, UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), V3D_DEPTH_ALL, V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_GPENCIL, V3D_DEPTH_OBJECT_ONLY, V3D_DEPTH_SELECTED_ONLY, V3D_HIDE_OVERLAYS, V3D_RUNTIME_DEPTHBUF_OVERRIDDEN, V3D_SELECT_OUTLINE, view3d_depths_create(), WM_draw_region_get_viewport(), WM_draw_region_viewport_bind(), WM_draw_region_viewport_ensure(), and WM_draw_region_viewport_unbind().
Referenced by annotation_paint_strokeend(), annotation_stroke_addpoint(), annotation_stroke_doeraser(), blender::ed::greasepencil::DrawingPlacement::cache_viewport_depths(), curve_draw_invoke(), blender::ed::curves::curves_draw_invoke(), depthdropper_depth_sample_pt(), ED_view3d_cursor3d_position(), navigate_pivot_get(), blender::ed::object::object_transform_axis_target_invoke(), paint_proj_stroke(), PE_set_view3d_data(), view3d_zoom_border_exec(), and viewcenter_pick_invoke().
| void ED_view3d_depths_free | ( | ViewDepths * | depths | ) |
Definition at line 2569 of file view3d_draw.cc.
References ViewDepths::depths, and MEM_freeN().
Referenced by annotation_session_free(), blender::ed::curves::curve_draw_exit(), curve_draw_exit(), ED_view3d_depth_override(), blender::ed::object::object_transform_axis_target_free_data(), PE_data_free(), and blender::ed::greasepencil::DrawingPlacement::~DrawingPlacement().
| void ED_view3d_draw_offscreen | ( | Depsgraph * | depsgraph, |
| const Scene * | scene, | ||
| eDrawType | drawtype, | ||
| View3D * | v3d, | ||
| ARegion * | region, | ||
| int | winx, | ||
| int | winy, | ||
| const float | viewmat[4][4], | ||
| const float | winmat[4][4], | ||
| bool | is_image_render, | ||
| bool | draw_background, | ||
| const char * | viewname, | ||
| const bool | do_color_management, | ||
| const bool | restore_rv3d_mats, | ||
| GPUOffScreen * | ofs, | ||
| GPUViewport * | viewport ) |
Needed so the value won't be left overwritten, Without this the wmPaintCursor can't use the pixel size & view matrices for drawing.
Definition at line 1723 of file view3d_draw.cc.
References BKE_image_free_anim_gputextures(), View3D::camera, depsgraph, draw_background(), blender::draw::DRW_cache_free_old_subdiv(), DRW_draw_render_loop_offscreen(), ED_view3d_engine_type(), ED_view3d_mats_rv3d_backup(), ED_view3d_mats_rv3d_restore(), G, G_FLAG_RENDER_VIEWPORT, GPU_matrix_identity_set(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_push(), GPU_matrix_push_projection(), GPU_viewport_tag_update(), View3D::lens, MEM_freeN(), RegionView3D::persp, ARegion::regiondata, RGN_TYPE_WINDOW, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, View3D::shading, SPACE_VIEW3D, View3DShading::type, UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), view3d_main_region_setup_offscreen(), view3d_stereo3d_setup_offscreen(), ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_simple(), and pygpu_offscreen_draw_view3d().
| bool ED_view3d_draw_offscreen_check_nested | ( | ) |
Drawing off-screen is not supported while drawing, this is a simple check to use when the code path may occur within a draw call (Python scripting for example).
Definition at line 2265 of file view3d_draw.cc.
References DRW_draw_in_progress().
Referenced by pygpu_offscreen_draw_view3d().
| ImBuf * ED_view3d_draw_offscreen_imbuf | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| eDrawType | drawtype, | ||
| View3D * | v3d, | ||
| ARegion * | region, | ||
| int | sizex, | ||
| int | sizey, | ||
| eImBufFlags | imbuf_flag, | ||
| int | alpha_mode, | ||
| const char * | viewname, | ||
| bool | restore_rv3d_mats, | ||
| GPUOffScreen * | ofs, | ||
| GPUViewport * | viewport, | ||
| bool | use_camera_view_bounds, | ||
| char | err_out[256] ) |
Utility func for ED_view3d_draw_offscreen
| ofs | Optional off-screen buffer, can be NULL. (avoids re-creating when doing multiple GL renders). |
| viewport | Optional viewport data, can be NULL. (avoids re-creating when doing multiple GL renders, allows keeping track of state across frames). |
| use_camera_view_bounds | if true and the viewport is looking through a camera, only render what the camera can see. In case the aspect ratio of the given sizex and sizey does not match the render aspect ratio of the scene, the returned image will be expanded so the camera view bounds are contained within it. |
Definition at line 1983 of file view3d_draw.cc.
References BKE_camera_multiview_params(), BKE_camera_multiview_render(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), ImBuf::byte_buffer, View3D::camera, View3D::clip_end, View3D::clip_start, copy_m4_m4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, DEG_get_evaluated(), depsgraph, DRW_gpu_context_disable(), DRW_gpu_context_enable(), ED_view3d_draw_offscreen(), ED_view3d_viewplane_get(), ImBuf::float_buffer, GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_framebuffer_active_get(), GPU_framebuffer_bind(), GPU_framebuffer_restore(), GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_format(), GPU_offscreen_free(), GPU_offscreen_height(), GPU_offscreen_read_color(), GPU_offscreen_unbind(), GPU_offscreen_width(), GPU_RGBA16F, GPU_RGBA8, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, IB_float_data, IMB_allocImBuf(), IMB_byte_from_float(), orthographic_m4(), params, RegionView3D::persp, perspective_m4(), Scene::r, R_ADDSKY, ARegion::regiondata, RV3D_CAMOB, RenderData::xasp, rctf::xmax, rctf::xmin, RenderData::yasp, rctf::ymax, and rctf::ymin.
Referenced by blend_file_thumb_from_camera(), ED_view3d_draw_offscreen_imbuf_simple(), screen_opengl_render_doit(), blender::ed::asset::screenshot_preview_exec(), and texture_paint_image_from_view_exec().
| ImBuf * ED_view3d_draw_offscreen_imbuf_simple | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| View3DShading * | shading_override, | ||
| eDrawType | drawtype, | ||
| Object * | camera, | ||
| int | width, | ||
| int | height, | ||
| eImBufFlags | imbuf_flags, | ||
| eV3DOffscreenDrawFlag | draw_flags, | ||
| int | alpha_mode, | ||
| const char * | viewname, | ||
| GPUOffScreen * | ofs, | ||
| GPUViewport * | viewport, | ||
| char | err_out[256] ) |
Creates separate fake 3d views (wrapping ED_view3d_draw_offscreen_imbuf)
| ofs | Optional off-screen buffer can be NULL. (avoids re-creating when doing multiple GL renders). |
| viewport | Optional viewport data, can be NULL. (avoids re-creating when doing multiple GL renders, allows keeping track of state across frames). |
Definition at line 2145 of file view3d_draw.cc.
References View3DShading::background_type, BKE_camera_multiview_params(), BKE_camera_multiview_render(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), BKE_scene_uses_blender_eevee(), BKE_scene_uses_blender_workbench(), View3D::camera, View3D::clip_end, View3D::clip_start, View3DShading::color_type, copy_m4_m4(), DEG_get_evaluated(), depsgraph, Scene::display, ED_view3d_draw_offscreen_imbuf(), ListBase::first, View3DShading::flag, View3D::flag2, View3DOverlay::gpencil_vertex_paint_opacity, View3D::gridflag, invert_m4_m4(), ListBase::last, View3D::lens, View3DShading::light, mul_m4_m4m4(), normalize_m4(), OB_MATERIAL, OB_RENDER, OB_SOLID, OB_TEXTURE, View3D::overlay, params, RegionView3D::persinv, RegionView3D::persmat, RegionView3D::persp, Scene::r, View3D::regionbase, ARegion::regiondata, ARegion::regiontype, View3DShading::render_pass, RGN_TYPE_WINDOW, ARegion::runtime, RV3D_CAMOB, SCE_PASS_COMBINED, SceneDisplay::shading, View3D::shading, View3DShading::type, V3D_HIDE_OVERLAYS, V3D_LIGHTING_STUDIO, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, V3D_OFSDRAW_SHOW_ANNOTATION, V3D_OFSDRAW_SHOW_GRIDFLOOR, V3D_SHADING_BACKGROUND_WORLD, V3D_SHADING_SCENE_LIGHTS, V3D_SHADING_SCENE_LIGHTS_RENDER, V3D_SHADING_SCENE_WORLD, V3D_SHADING_SCENE_WORLD_RENDER, V3D_SHADING_TEXTURE_COLOR, V3D_SHOW_ANNOTATION, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, View3DOverlay::wireframe_opacity, View3DOverlay::wireframe_threshold, RenderData::xasp, and RenderData::yasp.
Referenced by action_preview_render(), blend_file_thumb_from_camera(), blender::ed::vse::ED_spacetype_sequencer(), object_preview_render(), and screen_opengl_render_doit().
| void ED_view3d_draw_offscreen_simple | ( | Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| View3DShading * | shading_override, | ||
| eDrawType | drawtype, | ||
| int | object_type_exclude_viewport_override, | ||
| int | object_type_exclude_select_override, | ||
| int | winx, | ||
| int | winy, | ||
| unsigned int | draw_flags, | ||
| const float | viewmat[4][4], | ||
| const float | winmat[4][4], | ||
| float | clip_start, | ||
| float | clip_end, | ||
| bool | is_xr_surface, | ||
| bool | is_image_render, | ||
| bool | draw_background, | ||
| const char * | viewname, | ||
| bool | do_color_management, | ||
| GPUOffScreen * | ofs, | ||
| GPUViewport * | viewport ) |
Creates separate fake 3d views (wrapping ED_view3d_draw_offscreen). Similar too #ED_view_draw_offscreen_imbuf_simple, but takes view/projection matrices as arguments.
Definition at line 1862 of file view3d_draw.cc.
References View3D::clip_end, View3D::clip_start, depsgraph, Scene::display, draw_background(), ED_view3d_draw_offscreen(), Scene::eevee, ListBase::first, View3D::flag, View3DOverlay::flag, View3DShading::flag, View3D::flag2, View3D::grid, View3D::gridflag, View3D::gridlines, View3D::gridsubdiv, ListBase::last, View3D::lens, OB_ARMATURE, OB_MATERIAL, View3D::object_type_exclude_select, View3D::object_type_exclude_viewport, View3D::overlay, SceneEEVEE::overscan, RegionView3D::persp, View3D::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, ARegion::runtime, RV3D_PERSP, SceneDisplay::shading, View3D::shading, View3DShading::type, V3D_HIDE_HELPLINES, V3D_HIDE_OVERLAYS, V3D_OFSDRAW_NONE, V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS, V3D_OFSDRAW_SHOW_ANNOTATION, V3D_OFSDRAW_SHOW_GRIDFLOOR, V3D_OFSDRAW_SHOW_OBJECT_EXTRAS, V3D_OFSDRAW_SHOW_SELECTION, V3D_OFSDRAW_XR_SHOW_CONTROLLERS, V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS, V3D_OFSDRAW_XR_SHOW_PASSTHROUGH, V3D_OVERLAY_HIDE_BONES, V3D_OVERLAY_HIDE_CURSOR, V3D_OVERLAY_HIDE_MOTION_PATHS, V3D_OVERLAY_HIDE_OBJECT_ORIGINS, V3D_OVERLAY_HIDE_OBJECT_XTRAS, V3D_OVERLAY_HIDE_TEXT, V3D_SELECT_OUTLINE, V3D_SHADING_SCENE_LIGHTS, V3D_SHADING_SCENE_WORLD, V3D_SHOW_ANNOTATION, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, V3D_XR_SESSION_SURFACE, V3D_XR_SHOW_CONTROLLERS, V3D_XR_SHOW_CUSTOM_OVERLAYS, and V3D_XR_SHOW_PASSTHROUGH.
Referenced by wm_xr_draw_view().
| void ED_view3d_draw_setup_view | ( | const wmWindowManager * | wm, |
| wmWindow * | win, | ||
| Depsgraph * | depsgraph, | ||
| Scene * | scene, | ||
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const float | viewmat[4][4], | ||
| const float | winmat[4][4], | ||
| const rcti * | rect ) |
Set the correct matrices
Definition at line 343 of file view3d_draw.cc.
References depsgraph, ARegion::regiondata, UNUSED_VARS, view3d_main_region_setup_view(), view3d_stereo3d_active(), and view3d_stereo3d_setup().
Referenced by ED_view3d_depth_override(), gizmo_find_intersected_3d_intern(), blender::ed::sculpt_paint::paint_cursor_cursor_draw_3d_view_brush_cursor_active(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), view3d_draw_view(), and view3d_gpu_select_ex().
| RenderEngineType * ED_view3d_engine_type | ( | const Scene * | scene, |
| int | drawtype ) |
Definition at line 1648 of file view3d_draw.cc.
References RenderData::engine, RenderEngineType::flag, OB_MATERIAL, Scene::r, RE_engine_id_BLENDER_EEVEE_NEXT, RE_engines_find(), and RE_USE_EEVEE_VIEWPORT.
Referenced by DRW_draw_view(), ED_view3d_draw_offscreen(), and blender::draw::overlay::Instance::init().
Definition at line 856 of file view3d_draw.cc.
References ED_scene_grid_scale(), and View3D::grid.
Referenced by ED_view3d_grid_view_scale(), blender::ed::object::new_primitive_matrix(), blender::ed::object::object_camera_add_exec(), and WM_operator_view3d_unit_defaults().
| void ED_view3d_grid_steps | ( | const Scene * | scene, |
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| float | r_grid_steps[STEPS_LEN] ) |
Definition at line 915 of file view3d_draw.cc.
References STEPS_LEN, and view3d_grid_steps_ex().
| float ED_view3d_grid_view_scale | ( | const Scene * | scene, |
| const View3D * | v3d, | ||
| const ARegion * | region, | ||
| const char ** | r_grid_unit ) |
Simulates the grid scale that is actually viewed. The actual code is seen in object_grid_frag.glsl (see grid_res). Currently the simulation is only done when RV3D_VIEW_IS_AXIS.
Definition at line 923 of file view3d_draw.cc.
References BKE_unit_display_name_get(), ED_view3d_grid_scale(), i, IFACE_, RegionView3D::is_persp, ARegion::regiondata, RV3D_VIEW_IS_AXIS, ARegion::sizex, STEPS_LEN, RegionView3D::view, view3d_grid_steps_ex(), and RegionView3D::winmat.
Referenced by draw_grid_unit_name(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), idp_snap_calc_incremental(), snap_curs_to_grid_exec(), blender::ed::transform::snap_object_context_runtime_init(), snap_sel_to_grid_exec(), and blender::ed::transform::transform_snap_grid_init().
| bool ED_view3d_has_depth_buffer_updated | ( | const Depsgraph * | depsgraph, |
| const View3D * | v3d ) |
Definition at line 2577 of file view3d_draw.cc.
References DEG_get_evaluated_scene(), depsgraph, RenderData::engine, RenderEngineType::flag, View3D::flag2, OB_MATERIAL, OB_RENDER, OB_SOLID, Scene::r, RE_engine_id_BLENDER_EEVEE_NEXT, RE_engine_id_BLENDER_WORKBENCH, RE_engines_find(), RE_INTERNAL, View3D::shading, STREQ, View3DShading::type, UNUSED_VARS, V3D_HIDE_OVERLAYS, and XRAY_ENABLED.
Referenced by navigate_pivot_get().
| RV3DMatrixStore * ED_view3d_mats_rv3d_backup | ( | RegionView3D * | rv3d | ) |
Definition at line 2695 of file view3d_draw.cc.
References copy_m4_m4(), copy_v4_v4(), MEM_mallocN(), RegionView3D::persinv, RV3DMatrixStore::persinv, RegionView3D::persmat, RV3DMatrixStore::persmat, RegionView3D::pixsize, RV3DMatrixStore::pixsize, RegionView3D::viewcamtexcofac, RV3DMatrixStore::viewcamtexcofac, RegionView3D::viewinv, RV3DMatrixStore::viewinv, RegionView3D::viewmat, RV3DMatrixStore::viewmat, RegionView3D::winmat, and RV3DMatrixStore::winmat.
Referenced by ED_view3d_draw_offscreen(), and blender::ed::greasepencil::image_render::region_init().
| void ED_view3D_mats_rv3d_free | ( | RV3DMatrixStore * | rv3d_mat | ) |
Definition at line 2721 of file view3d_draw.cc.
References MEM_freeN().
Referenced by blender::ed::greasepencil::image_render::region_reset().
| void ED_view3d_mats_rv3d_restore | ( | RegionView3D * | rv3d, |
| RV3DMatrixStore * | rv3dmat_pt ) |
Definition at line 2709 of file view3d_draw.cc.
References copy_m4_m4(), copy_v4_v4(), RegionView3D::persinv, RV3DMatrixStore::persinv, RegionView3D::persmat, RV3DMatrixStore::persmat, RegionView3D::pixsize, RV3DMatrixStore::pixsize, RegionView3D::viewcamtexcofac, RV3DMatrixStore::viewcamtexcofac, RegionView3D::viewinv, RV3DMatrixStore::viewinv, RegionView3D::viewmat, RV3DMatrixStore::viewmat, RegionView3D::winmat, and RV3DMatrixStore::winmat.
Referenced by ED_view3d_draw_offscreen(), and blender::ed::greasepencil::image_render::region_reset().
| void ED_view3d_screen_datamask | ( | const Scene * | scene, |
| ViewLayer * | view_layer, | ||
| const bScreen * | screen, | ||
| CustomData_MeshMasks * | r_cddata_masks ) |
Goes over all modes and view3d settings.
Definition at line 2656 of file view3d_draw.cc.
References bScreen::areabase, CD_MASK_BAREMESH, CustomData_MeshMasks_update(), ED_view3d_datamask(), LISTBASE_FOREACH, and SPACE_VIEW3D.
Referenced by wm_event_do_depsgraph().
| void ED_view3d_select_id_validate | ( | const ViewContext * | vc | ) |
Definition at line 2370 of file view3d_draw.cc.
References ViewContext::depsgraph, ViewContext::obact, ViewContext::region, ViewContext::scene, ViewContext::v3d, validate_object_select_id(), and ViewContext::view_layer.
Referenced by ED_mesh_pick_edge(), ED_mesh_pick_face(), ED_mesh_pick_vert(), and paintface_select_loop().
| void ED_view3d_update_viewmat | ( | const Depsgraph * | depsgraph, |
| const Scene * | scene, | ||
| View3D * | v3d, | ||
| ARegion * | region, | ||
| const float | viewmat[4][4], | ||
| const float | winmat[4][4], | ||
| const rcti * | rect, | ||
| bool | offscreen ) |
Definition at line 98 of file view3d_draw.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View3D::camera, copy_m4_m4(), depsgraph, ED_view3d_calc_camera_border(), invert_m4_m4(), len_squared_v3(), max_ii(), min_ff(), mul_m4_m4m4(), RegionView3D::persinv, RegionView3D::persmat, RegionView3D::persp, RegionView3D::pixsize, ARegion::regiondata, RV3D_CAMOB, sqrtf, v2, view3d_viewmatrix_set(), view3d_winmatrix_set(), RegionView3D::viewcamtexcofac, RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, ARegion::winx, ARegion::winy, rctf::xmin, and rctf::ymin.
Referenced by blender::ed::greasepencil::image_render::compute_view_matrices(), ED_view3d_navigation_do(), view3d_main_region_setup_offscreen(), view3d_main_region_setup_view(), and view3d_smooth_view_force_finish_ex().
|
static |
Definition at line 1328 of file view3d_draw.cc.
References Object::data, OB_GREASE_PENCIL, and Object::type.
Referenced by draw_selected_name().
|
static |
Definition at line 2300 of file view3d_draw.cc.
References BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT, Object::base_flag, BKE_paint_select_face_test(), BKE_view_layer_base_find(), BKE_view_layer_synced_ensure(), BLI_assert, DEG_get_evaluated(), depsgraph, DRW_select_buffer_context_create(), View3D_Runtime::flag, Object::mode, OB_MODE_PARTICLE_EDIT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_WIRE, ARegion::regiontype, RGN_TYPE_WINDOW, View3D::runtime, View3D::shading, View3DShading::type, UNUSED_VARS_NDEBUG, V3D_RUNTIME_DEPTHBUF_OVERRIDDEN, and XRAY_ENABLED.
Referenced by ED_view3d_select_id_validate().
|
static |
Definition at line 381 of file view3d_draw.cc.
References BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_from_view3d(), BKE_camera_params_init(), BLI_rctf_size_x(), BLI_rctf_size_y(), View3D::camera, View3D::clip_end, View3D::clip_start, DEG_get_evaluated(), depsgraph, params, Scene::r, ARegion::winx, ARegion::winy, RenderData::xasp, rctf::xmax, rctf::xmin, RenderData::xsch, RenderData::yasp, rctf::ymax, rctf::ymin, and RenderData::ysch.
Referenced by ED_view3d_calc_camera_border(), and ED_view3d_calc_camera_border_size().
|
static |
Definition at line 2276 of file view3d_draw.cc.
References plane_point_side_v3().
Referenced by ED_view3d_clipping_test().
| float view3d_depth_near | ( | ViewDepths * | d | ) |
Utility function to find the closest Z value, use for auto-depth.
Definition at line 2452 of file view3d_draw.cc.
References ViewDepths::depth_range, ViewDepths::depths, FLT_MAX, ViewDepths::h, i, and ViewDepths::w.
Referenced by view3d_zoom_border_exec(), and view_autodist_depth_margin().
|
static |
Definition at line 2428 of file view3d_draw.cc.
References ViewDepths::depth_range, ViewDepths::depths, GPU_DATA_UINT_24_8, GPU_texture_height(), GPU_texture_read(), GPU_texture_width(), GPU_viewport_depth_texture(), ViewDepths::h, i, MEM_callocN(), ViewDepths::w, and WM_draw_region_get_viewport().
Referenced by ED_view3d_depth_override().
| void view3d_depths_rect_create | ( | ARegion * | region, |
| rcti * | rect, | ||
| ViewDepths * | r_d ) |
Definition at line 2387 of file view3d_draw.cc.
References BLI_rcti_isect(), BLI_rcti_size_x(), BLI_rcti_size_y(), ViewDepths::depth_range, ViewDepths::depths, ViewDepths::h, MEM_malloc_arrayN(), view3d_gpu_read_Z_pixels(), ViewDepths::w, w(), ARegion::winx, ARegion::winy, WM_draw_region_get_viewport(), ViewDepths::x, x, rcti::xmax, rcti::xmin, ViewDepths::y, y, rcti::ymax, and rcti::ymin.
Referenced by view3d_zoom_border_exec(), and view_autodist_depth_margin().
Render and camera border
Definition at line 1167 of file view3d_draw.cc.
References C, CTX_data_expect_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_view3d(), depsgraph, drawrenderborder(), drawviewborder(), View3D::flag2, RegionView3D::persp, ARegion::regiondata, RV3D_CAMOB, and V3D_RENDER_BORDER.
Referenced by view3d_draw_region_info().
|
static |
Information drawn on top of the solid plates and composed data.
Definition at line 1507 of file view3d_draw.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), BLF_batch_draw_begin(), BLF_batch_draw_end(), BLF_color4fv(), BLF_default(), BLF_default_size(), BLF_disable(), BLF_enable(), BLF_set_default(), BLF_SHADOW, BLF_shadow(), BLF_shadow_offset(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_manager(), CTX_wm_view3d(), draw_grid_unit_name(), draw_selected_name(), draw_view_axis(), draw_viewport_name(), DRW_draw_region_engine_info(), ED_info_draw_stats(), ED_region_pixelspace(), ED_region_visible_rect(), ED_scene_draw_fps(), ED_screen_animation_no_scrub(), ED_view3d_text_colors_get(), View3DOverlay::flag, View3D::flag2, View3D::gizmo_flag, View3D::gridflag, View3D::localvd, RegionView3D::ndof_flag, NDOF_IS_ORBIT_AROUND_CENTER_MODE, NDOF_ORBIT_CENTER_AUTO, RegionView3D::ndof_rot_angle, NDOF_SHOW_GUIDE_ORBIT_AXIS, NDOF_SHOW_GUIDE_ORBIT_CENTER, View3D::ob_center, View3D::ob_center_cursor, Outline, View3D::overlay, uiFontStyle::points, ARegion::regiondata, RV3D_LOCK_FLAGS, RV3D_LOCK_ROTATION, RV3D_NDOF_OFS_IS_VALID, U, UI_DEFAULT_TEXT_POINTS, UI_fontstyle_set(), UI_FSTYLE_WIDGET, USER_DRAWVIEWINFO, USER_MINI_AXIS_TYPE_GIZMO, USER_MINI_AXIS_TYPE_MINIMAL, USER_MINI_AXIS_TYPE_NONE, USER_SHOW_FPS, USER_SHOW_VIEWPORTNAME, V3D_GIZMO_HIDE, V3D_GIZMO_HIDE_NAVIGATE, V3D_HIDE_OVERLAYS, V3D_OVERLAY_HIDE_TEXT, V3D_OVERLAY_STATS, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, V3D_SHOW_Z, view3d_draw_border(), view3d_draw_grease_pencil(), VIEW3D_OVERLAY_LINEHEIGHT, rcti::xmin, and rcti::ymax.
Referenced by DRW_draw_region_info().
Definition at line 1632 of file view3d_draw.cc.
References C, CTX_data_expect_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_view3d(), CTX_wm_window(), DRW_draw_view(), and ED_view3d_draw_setup_view().
Referenced by view3d_main_region_draw().
|
static |
Viewport Name
Definition at line 1199 of file view3d_draw.cc.
References BLI_assert, CAM_CUSTOM, CAM_ORTHO, CAM_PANO, CAM_PERSP, View3D::camera, Object::data, IFACE_, OB_CAMERA, RegionView3D::persp, RV3D_CAMOB, RV3D_ORTHO, RV3D_VIEW_BACK, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, Camera::type, Object::type, and RegionView3D::view.
Referenced by draw_viewport_name().
|
static |
Definition at line 2346 of file view3d_draw.cc.
References BLI_rcti_size_x(), BLI_rcti_size_y(), data, GPU_ATTACHMENT_NONE, GPU_ATTACHMENT_TEXTURE, GPU_DATA_FLOAT, GPU_framebuffer_bind(), GPU_framebuffer_ensure_config, GPU_framebuffer_free(), GPU_framebuffer_read_depth(), GPU_framebuffer_restore(), GPU_viewport_depth_texture(), rcti::xmin, and rcti::ymin.
Referenced by view3d_depths_rect_create().
|
static |
Definition at line 862 of file view3d_draw.cc.
References B_UNIT_LENGTH, BKE_unit_base_get(), BKE_unit_scalar_get(), BKE_unit_system_get(), BLI_assert, View3D::grid, View3D::gridsubdiv, i, len, powf, RV3D_VIEW_USER, UnitSettings::scale_length, STEPS_LEN, UnitSettings::system, Scene::unit, and RegionView3D::view.
Referenced by ED_view3d_grid_steps(), and ED_view3d_grid_view_scale().
|
static |
Definition at line 2780 of file view3d_draw.cc.
References RenderData::engine, Scene::r, RE_engines_find(), RenderEngineType::view_draw, and RenderEngineType::view_update.
Referenced by ED_view3d_calc_render_border().
Definition at line 1673 of file view3d_draw.cc.
References BKE_image_free_old_gputextures(), C, CTX_data_main(), CTX_wm_view3d(), DRW_cache_free_old_batches(), blender::draw::DRW_cache_free_old_subdiv(), View3D_Runtime::flag, GPU_DEPTH_NONE, GPU_depth_test(), View3D::runtime, V3D_RUNTIME_DEPTHBUF_OVERRIDDEN, view3d_draw_view(), and view3d_update_viewer_path().
Referenced by ED_spacetype_view3d().
|
static |
Definition at line 197 of file view3d_draw.cc.
References depsgraph, ED_view3d_update_viewmat(), GPU_matrix_projection_set, GPU_matrix_set, ARegion::regiondata, RegionView3D::viewmat, and RegionView3D::winmat.
Referenced by ED_view3d_draw_offscreen(), and view3d_stereo3d_setup_offscreen().
|
static |
Definition at line 180 of file view3d_draw.cc.
References depsgraph, ED_view3d_update_viewmat(), GPU_matrix_projection_set, GPU_matrix_set, ARegion::regiondata, RegionView3D::viewmat, and RegionView3D::winmat.
Referenced by ED_view3d_draw_setup_view(), and view3d_stereo3d_setup().
|
static |
Definition at line 212 of file view3d_draw.cc.
References BKE_scene_multiview_is_stereo3d(), View3D::camera, OB_CAMERA, RegionView3D::persp, Scene::r, R_MULTIVIEW, RV3D_CAMOB, SCE_VIEWS_FORMAT_MULTIVIEW, RenderData::scemode, View3D::stereo3d_camera, STEREO_3D_ID, STEREO_LEFT_ID, STEREO_MONO_ID, STEREO_RIGHT_ID, Object::type, RenderData::views_format, and WM_stereo3d_enabled().
Referenced by ED_view3d_draw_setup_view().
|
static |
Definition at line 257 of file view3d_draw.cc.
References BKE_camera_multiview_render(), BKE_camera_multiview_shift_x(), BKE_camera_multiview_view_matrix(), BLI_thread_lock(), BLI_thread_unlock(), View3D::camera, data, Object::data, DEG_get_evaluated(), depsgraph, is_left(), LOCK_VIEW3D, View3D::multiview_eye, Scene::r, SCE_VIEWS_FORMAT_STEREO_3D, Camera::shiftx, View3D::stereo3d_camera, STEREO_3D_ID, STEREO_LEFT_ID, STEREO_LEFT_NAME, STEREO_RIGHT_ID, STEREO_RIGHT_NAME, view3d_main_region_setup_view(), and RenderData::views_format.
Referenced by ED_view3d_draw_setup_view().
|
static |
Definition at line 1699 of file view3d_draw.cc.
References BKE_camera_multiview_render(), BKE_camera_multiview_view_matrix(), View3D::camera, depsgraph, is_left(), Scene::r, SCE_VIEWS_FORMAT_STEREO_3D, STEREO_LEFT_NAME, STREQ, view3d_main_region_setup_offscreen(), and RenderData::views_format.
Referenced by ED_view3d_draw_offscreen().
|
static |
Definition at line 1662 of file view3d_draw.cc.
References BKE_viewer_path_clear(), BKE_viewer_path_copy(), BKE_viewer_path_equal(), C, CTX_wm_view3d(), CTX_wm_workspace(), View3D::viewer_path, and WorkSpace::viewer_path.
Referenced by view3d_main_region_draw().