Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_knife_project.c
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| #include "mesh_intern.h" /* own include */ | #include "mesh_intern.h" /* own include */ | ||||
| static LinkNode *knifeproject_poly_from_object(const bContext *C, | static LinkNode *knifeproject_poly_from_object(const bContext *C, | ||||
| Scene *scene, | Scene *scene, | ||||
| Object *ob, | Object *ob, | ||||
| LinkNode *polys) | LinkNode *polys) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| ARegion *ar = CTX_wm_region(C); | ARegion *ar = CTX_wm_region(C); | ||||
| struct Mesh *me_eval; | struct Mesh *me_eval; | ||||
| bool me_eval_needs_free; | bool me_eval_needs_free; | ||||
| if (ob->type == OB_MESH || ob->runtime.mesh_eval) { | if (ob->type == OB_MESH || ob->runtime.mesh_eval) { | ||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| me_eval = ob_eval->runtime.mesh_eval; | me_eval = ob_eval->runtime.mesh_eval; | ||||
| if (me_eval == NULL) { | if (me_eval == NULL) { | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | void MESH_OT_knife_project(wmOperatorType *ot) | ||||
| ot->idname = "MESH_OT_knife_project"; | ot->idname = "MESH_OT_knife_project"; | ||||
| ot->description = "Use other objects outlines & boundaries to project knife cuts"; | ot->description = "Use other objects outlines & boundaries to project knife cuts"; | ||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->exec = knifeproject_exec; | ot->exec = knifeproject_exec; | ||||
| ot->poll = ED_operator_editmesh_region_view3d; | ot->poll = ED_operator_editmesh_region_view3d; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; | ||||
| /* parameters */ | /* parameters */ | ||||
| RNA_def_boolean(ot->srna, | RNA_def_boolean(ot->srna, | ||||
| "cut_through", | "cut_through", | ||||
| false, | false, | ||||
| "Cut through", | "Cut through", | ||||
| "Cut through all faces, not just visible ones"); | "Cut through all faces, not just visible ones"); | ||||
| } | } | ||||