Revision: 21333
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21333
Author:   aligorith
Date:     2009-07-03 06:24:19 +0200 (Fri, 03 Jul 2009)

Log Message:
-----------
NLA SoC: Quick hack to get layer buttons in 3D view updating visible layers 
correctly.

Now it is possible to load old files and be able to switch layers to show/hide 
objects AND have that reflected in the Animation Editors which rely on the 
scene layers being set correctly.

Modified Paths:
--------------
    
branches/soc-2009-aligorith/source/blender/editors/space_view3d/view3d_header.c

Modified: 
branches/soc-2009-aligorith/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- 
branches/soc-2009-aligorith/source/blender/editors/space_view3d/view3d_header.c 
    2009-07-03 02:56:54 UTC (rev 21332)
+++ 
branches/soc-2009-aligorith/source/blender/editors/space_view3d/view3d_header.c 
    2009-07-03 04:24:19 UTC (rev 21333)
@@ -117,8 +117,7 @@
 #define TEST_EDITMESH  if(obedit==0) return; \
                                                if( (v3d->lay & obedit->lay)==0 
) return;
 
-/* XXX port over */
-static void handle_view3d_lock(void) {}
+/* XXX port over */    
 static void countall(void) {}
 extern void borderselect();
 static int retopo_mesh_paint_check() {return 0;}
@@ -201,6 +200,25 @@
        return NULL;
 }
 
+// XXX quickly ported across
+static void handle_view3d_lock(bContext *C) 
+{
+       Scene *scene= CTX_data_scene(C);
+       ScrArea *sa= CTX_wm_area(C);
+       View3D *v3d= (View3D *)CTX_wm_space_data(C);
+       
+       if (v3d != NULL && sa != NULL) {
+               if(v3d->localview==0 && v3d->scenelock && 
sa->spacetype==SPACE_VIEW3D) {
+                       
+                       /* copy to scene */
+                       scene->lay= v3d->lay;
+                       scene->camera= v3d->camera;
+                       
+                       //copy_view3d_lock(REDRAW);
+               }
+       }
+}
+
 /* XXX; all this context stuff...  should become operator */
 void do_layer_buttons(bContext *C, short event)
 {
@@ -230,7 +248,7 @@
                        v3d->lay= (1<<20)-1;
                }
                
-               if(v3d->scenelock) handle_view3d_lock();
+               if(v3d->scenelock) handle_view3d_lock(C);
                
                /* new layers might need unflushed events events */
                DAG_scene_update_flags(scene, v3d->lay);        /* tags all 
that moves and flushes */
@@ -266,7 +284,7 @@
        else 
                v3d->lay = (1<<nr);
        
-       if(v3d->scenelock) handle_view3d_lock();
+       if(v3d->scenelock) handle_view3d_lock(C);
        
        /* new layers might need unflushed events events */
        DAG_scene_update_flags(scene, v3d->lay);        /* tags all that moves 
and flushes */
@@ -5106,7 +5124,7 @@
                                v3d->layact= v3d->lay;
                        }
                        
-                       if(v3d->scenelock) handle_view3d_lock();
+                       if(v3d->scenelock) handle_view3d_lock(C);
                        
                        ED_area_tag_redraw(sa);
                        countall();


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to