Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mesh/editmesh_intersect.c
| Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static void edbm_intersect_ui(bContext *UNUSED(C), wmOperator *op) | static void edbm_intersect_ui(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| uiLayout *layout = op->layout; | uiLayout *layout = op->layout; | ||||
| uiLayout *row; | uiLayout *row; | ||||
| PointerRNA ptr; | |||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | bool use_exact = RNA_enum_get(op->ptr, "solver") == ISECT_SOLVER_EXACT; | ||||
| bool use_exact = RNA_enum_get(&ptr, "solver") == ISECT_SOLVER_EXACT; | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetPropDecorate(layout, false); | uiLayoutSetPropDecorate(layout, false); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, &ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, op->ptr, "mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, &ptr, "separate_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, op->ptr, "separate_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, op->ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| if (!use_exact) { | if (!use_exact) { | ||||
| uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "threshold", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| void MESH_OT_intersect(struct wmOperatorType *ot) | void MESH_OT_intersect(struct wmOperatorType *ot) | ||||
| { | { | ||||
| static const EnumPropertyItem isect_mode_items[] = { | static const EnumPropertyItem isect_mode_items[] = { | ||||
| {ISECT_SEL, "SELECT", 0, "Self Intersect", "Self intersect selected faces"}, | {ISECT_SEL, "SELECT", 0, "Self Intersect", "Self intersect selected faces"}, | ||||
| {ISECT_SEL_UNSEL, | {ISECT_SEL_UNSEL, | ||||
| ▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static void edbm_intersect_boolean_ui(bContext *UNUSED(C), wmOperator *op) | static void edbm_intersect_boolean_ui(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| uiLayout *layout = op->layout; | uiLayout *layout = op->layout; | ||||
| uiLayout *row; | uiLayout *row; | ||||
| PointerRNA ptr; | |||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| bool use_exact = RNA_enum_get(&ptr, "solver") == ISECT_SOLVER_EXACT; | bool use_exact = RNA_enum_get(op->ptr, "solver") == ISECT_SOLVER_EXACT; | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetPropDecorate(layout, false); | uiLayoutSetPropDecorate(layout, false); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, &ptr, "operation", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, op->ptr, "operation", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, &ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(row, op->ptr, "solver", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| uiItemR(layout, &ptr, "use_swap", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "use_swap", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "use_self", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "use_self", 0, NULL, ICON_NONE); | ||||
| if (!use_exact) { | if (!use_exact) { | ||||
| uiItemR(layout, &ptr, "threshold", 0, NULL, ICON_NONE); | uiItemR(layout, op->ptr, "threshold", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| void MESH_OT_intersect_boolean(struct wmOperatorType *ot) | void MESH_OT_intersect_boolean(struct wmOperatorType *ot) | ||||
| { | { | ||||
| static const EnumPropertyItem isect_boolean_operation_items[] = { | static const EnumPropertyItem isect_boolean_operation_items[] = { | ||||
| {BMESH_ISECT_BOOLEAN_ISECT, "INTERSECT", 0, "Intersect", ""}, | {BMESH_ISECT_BOOLEAN_ISECT, "INTERSECT", 0, "Intersect", ""}, | ||||
| {BMESH_ISECT_BOOLEAN_UNION, "UNION", 0, "Union", ""}, | {BMESH_ISECT_BOOLEAN_UNION, "UNION", 0, "Union", ""}, | ||||
| ▲ Show 20 Lines • Show All 651 Lines • Show Last 20 Lines | |||||