forked from bartvdbraak/blender
add back clear skin operator, removed with sticky by mistake.
This commit is contained in:
parent
816f01463a
commit
7f351d3b96
@ -810,6 +810,42 @@ void MESH_OT_customdata_clear_mask(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* Clear Skin */
|
||||
static int mesh_customdata_clear_skin_poll(bContext *C)
|
||||
{
|
||||
Object *ob = ED_object_context(C);
|
||||
|
||||
if (ob && ob->type == OB_MESH) {
|
||||
Mesh *me = ob->data;
|
||||
if (me->id.lib == NULL) {
|
||||
CustomData *data = GET_CD_DATA(me, vdata);
|
||||
if (CustomData_has_layer(data, CD_MVERT_SKIN)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
static int mesh_customdata_clear_skin_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MVERT_SKIN);
|
||||
}
|
||||
|
||||
void MESH_OT_customdata_clear_skin(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Clear Skin Data";
|
||||
ot->idname = "MESH_OT_customdata_clear_skin";
|
||||
ot->description = "Clear vertex skin layer";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = mesh_customdata_clear_skin_exec;
|
||||
ot->poll = mesh_customdata_clear_skin_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/************************** Add Geometry Layers *************************/
|
||||
|
||||
void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
|
||||
|
@ -189,6 +189,7 @@ void MESH_OT_vertex_color_add(struct wmOperatorType *ot);
|
||||
void MESH_OT_vertex_color_remove(struct wmOperatorType *ot);
|
||||
/* no create_mask yet */
|
||||
void MESH_OT_customdata_clear_mask(struct wmOperatorType *ot);
|
||||
void MESH_OT_customdata_clear_skin(struct wmOperatorType *ot);
|
||||
|
||||
void MESH_OT_drop_named_image(struct wmOperatorType *ot);
|
||||
|
||||
|
@ -143,6 +143,7 @@ void ED_operatortypes_mesh(void)
|
||||
WM_operatortype_append(MESH_OT_vertex_color_add);
|
||||
WM_operatortype_append(MESH_OT_vertex_color_remove);
|
||||
WM_operatortype_append(MESH_OT_customdata_clear_mask);
|
||||
WM_operatortype_append(MESH_OT_customdata_clear_skin);
|
||||
WM_operatortype_append(MESH_OT_drop_named_image);
|
||||
|
||||
WM_operatortype_append(MESH_OT_edgering_select);
|
||||
|
Loading…
Reference in New Issue
Block a user