Blender V2.61 - r43446
|
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLI_editVert.h"
#include "BLI_ghash.h"
#include "BLI_rand.h"
#include "BLI_threads.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_deform.h"
#include "BKE_DerivedMesh.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_material.h"
#include "BKE_report.h"
#include "BKE_multires.h"
#include "BLO_sys_types.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_view3d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "mesh_intern.h"
Go to the source code of this file.
Classes | |
struct | MocNode |
Defines | |
#define | MOC_RES 8 |
#define | MOC_NODE_RES 8 |
#define | MOC_THRESH 0.00002f |
#define | MOC_INDEX(vx, vy, vz) (((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz)) |
Typedefs | |
typedef struct MocNode | MocNode |
Functions | |
int | join_mesh_exec (bContext *C, wmOperator *op) |
int | join_mesh_shapes_exec (bContext *C, wmOperator *op) |
static int | mesh_octree_get_base_offs (float *co, float *offs, float *div) |
static void | mesh_octree_add_node (MocNode **bt, intptr_t index) |
static void | mesh_octree_free_node (MocNode **bt) |
static void | mesh_octree_add_nodes (MocNode **basetable, float *co, float *offs, float *div, intptr_t index) |
static intptr_t | mesh_octree_find_index (MocNode **bt, MVert *mvert, float *co) |
intptr_t | mesh_octree_table (Object *ob, EditMesh *em, float *co, char mode) |
int | mesh_mirrtopo_table (Object *ob, char mode) |
static int | mesh_get_x_mirror_vert_spacial (Object *ob, int index) |
static int | mesh_get_x_mirror_vert_topo (Object *ob, int index) |
int | mesh_get_x_mirror_vert (Object *ob, int index) |
static EditVert * | editmesh_get_x_mirror_vert_spacial (Object *ob, EditMesh *em, float *co) |
static EditVert * | editmesh_get_x_mirror_vert_topo (Object *ob, struct EditMesh *em, EditVert *eve, int index) |
EditVert * | editmesh_get_x_mirror_vert (Object *ob, struct EditMesh *em, EditVert *eve, float *co, int index) |
static unsigned int | mirror_facehash (const void *ptr) |
static int | mirror_facerotation (MFace *a, MFace *b) |
static int | mirror_facecmp (const void *a, const void *b) |
int * | mesh_get_x_mirror_faces (Object *ob, EditMesh *em) |
Variables | |
struct { | |
MocNode ** table | |
float offs [3] | |
float div [3] | |
} | MeshOctree |
MirrTopoStore_t | mesh_topo_store = {NULL, -1. -1, -1} |
Definition in file meshtools.c.
#define MOC_INDEX | ( | vx, | |
vy, | |||
vz | |||
) | (((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz)) |
Definition at line 674 of file meshtools.c.
Referenced by mesh_octree_add_nodes().
#define MOC_NODE_RES 8 |
Definition at line 621 of file meshtools.c.
Referenced by mesh_octree_add_node(), and mesh_octree_find_index().
#define MOC_RES 8 |
Definition at line 620 of file meshtools.c.
Referenced by mesh_octree_add_nodes(), mesh_octree_get_base_offs(), and mesh_octree_table().
#define MOC_THRESH 0.00002f |
Definition at line 622 of file meshtools.c.
Referenced by mesh_octree_add_nodes(), mesh_octree_find_index(), and mesh_octree_table().
EditVert* editmesh_get_x_mirror_vert | ( | Object * | ob, |
struct EditMesh * | em, | ||
EditVert * | eve, | ||
float * | co, | ||
int | index | ||
) | [read] |
Definition at line 946 of file meshtools.c.
References Object::data, editmesh_get_x_mirror_vert_spacial(), editmesh_get_x_mirror_vert_topo(), and ME_EDIT_MIRROR_TOPO.
Referenced by createTransEditVerts(), editvert_mirror_update(), EM_cache_x_mirror_vert(), and smooth_vertex().
static EditVert* editmesh_get_x_mirror_vert_spacial | ( | Object * | ob, |
EditMesh * | em, | ||
float * | co | ||
) | [static] |
Definition at line 903 of file meshtools.c.
References mesh_octree_table(), and NULL.
Referenced by editmesh_get_x_mirror_vert().
static EditVert* editmesh_get_x_mirror_vert_topo | ( | Object * | ob, |
struct EditMesh * | em, | ||
EditVert * | eve, | ||
int | index | ||
) | [static] |
Definition at line 925 of file meshtools.c.
References BLI_findindex(), MirrTopoStore_t::index_lookup, mesh_mirrtopo_table(), NULL, and EditMesh::verts.
Referenced by editmesh_get_x_mirror_vert().
int join_mesh_exec | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 91 of file meshtools.c.
References Object::actdef, add_key(), KeyBlock::adrcode, BKE_report(), BKE_reportf(), BLI_addtail(), BLI_findlink(), BLI_remlink(), Key::block, CD_CALLOC, CD_DEFAULT, CD_MASK_MESH, CD_MDEFORMVERT, CD_MEDGE, CD_MFACE, CD_MVERT, MVert::co, copy_key(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), CustomData_add_layer(), CustomData_copy_data(), CustomData_free(), CustomData_get(), CustomData_merge(), DAG_id_tag_update(), DAG_scene_sort(), KeyBlock::data, Object::data, MDeformWeight::def_nr, Object::defbase, defgroup_find_name(), MDeformVert::dw, ED_base_object_free_and_unlink(), ED_object_enter_editmode(), ED_object_exit_editmode(), EM_DO_UNDO, EM_FREEDATA, EM_WAITCURSOR, Mesh::fdata, ListBase::first, free_editMesh(), free_ipo(), free_key(), give_current_material(), i, Object::id, Material::id, id_us_plus(), invert_m4_m4(), Main::ipo, Main::key, Mesh::key, key_get_named_keyblock(), KEY_RELATIVE, ListBase::last, load_editMesh(), make_editMesh(), Mesh::mat, Object::mat, MFace::mat_nr, Object::matbits, MAXMAT, MEM_callocN(), MEM_dupallocN(), MEM_freeN(), MESH_MAX_VERTS, mesh_update_customdata_pointers(), mul_m4_v3(), mult_m4_m4m4(), multiresModifier_prepare_join(), KeyBlock::name, bDeformGroup::name, NC_SCENE, ND_OB_ACTIVE, bDeformGroup::next, KeyBlock::next, NULL, OB_MESH, OB_RECALC_DATA, OB_RECALC_OB, Scene::obedit, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, KeyBlock::pos, KeyBlock::prev, Key::refkey, wmOperator::reports, RPT_WARNING, STRINGIFY, test_object_materials(), Mesh::totcol, Object::totcol, Mesh::totedge, KeyBlock::totelem, Mesh::totface, LaplacianSystem::totface, Key::totkey, Mesh::totvert, LaplacianSystem::totvert, MDeformVert::totweight, Key::type, Object::type, ID::us, MEdge::v1, MFace::v1, MEdge::v2, MFace::v2, MFace::v3, MFace::v4, VECCOPY, KeyBlock::weights, and WM_event_add_notifier().
Referenced by join_exec().
int join_mesh_shapes_exec | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 547 of file meshtools.c.
References add_key(), add_keyblock(), BKE_report(), CD_MASK_BAREMESH, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_scene(), Object::data, DM_to_meshkey(), if(), Mesh::key, KEY_RELATIVE, mesh_get_derived_deform(), mesh_to_key(), NC_SCENE, ND_OB_ACTIVE, NULL, OB_MESH, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_WARNING, Mesh::totvert, and WM_event_add_notifier().
Referenced by join_shapes_exec().
Definition at line 1052 of file meshtools.c.
References BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), Object::data, MEM_callocN(), MEM_freeN(), mesh_get_x_mirror_vert(), mesh_octree_table(), Mesh::mface, mirror_facecmp(), mirror_facehash(), mirror_facerotation(), Mesh::mvert, NULL, SWAP, Mesh::totface, Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by PE_mirror_x().
int mesh_get_x_mirror_vert | ( | Object * | ob, |
int | index | ||
) |
Definition at line 894 of file meshtools.c.
References Object::data, ME_EDIT_MIRROR_TOPO, mesh_get_x_mirror_vert_spacial(), and mesh_get_x_mirror_vert_topo().
Referenced by do_weight_paint_vertex(), ED_vgroup_mirror(), envelope_bone_weighting(), heat_bone_weighting(), mesh_get_x_mirror_faces(), object_shape_key_mirror(), and wpaint_fill().
static int mesh_get_x_mirror_vert_spacial | ( | Object * | ob, |
int | index | ||
) | [static] |
Definition at line 872 of file meshtools.c.
References MVert::co, Object::data, mesh_octree_table(), Mesh::mvert, and NULL.
Referenced by mesh_get_x_mirror_vert().
static int mesh_get_x_mirror_vert_topo | ( | Object * | ob, |
int | index | ||
) | [static] |
Definition at line 886 of file meshtools.c.
References MirrTopoStore_t::index_lookup, and mesh_mirrtopo_table().
Referenced by mesh_get_x_mirror_vert().
int mesh_mirrtopo_table | ( | Object * | ob, |
char | mode | ||
) |
Definition at line 856 of file meshtools.c.
References Object::data, ED_mesh_mirrtopo_free(), ED_mesh_mirrtopo_init(), ED_mesh_mirrtopo_recalc_check(), FALSE, mesh_mirrtopo_table(), and Object::mode.
Referenced by ED_editors_exit(), ED_object_exit_editmode(), editmesh_get_x_mirror_vert_topo(), free_editMesh(), mesh_get_x_mirror_vert_topo(), mesh_mirrtopo_table(), and set_wpaint().
static void mesh_octree_add_node | ( | MocNode ** | bt, |
intptr_t | index | ||
) | [static] |
Definition at line 644 of file meshtools.c.
References MocNode::index, MEM_callocN(), MOC_NODE_RES, and NULL.
Referenced by mesh_octree_add_nodes().
static void mesh_octree_add_nodes | ( | MocNode ** | basetable, |
float * | co, | ||
float * | offs, | ||
float * | div, | ||
intptr_t | index | ||
) | [static] |
Definition at line 676 of file meshtools.c.
References CLAMP(), floorf, mesh_octree_add_node(), MOC_INDEX, MOC_RES, and MOC_THRESH.
Referenced by mesh_octree_table().
Definition at line 724 of file meshtools.c.
References EditVert::co, compare_v3v3(), MOC_NODE_RES, MOC_THRESH, and NULL.
Referenced by mesh_octree_table().
static void mesh_octree_free_node | ( | MocNode ** | bt | ) | [static] |
Definition at line 664 of file meshtools.c.
References MEM_freeN().
Referenced by mesh_octree_table().
static int mesh_octree_get_base_offs | ( | float * | co, |
float * | offs, | ||
float * | div | ||
) | [static] |
Definition at line 629 of file meshtools.c.
References CLAMP(), and MOC_RES.
Referenced by mesh_octree_table().
Definition at line 761 of file meshtools.c.
References MVert::co, EditVert::co, Object::data, DO_MINMAX, Mesh::edit_mesh, ListBase::first, INIT_MINMAX, max, MEM_callocN(), MEM_freeN(), mesh_octree_add_nodes(), mesh_octree_find_index(), mesh_octree_free_node(), mesh_octree_get_base_offs(), mesh_octree_table(), MeshOctree, min, MOC_RES, MOC_THRESH, mul_v3_fl(), Mesh::mvert, EditVert::next, NULL, sub_v3_v3v3(), VECCOPY, and EditMesh::verts.
Referenced by add_verts_to_dgroups(), ED_editors_exit(), ED_object_exit_editmode(), editmesh_get_x_mirror_vert_spacial(), free_editMesh(), mesh_get_x_mirror_faces(), mesh_get_x_mirror_vert_spacial(), mesh_octree_table(), object_shape_key_mirror(), set_wpaint(), and special_aftertrans_update().
static int mirror_facecmp | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 1047 of file meshtools.c.
References mirror_facerotation().
Referenced by mesh_get_x_mirror_faces().
static unsigned int mirror_facehash | ( | const void * | ptr | ) | [static] |
Definition at line 1023 of file meshtools.c.
References MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by mesh_get_x_mirror_faces(), and mirror_facecmp().
float div[3] |
Definition at line 756 of file meshtools.c.
Referenced by BLI_turbulence(), BLI_turbulence1(), boxsampleclip(), bsdf_oren_nayar_setup(), clip_line_plane(), compress_deepsamples(), hoco_to_zco(), isect_line_line_v2(), isect_line_line_v2_int(), load_fluidsimspeedvectors(), p_barycentric_2d(), p_intersect_line_2d_dir(), point_behind_tria2d(), precache_resolution(), ray_shadow_jitter(), ray_trace_shadow_rad(), RE_zbuf_accumulate_vecblur(), scopes_update(), shade_input_calc_viewco(), speedvector_project(), strand_project_point(), texnoise(), UI_view2d_region_to_view(), uiDrawBoxShade(), uiDrawBoxVerticalShade(), and viewpixel_to_lampbuf().
MirrTopoStore_t mesh_topo_store = {NULL, -1. -1, -1} |
Definition at line 851 of file meshtools.c.
struct { ... } MeshOctree [static] |
Referenced by mesh_octree_table().
float offs[3] |
Definition at line 756 of file meshtools.c.
Referenced by bglPolygonOffset(), displist_apply_allverts(), displist_get_allverts(), DM_calc_auto_bump_scale(), ed_marker_move_apply(), ed_marker_move_modal(), extrude_repeat_mesh_exec(), GenerateSharedVerticesIndexListSlow(), hammersley_create(), mg_distNoiseTex(), mg_HTerrainTex(), mg_mFractalOrfBmTex(), mg_ridgedOrHybridMFTex(), mixed_bones_object_selectbuffer(), new_mem_element(), new_pgn_element(), save_render_result_tile(), shadeDA_tile(), voronoiTex(), widget_numslider(), zbuffer_transp_shade(), and zbufshade_tile().
Definition at line 755 of file meshtools.c.
Referenced by avi_fetchibuf(), Filter::device_update(), DP_energy(), RE_Database_FromScene_Vectors(), and retargetArctoArcAggresive().