Merging r49622 through r49623 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 6 Aug 2012 15:22:19 +0000 (15:22 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 6 Aug 2012 15:22:19 +0000 (15:22 +0000)
release/scripts/startup/bl_ui/properties_mask_common.py
source/blender/blenkernel/intern/mask.c
source/blender/makesdna/DNA_mask_types.h
source/blender/makesrna/intern/rna_mask.c
source/gameengine/Ketsji/KX_PythonInit.cpp

index e40b46fda70e8216af8abcf6b50b6c7bad5f3ebc..7cd2ae0b5095ee6e8a1fb93bc64557402efefb85 100644 (file)
@@ -127,6 +127,8 @@ class MASK_PT_spline():
         row.prop(spline, "use_cyclic")
         row.prop(spline, "use_fill")
 
+        col.prop(spline, "use_self_intersection_check")
+
 
 class MASK_PT_point():
     # subclasses must define...
index 3208862cef64378565367248a0e6d30173a124f7..4b4dcff229de16a39cc82675332ab95555328fd9 100644 (file)
@@ -779,7 +779,8 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
 
        *tot_feather_point = tot;
 
-       spline_feather_collapse_inner_loops(spline, feather, tot);
+       if (spline->flag & MASK_SPLINE_NOINTERSECT)
+               spline_feather_collapse_inner_loops(spline, feather, tot);
 
        return feather;
 }
index 63015bd56af86ab67b51e3a1be1159b8c33fc7a6..475c4168fcbce64187f24afa712b536e8d308986 100644 (file)
@@ -144,7 +144,8 @@ typedef struct MaskLayer {
 /* reserve (1 << 0) for SELECT */
 enum {
        MASK_SPLINE_CYCLIC  = (1 << 1),
-       MASK_SPLINE_NOFILL    = (1 << 2)
+       MASK_SPLINE_NOFILL  = (1 << 2),
+       MASK_SPLINE_NOINTERSECT = (1 << 3)
 };
 
 /* MaskSpline->weight_interp */
index 9ee2bb99b4e4c90b338c0b4b8574e589b16fdc79..f197bf8391d6b0b1b51238dcc78a8e062b81d57b 100644 (file)
@@ -568,6 +568,13 @@ static void rna_def_maskSpline(BlenderRNA *brna)
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MASK_SPLINE_NOFILL);
        RNA_def_property_ui_text(prop, "Fill", "Make this spline filled");
        RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
+
+       /* self-intersection check */
+       prop = RNA_def_property(srna, "use_self_intersection_check", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_NOINTERSECT);
+       RNA_def_property_ui_text(prop, "Self Intersection Check", "Prevent feather from self-intersections");
+       RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
 }
 
 static void rna_def_mask_layer(BlenderRNA *brna)
index 536b32cbd77448d3114a224d777e1316528a5c6c..a7ec1b52bd8222790a73f6d0780e641958901aaa 100644 (file)
@@ -2007,13 +2007,21 @@ void setupGamePython(KX_KetsjiEngine* ketsjiengine, KX_Scene* startscene, Main *
 
        /* could be done a lot more nicely, but for now a quick way to get bge.* working */
        PyRun_SimpleString("sys = __import__('sys');"
-                          "mod = sys.modules['bge'] = type(sys)('bge');"
-                          "mod.__dict__.update({'logic':__import__('GameLogic'), "
+                          "bge = type(sys)('bge');"
+                          "bge.__dict__.update({'logic':__import__('GameLogic'), "
                                                "'render':__import__('Rasterizer'), "
                                                "'events':__import__('GameKeys'), "
                                                "'constraints':__import__('PhysicsConstraints'), "
                                                "'types':__import__('GameTypes'), "
                                                "'texture':__import__('VideoTexture')});"
+                          /* so we can do 'import bge.foo as bar' */
+                          "sys.modules.update({'bge': bge, "
+                                              "'bge.logic':bge.logic, "
+                                              "'bge.render':bge.render, "
+                                              "'bge.events':bge.events, "
+                                              "'bge.constraints':bge.constraints, "
+                                              "'bge.types':bge.types, "
+                                              "'bge.texture':bge.texture})"
                           );
 }