Bugfix for [#7018] Hiding, unhiding a spot lamp and then setting it to buf shadow...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 31 Aug 2007 23:23:38 +0000 (23:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 31 Aug 2007 23:23:38 +0000 (23:23 +0000)
buttons were not redrawing so it was possible to use them without an active object, this crashed blender.

source/blender/src/editobject.c

index c4736a84837dfe6dad7c84c7a9866600407ad2c1..757ca322bddc77f2074c094a8c921d1943b4b7d9 100644 (file)
@@ -5486,14 +5486,17 @@ int object_data_is_libdata(Object *ob)
 void hide_objects(int select)
 {
        Base *base;
 void hide_objects(int select)
 {
        Base *base;
-       int changed = 0;
+       short changed = 0, changed_act = 0;
        for(base = FIRSTBASE; base; base=base->next){
                if(TESTBASELIB(base)==select){
                        base->flag &= ~SELECT;
                        base->object->flag = base->flag;
                        base->object->restrictflag |= OB_RESTRICT_VIEW;
                        changed = 1;
        for(base = FIRSTBASE; base; base=base->next){
                if(TESTBASELIB(base)==select){
                        base->flag &= ~SELECT;
                        base->object->flag = base->flag;
                        base->object->restrictflag |= OB_RESTRICT_VIEW;
                        changed = 1;
-                       if (base==BASACT) BASACT= NULL;
+                       if (base==BASACT) {
+                               BASACT= NULL;
+                               changed_act = 1;
+                       }
                }
        }
        if (changed) {
                }
        }
        if (changed) {
@@ -5502,6 +5505,12 @@ void hide_objects(int select)
                DAG_scene_sort(G.scene);
                allqueue(REDRAWVIEW3D,0);
                allqueue(REDRAWOOPS,0);
                DAG_scene_sort(G.scene);
                allqueue(REDRAWVIEW3D,0);
                allqueue(REDRAWOOPS,0);
+               allqueue(REDRAWDATASELECT,0);
+               if (changed_act) { /* these spaces depend on the active object */
+                       allqueue(REDRAWBUTSALL,0);
+                       allqueue(REDRAWIPO,0);
+                       allqueue(REDRAWACTION,0);
+               }
                countall();
        }
 }
                countall();
        }
 }