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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-20 11:57:26 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-20 11:57:26 +0400
commita462d69bbf771e49d2fa49589608c375376b42ed (patch)
tree60d85d4131399a0a39dbc582e30a7144b14edc18 /source/blender/bmesh
parentd433cd65f7127d60e17d05a824290423ad226eae (diff)
Another big patch set by Bastien Montagne, thanks a lot!
* Made Freestyle optional (turned on by default). * Fix for missing bpath.c updates in the previous merge of trunk changes.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/CMakeLists.txt4
-rw-r--r--source/blender/bmesh/SConscript3
-rw-r--r--source/blender/bmesh/bmesh_class.h2
-rw-r--r--source/blender/bmesh/intern/bmesh_construct.c14
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.h4
-rw-r--r--source/blender/bmesh/operators/bmo_similar.c4
6 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index c41b0703240..f80dbc45926 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -130,4 +130,8 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_FREESTYLE)
+ add_definitions(-DWITH_FREESTYLE)
+endif()
+
blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/bmesh/SConscript b/source/blender/bmesh/SConscript
index 722b7518630..ee2380084ca 100644
--- a/source/blender/bmesh/SConscript
+++ b/source/blender/bmesh/SConscript
@@ -51,4 +51,7 @@ if env['WITH_BF_BULLET']:
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
+if env['WITH_BF_FREESTYLE']:
+ defs.append('WITH_FREESTYLE')
+
env.BlenderLib ( libname = 'bf_bmesh', sources = sources, includes = Split(incs), libtype = ['core','player'], defines=defs, priority=[100, 100], compileflags=cflags )
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h
index a2613f46bf8..5af9690b47e 100644
--- a/source/blender/bmesh/bmesh_class.h
+++ b/source/blender/bmesh/bmesh_class.h
@@ -246,7 +246,9 @@ enum {
/* spare tag, assumed dirty, use define in each function to name based on use */
// _BM_ELEM_TAG_ALT = (1 << 6), // UNUSED
+#ifdef WITH_FREESTYLE
BM_ELEM_FREESTYLE = (1 << 6), /* used for Freestyle faces and edges */
+#endif
BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging,
* since tools may want to tag verts and
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index 229a7caebfd..d23443daa7f 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -981,7 +981,11 @@ char BM_edge_flag_from_mflag(const short meflag)
((meflag & ME_EDGEDRAW) ? BM_ELEM_DRAW : 0) |
((meflag & ME_SHARP) == 0 ? BM_ELEM_SMOOTH : 0) | /* invert */
((meflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0) |
+#ifdef WITH_FREESTYLE
((meflag & ME_FREESTYLE_EDGE) ? BM_ELEM_FREESTYLE : 0)
+#else
+ 0
+#endif
);
}
char BM_face_flag_from_mflag(const char meflag)
@@ -989,7 +993,11 @@ char BM_face_flag_from_mflag(const char meflag)
return ( ((meflag & ME_FACE_SEL) ? BM_ELEM_SELECT : 0) |
((meflag & ME_SMOOTH) ? BM_ELEM_SMOOTH : 0) |
((meflag & ME_HIDE) ? BM_ELEM_HIDDEN : 0) |
+#ifdef WITH_FREESTYLE
((meflag & ME_FREESTYLE_FACE) ? BM_ELEM_FREESTYLE : 0)
+#else
+ 0
+#endif
);
}
@@ -1012,7 +1020,9 @@ short BM_edge_flag_to_mflag(BMEdge *eed)
((hflag & BM_ELEM_DRAW) ? ME_EDGEDRAW : 0) |
((hflag & BM_ELEM_SMOOTH) == 0 ? ME_SHARP : 0) |
((hflag & BM_ELEM_HIDDEN) ? ME_HIDE : 0) |
+#ifdef WITH_FREESTYLE
((hflag & BM_ELEM_FREESTYLE) ? ME_FREESTYLE_EDGE : 0) |
+#endif
((BM_edge_is_wire(eed)) ? ME_LOOSEEDGE : 0) | /* not typical */
ME_EDGERENDER
);
@@ -1024,6 +1034,10 @@ char BM_face_flag_to_mflag(BMFace *efa)
return ( ((hflag & BM_ELEM_SELECT) ? ME_FACE_SEL : 0) |
((hflag & BM_ELEM_SMOOTH) ? ME_SMOOTH : 0) |
((hflag & BM_ELEM_HIDDEN) ? ME_HIDE : 0) |
+#ifdef WITH_FREESTYLE
((hflag & BM_ELEM_FREESTYLE) ? ME_FREESTYLE_FACE : 0)
+#else
+ 0
+#endif
);
}
diff --git a/source/blender/bmesh/intern/bmesh_operators.h b/source/blender/bmesh/intern/bmesh_operators.h
index c98c3eae50b..16b38c340ff 100644
--- a/source/blender/bmesh/intern/bmesh_operators.h
+++ b/source/blender/bmesh/intern/bmesh_operators.h
@@ -61,7 +61,9 @@ enum {
SIMFACE_PERIMETER,
SIMFACE_NORMAL,
SIMFACE_COPLANAR,
+#ifdef WITH_FREESTYLE
SIMFACE_FREESTYLE
+#endif
};
/* similar edge selection slot values */
@@ -74,7 +76,9 @@ enum {
SIMEDGE_BEVEL,
SIMEDGE_SEAM,
SIMEDGE_SHARP,
+#ifdef WITH_FREESTYLE
SIMEDGE_FREESTYLE
+#endif
};
/* similar vertex selection slot values */
diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c
index 78b6ebb4bd7..a8cc152bd4e 100644
--- a/source/blender/bmesh/operators/bmo_similar.c
+++ b/source/blender/bmesh/operators/bmo_similar.c
@@ -245,12 +245,14 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op)
cont = FALSE;
}
break;
+#ifdef WITH_FREESTYLE
case SIMFACE_FREESTYLE:
if (BM_elem_flag_test(fm, BM_ELEM_FREESTYLE) == BM_elem_flag_test(fs, BM_ELEM_FREESTYLE)) {
BMO_elem_flag_enable(bm, fm, FACE_MARK);
cont = FALSE;
}
break;
+#endif
default:
BLI_assert(0);
}
@@ -469,12 +471,14 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
cont = FALSE;
}
break;
+#ifdef WITH_FREESTYLE
case SIMEDGE_FREESTYLE:
if (BM_elem_flag_test(e, BM_ELEM_FREESTYLE) == BM_elem_flag_test(es, BM_ELEM_FREESTYLE)) {
BMO_elem_flag_enable(bm, e, EDGE_MARK);
cont = FALSE;
}
break;
+#endif
default:
BLI_assert(0);
}