Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_edgehash.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_report.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_mesh.h"
#include "ED_object.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "RE_render_ext.h"
#include "mesh_intern.h"
Go to the source code of this file.
Definition in file mesh_data.c.
static void copy_editface_active_customdata | ( | EditMesh * | em, |
int | type, | ||
int | index | ||
) | [static] |
Definition at line 165 of file mesh_data.c.
References CustomData_em_get_n(), CustomData_em_set_n(), CustomData_get_active_layer(), EditFace::data, data, EditMesh::faces, EditMesh::fdata, ListBase::first, and EditFace::next.
Referenced by ED_mesh_color_add(), and ED_mesh_uv_texture_add().
static void delete_customdata_layer | ( | bContext * | C, |
Object * | ob, | ||
CustomDataLayer * | layer | ||
) | [static] |
Definition at line 74 of file mesh_data.c.
References CD_MCOL, CustomData_free_layer_active(), CustomData_get_active_layer_index(), CustomData_get_clone_layer_index(), CustomData_get_layer_index(), CustomData_get_render_layer_index(), CustomData_get_stencil_layer_index(), CustomData_has_layer(), CustomData_set_layer_active(), CustomData_set_layer_clone(), CustomData_set_layer_render(), CustomData_set_layer_stencil(), CustomDataLayer::data, data, Object::data, ED_object_toggle_modes(), Mesh::edit_mesh, EM_free_data_layer(), Mesh::fdata, EditMesh::fdata, i, CustomData::layers, mesh_update_customdata_pointers(), Object::mode, OB_MODE_VERTEX_PAINT, Mesh::totface, CustomData::totlayer, and CustomDataLayer::type.
Referenced by ED_mesh_color_remove(), ED_mesh_color_remove_named(), and ED_mesh_uv_texture_remove().
static int drop_named_image_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 352 of file mesh_data.c.
References BKE_add_image_file(), BKE_report(), CTX_data_main(), CTX_data_scene(), CTX_wm_view3d(), Object::data, ED_uvedit_assign_image(), ED_view3d_give_base_under_cursor(), Mesh::edit_mesh, FILE_MAX, find_id(), View3D::flag2, free_editMesh(), load_editMesh(), make_editMesh(), MAX_ID_NAME, MEM_freeN(), wmEvent::mval, NC_GEOM, ND_DATA, NULL, OB_MESH, Base::object, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_string_get(), RNA_struct_property_is_set(), RPT_ERROR, Object::type, V3D_SOLID_TEX, and WM_event_add_notifier().
Referenced by MESH_OT_drop_named_image().
void ED_mesh_calc_normals | ( | Mesh * | me | ) |
Definition at line 745 of file mesh_data.c.
References mesh_calc_normals(), Mesh::mface, Mesh::mvert, NULL, Mesh::totface, and Mesh::totvert.
int ED_mesh_color_add | ( | bContext * | C, |
Scene * | UNUSEDscene, | ||
Object * | UNUSEDob, | ||
Mesh * | me, | ||
const char * | name, | ||
int | active_set | ||
) |
Definition at line 237 of file mesh_data.c.
References CD_DEFAULT, CD_DUPLICATE, CD_MCOL, copy_editface_active_customdata(), CustomData_add_layer_named(), CustomData_number_of_layers(), CustomData_set_layer_active(), DAG_id_tag_update(), Mesh::edit_mesh, EM_add_data_layer(), Mesh::fdata, EditMesh::fdata, Mesh::id, MAX_MCOL, Mesh::mcol, mesh_update_customdata_pointers(), NC_GEOM, ND_DATA, NULL, Mesh::totface, and WM_event_add_notifier().
Definition at line 279 of file mesh_data.c.
References CD_MCOL, CustomData_get_active_layer_index(), DAG_id_tag_update(), data, delete_customdata_layer(), Mesh::edit_mesh, Mesh::fdata, EditMesh::fdata, Mesh::id, CustomData::layers, NC_GEOM, ND_DATA, NULL, and WM_event_add_notifier().
Referenced by vertex_color_remove_exec().
Definition at line 298 of file mesh_data.c.
References CD_MCOL, CustomData_get_named_layer_index(), DAG_id_tag_update(), data, delete_customdata_layer(), Mesh::edit_mesh, Mesh::fdata, EditMesh::fdata, Mesh::id, CustomData::layers, NC_GEOM, ND_DATA, NULL, and WM_event_add_notifier().
Referenced by output_toggle_exec().
void ED_mesh_edges_add | ( | Mesh * | mesh, |
ReportList * | reports, | ||
int | count | ||
) |
Definition at line 725 of file mesh_data.c.
References BKE_report(), Mesh::edit_mesh, mesh_add_edges(), and RPT_ERROR.
void ED_mesh_faces_add | ( | Mesh * | mesh, |
ReportList * | reports, | ||
int | count | ||
) |
Definition at line 715 of file mesh_data.c.
References BKE_report(), Mesh::edit_mesh, mesh_add_faces(), and RPT_ERROR.
void ED_mesh_transform | ( | Mesh * | me, |
float * | mat | ||
) |
Definition at line 627 of file mesh_data.c.
References MVert::co, i, mesh_calc_normals(), Mesh::mface, mul_m4_v3(), Mesh::mvert, NULL, Mesh::totface, and Mesh::totvert.
Definition at line 586 of file mesh_data.c.
References BKE_mesh_calc_edges(), DAG_id_tag_update(), Mesh::id, mesh_calc_normals(), Mesh::mface, Mesh::mvert, NC_GEOM, ND_DATA, NULL, Mesh::totedge, Mesh::totface, Mesh::totvert, and WM_event_add_notifier().
Definition at line 176 of file mesh_data.c.
References CD_DEFAULT, CD_DUPLICATE, CD_MTFACE, copy_editface_active_customdata(), CustomData_add_layer_named(), CustomData_number_of_layers(), CustomData_set_layer_active(), DAG_id_tag_update(), Mesh::edit_mesh, EM_add_data_layer(), Mesh::fdata, EditMesh::fdata, Mesh::id, MAX_MTFACE, mesh_update_customdata_pointers(), Mesh::mtface, NC_GEOM, ND_DATA, NULL, Mesh::totface, and WM_event_add_notifier().
Referenced by uv_texture_add_exec().
Definition at line 218 of file mesh_data.c.
References CD_MTFACE, CustomData_get_active_layer_index(), DAG_id_tag_update(), data, delete_customdata_layer(), Mesh::edit_mesh, Mesh::fdata, EditMesh::fdata, Mesh::id, CustomData::layers, NC_GEOM, ND_DATA, NULL, and WM_event_add_notifier().
Referenced by uv_texture_remove_exec().
void ED_mesh_vertices_add | ( | Mesh * | mesh, |
ReportList * | reports, | ||
int | count | ||
) |
Definition at line 735 of file mesh_data.c.
References BKE_report(), Mesh::edit_mesh, mesh_add_verts(), and RPT_ERROR.
static int layers_poll | ( | bContext * | C | ) | [static] |
Definition at line 319 of file mesh_data.c.
References Object::data, data, ED_object_context(), Object::id, ID::lib, NULL, OB_MESH, and Object::type.
Referenced by MESH_OT_drop_named_image(), MESH_OT_sticky_add(), MESH_OT_sticky_remove(), MESH_OT_uv_texture_add(), MESH_OT_uv_texture_remove(), MESH_OT_vertex_color_add(), and MESH_OT_vertex_color_remove().
static void mesh_add_edges | ( | Mesh * | mesh, |
int | len | ||
) | [static] |
Definition at line 638 of file mesh_data.c.
References CD_CALLOC, CD_DEFAULT, CD_MASK_MESH, CD_MEDGE, CustomData_add_layer(), CustomData_copy(), CustomData_copy_data(), CustomData_free(), CustomData_has_layer(), MEdge::flag, i, len(), ME_EDGEDRAW, ME_EDGERENDER, Mesh::medge, mesh_update_customdata_pointers(), NULL, SELECT, and Mesh::totedge.
Referenced by ED_mesh_edges_add().
static void mesh_add_faces | ( | Mesh * | mesh, |
int | len | ||
) | [static] |
Definition at line 668 of file mesh_data.c.
References CD_CALLOC, CD_DEFAULT, CD_MASK_MESH, CD_MFACE, CustomData_add_layer(), CustomData_copy(), CustomData_copy_data(), CustomData_free(), CustomData_has_layer(), Mesh::fdata, MFace::flag, i, len(), ME_FACE_SEL, mesh_update_customdata_pointers(), Mesh::mface, NULL, and Mesh::totface.
Referenced by ED_mesh_faces_add().
static void mesh_add_verts | ( | Mesh * | mesh, |
int | len | ||
) | [static] |
Definition at line 597 of file mesh_data.c.
References CD_CALLOC, CD_DEFAULT, CD_MASK_MESH, CD_MVERT, CustomData_add_layer(), CustomData_copy(), CustomData_copy_data(), CustomData_free(), CustomData_has_layer(), MVert::flag, i, len(), mesh_update_customdata_pointers(), Mesh::mvert, NULL, SELECT, and Mesh::totvert.
Referenced by ED_mesh_vertices_add().
void MESH_OT_drop_named_image | ( | wmOperatorType * | ot | ) |
Definition at line 417 of file mesh_data.c.
References wmOperatorType::description, drop_named_image_invoke(), FILE_MAX, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, layers_poll(), MAX_ID_NAME, wmOperatorType::name, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_mesh().
void MESH_OT_sticky_add | ( | wmOperatorType * | ot | ) |
Definition at line 537 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and sticky_add_exec().
Referenced by ED_operatortypes_mesh().
void MESH_OT_sticky_remove | ( | wmOperatorType * | ot | ) |
Definition at line 569 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and sticky_remove_exec().
Referenced by ED_operatortypes_mesh().
void MESH_OT_uv_texture_add | ( | wmOperatorType * | ot | ) |
Definition at line 337 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and uv_texture_add_exec().
Referenced by ED_operatortypes_mesh().
void MESH_OT_uv_texture_remove | ( | wmOperatorType * | ot | ) |
Definition at line 447 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and uv_texture_remove_exec().
Referenced by ED_operatortypes_mesh().
void MESH_OT_vertex_color_add | ( | wmOperatorType * | ot | ) |
Definition at line 476 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and vertex_color_add_exec().
Referenced by ED_operatortypes_mesh().
void MESH_OT_vertex_color_remove | ( | wmOperatorType * | ot | ) |
Definition at line 502 of file mesh_data.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, layers_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and vertex_color_remove_exec().
Referenced by ED_operatortypes_mesh().
static int sticky_add_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 519 of file mesh_data.c.
References CTX_data_scene(), CTX_wm_view3d(), DAG_id_tag_update(), Object::data, ED_object_context(), Mesh::id, NC_GEOM, ND_DATA, OPERATOR_FINISHED, RE_make_sticky(), and WM_event_add_notifier().
Referenced by MESH_OT_sticky_add().
static int sticky_remove_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 552 of file mesh_data.c.
References CD_MSTICKY, CustomData_free_layer_active(), DAG_id_tag_update(), Object::data, ED_object_context(), Mesh::id, Mesh::msticky, NC_GEOM, ND_DATA, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, Mesh::totvert, and WM_event_add_notifier().
Referenced by MESH_OT_sticky_remove().
static int uv_texture_add_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 326 of file mesh_data.c.
References Object::data, ED_mesh_uv_texture_add(), ED_object_context(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, and TRUE.
Referenced by MESH_OT_uv_texture_add().
static int uv_texture_remove_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 436 of file mesh_data.c.
References Object::data, ED_mesh_uv_texture_remove(), ED_object_context(), OPERATOR_CANCELLED, and OPERATOR_FINISHED.
Referenced by MESH_OT_uv_texture_remove().
static int vertex_color_add_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 464 of file mesh_data.c.
References CTX_data_scene(), Object::data, ED_mesh_color_add(), ED_object_context(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, and TRUE.
Referenced by MESH_OT_vertex_color_add().
static int vertex_color_remove_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 491 of file mesh_data.c.
References Object::data, ED_mesh_color_remove(), ED_object_context(), OPERATOR_CANCELLED, and OPERATOR_FINISHED.
Referenced by MESH_OT_vertex_color_remove().