Merged changes in the trunk up to revision 45383.
[blender.git] / source / blender / editors / mesh / editmesh_select.c
index 355d64a9fe19f7fdf96bf490d7ba481c54690131..0cf27c613812971c9917bc85ae62c70db9b0002e 100644 (file)
@@ -683,6 +683,7 @@ static EnumPropertyItem prop_similar_types[] = {
        {SIMEDGE_CREASE, "CREASE", 0, "Crease", ""},
        {SIMEDGE_SEAM, "SEAM", 0, "Seam", ""},
        {SIMEDGE_SHARP, "SHARP", 0, "Sharpness", ""},
+       {SIMEDGE_FREESTYLE, "FREESTYLE_EDGE", 0, "Freestyle Edge Marks", ""},
 
        {SIMFACE_MATERIAL, "MATERIAL", 0, "Material", ""},
        {SIMFACE_IMAGE, "IMAGE", 0, "Image", ""},
@@ -690,6 +691,7 @@ static EnumPropertyItem prop_similar_types[] = {
        {SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""},
        {SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""},
        {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""},
+       {SIMFACE_FREESTYLE, "FREESTYLE_FACE", 0, "Freestyle Face Marks", ""},
 
        {0, NULL, 0, NULL, NULL}
 };
@@ -850,7 +852,7 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *UNUS
                        }
                }
                else if (em->selectmode & SCE_SELECT_FACE) {
-                       for (a = SIMFACE_MATERIAL; a <= SIMFACE_COPLANAR; a++) {
+                       for (a = SIMFACE_MATERIAL; a <= SIMFACE_FREESTYLE; a++) {
                                RNA_enum_items_add_value(&item, &totitem, prop_similar_types, a);
                        }
                }
@@ -1174,6 +1176,9 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
                case EDGE_MODE_TAG_SHARP:
                        BM_elem_flag_set(e, BM_ELEM_SMOOTH, !val);
                        break;
+               case EDGE_MODE_TAG_FREESTYLE:
+                       BM_elem_flag_set(e, BM_ELEM_FREESTYLE, val);
+                       break;
                case EDGE_MODE_TAG_CREASE:
                {
                        float *crease = CustomData_bmesh_get(&em->bm->edata, e->head.data, CD_CREASE);
@@ -1198,6 +1203,8 @@ static int edgetag_context_check(Scene *scene, BMEditMesh *em, BMEdge *e)
                        return BM_elem_flag_test(e, BM_ELEM_SEAM);
                case EDGE_MODE_TAG_SHARP:
                        return !BM_elem_flag_test(e, BM_ELEM_SMOOTH);
+               case EDGE_MODE_TAG_FREESTYLE:
+                       return !BM_elem_flag_test(e, BM_ELEM_FREESTYLE);
                case EDGE_MODE_TAG_CREASE:
                        return BM_elem_float_data_get(&em->bm->edata, e, CD_CREASE) ? 1 : 0;
                case EDGE_MODE_TAG_BEVEL:
@@ -1409,6 +1416,9 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
                        case EDGE_MODE_TAG_BEVEL:
                                me->drawflag |= ME_DRAWBWEIGHTS;
                                break;
+                       case EDGE_MODE_TAG_FREESTYLE:
+                               me->drawflag |= ME_DRAW_FREESTYLE_EDGE;
+                               break;
                }
                
                EDBM_update_generic(C, em, FALSE);