Blender V2.61 - r43446
|
#include "GL/glew.h"
#include "BLI_blenlib.h"
#include "BLI_edgehash.h"
#include "BLI_editVert.h"
#include "BLI_math.h"
#include "BLI_pbvh.h"
#include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_paint.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_curve_types.h"
#include "MEM_guardedalloc.h"
#include "GPU_buffers.h"
#include "GPU_draw.h"
#include "GPU_extensions.h"
#include "GPU_material.h"
#include <string.h>
#include <limits.h>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | CDDerivedMesh |
Defines | |
#define | PASSVERT(index) |
Functions | |
static int | cdDM_getNumVerts (DerivedMesh *dm) |
static int | cdDM_getNumEdges (DerivedMesh *dm) |
static int | cdDM_getNumFaces (DerivedMesh *dm) |
static void | cdDM_getVert (DerivedMesh *dm, int index, MVert *vert_r) |
static void | cdDM_getEdge (DerivedMesh *dm, int index, MEdge *edge_r) |
static void | cdDM_getFace (DerivedMesh *dm, int index, MFace *face_r) |
static void | cdDM_copyVertArray (DerivedMesh *dm, MVert *vert_r) |
static void | cdDM_copyEdgeArray (DerivedMesh *dm, MEdge *edge_r) |
static void | cdDM_copyFaceArray (DerivedMesh *dm, MFace *face_r) |
static void | cdDM_getMinMax (DerivedMesh *dm, float min_r[3], float max_r[3]) |
static void | cdDM_getVertCo (DerivedMesh *dm, int index, float co_r[3]) |
static void | cdDM_getVertCos (DerivedMesh *dm, float(*cos_r)[3]) |
static void | cdDM_getVertNo (DerivedMesh *dm, int index, float no_r[3]) |
static ListBase * | cdDM_getFaceMap (Object *ob, DerivedMesh *dm) |
static int | can_pbvh_draw (Object *ob, DerivedMesh *dm) |
static struct PBVH * | cdDM_getPBVH (Object *ob, DerivedMesh *dm) |
static void | cdDM_update_normals_from_pbvh (DerivedMesh *dm) |
static void | cdDM_drawVerts (DerivedMesh *dm) |
static void | cdDM_drawUVEdges (DerivedMesh *dm) |
static void | cdDM_drawEdges (DerivedMesh *dm, int drawLooseEdges, int drawAllEdges) |
static void | cdDM_drawLooseEdges (DerivedMesh *dm) |
static void | cdDM_drawFacesSolid (DerivedMesh *dm, float(*partial_redraw_planes)[4], int UNUSED(fast), int(*setMaterial)(int, void *attribs)) |
static void | cdDM_drawFacesColored (DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2) |
static void | cdDM_drawFacesTex_common (DerivedMesh *dm, int(*drawParams)(MTFace *tface, int has_mcol, int matnr), int(*drawParamsMapped)(void *userData, int index), int(*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData) |
static void | cdDM_drawFacesTex (DerivedMesh *dm, int(*setDrawOptions)(MTFace *tface, int has_mcol, int matnr), int(*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData) |
static void | cdDM_drawMappedFaces (DerivedMesh *dm, int(*setDrawOptions)(void *userData, int index, int *drawSmooth_r), int(*setMaterial)(int, void *attribs), int(*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData, int useColors) |
static void | cdDM_drawMappedFacesTex (DerivedMesh *dm, int(*setDrawOptions)(void *userData, int index), int(*compareDrawOptions)(void *userData, int cur_index, int next_index), void *userData) |
static void | cddm_draw_attrib_vertex (DMVertexAttribs *attribs, MVert *mvert, int a, int index, int vert, int smoothnormal) |
static void | cdDM_drawMappedFacesGLSL (DerivedMesh *dm, int(*setMaterial)(int, void *attribs), int(*setDrawOptions)(void *userData, int index), void *userData) |
static void | cdDM_drawFacesGLSL (DerivedMesh *dm, int(*setMaterial)(int, void *attribs)) |
static void | cdDM_drawMappedFacesMat (DerivedMesh *dm, void(*setMaterial)(void *userData, int, void *attribs), int(*setFace)(void *userData, int index), void *userData) |
static void | cdDM_drawMappedEdges (DerivedMesh *dm, int(*setDrawOptions)(void *userData, int index), void *userData) |
static void | cdDM_foreachMappedVert (DerivedMesh *dm, void(*func)(void *userData, int index, float *co, float *no_f, short *no_s), void *userData) |
static void | cdDM_foreachMappedEdge (DerivedMesh *dm, void(*func)(void *userData, int index, float *v0co, float *v1co), void *userData) |
static void | cdDM_foreachMappedFaceCenter (DerivedMesh *dm, void(*func)(void *userData, int index, float *cent, float *no), void *userData) |
static void | cdDM_free_internal (CDDerivedMesh *cddm) |
static void | cdDM_release (DerivedMesh *dm) |
static CDDerivedMesh * | cdDM_create (const char *desc) |
DerivedMesh * | CDDM_new (int numVerts, int numEdges, int numFaces) |
DerivedMesh * | CDDM_from_mesh (Mesh *mesh, Object *UNUSED(ob)) |
DerivedMesh * | CDDM_from_editmesh (EditMesh *em, Mesh *UNUSED(me)) |
DerivedMesh * | CDDM_from_curve (Object *ob) |
DerivedMesh * | CDDM_from_curve_customDB (Object *ob, ListBase *dispbase) |
DerivedMesh * | CDDM_copy (DerivedMesh *source) |
DerivedMesh * | CDDM_from_template (DerivedMesh *source, int numVerts, int numEdges, int numFaces) |
void | CDDM_apply_vert_coords (DerivedMesh *dm, float(*vertCoords)[3]) |
void | CDDM_apply_vert_normals (DerivedMesh *dm, short(*vertNormals)[3]) |
void | CDDM_calc_normals (DerivedMesh *dm) |
void | CDDM_calc_edges (DerivedMesh *dm) |
void | CDDM_lower_num_verts (DerivedMesh *dm, int numVerts) |
void | CDDM_lower_num_edges (DerivedMesh *dm, int numEdges) |
void | CDDM_lower_num_faces (DerivedMesh *dm, int numFaces) |
MVert * | CDDM_get_vert (DerivedMesh *dm, int index) |
MEdge * | CDDM_get_edge (DerivedMesh *dm, int index) |
MFace * | CDDM_get_face (DerivedMesh *dm, int index) |
MVert * | CDDM_get_verts (DerivedMesh *dm) |
MEdge * | CDDM_get_edges (DerivedMesh *dm) |
MFace * | CDDM_get_faces (DerivedMesh *dm) |
Definition in file cdderivedmesh.c.
#define PASSVERT | ( | index | ) |
{ \ if(shademodel == GL_SMOOTH) { \ short *no = mvert[index].no; \ glNormal3sv(no); \ } \ glVertex3fv(mvert[index].co); \ }
Referenced by cdDM_drawFacesSolid().
static int can_pbvh_draw | ( | Object * | ob, |
DerivedMesh * | dm | ||
) | [static] |
Definition at line 187 of file cdderivedmesh.c.
References Object::data, SculptSession::kb, SculptSession::modifiers_active, CDDerivedMesh::mvert, Mesh::mvert, OB_SHAPE_LOCK, Object::sculpt, and Object::shapeflag.
Referenced by cdDM_getPBVH().
void CDDM_apply_vert_coords | ( | DerivedMesh * | dm, |
float(*) | vertCoords[3] | ||
) |
Definition at line 1866 of file cdderivedmesh.c.
References CD_MVERT, MVert::co, copy_v3_v3(), CustomData_duplicate_referenced_layer(), i, CDDerivedMesh::mvert, DerivedMesh::numVertData, and DerivedMesh::vertData.
Referenced by create_orco_dm(), curve_calc_modifiers_post(), deformVerts(), editmesh_calc_modifiers(), get_cddm(), get_dm(), mesh_calc_modifiers(), mesh_create_derived(), multires_apply_smat(), and multiresModifier_reshapeFromDeformMod().
void CDDM_apply_vert_normals | ( | DerivedMesh * | dm, |
short(*) | vertNormals[3] | ||
) |
Definition at line 1880 of file cdderivedmesh.c.
References CD_MVERT, copy_v3_v3_short(), CustomData_duplicate_referenced_layer(), i, CDDerivedMesh::mvert, MVert::no, DerivedMesh::numVertData, and DerivedMesh::vertData.
void CDDM_calc_edges | ( | DerivedMesh * | dm | ) |
Definition at line 1914 of file cdderivedmesh.c.
References BLI_edgehash_free(), BLI_edgehash_haskey(), BLI_edgehash_insert(), BLI_edgehash_new(), BLI_edgehash_size(), BLI_edgehashIterator_free(), BLI_edgehashIterator_getKey(), BLI_edgehashIterator_isDone(), BLI_edgehashIterator_new(), BLI_edgehashIterator_step(), CD_CALLOC, CD_MEDGE, CD_ORIGINDEX, CustomData_add_layer(), CustomData_free(), CustomData_get_layer(), DerivedMesh::edgeData, i, ME_EDGEDRAW, ME_EDGERENDER, CDDerivedMesh::medge, CDDerivedMesh::mface, NULL, DerivedMesh::numEdgeData, DerivedMesh::numFaceData, ORIGINDEX_NONE, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by applyModifier(), ConvertCSGDescriptorsToDerivedMesh(), and explodeMesh().
void CDDM_calc_normals | ( | DerivedMesh * | dm | ) |
Definition at line 1894 of file cdderivedmesh.c.
References CD_CALLOC, CD_MVERT, CD_NORMAL, CDDM_get_faces(), CustomData_add_layer(), CustomData_duplicate_referenced_layer(), CustomData_get_layer(), DerivedMesh::faceData, mesh_calc_normals(), CDDerivedMesh::mvert, NULL, DerivedMesh::numFaceData, DerivedMesh::numVertData, and DerivedMesh::vertData.
Referenced by applyModifier(), ConvertCSGDescriptorsToDerivedMesh(), create_orco_dm(), curve_calc_modifiers_post(), deformVerts(), dynamicPaint_Modifier_apply(), editmesh_calc_modifiers(), explodeMesh(), get_cddm(), mesh_calc_modifiers(), and mesh_create_derived().
DerivedMesh* CDDM_copy | ( | DerivedMesh * | source | ) | [read] |
Definition at line 1798 of file cdderivedmesh.c.
References CD_ASSIGN, CD_MEDGE, CD_MFACE, CD_MVERT, CD_ORIGINDEX, cdDM_create(), CustomData_add_layer(), CustomData_copy_data(), DerivedMesh::deformedOnly, CDDerivedMesh::dm, DM_from_template(), DM_TYPE_CDDM, DerivedMesh::dupEdgeArray, DerivedMesh::dupFaceArray, DerivedMesh::dupVertArray, DerivedMesh::edgeData, DerivedMesh::faceData, DerivedMesh::getEdgeDataArray, DerivedMesh::getFaceDataArray, DerivedMesh::getVertDataArray, CDDerivedMesh::medge, CDDerivedMesh::mface, CDDerivedMesh::mvert, DerivedMesh::numEdgeData, DerivedMesh::numFaceData, DerivedMesh::numVertData, and DerivedMesh::vertData.
Referenced by applyModifier(), canvas_copyDerivedMesh(), clothModifier_do(), connect_hair(), curve_calc_modifiers_post(), deformVerts(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_Modifier_apply(), dynamicPaint_paintMesh(), editmesh_calc_modifiers(), get_cddm(), get_multires_dm(), mesh_calc_modifiers(), multiresModifier_reshapeFromDeformMod(), multiresModifier_update(), and psys_render_set().
static void cdDM_copyEdgeArray | ( | DerivedMesh * | dm, |
MEdge * | edge_r | ||
) | [static] |
Definition at line 125 of file cdderivedmesh.c.
References CDDerivedMesh::medge, and DerivedMesh::numEdgeData.
Referenced by cdDM_create().
static void cdDM_copyFaceArray | ( | DerivedMesh * | dm, |
MFace * | face_r | ||
) | [static] |
Definition at line 131 of file cdderivedmesh.c.
References CDDerivedMesh::mface, and DerivedMesh::numFaceData.
Referenced by cdDM_create().
static void cdDM_copyVertArray | ( | DerivedMesh * | dm, |
MVert * | vert_r | ||
) | [static] |
Definition at line 119 of file cdderivedmesh.c.
References CDDerivedMesh::mvert, and DerivedMesh::numVertData.
Referenced by cdDM_create().
static CDDerivedMesh* cdDM_create | ( | const char * | desc | ) | [static] |
Definition at line 1556 of file cdderivedmesh.c.
References cdDM_copyEdgeArray(), cdDM_copyFaceArray(), cdDM_copyVertArray(), cdDM_drawEdges(), cdDM_drawFacesColored(), cdDM_drawFacesGLSL(), cdDM_drawFacesSolid(), cdDM_drawFacesTex(), cdDM_drawLooseEdges(), cdDM_drawMappedEdges(), cdDM_drawMappedFaces(), cdDM_drawMappedFacesGLSL(), cdDM_drawMappedFacesMat(), cdDM_drawMappedFacesTex(), cdDM_drawUVEdges(), cdDM_drawVerts(), cdDM_foreachMappedEdge(), cdDM_foreachMappedFaceCenter(), cdDM_foreachMappedVert(), cdDM_getEdge(), cdDM_getFace(), cdDM_getFaceMap(), cdDM_getMinMax(), cdDM_getNumEdges(), cdDM_getNumFaces(), cdDM_getNumVerts(), cdDM_getPBVH(), cdDM_getVert(), cdDM_getVertCo(), cdDM_getVertCos(), cdDM_getVertNo(), cdDM_release(), DerivedMesh::copyEdgeArray, DerivedMesh::copyFaceArray, DerivedMesh::copyVertArray, CDDerivedMesh::dm, DM_get_edge_data(), DM_get_edge_data_layer(), DM_get_face_data(), DM_get_face_data_layer(), DM_get_vert_data(), DM_get_vert_data_layer(), DerivedMesh::drawEdges, DerivedMesh::drawFacesColored, DerivedMesh::drawFacesGLSL, DerivedMesh::drawFacesSolid, DerivedMesh::drawFacesTex, DerivedMesh::drawLooseEdges, DerivedMesh::drawMappedEdges, DerivedMesh::drawMappedFaces, DerivedMesh::drawMappedFacesGLSL, DerivedMesh::drawMappedFacesMat, DerivedMesh::drawMappedFacesTex, DerivedMesh::drawUVEdges, DerivedMesh::drawVerts, DerivedMesh::foreachMappedEdge, DerivedMesh::foreachMappedFaceCenter, DerivedMesh::foreachMappedVert, DerivedMesh::getEdge, DerivedMesh::getEdgeData, DerivedMesh::getEdgeDataArray, DerivedMesh::getFace, DerivedMesh::getFaceData, DerivedMesh::getFaceDataArray, DerivedMesh::getFaceMap, DerivedMesh::getMinMax, DerivedMesh::getNumEdges, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getPBVH, DerivedMesh::getVert, DerivedMesh::getVertCo, DerivedMesh::getVertCos, DerivedMesh::getVertData, DerivedMesh::getVertDataArray, DerivedMesh::getVertNo, MEM_callocN(), and DerivedMesh::release.
Referenced by CDDM_copy(), CDDM_from_mesh(), CDDM_from_template(), and CDDM_new().
static void cddm_draw_attrib_vertex | ( | DMVertexAttribs * | attribs, |
MVert * | mvert, | ||
int | a, | ||
int | index, | ||
int | vert, | ||
int | smoothnormal | ||
) | [static] |
Definition at line 1016 of file cdderivedmesh.c.
References MCol::a, DMVertexAttribs::array, MCol::b, co, MCol::g, DMVertexAttribs::glIndex, DMVertexAttribs::glTexco, DMVertexAttribs::mcol, DMVertexAttribs::orco, MCol::r, DMVertexAttribs::tang, DMVertexAttribs::tface, DMVertexAttribs::totmcol, DMVertexAttribs::totorco, DMVertexAttribs::tottang, DMVertexAttribs::tottface, and MTFace::uv.
Referenced by cdDM_drawMappedFacesGLSL(), and cdDM_drawMappedFacesMat().
static void cdDM_drawEdges | ( | DerivedMesh * | dm, |
int | drawLooseEdges, | ||
int | drawAllEdges | ||
) | [static] |
Definition at line 361 of file cdderivedmesh.c.
References MVert::co, DEBUG_VBO, addon::engine::draw(), DerivedMesh::drawObject, GPUDrawObject::edges, MEdge::flag, GPU_buffer_draw_elements(), GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_edge_setup(), i, ME_EDGEDRAW, ME_LOOSEEDGE, CDDerivedMesh::medge, CDDerivedMesh::mvert, DerivedMesh::numEdgeData, MEdge::v1, and MEdge::v2.
Referenced by cdDM_create().
static void cdDM_drawFacesColored | ( | DerivedMesh * | dm, |
int | useTwoSided, | ||
unsigned char * | col1, | ||
unsigned char * | col2 | ||
) | [static] |
Definition at line 560 of file cdderivedmesh.c.
References cdDM_update_normals_from_pbvh(), MVert::co, DEBUG_VBO, DerivedMesh::drawObject, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_color4_upload(), GPU_color_setup(), GPU_vertex_setup(), CDDerivedMesh::mface, CDDerivedMesh::mvert, NULL, DerivedMesh::numFaceData, and GPUDrawObject::tot_triangle_point.
Referenced by cdDM_create().
static void cdDM_drawFacesGLSL | ( | DerivedMesh * | dm, |
int(*)(int, void *attribs) | setMaterial | ||
) | [static] |
Definition at line 1350 of file cdderivedmesh.c.
References DerivedMesh::drawMappedFacesGLSL, and NULL.
Referenced by cdDM_create().
static void cdDM_drawFacesSolid | ( | DerivedMesh * | dm, |
float(*) | partial_redraw_planes[4], | ||
int | UNUSEDfast, | ||
int(*)(int, void *attribs) | setMaterial | ||
) | [static] |
Definition at line 459 of file cdderivedmesh.c.
References BLI_pbvh_draw(), CD_NORMAL, MVert::co, CustomData_get_layer(), DEBUG_VBO, DerivedMesh::drawObject, DerivedMesh::faceData, MFace::flag, DerivedMesh::getFaceDataArray, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_normal_setup(), GPU_vertex_setup(), MFace::mat_nr, GPUBufferMaterial::mat_nr, GPUDrawObject::materials, ME_SMOOTH, CDDerivedMesh::mface, CDDerivedMesh::mvert, normal_quad_v3(), normal_tri_v3(), NULL, DerivedMesh::numFaceData, PASSVERT, CDDerivedMesh::pbvh, CDDerivedMesh::pbvh_draw, GPUBufferMaterial::start, GPUDrawObject::totmaterial, GPUBufferMaterial::totpoint, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_drawFacesTex | ( | DerivedMesh * | dm, |
int(*)(MTFace *tface, int has_mcol, int matnr) | setDrawOptions, | ||
int(*)(void *userData, int cur_index, int next_index) | compareDrawOptions, | ||
void * | userData | ||
) | [static] |
Definition at line 835 of file cdderivedmesh.c.
References cdDM_drawFacesTex_common(), compareDrawOptions(), and NULL.
Referenced by cdDM_create().
static void cdDM_drawFacesTex_common | ( | DerivedMesh * | dm, |
int(*)(MTFace *tface, int has_mcol, int matnr) | drawParams, | ||
int(*)(void *userData, int index) | drawParamsMapped, | ||
int(*)(void *userData, int cur_index, int next_index) | compareDrawOptions, | ||
void * | userData | ||
) | [static] |
Definition at line 647 of file cdderivedmesh.c.
References MCol::b, CD_MCOL, CD_MFACE, CD_MTFACE, CD_NORMAL, CD_ORIGINDEX, CD_TEXTURE_MCOL, CD_WEIGHT_MCOL, cdDM_update_normals_from_pbvh(), MVert::co, GPUDrawObject::colType, compareDrawOptions(), DEBUG_VBO, DM_get_face_data_layer(), DerivedMesh::drawObject, MFace::flag, MCol::g, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_color3_upload(), GPU_color_setup(), GPU_color_switch(), GPU_normal_setup(), GPU_uv_setup(), GPU_vertex_setup(), i, MFace::mat_nr, ME_SMOOTH, MEM_freeN(), MEM_mallocN(), CDDerivedMesh::mvert, MVert::no, normal_quad_v3(), normal_tri_v3(), NULL, DerivedMesh::numFaceData, ORIGINDEX_NONE, MCol::r, GPUDrawObject::tot_triangle_point, GPUDrawObject::triangle_to_mface, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_drawFacesTex(), and cdDM_drawMappedFacesTex().
static void cdDM_drawLooseEdges | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 411 of file cdderivedmesh.c.
References MVert::co, DEBUG_VBO, addon::engine::draw(), DerivedMesh::drawObject, GPUDrawObject::edges, MEdge::flag, GPU_buffer_draw_elements(), GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_edge_setup(), i, ME_LOOSEEDGE, CDDerivedMesh::medge, CDDerivedMesh::mvert, DerivedMesh::numEdgeData, MEdge::v1, and MEdge::v2.
Referenced by cdDM_create().
static void cdDM_drawMappedEdges | ( | DerivedMesh * | dm, |
int(*)(void *userData, int index) | setDrawOptions, | ||
void * | userData | ||
) | [static] |
Definition at line 1434 of file cdderivedmesh.c.
References CD_ORIGINDEX, MVert::co, DM_get_edge_data_layer(), i, CDDerivedMesh::medge, CDDerivedMesh::mvert, DerivedMesh::numEdgeData, ORIGINDEX_NONE, MEdge::v1, and MEdge::v2.
Referenced by cdDM_create().
static void cdDM_drawMappedFaces | ( | DerivedMesh * | dm, |
int(*)(void *userData, int index, int *drawSmooth_r) | setDrawOptions, | ||
int(*)(int, void *attribs) | setMaterial, | ||
int(*)(void *userData, int cur_index, int next_index) | compareDrawOptions, | ||
void * | userData, | ||
int | useColors | ||
) | [static] |
Definition at line 843 of file cdderivedmesh.c.
References CD_ID_MCOL, CD_MCOL, CD_NORMAL, CD_ORIGINDEX, CD_WEIGHT_MCOL, cdDM_update_normals_from_pbvh(), MVert::co, compareDrawOptions(), DEBUG_VBO, DM_get_face_data_layer(), addon::engine::draw(), DerivedMesh::drawObject, MFace::flag, G, G_BACKBUFSEL, DerivedMesh::getFaceDataArray, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_color_setup(), GPU_normal_setup(), GPU_vertex_setup(), i, MFace::mat_nr, ME_SMOOTH, CDDerivedMesh::mface, CDDerivedMesh::mvert, MVert::no, normal_quad_v3(), normal_tri_v3(), NULL, DerivedMesh::numFaceData, ORIGINDEX_NONE, GPUDrawObject::tot_triangle_point, GPUDrawObject::triangle_to_mface, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_drawMappedFacesGLSL | ( | DerivedMesh * | dm, |
int(*)(int, void *attribs) | setMaterial, | ||
int(*)(void *userData, int index) | setDrawOptions, | ||
void * | userData | ||
) | [static] |
Definition at line 1060 of file cdderivedmesh.c.
References MCol::a, DMVertexAttribs::array, MCol::b, CD_NORMAL, CD_ORIGINDEX, cddm_draw_attrib_vertex(), cdDM_update_normals_from_pbvh(), MVert::co, copy_v2_v2(), copy_v3_v3(), copy_v4_v4(), copy_v4_v4_char(), DEBUG_VBO, DM_vertex_attributes_from_gpu(), DerivedMesh::drawObject, elementsize(), MFace::flag, MCol::g, DerivedMesh::getFaceDataArray, DMVertexAttribs::glIndex, GPU_attrib_element_size(), GPU_buffer_alloc(), GPU_buffer_free(), GPU_buffer_legacy(), GPU_buffer_lock_stream(), GPU_buffer_unbind(), GPU_buffer_unlock(), GPU_interleaved_attrib_setup(), GPU_MAX_ATTRIB, GPU_normal_setup(), GPU_vertex_setup(), i, GPUAttrib::index, GPUDrawObject::legacy, MFace::mat_nr, DMVertexAttribs::mcol, ME_SMOOTH, CDDerivedMesh::mface, CDDerivedMesh::mvert, normal_quad_v3(), normal_tri_v3(), NULL, DerivedMesh::numFaceData, DMVertexAttribs::orco, ORIGINDEX_NONE, MCol::r, GPUAttrib::size, DMVertexAttribs::tang, DMVertexAttribs::tface, GPUDrawObject::tot_triangle_point, DMVertexAttribs::totmcol, DMVertexAttribs::totorco, DMVertexAttribs::tottang, DMVertexAttribs::tottface, GPUDrawObject::triangle_to_mface, GPUAttrib::type, MTFace::uv, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_drawMappedFacesMat | ( | DerivedMesh * | dm, |
void(*)(void *userData, int, void *attribs) | setMaterial, | ||
int(*)(void *userData, int index) | setFace, | ||
void * | userData | ||
) | [static] |
Definition at line 1355 of file cdderivedmesh.c.
References CD_NORMAL, CD_ORIGINDEX, cddm_draw_attrib_vertex(), cdDM_update_normals_from_pbvh(), MVert::co, DM_vertex_attributes_from_gpu(), MFace::flag, DerivedMesh::getFaceDataArray, MFace::mat_nr, ME_SMOOTH, CDDerivedMesh::mface, CDDerivedMesh::mvert, normal_quad_v3(), normal_tri_v3(), DerivedMesh::numFaceData, ORIGINDEX_NONE, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_drawMappedFacesTex | ( | DerivedMesh * | dm, |
int(*)(void *userData, int index) | setDrawOptions, | ||
int(*)(void *userData, int cur_index, int next_index) | compareDrawOptions, | ||
void * | userData | ||
) | [static] |
Definition at line 1008 of file cdderivedmesh.c.
References cdDM_drawFacesTex_common(), compareDrawOptions(), and NULL.
Referenced by cdDM_create().
static void cdDM_drawUVEdges | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 291 of file cdderivedmesh.c.
References CD_MTFACE, DM_get_face_data_layer(), addon::engine::draw(), MFace::flag, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_uvedge_setup(), i, ME_HIDE, CDDerivedMesh::mface, DerivedMesh::numFaceData, MTFace::uv, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_drawVerts | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 267 of file cdderivedmesh.c.
References MVert::co, DerivedMesh::drawObject, GPU_buffer_legacy(), GPU_buffer_unbind(), GPU_vertex_setup(), i, CDDerivedMesh::mvert, DerivedMesh::numVertData, GPUDrawObject::tot_loose_point, and GPUDrawObject::tot_triangle_point.
Referenced by cdDM_create().
static void cdDM_foreachMappedEdge | ( | DerivedMesh * | dm, |
void(*)(void *userData, int index, float *v0co, float *v1co) | func, | ||
void * | userData | ||
) | [static] |
Definition at line 1478 of file cdderivedmesh.c.
References CD_ORIGINDEX, MVert::co, DM_get_edge_data_layer(), i, CDDerivedMesh::medge, CDDerivedMesh::mvert, DerivedMesh::numEdgeData, ORIGINDEX_NONE, MEdge::v1, and MEdge::v2.
Referenced by cdDM_create().
static void cdDM_foreachMappedFaceCenter | ( | DerivedMesh * | dm, |
void(*)(void *userData, int index, float *cent, float *no) | func, | ||
void * | userData | ||
) | [static] |
Definition at line 1500 of file cdderivedmesh.c.
References add_v3_v3(), CD_ORIGINDEX, MVert::co, copy_v3_v3(), DM_get_face_data_layer(), i, CDDerivedMesh::mface, mul_v3_fl(), CDDerivedMesh::mvert, normal_quad_v3(), normal_tri_v3(), DerivedMesh::numFaceData, ORIGINDEX_NONE, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by cdDM_create().
static void cdDM_foreachMappedVert | ( | DerivedMesh * | dm, |
void(*)(void *userData, int index, float *co, float *no_f, short *no_s) | func, | ||
void * | userData | ||
) | [static] |
Definition at line 1458 of file cdderivedmesh.c.
References CD_ORIGINDEX, CDDM_get_verts(), MVert::co, DM_get_vert_data_layer(), i, MVert::no, NULL, DerivedMesh::numVertData, and ORIGINDEX_NONE.
Referenced by cdDM_create().
static void cdDM_free_internal | ( | CDDerivedMesh * | cddm | ) | [static] |
Definition at line 1539 of file cdderivedmesh.c.
References CDDerivedMesh::fmap, CDDerivedMesh::fmap_mem, and MEM_freeN().
Referenced by cdDM_release().
DerivedMesh* CDDM_from_curve | ( | Object * | ob | ) | [read] |
Definition at line 1762 of file cdderivedmesh.c.
References CDDM_from_curve_customDB(), and Object::disp.
Referenced by applyModifier(), and get_dm().
DerivedMesh* CDDM_from_curve_customDB | ( | Object * | ob, |
ListBase * | dispbase | ||
) |
Definition at line 1767 of file cdderivedmesh.c.
References CDDM_new(), DerivedMesh::deformedOnly, CDDerivedMesh::medge, MEM_freeN(), CDDerivedMesh::mface, CDDerivedMesh::mvert, nurbs_to_mdata_customdb(), and PBVH::totvert.
Referenced by CDDM_from_curve(), create_orco_dm(), and curve_calc_modifiers_post().
DerivedMesh* CDDM_from_editmesh | ( | EditMesh * | em, |
Mesh * | UNUSEDme | ||
) |
Definition at line 1666 of file cdderivedmesh.c.
References BLI_countlist(), EditEdge::bweight, MEdge::bweight, EditVert::bweight, MVert::bweight, CD_CALLOC, CD_MASK_DERIVEDMESH, CD_ORIGINDEX, CDDM_new(), EditVert::co, MVert::co, copy_v3_v3(), EditEdge::crease, MEdge::crease, CustomData_from_em_block(), CustomData_merge(), EditFace::data, EditVert::data, DerivedMesh::deformedOnly, EditFace::e1, EditFace::e2, EditFace::e3, EditFace::e4, EditMesh::edges, EditEdge::f2, DerivedMesh::faceData, EditMesh::faces, EditMesh::fdata, ListBase::first, EditFace::flag, MFace::flag, MEdge::flag, MVert::flag, DerivedMesh::getEdgeDataArray, DerivedMesh::getFaceDataArray, DerivedMesh::getVertDataArray, i, EditVert::l, EditFace::mat_nr, MFace::mat_nr, ME_EDGEDRAW, ME_EDGERENDER, ME_LOOSEEDGE, ME_SEAM, ME_SHARP, CDDerivedMesh::medge, CDDerivedMesh::mface, CDDerivedMesh::mvert, EditFace::next, EditEdge::next, EditVert::next, EditVert::no, MVert::no, normal_float_to_short_v3(), DerivedMesh::numFaceData, DerivedMesh::numVertData, EditEdge::seam, EditEdge::sharp, test_index_face(), EditVert::tmp, EditFace::v1, MFace::v1, EditEdge::v1, MEdge::v1, EditFace::v2, MFace::v2, EditEdge::v2, MEdge::v2, EditFace::v3, MFace::v3, EditFace::v4, MFace::v4, EditMesh::vdata, DerivedMesh::vertData, and EditMesh::verts.
DerivedMesh* CDDM_from_mesh | ( | Mesh * | mesh, |
Object * | UNUSEDob | ||
) |
Definition at line 1637 of file cdderivedmesh.c.
References CD_MASK_MDISPS, CD_MASK_MESH, CD_MEDGE, CD_MFACE, CD_MVERT, CD_REFERENCE, cdDM_create(), CustomData_get_layer(), CustomData_merge(), DerivedMesh::deformedOnly, CDDerivedMesh::dm, DM_init(), DM_TYPE_CDDM, DerivedMesh::edgeData, DerivedMesh::faceData, Mesh::fdata, CDDerivedMesh::medge, CDDerivedMesh::mface, CDDerivedMesh::mvert, Mesh::totedge, Mesh::totface, Mesh::totvert, and DerivedMesh::vertData.
DerivedMesh* CDDM_from_template | ( | DerivedMesh * | source, |
int | numVerts, | ||
int | numEdges, | ||
int | numFaces | ||
) | [read] |
Definition at line 1833 of file cdderivedmesh.c.
References CD_CALLOC, CD_MEDGE, CD_MFACE, CD_MVERT, CD_ORIGINDEX, cdDM_create(), CustomData_add_layer(), CustomData_get_layer(), CDDerivedMesh::dm, DM_from_template(), DM_TYPE_CDDM, DerivedMesh::edgeData, DerivedMesh::faceData, DerivedMesh::getEdgeDataArray, DerivedMesh::getFaceDataArray, DerivedMesh::getVertDataArray, CDDerivedMesh::medge, CDDerivedMesh::mface, CDDerivedMesh::mvert, NULL, and DerivedMesh::vertData.
Referenced by applyModifier(), arrayModifier_doArray(), BME_bmesh_to_derivedmesh(), CDDM_from_smoothmesh(), cutEdges(), doMirrorOnAxis(), and explodeMesh().
MEdge* CDDM_get_edge | ( | DerivedMesh * | dm, |
int | index | ||
) | [read] |
Definition at line 1999 of file cdderivedmesh.c.
Referenced by applyModifier(), and doMirrorOnAxis().
MEdge* CDDM_get_edges | ( | DerivedMesh * | dm | ) | [read] |
Definition at line 2014 of file cdderivedmesh.c.
Referenced by arrayModifier_doArray(), BME_bmesh_to_derivedmesh(), CDDM_from_smoothmesh(), and do_hair_dynamics().
MFace* CDDM_get_face | ( | DerivedMesh * | dm, |
int | index | ||
) | [read] |
Definition at line 2004 of file cdderivedmesh.c.
Referenced by applyModifier(), closest_point_on_surface(), connect_hair(), ConvertCSGDescriptorsToDerivedMesh(), cutEdges(), doMirrorOnAxis(), explodeMesh(), get_dface(), and InterpCSGFace().
MFace* CDDM_get_faces | ( | DerivedMesh * | dm | ) | [read] |
Definition at line 2019 of file cdderivedmesh.c.
Referenced by arrayModifier_doArray(), BME_bmesh_to_derivedmesh(), CDDM_calc_normals(), and CDDM_from_smoothmesh().
MVert* CDDM_get_vert | ( | DerivedMesh * | dm, |
int | index | ||
) | [read] |
Definition at line 1994 of file cdderivedmesh.c.
Referenced by applyModifier(), connect_hair(), ConvertCSGDescriptorsToDerivedMesh(), cutEdges(), deformVerts(), doMirrorOnAxis(), explodeMesh(), init_particle_interpolation(), and InterpCSGFace().
MVert* CDDM_get_verts | ( | DerivedMesh * | dm | ) | [read] |
Definition at line 2009 of file cdderivedmesh.c.
Referenced by arrayModifier_doArray(), BME_bmesh_to_derivedmesh(), cdDM_foreachMappedVert(), CDDM_from_smoothmesh(), cdDM_getVertCos(), cloth_to_object(), displaceModifier_do(), and do_hair_dynamics().
static void cdDM_getEdge | ( | DerivedMesh * | dm, |
int | index, | ||
MEdge * | edge_r | ||
) | [static] |
Definition at line 107 of file cdderivedmesh.c.
References IndexNode::index, and CDDerivedMesh::medge.
Referenced by cdDM_create().
static void cdDM_getFace | ( | DerivedMesh * | dm, |
int | index, | ||
MFace * | face_r | ||
) | [static] |
Definition at line 113 of file cdderivedmesh.c.
References IndexNode::index, and CDDerivedMesh::mface.
Referenced by cdDM_create().
static ListBase* cdDM_getFaceMap | ( | Object * | ob, |
DerivedMesh * | dm | ||
) | [static] |
Definition at line 173 of file cdderivedmesh.c.
References create_vert_face_map(), Object::data, CDDerivedMesh::fmap, CDDerivedMesh::fmap_mem, Mesh::mface, OB_MESH, Mesh::totface, Mesh::totvert, and Object::type.
Referenced by cdDM_create().
static void cdDM_getMinMax | ( | DerivedMesh * | dm, |
float | min_r[3], | ||
float | max_r[3] | ||
) | [static] |
Definition at line 137 of file cdderivedmesh.c.
References MVert::co, DO_MINMAX, i, CDDerivedMesh::mvert, and DerivedMesh::numVertData.
Referenced by cdDM_create().
static int cdDM_getNumEdges | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 91 of file cdderivedmesh.c.
References DerivedMesh::numEdgeData.
Referenced by cdDM_create().
static int cdDM_getNumFaces | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 96 of file cdderivedmesh.c.
References DerivedMesh::numFaceData.
Referenced by cdDM_create().
static int cdDM_getNumVerts | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 86 of file cdderivedmesh.c.
References DerivedMesh::numVertData.
Referenced by cdDM_create().
static struct PBVH* cdDM_getPBVH | ( | Object * | ob, |
DerivedMesh * | dm | ||
) | [static, read] |
Definition at line 209 of file cdderivedmesh.c.
References BLI_pbvh_apply_vertCos(), BLI_pbvh_build_mesh(), BLI_pbvh_new(), can_pbvh_draw(), Object::data, Object::derivedDeform, DerivedMesh::getNumVerts, DerivedMesh::getVertCos, MEM_callocN(), MEM_freeN(), Mesh::mface, SculptSession::modifiers_active, Mesh::mvert, NULL, OB_MESH, CDDerivedMesh::pbvh, SculptSession::pbvh, CDDerivedMesh::pbvh_draw, Object::sculpt, Mesh::totface, Mesh::totvert, PBVH::totvert, and Object::type.
Referenced by cdDM_create().
static void cdDM_getVert | ( | DerivedMesh * | dm, |
int | index, | ||
MVert * | vert_r | ||
) | [static] |
Definition at line 101 of file cdderivedmesh.c.
References IndexNode::index, and CDDerivedMesh::mvert.
Referenced by cdDM_create().
static void cdDM_getVertCo | ( | DerivedMesh * | dm, |
int | index, | ||
float | co_r[3] | ||
) | [static] |
Definition at line 151 of file cdderivedmesh.c.
References MVert::co, copy_v3_v3(), and CDDerivedMesh::mvert.
Referenced by cdDM_create().
static void cdDM_getVertCos | ( | DerivedMesh * | dm, |
float(*) | cos_r[3] | ||
) | [static] |
Definition at line 158 of file cdderivedmesh.c.
References CDDM_get_verts(), MVert::co, copy_v3_v3(), i, and DerivedMesh::numVertData.
Referenced by cdDM_create().
static void cdDM_getVertNo | ( | DerivedMesh * | dm, |
int | index, | ||
float | no_r[3] | ||
) | [static] |
Definition at line 167 of file cdderivedmesh.c.
References CDDerivedMesh::mvert, MVert::no, and normal_short_to_float_v3().
Referenced by cdDM_create().
void CDDM_lower_num_edges | ( | DerivedMesh * | dm, |
int | numEdges | ||
) |
Definition at line 1978 of file cdderivedmesh.c.
References CustomData_free_elem(), DerivedMesh::edgeData, and DerivedMesh::numEdgeData.
Referenced by arrayModifier_doArray(), and doMirrorOnAxis().
void CDDM_lower_num_faces | ( | DerivedMesh * | dm, |
int | numFaces | ||
) |
Definition at line 1986 of file cdderivedmesh.c.
References CustomData_free_elem(), DerivedMesh::faceData, and DerivedMesh::numFaceData.
Referenced by arrayModifier_doArray(), and doMirrorOnAxis().
void CDDM_lower_num_verts | ( | DerivedMesh * | dm, |
int | numVerts | ||
) |
Definition at line 1970 of file cdderivedmesh.c.
References CustomData_free_elem(), DerivedMesh::numVertData, and DerivedMesh::vertData.
Referenced by arrayModifier_doArray(), and doMirrorOnAxis().
DerivedMesh* CDDM_new | ( | int | numVerts, |
int | numEdges, | ||
int | numFaces | ||
) | [read] |
Definition at line 1615 of file cdderivedmesh.c.
References CD_CALLOC, CD_MEDGE, CD_MFACE, CD_MVERT, CD_ORIGINDEX, cdDM_create(), CustomData_add_layer(), CustomData_get_layer(), CDDerivedMesh::dm, DM_init(), DM_TYPE_CDDM, DerivedMesh::edgeData, DerivedMesh::faceData, CDDerivedMesh::medge, CDDerivedMesh::mface, CDDerivedMesh::mvert, NULL, and DerivedMesh::vertData.
Referenced by CDDM_from_curve_customDB(), CDDM_from_editmesh(), ConvertCSGDescriptorsToDerivedMesh(), and do_hair_dynamics().
static void cdDM_release | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 1545 of file cdderivedmesh.c.
References cdDM_free_internal(), DM_release(), and MEM_freeN().
Referenced by cdDM_create().
static void cdDM_update_normals_from_pbvh | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 254 of file cdderivedmesh.c.
References BLI_pbvh_update(), CD_NORMAL, CustomData_get_layer(), DerivedMesh::faceData, DerivedMesh::numFaceData, CDDerivedMesh::pbvh, CDDerivedMesh::pbvh_draw, and PBVH_UpdateNormals.
Referenced by cdDM_drawFacesColored(), cdDM_drawFacesTex_common(), cdDM_drawMappedFaces(), cdDM_drawMappedFacesGLSL(), and cdDM_drawMappedFacesMat().