Orange bug: forgot to restore inverse matrix calculus for OpengGL render
authorTon Roosendaal <ton@blender.org>
Tue, 24 Jan 2006 17:07:39 +0000 (17:07 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 24 Jan 2006 17:07:39 +0000 (17:07 +0000)
in a window... didn't know what it was for, but now I do! It uses the
inverse to do pre-clipping on objects.

source/blender/src/drawnode.c
source/blender/src/drawview.c
source/blender/src/editnode.c
source/blender/src/renderwin.c

index 7f9f13920d3458f0b8b1dfdc21a97b1a7227b8d0..17aceb24745a9d89ed16bb2575768c7b06b51701 100644 (file)
@@ -216,22 +216,23 @@ static int node_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *bu
 {
        if(block) {
                bNodeSocket *sock= node->outputs.first;         /* first socket stores value */
-               
-               /* enforce square box drawing */
-               uiBlockSetEmboss(block, UI_EMBOSSP);
-               
-               uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", 
-                                 butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, 
-                                 sock->ns.vec, 0.0f, 1.0f, 3, 0, "");
-               uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", 
-                                 butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15, 
-                                 sock->ns.vec, 0.0f, 1.0f, 2, 0, "");
-               uiDefButF(block, COL, B_NOP, "",                
-                                 butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12, 
-                                 sock->ns.vec, 0.0, 0.0, -1, 0, "");
-               /* the -1 above prevents col button to popup a color picker */
-               
-               uiBlockSetEmboss(block, UI_EMBOSS);
+               if(sock) {
+                       /* enforce square box drawing */
+                       uiBlockSetEmboss(block, UI_EMBOSSP);
+                       
+                       uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", 
+                                         butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, 
+                                         sock->ns.vec, 0.0f, 1.0f, 3, 0, "");
+                       uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", 
+                                         butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15, 
+                                         sock->ns.vec, 0.0f, 1.0f, 2, 0, "");
+                       uiDefButF(block, COL, B_NOP, "",                
+                                         butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12, 
+                                         sock->ns.vec, 0.0, 0.0, -1, 0, "");
+                       /* the -1 above prevents col button to popup a color picker */
+                       
+                       uiBlockSetEmboss(block, UI_EMBOSS);
+               }
        }
        return 30 + (int)(node->width-NODE_DY);
 }
index f5dc0f458cf42e95a3500458b4546cf6ba9b08ff..5e8cc3225eecac734dcf3f40d770c5bf3d9f5802 100644 (file)
@@ -2389,16 +2389,20 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy)
 {
        Base *base;
        Scene *setscene;
-
+       float winmat[4][4];
+       
        update_for_newframe_muted();    /* first, since camera can be animated */
 
        setwinmatrixview3d(winx, winy, NULL);
        
        setviewmatrixview3d();
        myloadmatrix(v3d->viewmat);
-//     Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat);
-//     Mat4Invert(v3d->persinv, v3d->persmat);
-//     Mat4Invert(v3d->viewinv, v3d->viewmat);
+       glMatrixMode(GL_PROJECTION);
+       mygetmatrix(winmat);
+       glMatrixMode(GL_MODELVIEW);
+       Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat);
+       Mat4Invert(v3d->persinv, v3d->persmat);
+       Mat4Invert(v3d->viewinv, v3d->viewmat);
 
        free_all_realtime_images();
        reshadeall_displist();
index ce6344b7b8df4271347b581cba014f5643adbb53..114c3983712002deace8a277bb025880c7d4271f 100644 (file)
@@ -1129,7 +1129,7 @@ static void node_add_menu(SpaceNode *snode)
        }
        else if(snode->treetype==NTREE_COMPOSIT) {
                /* compo menu, still hardcoded defines... solve */
-               event= pupmenu("Add Node%t|Output%x201|Render Result %x221|Image %x220|RGB Curves%x209|AlphaOver %x210|Blur %x211|Filter %x212|Value %x203|Color %x202|Mix %x204|ColorRamp %x205|Color to BW %x206|Normal %x207");
+               event= pupmenu("Add Node%t|Output%x201|Render Output%x202|Render Result %x221|Image %x220|RGB Curves%x209|AlphaOver %x210|Blur %x211|Filter %x212|Value %x203|Color %x202|Mix %x204|ColorRamp %x205|Color to BW %x206|Normal %x207");
                if(event<1) return;
        }
        else return;
index 69f0a9982859f32218cee605fbc606d18a6cfe5b..97f1a6fbca2de0efae3d7d79105993b5ed0a29e3 100644 (file)
@@ -1051,6 +1051,7 @@ void BIF_do_ogl_render(View3D *v3d, int anim)
 
        if(anim) {
                bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype);
+               int cfrao= CFRA;
                
                mh->start_movie(&G.scene->r, winx, winy);
                
@@ -1063,6 +1064,7 @@ void BIF_do_ogl_render(View3D *v3d, int anim)
                        if(test_break()) break;
                }
                mh->end_movie();
+               CFRA= cfrao;
        }
        else {
                drawview3d_render(v3d, winx, winy);