2.5: Two Bugfixes
authorJoshua Leung <aligorith@gmail.com>
Fri, 11 Sep 2009 09:09:54 +0000 (09:09 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 11 Sep 2009 09:09:54 +0000 (09:09 +0000)
* Mesh Deform modifier now correctly shows Bind/Unbind buttons. Previously, only Bind got shown...

* Selecting keyframes in the Graph Editor using Border Select now allows the keyframes to be editable afterwards. Previously, the curves weren't getting selected afterwards, therefore, the poll operators would skip those curves.

release/ui/buttons_data_modifier.py
source/blender/editors/space_graph/graph_select.c
source/blender/makesrna/intern/rna_modifier.c

index 2835f55f71ada0e7f5fcbcb5eecd439244fabbba..754e8ce106e4e494e42f88d102769fb965e5aa6d 100644 (file)
@@ -242,10 +242,13 @@ class DATA_PT_modifiers(DataButtonsPanel):
 
                layout.itemS()
                
-               layout.itemO("object.meshdeform_bind", text="Bind")
-               row = layout.row()
-               row.itemR(md, "precision")
-               row.itemR(md, "dynamic")
+               if md.is_bound:
+                       layout.itemO("object.meshdeform_bind", text="Unbind")
+               else:
+                       layout.itemO("object.meshdeform_bind", text="Bind")
+                       row = layout.row()
+                       row.itemR(md, "precision")
+                       row.itemR(md, "dynamic")
                
        def MIRROR(self, layout, ob, md):
                layout.itemR(md, "merge_limit")
index 43f3586231502edf57bc7cc67462c10d9d0fa924..728c9310a47f6572b5a31558231e8205be05503d 100644 (file)
@@ -234,6 +234,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
        /* loop over data, doing border select */
        for (ale= anim_data.first; ale; ale= ale->next) {
                AnimData *adt= ANIM_nla_mapping_get(ac, ale);
+               FCurve *fcu= (FCurve *)ale->key_data;
                
                /* set horizontal range (if applicable) */
                if (mode != BEZT_OK_VALUERANGE) {
@@ -253,7 +254,13 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
                }
                
                /* select keyframes that are in the appropriate places */
-               ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL);
+               ANIM_fcurve_keys_bezier_loop(&bed, fcu, ok_cb, select_cb, NULL);
+               
+               /* select the curve too 
+                * NOTE: this should really only happen if the curve got touched...
+                */
+               if (selectmode == SELECT_ADD)
+                       fcu->flag |= FCURVE_SELECTED;
        }
        
        /* cleanup */
index 28223d2f80b7dce609d9338b92875b3273c2d5c5..32e34559f1fffd9cbaeee1be3abe7477c2b4d378 100644 (file)
@@ -384,6 +384,11 @@ static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value)
        modifier_object_set(&((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value);
 }
 
+static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr)
+{
+       return (((MeshDeformModifierData*)ptr->data)->bindcos != NULL);
+}
+
 static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr)
 {
        Object *ob= (Object*)ptr->id.data;
@@ -1368,7 +1373,12 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna)
        RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL);
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
-
+       
+       prop= RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL);
+       RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage.");
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       
        prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP);
        RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence.");