Fix for Freestyle edge/face marks not working with most modifiers (except for Subdivi...
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Wed, 27 Mar 2013 02:06:36 +0000 (02:06 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Wed, 27 Mar 2013 02:06:36 +0000 (02:06 +0000)
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/mesh.c

index 2118bbcd42b358e16fa5952e08390e8dd3b6d88c..9fb700183d990aafb991d50426e3e820f789b878 100644 (file)
@@ -1168,7 +1168,8 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
 
 
 const CustomDataMask CD_MASK_BAREMESH =
 
 
 const CustomDataMask CD_MASK_BAREMESH =
-    CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE | CD_MASK_MLOOP | CD_MASK_MPOLY | CD_MASK_BWEIGHT;
+    CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE | CD_MASK_MLOOP | CD_MASK_MPOLY | CD_MASK_BWEIGHT |
+    CD_MASK_FREESTYLE_EDGE | CD_MASK_FREESTYLE_FACE;
 const CustomDataMask CD_MASK_MESH =
     CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE |
     CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL |
 const CustomDataMask CD_MASK_MESH =
     CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE |
     CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE | CD_MASK_MCOL |
index 408fadde5642fb501de95275456d5ac7012618b9..4c963969797f3970f5f0e4a9e31d6af8d280f584 100644 (file)
@@ -2636,6 +2636,16 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
                }
        }
 
                }
        }
 
+#ifdef WITH_FREESTYLE
+       if (CustomData_has_layer(pdata, CD_FREESTYLE_FACE)) {
+               FreestyleEdge *poly_ffa = CustomData_get_layer(pdata, CD_FREESTYLE_FACE);
+               FreestyleEdge *face_ffa = CustomData_add_layer(fdata, CD_FREESTYLE_FACE, CD_CALLOC, NULL, totface);
+               for (mface_index = 0; mface_index < totface; mface_index++) {
+                       face_ffa[mface_index] = poly_ffa[mface_to_poly_map[mface_index]];
+               }
+       }
+#endif
+
        mf = mface;
        for (mface_index = 0; mface_index < totface; mface_index++, mf++) {
 
        mf = mface;
        for (mface_index = 0; mface_index < totface; mface_index++, mf++) {