Blender V2.61 - r43446
|
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "DNA_armature_types.h"
#include "DNA_camera_types.h"
#include "DNA_customdata_types.h"
#include "DNA_object_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BKE_anim.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
#include "BKE_movieclip.h"
#include "RE_engine.h"
#include "RE_pipeline.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "BLF_api.h"
#include "ED_armature.h"
#include "ED_keyframing.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_screen_types.h"
#include "ED_transform.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "GPU_draw.h"
#include "GPU_material.h"
#include "GPU_extensions.h"
#include "view3d_intern.h"
Go to the source code of this file.
Classes | |
struct | View3DAfter |
struct | View3DShadow |
Defines | |
#define | GRID_MIN_PX 6.0f |
#define | ROT_AXIS_DETAIL 13 |
Typedefs | |
typedef struct View3DAfter | View3DAfter |
typedef struct View3DShadow | View3DShadow |
Functions | |
static void | star_stuff_init_func (void) |
static void | star_stuff_vertex_func (float *i) |
static void | star_stuff_term_func (void) |
void | circf (float x, float y, float rad) |
void | circ (float x, float y, float rad) |
static void | view3d_draw_clipping (RegionView3D *rv3d) |
void | view3d_set_clipping (RegionView3D *rv3d) |
void | view3d_clr_clipping (void) |
static int | test_clipping (const float vec[3], float clip[][4]) |
int | ED_view3d_test_clipping (RegionView3D *rv3d, const float vec[3], const int local) |
static void | drawgrid_draw (ARegion *ar, float wx, float wy, float x, float y, float dx) |
static void | drawgrid (UnitSettings *unit, ARegion *ar, View3D *v3d, const char **grid_unit) |
static void | drawfloor (Scene *scene, View3D *v3d, const char **grid_unit) |
static void | drawcursor (Scene *scene, ARegion *ar, View3D *v3d) |
static void | draw_view_axis (RegionView3D *rv3d) |
static void | draw_rotation_guide (RegionView3D *rv3d) |
static void | draw_view_icon (RegionView3D *rv3d) |
static const char * | view3d_get_name (View3D *v3d, RegionView3D *rv3d) |
static void | draw_viewport_name (ARegion *ar, View3D *v3d) |
static void | draw_selected_name (Scene *scene, Object *ob) |
static void | view3d_camera_border (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift, short no_zoom) |
void | ED_view3d_calc_camera_border_size (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, float size_r[2]) |
void | ED_view3d_calc_camera_border (Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, rctf *viewborder_r, short no_shift) |
static void | drawviewborder_grid3 (float x1, float x2, float y1, float y2, float fac) |
static void | drawviewborder_triangle (float x1, float x2, float y1, float y2, const char golden, const char dir) |
static void | drawviewborder (Scene *scene, ARegion *ar, View3D *v3d) |
static void | backdrawview3d (Scene *scene, ARegion *ar, View3D *v3d) |
void | view3d_validate_backbuf (ViewContext *vc) |
unsigned int | view3d_sample_backbuf (ViewContext *vc, int x, int y) |
ImBuf * | view3d_read_backbuf (ViewContext *vc, short xmin, short ymin, short xmax, short ymax) |
unsigned int | view3d_sample_backbuf_rect (ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, void *handle, unsigned int(*indextest)(void *handle, unsigned int index)) |
static void | draw_bgpic (Scene *scene, ARegion *ar, View3D *v3d) |
void | add_view3d_after (ListBase *lb, Base *base, int flag) |
static void | view3d_draw_transp (Scene *scene, ARegion *ar, View3D *v3d) |
static void | view3d_draw_xray (Scene *scene, ARegion *ar, View3D *v3d, int clear) |
static void | view3d_draw_xraytransp (Scene *scene, ARegion *ar, View3D *v3d, int clear) |
static DupliObject * | dupli_step (DupliObject *dob) |
static void | draw_dupli_objects_color (Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) |
static void | draw_dupli_objects (Scene *scene, ARegion *ar, View3D *v3d, Base *base) |
void | view3d_update_depths_rect (ARegion *ar, ViewDepths *d, rcti *rect) |
void | ED_view3d_depth_update (ARegion *ar) |
float | view3d_depth_near (ViewDepths *d) |
void | draw_depth_gpencil (Scene *scene, ARegion *ar, View3D *v3d) |
void | draw_depth (Scene *scene, ARegion *ar, View3D *v3d, int(*func)(void *)) |
static void | gpu_render_lamp_update (Scene *scene, View3D *v3d, Object *ob, Object *par, float obmat[][4], ListBase *shadows) |
static void | gpu_update_lamps_shadows (Scene *scene, View3D *v3d) |
CustomDataMask | ED_view3d_datamask (Scene *scene, View3D *v3d) |
CustomDataMask | ED_view3d_object_datamask (Scene *scene) |
CustomDataMask | ED_view3d_screen_datamask (bScreen *screen) |
static void | view3d_main_area_setup_view (Scene *scene, View3D *v3d, ARegion *ar, float viewmat[][4], float winmat[][4]) |
void | ED_view3d_draw_offscreen (Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, float viewmat[][4], float winmat[][4]) |
ImBuf * | ED_view3d_draw_offscreen_imbuf (Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256]) |
ImBuf * | ED_view3d_draw_offscreen_imbuf_simple (Scene *scene, Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256]) |
static void | draw_viewport_fps (Scene *scene, ARegion *ar) |
static int | view3d_main_area_draw_engine (const bContext *C, ARegion *ar) |
static void | view3d_main_area_draw_engine_info (RegionView3D *rv3d, ARegion *ar) |
static void | view3d_main_area_draw_objects (const bContext *C, ARegion *ar, const char **grid_unit) |
static void | view3d_main_area_draw_info (const bContext *C, ARegion *ar, const char *grid_unit) |
void | view3d_main_area_draw (const bContext *C, ARegion *ar) |
Definition in file view3d_draw.c.
#define GRID_MIN_PX 6.0f |
Definition at line 255 of file view3d_draw.c.
Referenced by drawgrid().
#define ROT_AXIS_DETAIL 13 |
Referenced by draw_rotation_guide().
typedef struct View3DAfter View3DAfter |
typedef struct View3DShadow View3DShadow |
Definition at line 1664 of file view3d_draw.c.
References View3DAfter::base, BLI_addtail(), Base::flag, View3DAfter::flag, and MEM_callocN().
Referenced by draw_mesh_object(), draw_object(), and drawlamp().
Definition at line 1253 of file view3d_draw.c.
References Scene::basact, BLI_assert, draw_object_backbufsel(), View3D::drawtype, FALSE, View3D::flag, ImagePaintSettings::flag, G, G_BACKBUFSEL, IMAGEPAINT_PROJECT_DISABLE, ToolSettings::imapaint, View3D::lay, Base::lay, Object::mode, OB_MODE_PARTICLE_EDIT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_WIRE, Scene::obedit, Base::object, paint_facesel_test(), region_scissor_winrct(), ARegion::regiondata, ARegion::regiontype, RegionView3D::rflag, RGN_TYPE_WINDOW, RV3D_CLIPPING, ARegion::swap, Scene::toolsettings, TRUE, V3D_INVALID_BACKBUF, V3D_ZBUF_SELECT, view3d_clr_clipping(), view3d_set_clipping(), rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and View3D::zbuf.
Referenced by view3d_validate_backbuf().
void circ | ( | float | x, |
float | y, | ||
float | rad | ||
) |
Definition at line 131 of file view3d_draw.c.
Referenced by drawcursor(), and drawlamp().
void circf | ( | float | x, |
float | y, | ||
float | rad | ||
) |
Definition at line 114 of file view3d_draw.c.
Definition at line 1492 of file view3d_draw.c.
References View3D::bgpicbase, BKE_image_get_ibuf(), BKE_image_user_calc_frame(), BKE_movieclip_get_ibuf(), BKE_movieclip_user_set_frame(), BGpic::blend, Scene::camera, CFRA, ImBuf::channels, BGpic::clip, BGpic::cuser, ED_region_pixelspace(), ED_view3d_calc_camera_border(), ED_view3d_project_float(), ED_view3d_win_to_delta(), fabs(), FALSE, ListBase::first, BGpic::flag, glaDrawPixelsTex(), IB_MIPMAP_INVALID, BGpic::ima, IMB_freeImBuf(), IMB_makemipmap(), IMB_rect_from_float(), IMB_remakemipmap(), initgrabz(), BGpic::iuser, MAX3(), MIN2, ImBuf::mipmap, BGpic::next, NULL, object_get_movieclip(), RegionView3D::persmat, RegionView3D::persp, ImBuf::rect, ImBuf::rect_float, ARegion::regiondata, RV3D_CAMOB, RV3D_VIEW_CAMERA, BGpic::size, BGpic::source, ImBuf::userflags, V3D_BGPIC_CAMERACLIP, V3D_BGPIC_DISABLED, V3D_BGPIC_IMAGE, RegionView3D::view, BGpic::view, ARegion::winx, ARegion::winy, ImBuf::x, rctf::xmax, rctf::xmin, BGpic::xof, ImBuf::y, rctf::ymax, rctf::ymin, BGpic::yof, and View3D::zbuf.
Referenced by view3d_main_area_draw_objects().
Definition at line 2010 of file view3d_draw.c.
References View3D::afterdraw_transp, View3D::afterdraw_xray, View3D::afterdraw_xraytransp, View3DAfter::base, Scene::base, BLI_remlink(), draw_dupli_objects(), draw_dupli_objects_color(), draw_object(), FALSE, ListBase::first, View3D::flag, Base::flag, UserDef::glalphaclip, glLoadMatrixf, invert_m4_m4(), Base::lay, View3D::lay, MEM_freeN(), mult_m4_m4m4(), View3DAfter::next, next, Base::next, NULL, OB_DUPLI, UserDef::obcenter_dia, Base::object, RegionView3D::persinv, RegionView3D::persmat, ARegion::regiondata, RegionView3D::rflag, RV3D_CLIPPING, Scene::set, SETLOOPER, setviewmatrixview3d(), setwinmatrixview3d(), TH_WIRE, Object::transflag, View3D::transp, TRUE, U, V3D_SELECT_OUTLINE, view3d_clr_clipping(), view3d_set_clipping(), RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, View3D::xray, and View3D::zbuf.
Referenced by ED_view3d_autodist(), ED_view3d_autodist_init(), and view3d_zoom_border_exec().
Definition at line 1985 of file view3d_draw.c.
References draw_gpencil_view3d(), glLoadMatrixf, invert_m4_m4(), mult_m4_m4m4(), NULL, RegionView3D::persinv, RegionView3D::persmat, ARegion::regiondata, setviewmatrixview3d(), setwinmatrixview3d(), TRUE, RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, and View3D::zbuf.
Referenced by ED_view3d_autodist_init().
Definition at line 1863 of file view3d_draw.c.
References MakeCursor::color, draw_dupli_objects_color(), Object::dup_group, Base::flag, Group::id, Base::object, SELECT, TH_REDALERT, TH_SELECT, TH_WIRE, and ID::us.
Referenced by draw_depth(), ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
static void draw_dupli_objects_color | ( | Scene * | scene, |
ARegion * | ar, | ||
View3D * | v3d, | ||
Base * | base, | ||
int | color | ||
) | [static] |
Definition at line 1762 of file view3d_draw.c.
References copy_m4_m4(), DRAW_CONSTCOLOR, draw_object(), Object::dt, Object::dtx, dupli_step(), ED_view3d_boundbox_clip(), ListBase::first, Base::flag, free_object_duplilist(), glLoadMatrixf, glMultMatrixf, MIN2, NULL, DupliObject::ob, OB_BB_DISABLED, OB_DUPLIGROUP, OB_FROMDUPLI, OB_LAMP, OB_NEG_SCALE, OB_RESTRICT_VIEW, Base::object, object_boundbox_flag(), object_duplilist(), object_get_boundbox(), ARegion::regiondata, Object::restrictflag, TH_BACK, Object::transflag, UI_ThemeColorBlend(), unit_m4(), and RegionView3D::viewmat.
Referenced by draw_depth(), draw_dupli_objects(), ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
static void draw_rotation_guide | ( | RegionView3D * | rv3d | ) | [static] |
Definition at line 646 of file view3d_draw.c.
References acosf, add_v3_v3(), add_v3_v3v3(), angle(), axis_angle_to_quat(), MakeCursor::color, cosf, cross_v3_v3v3(), RegionView3D::dist, dot_v3v3(), fabsf, i, M_PI, mul_qt_v3(), mul_v3_v3fl(), negate_v3_v3(), RegionView3D::ofs, p, RegionView3D::rot_angle, RegionView3D::rot_axis, ROT_AXIS_DETAIL, sinf, step(), and sub_v3_v3v3().
Referenced by view3d_main_area_draw_objects().
Definition at line 835 of file view3d_draw.c.
References bArmature::act_bone, bArmature::act_edbone, ANIMFILTER_KEYS_LOCAL, BLF_draw_default(), BLI_findlink(), BLI_snprintf(), Key::block, CFRA, Object::data, bArmature::edbo, ELEM3, Object::id, id_frame_has_keyframe(), bArmature::layer, Bone::layer, MAX_NAME, Object::mode, KeyBlock::name, ID::name, Bone::name, NULL, OB_ARMATURE, OB_CURVE, ob_get_key(), OB_LATTICE, OB_MESH, OB_MODE_POSE, OB_SHAPE_LOCK, UserDef::rvisize, scene_find_marker_name(), Object::shapeflag, Object::shapenr, TH_TEXT_HI, TH_VERTEX_SELECT, Object::type, U, UI_ThemeColor(), UserDef::uiflag, and USER_SHOW_ROTVIEWICON.
Referenced by view3d_main_area_draw_info().
static void draw_view_axis | ( | RegionView3D * | rv3d | ) | [static] |
Definition at line 566 of file view3d_draw.c.
References BLF_draw_default_ascii(), fabsf, mul_qt_v3(), UserDef::rvibright, UserDef::rvisize, U, and RegionView3D::viewquat.
Referenced by view3d_main_area_draw_info().
static void draw_view_icon | ( | RegionView3D * | rv3d | ) | [static] |
Definition at line 747 of file view3d_draw.c.
References ELEM, RV3D_VIEW_BACK, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, UI_icon_draw(), and RegionView3D::view.
Referenced by view3d_main_area_draw_info().
Definition at line 2581 of file view3d_draw.c.
References BLF_draw_default_ascii(), BLI_snprintf(), FPS, Scene::fps_info, i, ScreenFrameRateInfo::lredrawtime, REDRAW_FRAME_AVERAGE, ScreenFrameRateInfo::redrawtime, ScreenFrameRateInfo::redrawtime_index, ScreenFrameRateInfo::redrawtimes_fps, TH_REDALERT, TH_TEXT_HI, UI_ThemeColor(), and ARegion::winy.
Referenced by view3d_main_area_draw_info().
Definition at line 815 of file view3d_draw.c.
References BLF_draw_default_ascii(), BLI_snprintf(), View3D::localvd, ARegion::regiondata, TH_TEXT_HI, UI_ThemeColor(), view3d_get_name(), and ARegion::winy.
Referenced by view3d_main_area_draw_info().
Definition at line 533 of file view3d_draw.c.
References circ(), co, cpack, View3D::flag, give_cursor(), IS_CLIPPED, project_int(), sdrawline(), and setlinestyle().
Referenced by view3d_main_area_draw_info().
Definition at line 430 of file view3d_draw.c.
References B_UNIT_LENGTH, bUnit_GetBaseUnit(), bUnit_GetNameDisplay(), bUnit_GetScaler(), bUnit_GetSystem(), GPU_print_error(), View3D::grid, View3D::gridflag, View3D::gridlines, i, len(), Scene::obedit, UnitSettings::scale_length, UnitSettings::system, TH_BACK, TH_GRID, UI_GetColorPtrShade3ubv(), UI_GetThemeColor3ubv(), UI_make_axis_color(), Scene::unit, V3D_SHOW_FLOOR, V3D_SHOW_X, V3D_SHOW_Y, V3D_SHOW_Z, View3D::zbuf, and zero_v3().
Referenced by view3d_main_area_draw_objects().
static void drawgrid | ( | UnitSettings * | unit, |
ARegion * | ar, | ||
View3D * | v3d, | ||
const char ** | grid_unit | ||
) | [static] |
Definition at line 257 of file view3d_draw.c.
References B_UNIT_LENGTH, bUnit_GetNameDisplay(), bUnit_GetScaler(), bUnit_GetSystem(), CLAMP(), drawgrid_draw(), ELEM, fabs(), fdrawline(), View3D::grid, GRID_MIN_PX, View3D::gridsubdiv, RegionView3D::gridview, i, len(), mul_m4_v4(), NULL, RegionView3D::persmat, ARegion::regiondata, RV3D_VIEW_BOTTOM, RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, UnitSettings::scale_length, setlinestyle(), UnitSettings::system, TH_BACK, TH_GRID, UI_GetThemeColor3ubv(), UI_make_axis_color(), UI_ThemeColor(), UI_ThemeColorBlend(), RegionView3D::view, ARegion::winx, and ARegion::winy.
Referenced by view3d_main_area_draw_objects().
static void drawgrid_draw | ( | ARegion * | ar, |
float | wx, | ||
float | wy, | ||
float | x, | ||
float | y, | ||
float | dx | ||
) | [static] |
Definition at line 220 of file view3d_draw.c.
References floorf, ARegion::winx, and ARegion::winy.
Referenced by drawgrid().
Definition at line 1041 of file view3d_draw.c.
References 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_SHOWNAME, CAM_SHOWPASSEPARTOUT, CAM_SHOWSENSOR, CAM_SHOWTITLESAFE, View3D::camera, camera_sensor_fit(), CAMERA_SENSOR_FIT_AUTO, CAMERA_SENSOR_FIT_HOR, cpack, Object::data, drawviewborder_grid3(), drawviewborder_triangle(), Camera::dtx, ED_view3d_calc_camera_border(), FALSE, Camera::flag, Object::id, RenderData::mode, ID::name, NULL, OB_CAMERA, Camera::passepartalpha, Scene::r, R_BORDER, ARegion::regiondata, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, setlinestyle(), TH_BACK, TH_TEXT_HI, TH_WIRE, TRUE, Object::type, UI_CNR_ALL, UI_ThemeColor(), UI_ThemeColorBlendShade(), UI_ThemeColorShade(), uiDrawBox(), uiSetRoundBox(), 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_main_area_draw_info().
static void drawviewborder_grid3 | ( | float | x1, |
float | x2, | ||
float | y1, | ||
float | y2, | ||
float | fac | ||
) | [static] |
Definition at line 970 of file view3d_draw.c.
Referenced by drawviewborder().
static void drawviewborder_triangle | ( | float | x1, |
float | x2, | ||
float | y1, | ||
float | y2, | ||
const char | golden, | ||
const char | dir | ||
) | [static] |
Definition at line 995 of file view3d_draw.c.
References SWAP, and simple_enum_gen::w.
Referenced by drawviewborder().
static DupliObject* dupli_step | ( | DupliObject * | dob | ) | [static] |
Definition at line 1755 of file view3d_draw.c.
References DupliObject::next, and DupliObject::no_draw.
Referenced by draw_dupli_objects_color().
void ED_view3d_calc_camera_border | ( | Scene * | scene, |
ARegion * | ar, | ||
View3D * | v3d, | ||
RegionView3D * | rv3d, | ||
rctf * | viewborder_r, | ||
short | no_shift | ||
) |
Definition at line 965 of file view3d_draw.c.
References FALSE, and view3d_camera_border().
Referenced by draw_bgpic(), draw_gpencil_view3d(), drawviewborder(), game_engine_exec(), gp_camera_view_subrect(), gp_paint_initstroke(), and render_border_exec().
void ED_view3d_calc_camera_border_size | ( | Scene * | scene, |
ARegion * | ar, | ||
View3D * | v3d, | ||
RegionView3D * | rv3d, | ||
float | size_r[2] | ||
) |
Definition at line 956 of file view3d_draw.c.
References TRUE, view3d_camera_border(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by view3d_center_camera_exec(), and view3d_set_1_to_1_viewborder().
CustomDataMask ED_view3d_datamask | ( | Scene * | scene, |
View3D * | v3d | ||
) |
Definition at line 2235 of file view3d_draw.c.
References CD_MASK_MCOL, CD_MASK_MTFACE, CD_MASK_ORCO, View3D::drawtype, ELEM, View3D::flag2, GAME_MAT_GLSL, Scene::gm, GameData::matmode, OB_MATERIAL, OB_SOLID, OB_TEXTURE, scene_use_new_shading_nodes(), and V3D_SOLID_TEX.
Referenced by ED_view3d_screen_datamask(), and screen_opengl_render_init().
void ED_view3d_depth_update | ( | ARegion * | ar | ) |
Definition at line 1931 of file view3d_draw.c.
References simple_enum_gen::d, ViewDepths::damaged, ViewDepths::depth_range, ViewDepths::depths, RegionView3D::depths, ViewDepths::h, MEM_callocN(), MEM_freeN(), MEM_mallocN(), ARegion::regiondata, ViewDepths::w, ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmin, and rcti::ymin.
Referenced by PE_set_view3d_data().
void ED_view3d_draw_offscreen | ( | Scene * | scene, |
View3D * | v3d, | ||
ARegion * | ar, | ||
int | winx, | ||
int | winy, | ||
float | viewmat[][4], | ||
float | winmat[][4] | ||
) |
Definition at line 2347 of file view3d_draw.c.
References View3D::afterdraw_transp, View3D::afterdraw_xray, View3D::afterdraw_xraytransp, Scene::base, RenderData::color_mgt_flag, copy_v3_v3(), DRAW_CONSTCOLOR, draw_dupli_objects(), draw_dupli_objects_color(), draw_glsl_material(), draw_gpencil_view3d(), draw_object(), DRAW_SCENESET, View3D::drawtype, ED_region_pixelspace(), FALSE, ListBase::first, G, G_RENDER_OGL, GPU_free_images_anim(), gpu_update_lamps_shadows(), World::horr, Base::lay, View3D::lay, linearrgb_to_srgb_v3_v3(), Base::next, NULL, OB_DUPLI, OB_WIRE, Base::object, Scene::r, R_COLOR_MANAGEMENT, ARegion::regiondata, RegionView3D::rflag, RV3D_CLIPPING, Scene::set, SETLOOPER, TH_BACK, TH_WIRE, Object::transflag, TRUE, UI_ThemeClearColor(), UI_ThemeColorBlend(), view3d_clr_clipping(), view3d_draw_clipping(), view3d_draw_transp(), view3d_draw_xray(), view3d_draw_xraytransp(), view3d_main_area_setup_view(), view3d_set_clipping(), ARegion::winrct, ARegion::winx, ARegion::winy, Scene::world, rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and View3D::zbuf.
Referenced by ED_view3d_draw_offscreen_imbuf(), gpu_update_lamps_shadows(), and screen_opengl_render_apply().
ImBuf* ED_view3d_draw_offscreen_imbuf | ( | Scene * | scene, |
View3D * | v3d, | ||
ARegion * | ar, | ||
int | sizex, | ||
int | sizey, | ||
unsigned int | flag, | ||
char | err_out[256] | ||
) | [read] |
Definition at line 2478 of file view3d_draw.c.
References View3D::camera, camera_params_compute_matrix(), camera_params_compute_viewplane(), camera_params_from_object(), camera_params_init(), ED_view3d_draw_offscreen(), GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_free(), GPU_offscreen_read_pixels(), GPU_offscreen_unbind(), IMB_allocImBuf(), IMB_rect_from_float(), NULL, RegionView3D::persp, Scene::r, ImBuf::rect, ImBuf::rect_float, ARegion::regiondata, RV3D_CAMOB, CameraParams::winmat, RenderData::xasp, and RenderData::yasp.
Referenced by ED_view3d_draw_offscreen_imbuf_simple(), and texture_paint_image_from_view_exec().
ImBuf* ED_view3d_draw_offscreen_imbuf_simple | ( | Scene * | scene, |
Object * | camera, | ||
int | width, | ||
int | height, | ||
unsigned int | flag, | ||
int | drawtype, | ||
char | err_out[256] | ||
) | [read] |
Definition at line 2533 of file view3d_draw.c.
References View3D::camera, camera_params_compute_matrix(), camera_params_compute_viewplane(), camera_params_from_object(), camera_params_init(), CameraParams::clipend, CameraParams::clipsta, copy_m4_m4(), View3D::drawtype, ED_view3d_draw_offscreen_imbuf(), View3D::far, ListBase::first, View3D::flag2, invert_m4_m4(), ListBase::last, Scene::lay, View3D::lay, CameraParams::lens, View3D::lens, mult_m4_m4m4(), View3D::near, normalize_m4(), NULL, Object::obmat, RegionView3D::persinv, RegionView3D::persmat, RegionView3D::persp, Scene::r, View3D::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_CAMOB, V3D_RENDER_OVERRIDE, RegionView3D::viewinv, RegionView3D::viewmat, CameraParams::winmat, RegionView3D::winmat, RenderData::xasp, and RenderData::yasp.
Referenced by blend_file_thumb(), ED_spacetype_sequencer(), and screen_opengl_render_apply().
CustomDataMask ED_view3d_object_datamask | ( | Scene * | scene | ) |
Definition at line 2255 of file view3d_draw.c.
References Scene::basact, CD_MASK_MCOL, CD_MASK_MTFACE, CD_MASK_WEIGHT_MCOL, Object::mode, NULL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Base::object, and paint_facesel_test().
Referenced by ED_view3d_screen_datamask(), and screen_opengl_render_init().
CustomDataMask ED_view3d_screen_datamask | ( | bScreen * | screen | ) |
Definition at line 2280 of file view3d_draw.c.
References bScreen::areabase, CD_MASK_BAREMESH, ED_view3d_datamask(), ED_view3d_object_datamask(), ListBase::first, ScrArea::next, bScreen::scene, SPACE_VIEW3D, ScrArea::spacedata, and ScrArea::spacetype.
Referenced by wm_event_do_notifiers().
int ED_view3d_test_clipping | ( | RegionView3D * | rv3d, |
const float | vec[3], | ||
const int | local | ||
) |
Definition at line 212 of file view3d_draw.c.
References RegionView3D::clip, RegionView3D::clip_local, and test_clipping().
Referenced by findnearestedge__doClosest(), project_paint_face_init(), project_paint_occlude_ptv_clip(), project_short(), view3d_project_short_clip(), and view3d_project_short_clip_persmat().
static void gpu_render_lamp_update | ( | Scene * | scene, |
View3D * | v3d, | ||
Object * | ob, | ||
Object * | par, | ||
float | obmat[][4], | ||
ListBase * | shadows | ||
) | [static] |
Definition at line 2145 of file view3d_draw.c.
References Lamp::b, BLI_addtail(), Object::data, Lamp::energy, Lamp::g, GPU_lamp_from_blender(), GPU_lamp_has_shadow_buffer(), GPU_lamp_update(), GPU_lamp_update_colors(), View3DShadow::lamp, View3D::lay, Object::lay, MEM_callocN(), OB_RESTRICT_RENDER, Lamp::r, and Object::restrictflag.
Referenced by gpu_update_lamps_shadows().
Definition at line 2165 of file view3d_draw.c.
References BLI_freelistN(), copy_m4_m4(), View3D::drawtype, ED_view3d_draw_offscreen(), ListBase::first, View3D::flag2, free_object_duplilist(), GPU_lamp_shadow_buffer_bind(), GPU_lamp_shadow_buffer_unbind(), GPU_lamp_shadow_layer(), gpu_render_lamp_update(), invert_m4_m4(), View3DShadow::lamp, ListBase::last, View3D::lay, DupliObject::mat, mult_m4_m4m4(), View3DShadow::next, DupliObject::next, NULL, DupliObject::ob, OB_DUPLI, OB_LAMP, OB_SOLID, Base::object, object_duplilist(), Object::obmat, RegionView3D::persinv, RegionView3D::persmat, RegionView3D::persp, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_CAMOB, SETLOOPER, Object::transflag, Object::type, V3D_RENDER_OVERRIDE, V3D_RENDER_SHADOW, V3D_SOLID_TEX, RegionView3D::viewinv, RegionView3D::viewmat, and RegionView3D::winmat.
Referenced by ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
static void star_stuff_init_func | ( | void | ) | [static] |
Definition at line 99 of file view3d_draw.c.
References cpack.
Referenced by view3d_main_area_draw_objects().
static void star_stuff_term_func | ( | void | ) | [static] |
Definition at line 109 of file view3d_draw.c.
Referenced by view3d_main_area_draw_objects().
static void star_stuff_vertex_func | ( | float * | i | ) | [static] |
Definition at line 105 of file view3d_draw.c.
Referenced by view3d_main_area_draw_objects().
static int test_clipping | ( | const float | vec[3], |
float | clip[][4] | ||
) | [static] |
Definition at line 196 of file view3d_draw.c.
References copy_v3_v3(), and dot_v3v3().
Referenced by ED_view3d_test_clipping().
static void view3d_camera_border | ( | Scene * | scene, |
ARegion * | ar, | ||
View3D * | v3d, | ||
RegionView3D * | rv3d, | ||
rctf * | viewborder_r, | ||
short | no_shift, | ||
short | no_zoom | ||
) | [static] |
Definition at line 926 of file view3d_draw.c.
References View3D::camera, camera_params_compute_viewplane(), camera_params_from_object(), camera_params_from_view3d(), camera_params_init(), Scene::r, CameraParams::shiftx, CameraParams::shifty, CameraParams::viewplane, ARegion::winx, ARegion::winy, RenderData::xasp, rctf::xmax, rctf::xmin, RenderData::xsch, RenderData::yasp, rctf::ymax, rctf::ymin, RenderData::ysch, and CameraParams::zoom.
Referenced by ED_view3d_calc_camera_border(), and ED_view3d_calc_camera_border_size().
void view3d_clr_clipping | ( | void | ) |
Definition at line 187 of file view3d_draw.c.
Referenced by backdrawview3d(), draw_depth(), ED_view3d_draw_offscreen(), view3d_main_area_draw_objects(), and view3d_opengl_select().
float view3d_depth_near | ( | ViewDepths * | d | ) |
Definition at line 1962 of file view3d_draw.c.
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 void view3d_draw_clipping | ( | RegionView3D * | rv3d | ) | [static] |
Definition at line 151 of file view3d_draw.c.
References RegionView3D::clipbb, TH_BACK, UI_ThemeColorShade(), and BoundBox::vec.
Referenced by ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
Definition at line 1673 of file view3d_draw.c.
References View3D::afterdraw_transp, View3DAfter::base, BLI_remlink(), draw_object(), FALSE, ListBase::first, View3DAfter::flag, MEM_freeN(), View3DAfter::next, next, View3D::transp, and TRUE.
Referenced by ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
Definition at line 1693 of file view3d_draw.c.
References View3D::afterdraw_xray, View3DAfter::base, BLI_remlink(), draw_object(), FALSE, ListBase::first, View3DAfter::flag, MEM_freeN(), View3DAfter::next, next, TRUE, View3D::xray, and View3D::zbuf.
Referenced by ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
static void view3d_draw_xraytransp | ( | Scene * | scene, |
ARegion * | ar, | ||
View3D * | v3d, | ||
int | clear | ||
) | [static] |
Definition at line 1712 of file view3d_draw.c.
References View3D::afterdraw_xraytransp, View3DAfter::base, BLI_remlink(), draw_object(), FALSE, ListBase::first, View3DAfter::flag, MEM_freeN(), View3DAfter::next, next, View3D::transp, TRUE, View3D::xray, and View3D::zbuf.
Referenced by ED_view3d_draw_offscreen(), and view3d_main_area_draw_objects().
static const char* view3d_get_name | ( | View3D * | v3d, |
RegionView3D * | rv3d | ||
) | [static] |
Definition at line 767 of file view3d_draw.c.
References CAM_ORTHO, View3D::camera, Object::data, NULL, 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().
Definition at line 2905 of file view3d_draw.c.
References CTX_wm_view3d(), View3D::drawtype, ED_region_pixelspace(), View3D::flag, NULL, OB_RENDER, V3D_INVALID_BACKBUF, view3d_main_area_draw_engine(), view3d_main_area_draw_info(), and view3d_main_area_draw_objects().
Referenced by ED_spacetype_view3d().
Definition at line 2629 of file view3d_draw.c.
References CTX_data_scene(), CTX_wm_region_view3d(), CTX_wm_view3d(), ED_region_pixelspace(), RenderData::engine, NULL, Scene::r, RE_engine_create(), RE_engines_find(), RegionView3D::render_engine, RenderEngine::type, view3d_main_area_setup_view(), RenderEngineType::view_draw, and RenderEngineType::view_update.
Referenced by view3d_main_area_draw().
static void view3d_main_area_draw_engine_info | ( | RegionView3D * | rv3d, |
ARegion * | ar | ||
) | [static] |
Definition at line 2659 of file view3d_draw.c.
References ED_region_info_draw(), RegionView3D::render_engine, and RenderEngine::text.
Referenced by view3d_main_area_draw_info().
static void view3d_main_area_draw_info | ( | const bContext * | C, |
ARegion * | ar, | ||
const char * | grid_unit | ||
) | [static] |
Definition at line 2852 of file view3d_draw.c.
References bScreen::animtimer, BLF_draw_default_ascii(), BLI_snprintf(), CTX_data_scene(), CTX_wm_region_view3d(), CTX_wm_screen(), CTX_wm_view3d(), draw_gpencil_view3d(), draw_selected_name(), draw_view_axis(), draw_view_icon(), draw_viewport_fps(), draw_viewport_name(), drawcursor(), drawviewborder(), View3D::flag2, View3D::grid, OBACT, RegionView3D::persp, RegionView3D::render_engine, RV3D_CAMOB, TH_TEXT_HI, U, UI_ThemeColor(), UserDef::uiflag, USER_DRAWVIEWINFO, USER_SHOW_FPS, USER_SHOW_ROTVIEWICON, USER_SHOW_VIEWPORTNAME, V3D_RENDER_OVERRIDE, view3d_main_area_draw_engine_info(), and ARegion::winy.
Referenced by view3d_main_area_draw().
static void view3d_main_area_draw_objects | ( | const bContext * | C, |
ARegion * | ar, | ||
const char ** | grid_unit | ||
) | [static] |
Definition at line 2668 of file view3d_draw.c.
References View3D::afterdraw_transp, View3D::afterdraw_xray, View3D::afterdraw_xraytransp, Scene::base, BDR_drawSketch(), BIF_draw_manipulator(), BKE_area_find_region_type(), RenderData::color_mgt_flag, copy_v3_v3(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region_view3d(), CTX_wm_view3d(), draw_bgpic(), DRAW_CONSTCOLOR, draw_dupli_objects(), draw_dupli_objects_color(), draw_glsl_material(), draw_gpencil_view3d(), draw_object(), draw_rotation_guide(), DRAW_SCENESET, drawfloor(), drawgrid(), View3D::drawtype, ED_region_draw_cb_draw(), ED_region_pixelspace(), ED_region_tag_redraw(), FALSE, ListBase::first, Base::flag, View3D::flag, View3D::flag2, glLoadMatrixf, GPU_default_lights(), gpu_update_lamps_shadows(), View3D::grid, RegionView3D::gridview, World::horr, Base::lay, View3D::lay, View3D::lay_used, linearrgb_to_srgb_v3_v3(), World::mode, UserDef::ndof_flag, NDOF_SHOW_GUIDE, Base::next, NULL, OB_DUPLI, OB_WIRE, Scene::obedit, Base::object, RegionView3D::persp, Scene::r, R_COLOR_MANAGEMENT, RE_make_stars(), REGION_DRAW_POST_VIEW, REGION_DRAW_PRE_VIEW, RegionView3D::rflag, RGN_TYPE_HEADER, RV3D_CAMOB, RV3D_CLIPPING, RV3D_GPULIGHT_UPDATE, RV3D_LOCKED, RV3D_ORTHO, RV3D_VIEW_USER, SELECT, Scene::set, SETLOOPER, star_stuff_init_func(), star_stuff_term_func(), star_stuff_vertex_func(), TH_BACK, TH_WIRE, Object::transflag, TRUE, U, UI_ThemeClearColor(), UI_ThemeColorBlend(), Scene::unit, V3D_DISPBGPICS, V3D_RENDER_OVERRIDE, RegionView3D::view, view3d_clr_clipping(), view3d_draw_clipping(), view3d_draw_transp(), view3d_draw_xray(), view3d_draw_xraytransp(), view3d_main_area_setup_view(), view3d_set_clipping(), RegionView3D::viewlock, RegionView3D::viewmat, RegionView3D::winmat, WO_STARS, Scene::world, and View3D::zbuf.
Referenced by view3d_main_area_draw().
static void view3d_main_area_setup_view | ( | Scene * | scene, |
View3D * | v3d, | ||
ARegion * | ar, | ||
float | viewmat[][4], | ||
float | winmat[][4] | ||
) | [static] |
Definition at line 2298 of file view3d_draw.c.
References copy_m4_m4(), glLoadMatrixf, invert_m4_m4(), len_v3(), MAX2, mult_m4_m4m4(), NULL, RegionView3D::persinv, RegionView3D::persmat, RegionView3D::pixsize, ARegion::regiondata, setviewmatrixview3d(), setwinmatrixview3d(), RegionView3D::viewinv, RegionView3D::viewmat, RegionView3D::winmat, ARegion::winx, and ARegion::winy.
Referenced by ED_view3d_draw_offscreen(), view3d_main_area_draw_engine(), and view3d_main_area_draw_objects().
ImBuf* view3d_read_backbuf | ( | ViewContext * | vc, |
short | xmin, | ||
short | ymin, | ||
short | xmax, | ||
short | ymax | ||
) | [read] |
Definition at line 1369 of file view3d_draw.c.
References ViewContext::ar, B_ENDIAN, ENDIAN_ORDER, IB_rect, IMB_allocImBuf(), IMB_convert_rgba_to_abgr(), IMB_freeImBuf(), NULL, ImBuf::rect, view3d_validate_backbuf(), ARegion::winrct, ARegion::winx, ARegion::winy, WM_framebuffer_to_index(), rcti::xmin, and rcti::ymin.
Referenced by EM_init_backbuf_border(), EM_init_backbuf_circle(), EM_mask_init_backbuf_border(), sample_backbuf_area(), and view3d_sample_backbuf_rect().
unsigned int view3d_sample_backbuf | ( | ViewContext * | vc, |
int | x, | ||
int | y | ||
) |
Definition at line 1350 of file view3d_draw.c.
References ViewContext::ar, B_ENDIAN, ENDIAN_ORDER, SWITCH_INT, view3d_validate_backbuf(), ARegion::winrct, ARegion::winx, ARegion::winy, WM_framebuffer_to_index(), rcti::xmin, and rcti::ymin.
Referenced by facesel_face_pick(), findnearestface(), imapaint_pick_face(), vertsel_vert_pick(), vpaint_stroke_update_step(), weight_paint_sample_enum_itemf(), weight_sample_invoke(), and wpaint_stroke_update_step().
unsigned int view3d_sample_backbuf_rect | ( | ViewContext * | vc, |
const int | mval[2], | ||
int | size, | ||
unsigned int | min, | ||
unsigned int | max, | ||
int * | dist, | ||
short | strict, | ||
void * | handle, | ||
unsigned int(*)(void *handle, unsigned int index) | indextest | ||
) |
Definition at line 1422 of file view3d_draw.c.
References distance(), IMB_freeImBuf(), ImBuf::index, size(), sqrt(), and view3d_read_backbuf().
Referenced by facesel_face_pick(), findnearestedge(), findnearestvert(), and vertsel_vert_pick().
void view3d_set_clipping | ( | RegionView3D * | rv3d | ) |
Definition at line 173 of file view3d_draw.c.
References RegionView3D::clip, QUATCOPY, and RegionView3D::viewlock.
Referenced by backdrawview3d(), draw_depth(), ED_view3d_draw_offscreen(), view3d_main_area_draw_objects(), and view3d_opengl_select().
void view3d_update_depths_rect | ( | ARegion * | ar, |
ViewDepths * | d, | ||
rcti * | rect | ||
) |
Definition at line 1876 of file view3d_draw.c.
References BLI_isect_rcti(), ViewDepths::damaged, ViewDepths::depth_range, ViewDepths::depths, FALSE, ViewDepths::h, MEM_freeN(), MEM_mallocN(), NULL, TRUE, simple_enum_gen::w, ViewDepths::w, ARegion::winrct, ARegion::winx, ARegion::winy, ViewDepths::x, rcti::xmax, rcti::xmin, ViewDepths::y, rcti::ymax, and rcti::ymin.
Referenced by view3d_zoom_border_exec(), and view_autodist_depth_margin().
void view3d_validate_backbuf | ( | ViewContext * | vc | ) |
Definition at line 1343 of file view3d_draw.c.
References ViewContext::ar, backdrawview3d(), View3D::flag, ViewContext::scene, ViewContext::v3d, and V3D_INVALID_BACKBUF.
Referenced by do_paintface_box_select(), do_paintvert_box_select(), mouse_mesh_loop(), mouse_mesh_shortest_path(), PE_set_view3d_data(), unified_findnearest(), view3d_read_backbuf(), and view3d_sample_backbuf().