|
Blender
V2.59
|
#include <string.h>#include <math.h>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_edgehash.h"#include "BLI_editVert.h"#include "BLI_utildefines.h"#include "DNA_material_types.h"#include "DNA_meshdata_types.h"#include "DNA_property_types.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_view3d_types.h"#include "DNA_object_types.h"#include "BKE_DerivedMesh.h"#include "BKE_effect.h"#include "BKE_image.h"#include "BKE_material.h"#include "BKE_paint.h"#include "BKE_property.h"#include "BIF_gl.h"#include "BIF_glutil.h"#include "UI_resources.h"#include "GPU_buffers.h"#include "GPU_extensions.h"#include "GPU_draw.h"#include "ED_mesh.h"#include "view3d_intern.h"Go to the source code of this file.
Classes | |
| struct | TextureDrawState |
Enumerations | |
| enum | { eEdge_Visible = (1<<0), eEdge_Select = (1<<1) } |
Functions | |
| static void | get_marked_edge_info__orFlags (EdgeHash *eh, int v0, int v1, int flags) |
| static EdgeHash * | get_tface_mesh_marked_edge_info (Mesh *me) |
| static int | draw_tfaces3D__setHiddenOpts (void *userData, int index) |
| static int | draw_tfaces3D__setSeamOpts (void *userData, int index) |
| static int | draw_tfaces3D__setSelectOpts (void *userData, int index) |
| static int | draw_tfaces3D__drawFaceOptsInv (void *userData, int index) |
| static void | draw_tfaces3D (RegionView3D *rv3d, Mesh *me, DerivedMesh *dm, short draw_seams) |
| static Material * | give_current_material_or_def (Object *ob, int matnr) |
| static int | set_draw_settings_cached (int clearcache, int textured, MTFace *texface, int lit, Object *litob, int litmatnr, int doublesided) |
| static void | draw_textured_begin (Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) |
| static void | draw_textured_end (void) |
| static int | draw_tface__set_draw_legacy (MTFace *tface, MCol *mcol, int matnr) |
| static int | draw_tface__set_draw (MTFace *tface, MCol *mcol, int matnr) |
| static void | add_tface_color_layer (DerivedMesh *dm) |
| static int | draw_tface_mapped__set_draw (void *userData, int index) |
| static int | draw_em_tf_mapped__set_draw (void *userData, int index) |
| static int | wpaint__setSolidDrawOptions (void *userData, int index, int *drawSmooth_r) |
| static void | draw_mesh_text (Scene *scene, Object *ob, int glsl) |
| void | draw_mesh_textured (Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, DerivedMesh *dm, int faceselect) |
Variables | |
| static struct TextureDrawState | Gtexdraw |
Definition in file drawmesh.c.
| anonymous enum |
Definition at line 76 of file drawmesh.c.
| static void add_tface_color_layer | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 454 of file drawmesh.c.
References MCol::b, CD_ASSIGN, CD_MCOL, CD_MFACE, CD_MTFACE, CD_TEXTURE_MCOL, CD_WEIGHT_MCOL, TextureDrawState::color_profile, copy_v3_v3(), CustomData_add_layer(), DM_get_face_data_layer(), DerivedMesh::faceData, FTOCHAR, MCol::g, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, give_current_material(), Gtexdraw, i, TextureDrawState::islit, TextureDrawState::istex, linearrgb_to_srgb_v3_v3(), MFace::mat_nr, MEM_mallocN(), MTFace::mode, DerivedMesh::numFaceData, TextureDrawState::ob, TextureDrawState::obcol, MCol::r, Material::r, set_draw_settings_cached(), TF_INVISIBLE, TF_OBCOL, and TF_TWOSIDE.
Referenced by draw_mesh_textured().
| static int draw_em_tf_mapped__set_draw | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 539 of file drawmesh.c.
References CD_MCOL, CD_MTFACE, CustomData_em_get(), EditFace::data, draw_tface__set_draw_legacy(), EM_get_face_for_index(), EditMesh::fdata, EditFace::h, and EditFace::mat_nr.
Referenced by draw_mesh_textured().
Definition at line 571 of file drawmesh.c.
References BKE_image_get_ibuf(), CD_MASK_BAREMESH, CD_MTFACE, Object::data, MFace::flag, get_ob_property(), DerivedMesh::getVertCo, GPUVertexAttribs::glindex, GPU_enable_material(), GPU_render_text(), Gtexdraw, i, TextureDrawState::islit, TextureDrawState::istex, GPUVertexAttribs::layer, MFace::mat_nr, MAX_PROPSTRING, Mesh::mcol, ME_HIDE, ME_SMOOTH, mesh_get_derived_deform(), Mesh::mface, Object::mode, Mesh::mtface, normal_tri_v3(), NULL, TextureDrawState::ob, OB_MODE_EDIT, OBACT, paint_facesel_test(), DerivedMesh::release, set_draw_settings_cached(), set_property_valstr(), TF_BMFONT, TF_INVISIBLE, TF_TWOSIDE, Mesh::totface, GPUVertexAttribs::totlayer, GPUVertexAttribs::type, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by draw_mesh_textured().
| void draw_mesh_textured | ( | Scene * | scene, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d, | ||
| Object * | ob, | ||
| DerivedMesh * | dm, | ||
| int | faceselect | ||
| ) |
Definition at line 656 of file drawmesh.c.
References add_tface_color_layer(), CD_TEXTURE_MCOL, CustomData_has_layer(), Object::data, draw_em_tf_mapped__set_draw(), draw_mesh_text(), draw_textured_begin(), draw_textured_end(), draw_tface__set_draw(), draw_tface__set_draw_legacy(), draw_tface_mapped__set_draw(), draw_tfaces3D(), DerivedMesh::drawFacesTex, DerivedMesh::drawMappedFaces, DerivedMesh::drawMappedFacesTex, Mesh::edit_mesh, DerivedMesh::faceData, get_ob_property(), GPU_buffer_legacy(), GPU_enable_material(), Mesh::mface, Object::mode, NULL, OB_MODE_EDIT, OB_MODE_WEIGHT_PAINT, OB_NEG_SCALE, Scene::obedit, Object::transflag, and wpaint__setSolidDrawOptions().
Referenced by draw_em_fancy(), and draw_mesh_fancy().
| static void draw_textured_begin | ( | Scene * | scene, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d, | ||
| Object * | ob | ||
| ) | [static] |
Definition at line 356 of file drawmesh.c.
References CLAMPIS, Object::col, RenderData::color_mgt_flag, TextureDrawState::color_profile, View3D::drawtype, GPU_scene_object_lights(), Gtexdraw, RegionView3D::is_persp, TextureDrawState::islit, TextureDrawState::istex, View3D::lay, Object::mode, NULL, TextureDrawState::ob, OB_MODE_EDIT, OB_SOLID, OB_TEXTURE, TextureDrawState::obcol, Scene::r, R_COLOR_MANAGEMENT, set_draw_settings_cached(), and RegionView3D::viewmat.
Referenced by draw_mesh_textured().
| static void draw_textured_end | ( | void | ) | [static] |
Definition at line 389 of file drawmesh.c.
References GPU_default_lights(), GPU_set_tpage(), and NULL.
Referenced by draw_mesh_textured().
Definition at line 440 of file drawmesh.c.
References Gtexdraw, TextureDrawState::islit, TextureDrawState::istex, MTFace::mode, TextureDrawState::ob, set_draw_settings_cached(), TF_INVISIBLE, TF_OBCOL, and TF_TWOSIDE.
Referenced by draw_mesh_textured(), and draw_tface_mapped__set_draw().
Definition at line 412 of file drawmesh.c.
References TextureDrawState::color_profile, copy_v3_v3(), give_current_material(), Gtexdraw, TextureDrawState::islit, TextureDrawState::istex, linearrgb_to_srgb_v3_v3(), MTFace::mode, TextureDrawState::ob, TextureDrawState::obcol, Material::r, set_draw_settings_cached(), TF_INVISIBLE, TF_OBCOL, and TF_TWOSIDE.
Referenced by draw_em_tf_mapped__set_draw(), and draw_mesh_textured().
| static int draw_tface_mapped__set_draw | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 528 of file drawmesh.c.
References draw_tface__set_draw(), MFace::flag, MFace::mat_nr, Mesh::mcol, ME_HIDE, Mesh::mface, Mesh::mtface, and NULL.
Referenced by draw_mesh_textured().
| static void draw_tfaces3D | ( | RegionView3D * | rv3d, |
| Mesh * | me, | ||
| DerivedMesh * | dm, | ||
| short | draw_seams | ||
| ) | [static] |
Definition at line 211 of file drawmesh.c.
References bglPolygonOffset(), BLI_edgehash_free(), RegionView3D::dist, draw_tfaces3D__drawFaceOptsInv(), draw_tfaces3D__setHiddenOpts(), draw_tfaces3D__setSeamOpts(), draw_tfaces3D__setSelectOpts(), Mesh::drawflag, DerivedMesh::drawMappedEdges, DerivedMesh::drawMappedFacesTex, get_tface_mesh_marked_edge_info(), ME_DRAWFACES, ME_DRAWSEAMS, NULL, setlinestyle(), TH_EDGE_FACESEL, TH_EDGE_SEAM, TH_FACE_SELECT, UI_ThemeColor(), and UI_ThemeColor4().
Referenced by draw_mesh_textured().
| static int draw_tfaces3D__drawFaceOptsInv | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 200 of file drawmesh.c.
References MFace::flag, ME_FACE_SEL, ME_HIDE, and Mesh::mface.
Referenced by draw_tfaces3D().
| static int draw_tfaces3D__setHiddenOpts | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 126 of file drawmesh.c.
References BLI_edgehash_lookup(), Mesh::drawflag, eEdge_Select, eEdge_Visible, MEdge::flag, ME_DRAWEDGES, ME_DRAWSEAMS, ME_HIDDENEDGES, ME_SEAM, Mesh::medge, MEdge::v1, and MEdge::v2.
Referenced by draw_tfaces3D().
| static int draw_tfaces3D__setSeamOpts | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 146 of file drawmesh.c.
References BLI_edgehash_lookup(), Mesh::drawflag, eEdge_Visible, MEdge::flag, ME_HIDDENEDGES, ME_SEAM, MEdge::v1, and MEdge::v2.
Referenced by draw_tfaces3D().
| static int draw_tfaces3D__setSelectOpts | ( | void * | userData, |
| int | index | ||
| ) | [static] |
Definition at line 164 of file drawmesh.c.
References BLI_edgehash_lookup(), eEdge_Select, MEdge::v1, and MEdge::v2.
Referenced by draw_tfaces3D().
| static void get_marked_edge_info__orFlags | ( | EdgeHash * | eh, |
| int | v0, | ||
| int | v1, | ||
| int | flags | ||
| ) | [static] |
Definition at line 84 of file drawmesh.c.
References BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_lookup_p(), and NULL.
Referenced by get_tface_mesh_marked_edge_info().
Definition at line 96 of file drawmesh.c.
References BLI_edgehash_new(), eEdge_Select, eEdge_Visible, MFace::flag, get_marked_edge_info__orFlags(), i, ME_FACE_SEL, ME_HIDE, Mesh::mface, Mesh::totface, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by draw_tfaces3D().
Definition at line 266 of file drawmesh.c.
References defmaterial, and give_current_material().
Referenced by set_draw_settings_cached().
| static int set_draw_settings_cached | ( | int | clearcache, |
| int | textured, | ||
| MTFace * | texface, | ||
| int | lit, | ||
| Object * | litob, | ||
| int | litmatnr, | ||
| int | doublesided | ||
| ) | [static] |
Definition at line 274 of file drawmesh.c.
References CLAMPIS, give_current_material_or_def(), GPU_set_tpage(), Material::har, MTFace::mode, Object::mode, NULL, OB_MODE_TEXTURE_PAINT, Material::spec, spec(), Material::specb, Material::specg, Material::specr, TF_LIGHT, TF_TEX, and TF_TWOSIDE.
Referenced by add_tface_color_layer(), draw_mesh_text(), draw_textured_begin(), draw_tface__set_draw(), and draw_tface__set_draw_legacy().
| static int wpaint__setSolidDrawOptions | ( | void * | userData, |
| int | index, | ||
| int * | drawSmooth_r | ||
| ) | [static] |
Definition at line 557 of file drawmesh.c.
References MFace::flag, ME_HIDE, Mesh::mface, MTFace::mode, Mesh::mtface, and TF_INVISIBLE.
Referenced by draw_mesh_textured().
struct TextureDrawState Gtexdraw [static] |