forked from bartvdbraak/blender
Orange bug: forgot to restore inverse matrix calculus for OpengGL render
in a window... didn't know what it was for, but now I do! It uses the inverse to do pre-clipping on objects.
This commit is contained in:
parent
26b718654d
commit
9a20e5466c
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user