Merging r50149 through r50156 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Aug 2012 13:51:41 +0000 (13:51 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Aug 2012 13:51:41 +0000 (13:51 +0000)
release/scripts/startup/bl_operators/wm.py
source/blender/blenkernel/intern/customdata.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/ikplugin/SConscript
source/blender/makesrna/intern/rna_sequencer.c

index a81733fe59cb15dadff0eaeb0c810b4e516c76ba..b34c427c4a17eb068e7198483ddc8b285f997804 100644 (file)
@@ -790,7 +790,7 @@ class WM_OT_path_open(Operator):
             return {'CANCELLED'}
 
         if sys.platform[:3] == "win":
-            subprocess.Popen(["start", filepath], shell=True)
+            os.startfile(filepath)
         elif sys.platform == "darwin":
             subprocess.Popen(["open", filepath])
         else:
index b04bd5bc47fcd4e9646de4e417d728ad305751c4..d4e23c365e8bf72acdcedaf30a3f50157d1474b4 100644 (file)
@@ -99,7 +99,7 @@ typedef struct LayerTypeInfo {
         *    (there should be (sub element count)^2 weights per element)
         * count gives the number of elements in sources
         */
-       void (*interp)(void **sources, float *weights, float *sub_weights,
+       void (*interp)(void **sources, const float *weights, const float *sub_weights,
                       int count, void *dest);
 
        /* a function to swap the data in corners of the element */
@@ -203,8 +203,8 @@ static void linklist_free_simple(void *link)
        MEM_freeN(link);
 }
 
-static void layerInterp_mdeformvert(void **sources, float *weights,
-                                    float *UNUSED(sub_weights), int count, void *dest)
+static void layerInterp_mdeformvert(void **sources, const float *weights,
+                                    const float *UNUSED(sub_weights), int count, void *dest)
 {
        MDeformVert *dvert = dest;
        LinkNode *dest_dw = NULL; /* a list of lists of MDeformWeight pointers */
@@ -261,8 +261,8 @@ static void layerInterp_mdeformvert(void **sources, float *weights,
 }
 
 
-static void layerInterp_msticky(void **sources, float *weights,
-                                float *UNUSED(sub_weights), int count, void *dest)
+static void layerInterp_msticky(void **sources, const float *weights,
+                                const float *UNUSED(sub_weights), int count, void *dest)
 {
        float co[2], w;
        MSticky *mst;
@@ -291,13 +291,13 @@ static void layerCopy_tface(const void *source, void *dest, int count)
                dest_tf[i] = source_tf[i];
 }
 
-static void layerInterp_tface(void **sources, float *weights,
-                              float *sub_weights, int count, void *dest)
+static void layerInterp_tface(void **sources, const float *weights,
+                              const float *sub_weights, int count, void *dest)
 {
        MTFace *tf = dest;
        int i, j, k;
        float uv[4][2] = {{0.0f}};
-       float *sub_weight;
+       const float *sub_weight;
 
        if (count <= 0) return;
 
@@ -392,13 +392,13 @@ static void layerCopy_origspace_face(const void *source, void *dest, int count)
                dest_tf[i] = source_tf[i];
 }
 
-static void layerInterp_origspace_face(void **sources, float *weights,
-                                       float *sub_weights, int count, void *dest)
+static void layerInterp_origspace_face(void **sources, const float *weights,
+                                       const float *sub_weights, int count, void *dest)
 {
        OrigSpaceFace *osf = dest;
        int i, j, k;
        float uv[4][2] = {{0.0f}};
-       float *sub_weight;
+       const float *sub_weight;
 
        if (count <= 0) return;
 
@@ -680,12 +680,12 @@ static void layerDefault_mloopcol(void *data, int count)
 
 }
 
-static void layerInterp_mloopcol(void **sources, float *weights,
-                                 float *sub_weights, int count, void *dest)
+static void layerInterp_mloopcol(void **sources, const float *weights,
+                                 const float *sub_weights, int count, void *dest)
 {
        MLoopCol *mc = dest;
        int i;
-       float *sub_weight;
+       const float *sub_weight;
        struct {
                float a;
                float r;
@@ -768,8 +768,8 @@ static void layerAdd_mloopuv(void *data1, void *data2)
        add_v2_v2(l1->uv, l2->uv);
 }
 
-static void layerInterp_mloopuv(void **sources, float *weights,
-                                float *sub_weights, int count, void *dest)
+static void layerInterp_mloopuv(void **sources, const float *weights,
+                                const float *sub_weights, int count, void *dest)
 {
        MLoopUV *mluv = dest;
        float *uv = mluv->uv;
@@ -838,8 +838,8 @@ static void layerAdd_mloop_origspace(void *data1, void *data2)
        add_v2_v2(l1->uv, l2->uv);
 }
 
-static void layerInterp_mloop_origspace(void **sources, float *weights,
-                                        float *sub_weights, int count, void *dest)
+static void layerInterp_mloop_origspace(void **sources, const float *weights,
+                                        const float *sub_weights, int count, void *dest)
 {
        OrigSpaceLoop *mluv = dest;
        float *uv = mluv->uv;
@@ -866,8 +866,8 @@ static void layerInterp_mloop_origspace(void **sources, float *weights,
 }
 /* --- end copy */
 
-static void layerInterp_mcol(void **sources, float *weights,
-                             float *sub_weights, int count, void *dest)
+static void layerInterp_mcol(void **sources, const float *weights,
+                             const float *sub_weights, int count, void *dest)
 {
        MCol *mc = dest;
        int i, j, k;
@@ -878,7 +878,7 @@ static void layerInterp_mcol(void **sources, float *weights,
                float b;
        } col[4] = {{0.0f}};
 
-       float *sub_weight;
+       const float *sub_weight;
 
        if (count <= 0) return;
        
@@ -946,8 +946,8 @@ static void layerDefault_mcol(void *data, int count)
        }
 }
 
-static void layerInterp_bweight(void **sources, float *weights,
-                                float *UNUSED(sub_weights), int count, void *dest)
+static void layerInterp_bweight(void **sources, const float *weights,
+                                const float *UNUSED(sub_weights), int count, void *dest)
 {
        float *f = dest;
        float **in = (float **)sources;
@@ -969,8 +969,8 @@ static void layerInterp_bweight(void **sources, float *weights,
        }
 }
 
-static void layerInterp_shapekey(void **sources, float *weights,
-                                 float *UNUSED(sub_weights), int count, void *dest)
+static void layerInterp_shapekey(void **sources, const float *weights,
+                                 const float *UNUSED(sub_weights), int count, void *dest)
 {
        float *co = dest;
        float **in = (float **)sources;
@@ -1003,8 +1003,8 @@ static void layerDefault_mvert_skin(void *data, int count)
        }
 }
 
-static void layerInterp_mvert_skin(void **sources, float *weights,
-                                   float *UNUSED(sub_weights),
+static void layerInterp_mvert_skin(void **sources, const float *weights,
+                                   const float *UNUSED(sub_weights),
                                    int count, void *dest)
 {
        float radius[3], w;
index 164885016519019975fb0b962a50df5c70d45bb8..9033436d1b281697667840421078d48c9a97569a 100644 (file)
@@ -46,7 +46,7 @@
 #include "intern/bmesh_private.h"
 
 /* edge and vertex share, currently theres no need to have different logic */
-static void bm_data_interp_from_elem(BMesh *bm, BMElem *ele1, BMElem *ele2, BMElem *ele_dst, const float fac)
+static void bm_data_interp_from_elem(CustomData *data_layer, BMElem *ele1, BMElem *ele2, BMElem *ele_dst, const float fac)
 {
        if (ele1->head.data && ele2->head.data) {
                /* first see if we can avoid interpolation */
@@ -55,8 +55,8 @@ static void bm_data_interp_from_elem(BMesh *bm, BMElem *ele1, BMElem *ele2, BMEl
                                /* do nothing */
                        }
                        else {
-                               CustomData_bmesh_free_block(&bm->vdata, &ele_dst->head.data);
-                               CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, ele1->head.data, &ele_dst->head.data);
+                               CustomData_bmesh_free_block(data_layer, &ele_dst->head.data);
+                               CustomData_bmesh_copy_data(data_layer, data_layer, ele1->head.data, &ele_dst->head.data);
                        }
                }
                else if (fac >= 1.0f) {
@@ -64,8 +64,8 @@ static void bm_data_interp_from_elem(BMesh *bm, BMElem *ele1, BMElem *ele2, BMEl
                                /* do nothing */
                        }
                        else {
-                               CustomData_bmesh_free_block(&bm->vdata, &ele_dst->head.data);
-                               CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, ele2->head.data, &ele_dst->head.data);
+                               CustomData_bmesh_free_block(data_layer, &ele_dst->head.data);
+                               CustomData_bmesh_copy_data(data_layer, data_layer, ele2->head.data, &ele_dst->head.data);
                        }
                }
                else {
@@ -76,7 +76,7 @@ static void bm_data_interp_from_elem(BMesh *bm, BMElem *ele1, BMElem *ele2, BMEl
                        src[1] = ele2->head.data;
                        w[0] = 1.0f - fac;
                        w[1] = fac;
-                       CustomData_bmesh_interp(&bm->vdata, src, w, NULL, 2, ele_dst->head.data);
+                       CustomData_bmesh_interp(data_layer, src, w, NULL, 2, ele_dst->head.data);
                }
        }
 }
@@ -90,7 +90,7 @@ static void bm_data_interp_from_elem(BMesh *bm, BMElem *ele1, BMElem *ele2, BMEl
  */
 void BM_data_interp_from_verts(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v, const float fac)
 {
-       bm_data_interp_from_elem(bm, (BMElem *)v1, (BMElem *)v2, (BMElem *)v, fac);
+       bm_data_interp_from_elem(&bm->vdata, (BMElem *)v1, (BMElem *)v2, (BMElem *)v, fac);
 }
 
 /**
@@ -102,7 +102,7 @@ void BM_data_interp_from_verts(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v, con
  */
 void BM_data_interp_from_edges(BMesh *bm, BMEdge *e1, BMEdge *e2, BMEdge *e, const float fac)
 {
-       bm_data_interp_from_elem(bm, (BMElem *)e1, (BMElem *)e2, (BMElem *)e, fac);
+       bm_data_interp_from_elem(&bm->edata, (BMElem *)e1, (BMElem *)e2, (BMElem *)e, fac);
 }
 
 /**
index f0d2cb183b59a8aaad8a5760b131c3489a40d3fc..39567a5b00b4d2e65a7aeb262d649b05dc993c36 100644 (file)
@@ -838,6 +838,7 @@ static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to)
        /* (3) add a new controller */
        if (WM_operator_name_call(C, "LOGIC_OT_controller_add", WM_OP_EXEC_DEFAULT, NULL) & OPERATOR_FINISHED) {
                cont = (bController *)ob->controllers.last;
+               cont->type = CONT_LOGIC_AND; /* Quick fix to make sure we always have an AND controller. It might be nicer to make sure the operator gives us the right one though... */
 
                /* (4) link the sensor->controller->actuator */
                tmp_but = MEM_callocN(sizeof(uiBut), "uiBut");
index 6bd2ac75226b6446e2880e8f29818d1480318803..07b53b1cf7f9493d7a25c0551c3b83d73e41eca6 100644 (file)
@@ -2098,7 +2098,7 @@ void MESH_OT_remove_doubles(wmOperatorType *ot)
        RNA_def_float(ot->srna, "mergedist", 0.0001f, 0.000001f, 50.0f, 
                      "Merge Distance",
                      "Minimum distance between elements to merge", 0.00001, 10.0);
-       RNA_def_boolean(ot->srna, "use_unselected", 1, "Unselected", "Merge selected to other unselected vertices");
+       RNA_def_boolean(ot->srna, "use_unselected", 0, "Unselected", "Merge selected to other unselected vertices");
 }
 
 /************************ Vertex Path Operator *************************/
index a52b9c179dbdc083836255b39537b50ec1b9bf86..f49e63683e2559115944edd153b1596639844164 100644 (file)
@@ -2363,8 +2363,8 @@ static int find_next_prev_edit(Scene *scene, int cfra,
 }
 
 static int strip_jump_internal(Scene *scene,
-                                   const short side,
-                                   const short do_skip_mute, const short do_center)
+                               const short side,
+                               const short do_skip_mute, const short do_center)
 {
        int change = FALSE;
        int cfra = CFRA;
index 38c53894df8e60e34e4d1868cd706fbdc9e184a1..97b1cf18e0d862d79fadb6f64bc2e20ebd0e97c0 100644 (file)
@@ -7,5 +7,6 @@ incs = '#/intern/guardedalloc #/intern/iksolver/extern ../makesdna ../blenlib'
 incs += ' ../blenkernel ../include ../ikplugin #/intern/itasc #/extern/Eigen3'
 
 defs.append('WITH_IK_ITASC')
+defs.append('WITH_IK_SOLVER')
 
 env.BlenderLib ( 'bf_ikplugin', sources, Split(incs), defs, libtype=['core','player'], priority=[180, 190] )
index aeb72553bf76f0aa2dbb2a54456ce99197e1d50b..bdee89308cfa4fbd06b2b69d62e42444002700b1 100644 (file)
@@ -76,6 +76,7 @@ EnumPropertyItem sequence_modifier_type_items[] = {
 typedef struct SequenceSearchData {
        Sequence *seq;
        void *data;
+       SequenceModifierData *smd;
 } SequenceSearchData;
 
 /* build a temp reference to the parent */
@@ -743,6 +744,7 @@ static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
 
        if (seq->strip && seq->strip->color_balance == data->data) {
                data->seq = seq;
+               data->smd = NULL;
                return -1; /* done so bail out */
        }
 
@@ -755,6 +757,7 @@ static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
 
                                if (&cbmd->color_balance == data->data) {
                                        data->seq = seq;
+                                       data->smd = smd;
                                        return -1; /* done so bail out */
                                }
                        }
@@ -764,27 +767,39 @@ static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt)
        return 1;
 }
 
-static Sequence *sequence_get_by_colorbalance(Editing *ed, StripColorBalance *cb)
+static Sequence *sequence_get_by_colorbalance(Editing *ed, StripColorBalance *cb, SequenceModifierData **smd_r)
 {
        SequenceSearchData data;
 
        data.seq = NULL;
+       data.smd = NULL;
        data.data = cb;
 
        /* irritating we need to search for our sequence! */
        BKE_sequencer_base_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data);
 
+       *smd_r = data.smd;
+
        return data.seq;
 }
 
 static char *rna_SequenceColorBalance_path(PointerRNA *ptr)
 {
        Scene *scene = ptr->id.data;
+       SequenceModifierData *smd;
        Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
-       Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data);
+       Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
 
-       if (seq && seq->name + 2)
-               return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name + 2);
+       if (seq && seq->name + 2) {
+               if (!smd) {
+                       /* path to old filter color balance */
+                       return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name + 2);
+               }
+               else {
+                       /* path to modifier */
+                       return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].modifiers[\"%s\"].color_balance", seq->name + 2, smd->name);
+               }
+       }
        else
                return BLI_strdup("");
 }
