Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_path.c27
-rw-r--r--source/blender/editors/mesh/editmesh_select_similar.c32
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c57
-rw-r--r--source/blender/editors/mesh/mesh_intern.h6
-rw-r--r--source/blender/editors/mesh/mesh_ops.c9
5 files changed, 71 insertions, 60 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index 42f722dcdaa..06c41b78c37 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -28,8 +28,9 @@
#include "DNA_mesh_types.h"
#include "DNA_windowmanager_types.h"
-// for freestyle edge mark.
-#include "DNA_meshdata_types.h"
+#ifdef WITH_FREESTYLE
+# include "DNA_meshdata_types.h"
+#endif
#include "BLI_math.h"
#include "BLI_linklist.h"
@@ -300,10 +301,12 @@ static bool edgetag_test_cb(BMEdge *e, void *user_data_v)
return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? true : false;
case EDGE_MODE_TAG_BEVEL:
return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? true : false;
+#ifdef WITH_FREESTYLE
case EDGE_MODE_TAG_FREESTYLE: {
- LanprEdge *fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_LANPR_EDGE);
- return (!fed) ? false : (fed->flag & LANPR_EDGE_MARK) ? true : false;
+ FreestyleEdge *fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_FREESTYLE_EDGE);
+ return (!fed) ? false : (fed->flag & FREESTYLE_EDGE_MARK) ? true : false;
}
+#endif
}
return 0;
}
@@ -329,17 +332,19 @@ static void edgetag_set_cb(BMEdge *e, bool val, void *user_data_v)
case EDGE_MODE_TAG_BEVEL:
BM_elem_float_data_set(&bm->edata, e, CD_BWEIGHT, (val) ? 1.0f : 0.0f);
break;
+#ifdef WITH_FREESTYLE
case EDGE_MODE_TAG_FREESTYLE: {
- LanprEdge *fed;
- fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_LANPR_EDGE);
+ FreestyleEdge *fed;
+ fed = CustomData_bmesh_get(&bm->edata, e->head.data, CD_FREESTYLE_EDGE);
if (!val) {
- fed->flag &= ~LANPR_EDGE_MARK;
+ fed->flag &= ~FREESTYLE_EDGE_MARK;
}
else {
- fed->flag |= LANPR_EDGE_MARK;
+ fed->flag |= FREESTYLE_EDGE_MARK;
}
break;
}
+#endif
}
}
@@ -354,11 +359,13 @@ static void edgetag_ensure_cd_flag(Mesh *me, const char edge_mode)
case EDGE_MODE_TAG_BEVEL:
BM_mesh_cd_flag_ensure(bm, me, ME_CDFLAG_EDGE_BWEIGHT);
break;
+#ifdef WITH_FREESTYLE
case EDGE_MODE_TAG_FREESTYLE:
- if (!CustomData_has_layer(&bm->edata, CD_LANPR_EDGE)) {
- BM_data_layer_add(bm, &bm->edata, CD_LANPR_EDGE);
+ if (!CustomData_has_layer(&bm->edata, CD_FREESTYLE_EDGE)) {
+ BM_data_layer_add(bm, &bm->edata, CD_FREESTYLE_EDGE);
}
break;
+#endif
default:
break;
}
diff --git a/source/blender/editors/mesh/editmesh_select_similar.c b/source/blender/editors/mesh/editmesh_select_similar.c
index 02ec903dcdf..2782cc92aca 100644
--- a/source/blender/editors/mesh/editmesh_select_similar.c
+++ b/source/blender/editors/mesh/editmesh_select_similar.c
@@ -233,7 +233,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
break;
}
case SIMFACE_FREESTYLE: {
- if (!CustomData_has_layer(&bm->pdata, CD_LANPR_FACE)) {
+ if (!CustomData_has_layer(&bm->pdata, CD_FREESTYLE_FACE)) {
face_data_value |= SIMFACE_DATA_FALSE;
continue;
}
@@ -297,9 +297,9 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
break;
}
case SIMFACE_FREESTYLE: {
- LanprFace *fface;
- fface = CustomData_bmesh_get(&bm->pdata, face->head.data, CD_LANPR_FACE);
- if ((fface == NULL) || ((fface->flag & LANPR_FACE_MARK) == 0)) {
+ FreestyleFace *fface;
+ fface = CustomData_bmesh_get(&bm->pdata, face->head.data, CD_FREESTYLE_FACE);
+ if ((fface == NULL) || ((fface->flag & FREESTYLE_FACE_MARK) == 0)) {
face_data_value |= SIMFACE_DATA_FALSE;
}
else {
@@ -357,7 +357,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
break;
}
case SIMFACE_FREESTYLE: {
- has_custom_data_layer = CustomData_has_layer(&bm->pdata, CD_LANPR_FACE);
+ has_custom_data_layer = CustomData_has_layer(&bm->pdata, CD_FREESTYLE_FACE);
if ((face_data_value == SIMFACE_DATA_TRUE) && !has_custom_data_layer) {
continue;
}
@@ -459,7 +459,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
}
break;
case SIMFACE_FREESTYLE: {
- LanprFace *fface;
+ FreestyleFace *fface;
if (!has_custom_data_layer) {
BLI_assert(face_data_value == SIMFACE_DATA_FALSE);
@@ -467,8 +467,8 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
break;
}
- fface = CustomData_bmesh_get(&bm->pdata, face->head.data, CD_LANPR_FACE);
- if (((fface != NULL) && (fface->flag & LANPR_FACE_MARK)) ==
+ fface = CustomData_bmesh_get(&bm->pdata, face->head.data, CD_FREESTYLE_FACE);
+ if (((fface != NULL) && (fface->flag & FREESTYLE_FACE_MARK)) ==
((face_data_value & SIMFACE_DATA_TRUE) != 0)) {
select = true;
}
@@ -687,7 +687,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
switch (type) {
case SIMEDGE_FREESTYLE: {
- if (!CustomData_has_layer(&bm->edata, CD_LANPR_EDGE)) {
+ if (!CustomData_has_layer(&bm->edata, CD_FREESTYLE_EDGE)) {
edge_data_value |= SIMEDGE_DATA_FALSE;
continue;
}
@@ -745,9 +745,9 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
}
break;
case SIMEDGE_FREESTYLE: {
- LanprEdge *fedge;
- fedge = CustomData_bmesh_get(&bm->edata, edge->head.data, CD_LANPR_EDGE);
- if ((fedge == NULL) || ((fedge->flag & LANPR_EDGE_MARK) == 0)) {
+ FreestyleEdge *fedge;
+ fedge = CustomData_bmesh_get(&bm->edata, edge->head.data, CD_FREESTYLE_EDGE);
+ if ((fedge == NULL) || ((fedge->flag & FREESTYLE_EDGE_MARK) == 0)) {
edge_data_value |= SIMEDGE_DATA_FALSE;
}
else {
@@ -790,7 +790,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
bool has_custom_data_layer = false;
switch (type) {
case SIMEDGE_FREESTYLE: {
- has_custom_data_layer = CustomData_has_layer(&bm->edata, CD_LANPR_EDGE);
+ has_custom_data_layer = CustomData_has_layer(&bm->edata, CD_FREESTYLE_EDGE);
if ((edge_data_value == SIMEDGE_DATA_TRUE) && !has_custom_data_layer) {
continue;
}
@@ -877,7 +877,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
}
break;
case SIMEDGE_FREESTYLE: {
- LanprEdge *fedge;
+ FreestyleEdge *fedge;
if (!has_custom_data_layer) {
BLI_assert(edge_data_value == SIMEDGE_DATA_FALSE);
@@ -885,8 +885,8 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
break;
}
- fedge = CustomData_bmesh_get(&bm->edata, edge->head.data, CD_LANPR_EDGE);
- if (((fedge != NULL) && (fedge->flag & LANPR_EDGE_MARK)) ==
+ fedge = CustomData_bmesh_get(&bm->edata, edge->head.data, CD_FREESTYLE_EDGE);
+ if (((fedge != NULL) && (fedge->flag & FREESTYLE_EDGE_MARK)) ==
((edge_data_value & SIMEDGE_DATA_TRUE) != 0)) {
select = true;
}
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 0c4db012786..e5023068100 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -7413,18 +7413,17 @@ void MESH_OT_symmetry_snap(struct wmOperatorType *ot)
/** \} */
-/* preserve the edge marking capability */
-//#ifdef WITH_FREESTYLE
+#ifdef WITH_FREESTYLE
/* -------------------------------------------------------------------- */
/** \name Mark Edge (Freestyle) Operator
* \{ */
-static int edbm_mark_lanpr_edge_exec(bContext *C, wmOperator *op)
+static int edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op)
{
BMEdge *eed;
BMIter iter;
- LanprEdge *fed;
+ FreestyleEdge *fed;
const bool clear = RNA_boolean_get(op->ptr, "clear");
ViewLayer *view_layer = CTX_data_view_layer(C);
@@ -7445,23 +7444,23 @@ static int edbm_mark_lanpr_edge_exec(bContext *C, wmOperator *op)
continue;
}
- if (!CustomData_has_layer(&em->bm->edata, CD_LANPR_EDGE)) {
- BM_data_layer_add(em->bm, &em->bm->edata, CD_LANPR_EDGE);
+ if (!CustomData_has_layer(&em->bm->edata, CD_FREESTYLE_EDGE)) {
+ BM_data_layer_add(em->bm, &em->bm->edata, CD_FREESTYLE_EDGE);
}
if (clear) {
BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- fed = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_LANPR_EDGE);
- fed->flag &= ~LANPR_EDGE_MARK;
+ fed = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_FREESTYLE_EDGE);
+ fed->flag &= ~FREESTYLE_EDGE_MARK;
}
}
}
else {
BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
if (BM_elem_flag_test(eed, BM_ELEM_SELECT) && !BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
- fed = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_LANPR_EDGE);
- fed->flag |= LANPR_EDGE_MARK;
+ fed = CustomData_bmesh_get(&em->bm->edata, eed->head.data, CD_FREESTYLE_EDGE);
+ fed->flag |= FREESTYLE_EDGE_MARK;
}
}
}
@@ -7474,17 +7473,17 @@ static int edbm_mark_lanpr_edge_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void MESH_OT_mark_lanpr_edge(wmOperatorType *ot)
+void MESH_OT_mark_freestyle_edge(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
- ot->name = "Mark LANPR Edge";
- ot->description = "(Un)mark selected edges as LANPR feature edges";
- ot->idname = "MESH_OT_mark_lanpr_edge";
+ ot->name = "Mark Freestyle Edge";
+ ot->description = "(Un)mark selected edges as Freestyle feature edges";
+ ot->idname = "MESH_OT_mark_freestyle_edge";
/* api callbacks */
- ot->exec = edbm_mark_lanpr_edge_exec;
+ ot->exec = edbm_mark_freestyle_edge_exec;
ot->poll = ED_operator_editmesh;
/* flags */
@@ -7500,11 +7499,11 @@ void MESH_OT_mark_lanpr_edge(wmOperatorType *ot)
/** \name Mark Face (Freestyle) Operator
* \{ */
-static int edbm_mark_lanpr_face_exec(bContext *C, wmOperator *op)
+static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
{
BMFace *efa;
BMIter iter;
- LanprFace *ffa;
+ FreestyleFace *ffa;
const bool clear = RNA_boolean_get(op->ptr, "clear");
ViewLayer *view_layer = CTX_data_view_layer(C);
@@ -7523,23 +7522,23 @@ static int edbm_mark_lanpr_face_exec(bContext *C, wmOperator *op)
continue;
}
- if (!CustomData_has_layer(&em->bm->pdata, CD_LANPR_FACE)) {
- BM_data_layer_add(em->bm, &em->bm->pdata, CD_LANPR_FACE);
+ if (!CustomData_has_layer(&em->bm->pdata, CD_FREESTYLE_FACE)) {
+ BM_data_layer_add(em->bm, &em->bm->pdata, CD_FREESTYLE_FACE);
}
if (clear) {
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- ffa = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_LANPR_FACE);
- ffa->flag &= ~LANPR_FACE_MARK;
+ ffa = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_FREESTYLE_FACE);
+ ffa->flag &= ~FREESTYLE_FACE_MARK;
}
}
}
else {
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
- ffa = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_LANPR_FACE);
- ffa->flag |= LANPR_FACE_MARK;
+ ffa = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_FREESTYLE_FACE);
+ ffa->flag |= FREESTYLE_FACE_MARK;
}
}
}
@@ -7552,17 +7551,17 @@ static int edbm_mark_lanpr_face_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void MESH_OT_mark_lanpr_face(wmOperatorType *ot)
+void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
{
PropertyRNA *prop;
/* identifiers */
- ot->name = "Mark LANPR Face";
- ot->description = "(Un)mark selected faces for exclusion from LANPR feature edge detection";
- ot->idname = "MESH_OT_mark_lanpr_face";
+ ot->name = "Mark Freestyle Face";
+ ot->description = "(Un)mark selected faces for exclusion from Freestyle feature edge detection";
+ ot->idname = "MESH_OT_mark_freestyle_face";
/* api callbacks */
- ot->exec = edbm_mark_lanpr_face_exec;
+ ot->exec = edbm_mark_freestyle_face_exec;
ot->poll = ED_operator_editmesh;
/* flags */
@@ -7574,7 +7573,7 @@ void MESH_OT_mark_lanpr_face(wmOperatorType *ot)
/** \} */
-//#endif /* WITH_FREESTYLE */
+#endif /* WITH_FREESTYLE */
/* -------------------------------------------------------------------- */
/** \name Loop Normals Editing Tools Modal Map
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index bab5e35df53..8d340d93c0a 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -256,8 +256,10 @@ void MESH_OT_paint_mask_extract(struct wmOperatorType *ot);
struct wmKeyMap *point_normals_modal_keymap(wmKeyConfig *keyconf);
-void MESH_OT_mark_lanpr_edge(struct wmOperatorType *ot);
-void MESH_OT_mark_lanpr_face(struct wmOperatorType *ot);
+#ifdef WITH_FREESTYLE
+void MESH_OT_mark_freestyle_edge(struct wmOperatorType *ot);
+void MESH_OT_mark_freestyle_face(struct wmOperatorType *ot);
+#endif
/* *** mesh_data.c *** */
void MESH_OT_uv_texture_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index fc1c91dbeef..4105f853868 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -114,7 +114,9 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_faces_shade_smooth);
WM_operatortype_append(MESH_OT_faces_shade_flat);
WM_operatortype_append(MESH_OT_sort_elements);
- WM_operatortype_append(MESH_OT_mark_lanpr_face);
+#ifdef WITH_FREESTYLE
+ WM_operatortype_append(MESH_OT_mark_freestyle_face);
+#endif
WM_operatortype_append(MESH_OT_delete);
WM_operatortype_append(MESH_OT_delete_loose);
@@ -131,8 +133,9 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_loop_multi_select);
WM_operatortype_append(MESH_OT_mark_seam);
WM_operatortype_append(MESH_OT_mark_sharp);
- WM_operatortype_append(MESH_OT_mark_lanpr_edge);
-
+#ifdef WITH_FREESTYLE
+ WM_operatortype_append(MESH_OT_mark_freestyle_edge);
+#endif
WM_operatortype_append(MESH_OT_vertices_smooth);
WM_operatortype_append(MESH_OT_vertices_smooth_laplacian);
WM_operatortype_append(MESH_OT_flip_normals);