Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/mesh_data.c
| Show First 20 Lines • Show All 1,008 Lines • ▼ Show 20 Lines | void MESH_OT_customdata_custom_splitnormals_add(wmOperatorType *ot) | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| static int mesh_customdata_custom_splitnormals_clear_exec(bContext *C, wmOperator *UNUSED(op)) | static int mesh_customdata_custom_splitnormals_clear_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Mesh *me = ED_mesh_context(C); | Mesh *me = ED_mesh_context(C); | ||||
| if (BKE_mesh_has_custom_loop_normals(me)) { | if (BKE_mesh_has_custom_loop_normals(me)) { | ||||
| if (me->edit_mesh) { | |||||
| BKE_lnor_spacearr_clear(me->edit_mesh->bm->lnor_spacearr); | |||||
| } | |||||
| return mesh_customdata_clear_exec__internal(C, BM_LOOP, CD_CUSTOMLOOPNORMAL); | return mesh_customdata_clear_exec__internal(C, BM_LOOP, CD_CUSTOMLOOPNORMAL); | ||||
| } | } | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
mont29: I think this should be the proper solution yes, it will also save some useless memory usage. | |||||
| } | } | ||||
| void MESH_OT_customdata_custom_splitnormals_clear(wmOperatorType *ot) | void MESH_OT_customdata_custom_splitnormals_clear(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Clear Custom Split Normals Data"; | ot->name = "Clear Custom Split Normals Data"; | ||||
| ot->idname = "MESH_OT_customdata_custom_splitnormals_clear"; | ot->idname = "MESH_OT_customdata_custom_splitnormals_clear"; | ||||
| ot->description = "Remove the custom split normals layer, if it exists"; | ot->description = "Remove the custom split normals layer, if it exists"; | ||||
| ▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines | |||||
I think this should be the proper solution yes, it will also save some useless memory usage.