117 #define GET_CD_DATA(me, data) ((me)->edit_mesh ? &(me)->edit_mesh->bm->data : &(me)->data)
122 int layer_index, tot, n;
134 n = (layer - &
data->layers[layer_index]);
173 float fac = 0.0f, dfac = 1.0f / (
float)
len;
177 for (
int i = 0; i <
len; i++) {
178 fuv[i][0] = 0.5f *
sinf(fac) + 0.5f;
179 fuv[i][1] = 0.5f *
cosf(fac) + 0.5f;
204 for (
int i = 0; i < mp->
totloop; i++) {
238 for (
int i = 0; i < me->
totpoly; i++) {
262 bool is_init =
false;
275 if (layernum_dst && do_init) {
281 if (active_set || layernum_dst == 0) {
300 if (active_set || layernum_dst == 0) {
308 if (!is_init && do_init) {
327 if (layernum_dst == 0) {
333 if (layernum_dst == 0) {
346 cdlu = (index == -1) ?
NULL : &ldata->
layers[index];
398 if (layernum && do_init) {
402 if (active_set || layernum == 0) {
420 if (active_set || layernum == 0) {
454 cdl = (index == -1) ?
NULL : &ldata->
layers[index];
504 if (layernum && do_init) {
508 if (active_set || layernum == 0) {
527 if (active_set || layernum == 0) {
561 cdl = (index == -1) ?
NULL : &vdata->
layers[index];
624 ot->
idname =
"MESH_OT_uv_texture_add";
655 ot->
name =
"Remove UV Map";
657 ot->
idname =
"MESH_OT_uv_texture_remove";
684 ot->
name =
"Add Vertex Color";
686 ot->
idname =
"MESH_OT_vertex_color_add";
711 ot->
name =
"Remove Vertex Color";
713 ot->
idname =
"MESH_OT_vertex_color_remove";
740 ot->
name =
"Add Sculpt Vertex Color";
742 ot->
idname =
"MESH_OT_sculpt_vertex_color_add";
767 ot->
name =
"Remove Sculpt Vertex Color";
769 ot->
idname =
"MESH_OT_sculpt_vertex_color_remove";
846 ot->
name =
"Clear Sculpt Mask Data";
847 ot->
idname =
"MESH_OT_customdata_mask_clear";
848 ot->
description =
"Clear vertex sculpt masking data from the mesh";
897 ot->
name =
"Add Skin Data";
898 ot->
idname =
"MESH_OT_customdata_skin_add";
922 ot->
name =
"Clear Skin Data";
923 ot->
idname =
"MESH_OT_customdata_skin_clear";
995 ot->
name =
"Add Custom Split Normals Data";
996 ot->
idname =
"MESH_OT_customdata_custom_splitnormals_add";
997 ot->
description =
"Add a custom split normals layer, if none exists yet";
1024 ot->
name =
"Clear Custom Split Normals Data";
1025 ot->
idname =
"MESH_OT_customdata_custom_splitnormals_clear";
1026 ot->
description =
"Remove the custom split normals layer, if it exists";
1073 mesh->vdata = vdata;
1080 for (
int i = 0; i <
len; i++, mvert++) {
1109 mesh->edata = edata;
1114 for (i = 0; i <
len; i++, medge++) {
1168 mesh->pdata = pdata;
1173 for (i = 0; i <
len; i++, mpoly++) {
1334 const char *elem_type;
1337 elem_type =
"vertices";
1340 elem_type =
"edges";
1343 elem_type =
"faces";
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type)
void CustomData_free(struct CustomData *data, int totelem)
int CustomData_number_of_layers(const struct CustomData *data, int type)
bool CustomData_free_layer(struct CustomData *data, int type, int totelem, int index)
void CustomData_set_layer_active(struct CustomData *data, int type, int n)
void CustomData_free_layers(struct CustomData *data, int type, int totelem)
bool CustomData_has_layer(const struct CustomData *data, int type)
bool CustomData_layertype_is_singleton(int type)
int CustomData_get_layer_index_n(const struct CustomData *data, int type, int n)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
int CustomData_get_active_layer(const struct CustomData *data, int type)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
int CustomData_get_layer_index(const struct CustomData *data, int type)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer(const struct CustomData *data, int type, const char *name)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
int CustomData_get_n_offset(const struct CustomData *data, int type, int n)
void CustomData_free_elem(struct CustomData *data, int index, int count)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, eCDAllocType alloctype, int totelem)
void CustomData_copy_data(const struct CustomData *source, struct CustomData *dest, int source_index, int dest_index, int count)
const CustomData_MeshMasks CD_MASK_MESH
void BKE_mesh_tessface_clear(struct Mesh *mesh)
bool BKE_mesh_has_custom_loop_normals(struct Mesh *me)
void BKE_mesh_ensure_skin_customdata(struct Mesh *me)
void BKE_mesh_calc_edges_loose(struct Mesh *mesh)
void BKE_edges_sharp_from_angle_set(const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges, struct MLoop *mloops, const int numLoops, struct MPoly *mpolys, const float(*polynors)[3], const int numPolys, const float split_angle)
void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr)
void BKE_mesh_calc_normals(struct Mesh *me)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd)
void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, const bool select_new_edges)
void BKE_mesh_calc_normals_poly(struct MVert *mverts, float(*r_vertnors)[3], int numVerts, const struct MLoop *mloop, const struct MPoly *mpolys, int numLoops, int numPolys, float(*r_polyNors)[3], const bool only_face_normals)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_array_alloca(arr, realsize)
void DEG_id_tag_update(struct ID *id, int flag)
#define ID_IS_LINKED(_id)
Object is a sort of wrapper for general info.
#define SCE_SELECT_VERTEX
struct Object * ED_object_context(const struct bContext *C)
struct Object * ED_object_active_context(const struct bContext *C)
bool ED_paint_proj_mesh_data_check(struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
bool ED_operator_editable_mesh(struct bContext *C)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_elem_flag_test(ele, hflag)
void BM_data_layer_free_n(BMesh *bm, CustomData *data, int type, int n)
void BM_data_layer_free(BMesh *bm, CustomData *data, int type)
void BM_data_layer_copy(BMesh *bm, CustomData *data, int type, int src_n, int dst_n)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_edges_sharp_from_angle_set(BMesh *bm, const float split_angle)
return(oflags[bm->toolflag_index].f &oflag) !=0
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
void MESH_OT_customdata_mask_clear(wmOperatorType *ot)
void ED_mesh_update(Mesh *mesh, bContext *C, bool calc_edges, bool calc_edges_loose)
bool ED_mesh_sculpt_color_remove_active(Mesh *me)
static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
void ED_mesh_edges_remove(Mesh *mesh, ReportList *reports, int count)
static bool layers_poll(bContext *C)
static void mesh_uv_reset_bmface(BMFace *f, const int cd_loop_uv_offset)
bool ED_mesh_uv_texture_remove_named(Mesh *me, const char *name)
static void mesh_remove_loops(Mesh *mesh, int len)
bool ED_mesh_color_remove_index(Mesh *me, const int n)
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char selectmode)
static int mesh_vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_customdata_skin_add(wmOperatorType *ot)
bool ED_mesh_sculpt_color_remove_named(Mesh *me, const char *name)
bool ED_mesh_sculpt_color_remove_index(Mesh *me, const int n)
static int mesh_vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_vertex_color_add(wmOperatorType *ot)
void MESH_OT_uv_texture_remove(wmOperatorType *ot)
static void mesh_uv_reset_mface(MPoly *mp, MLoopUV *mloopuv)
void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
static void mesh_add_polys(Mesh *mesh, int len)
void ED_mesh_loops_add(Mesh *mesh, ReportList *reports, int count)
static int mesh_customdata_custom_splitnormals_clear_exec(bContext *C, wmOperator *UNUSED(op))
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail)
void ED_mesh_uv_loop_reset_ex(struct Mesh *me, const int layernum)
void ED_mesh_uv_loop_reset(struct bContext *C, struct Mesh *me)
#define GET_CD_DATA(me, data)
void ED_mesh_verts_add(Mesh *mesh, ReportList *reports, int count)
static int mesh_sculpt_vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_customdata_skin_clear(wmOperatorType *ot)
static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
void ED_mesh_geometry_clear(Mesh *mesh)
static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
static void mesh_add_edges(Mesh *mesh, int len)
int ED_mesh_color_add(Mesh *me, const char *name, const bool active_set, const bool do_init)
void ED_mesh_polys_remove(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_uv_texture_ensure(struct Mesh *me, const char *name)
bool ED_mesh_uv_texture_remove_active(Mesh *me)
static bool mesh_customdata_skin_add_poll(bContext *C)
static CustomData * mesh_customdata_get_type(Mesh *me, const char htype, int *r_tot)
void ED_mesh_loops_remove(Mesh *mesh, ReportList *reports, int count)
void MESH_OT_vertex_color_remove(wmOperatorType *ot)
void MESH_OT_sculpt_vertex_color_remove(wmOperatorType *ot)
static int mesh_customdata_skin_add_exec(bContext *C, wmOperator *UNUSED(op))
static int mesh_customdata_skin_state(bContext *C)
bool ED_mesh_color_ensure(struct Mesh *me, const char *name)
bool ED_mesh_color_remove_named(Mesh *me, const char *name)
int ED_mesh_sculpt_color_add(Mesh *me, const char *name, const bool active_set, const bool do_init)
static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator *UNUSED(op))
Mesh * ED_mesh_context(struct bContext *C)
void MESH_OT_sculpt_vertex_color_add(wmOperatorType *ot)
bool ED_mesh_uv_texture_remove_index(Mesh *me, const int n)
bool ED_mesh_sculpt_color_ensure(struct Mesh *me, const char *name)
static void mesh_remove_verts(Mesh *mesh, int len)
static void mesh_add_verts(Mesh *mesh, int len)
void MESH_OT_uv_texture_add(wmOperatorType *ot)
static void mesh_add_loops(Mesh *mesh, int len)
static bool mesh_customdata_mask_clear_poll(bContext *C)
bool ED_mesh_color_remove_active(Mesh *me)
static void mesh_remove_edges(Mesh *mesh, int len)
void ED_mesh_polys_add(Mesh *mesh, ReportList *reports, int count)
void MESH_OT_customdata_custom_splitnormals_add(wmOperatorType *ot)
int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set, const bool do_init)
static bool mesh_customdata_skin_clear_poll(bContext *C)
static void mesh_remove_polys(Mesh *mesh, int len)
static int mesh_sculpt_vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
void ED_mesh_verts_remove(Mesh *mesh, ReportList *reports, int count)
static int mesh_customdata_clear_exec__internal(bContext *C, char htype, int type)
static void mesh_uv_reset_array(float **fuv, const int len)
static int mesh_customdata_mask_clear_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_customdata_custom_splitnormals_clear(wmOperatorType *ot)
static int mesh_customdata_skin_clear_exec(bContext *C, wmOperator *UNUSED(op))
struct MLoopNorSpaceArray * lnor_spacearr
struct BMEditMesh * edit_mesh
struct CustomData pdata ldata
struct MLoopCol * mloopcol
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)