fix [#28961] FCurves.range() returns wrong values for one-point curves (sic!)
authorCampbell Barton <ideasman42@gmail.com>
Mon, 24 Oct 2011 12:26:14 +0000 (12:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 24 Oct 2011 12:26:14 +0000 (12:26 +0000)
also fix for case where verts were treated as found but were infact not because none were selected.

source/blender/blenkernel/intern/action.c

index ac0697d..e46e2df 100644 (file)
@@ -137,14 +137,19 @@ void make_local_action(bAction *act)
        
        // XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default
        if ((act->id.flag & LIB_FAKEUSER) && (act->id.us<=1)) {
        
        // XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default
        if ((act->id.flag & LIB_FAKEUSER) && (act->id.us<=1)) {
-               id_clear_lib_data(&bmain->action, (ID *)act);
+               act->id.lib= NULL;
+               act->id.flag= LIB_LOCAL;
+               new_id(&bmain->action, (ID *)act, NULL);
                return;
        }
        
        BKE_animdata_main_cb(bmain, make_localact_init_cb, &mlac);
        
        if (mlac.local && mlac.lib==0) {
                return;
        }
        
        BKE_animdata_main_cb(bmain, make_localact_init_cb, &mlac);
        
        if (mlac.local && mlac.lib==0) {
-               id_clear_lib_data(&bmain->action, (ID *)act);
+               act->id.lib= NULL;
+               act->id.flag= LIB_LOCAL;
+               //make_local_action_channels(act);
+               new_id(&bmain->action, (ID *)act, NULL);
        }
        else if (mlac.local && mlac.lib) {
                mlac.actn= copy_action(act);
        }
        else if (mlac.local && mlac.lib) {
                mlac.actn= copy_action(act);