@@ -793,9 +808,10 @@ static void rna_SequenceColorBalance_update(Main *UNUSED(bmain), Scene *UNUSED(s
 {
        Scene *scene = (Scene *) ptr->id.data;
        Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
-       Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data);
+       SequenceModifierData *smd;
+       Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd);
 
-       if (seq->strip->color_balance == ptr->data)
+       if (smd == NULL)
                BKE_sequence_invalidate_cache(scene, seq);
        else
                BKE_sequence_invalidate_cache_for_modifier(scene, seq);
@@ -943,8 +959,8 @@ static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value)
        if (adt) {
                char path[1024];
 
-               BLI_snprintf(path, sizeof(path), "sequence_editor.sequences_all[\"%s\"].modifiers", seq->name);
-               BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, path, oldname, smd->name + 2, 0, 0, 1);
+               BLI_snprintf(path, sizeof(path), "sequence_editor.sequences_all[\"%s\"].modifiers", seq->name + 2);
+               BKE_animdata_fix_paths_rename(&scene->id, adt, NULL, path, oldname, smd->name, 0, 0, 1);
        }
 }
 
@@ -1239,6 +1255,8 @@ static void rna_def_color_balance(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Saturation", "");
        RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_ColorBabalnce_update");
 #endif
+
+       RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
 }
 
 static void rna_def_strip_color_balance(BlenderRNA *brna)
@@ -1248,8 +1266,6 @@ static void rna_def_strip_color_balance(BlenderRNA *brna)
        srna = RNA_def_struct(brna, "SequenceColorBalance", "SequenceColorBalanceData");
        RNA_def_struct_ui_text(srna, "Sequence Color Balance", "Color balance parameters for a sequence strip");
        RNA_def_struct_sdna(srna, "StripColorBalance");
-
-       RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path");
 }
 
 EnumPropertyItem blend_mode_items[] = {