2.5
authorTon Roosendaal <ton@blender.org>
Mon, 9 Feb 2009 16:52:33 +0000 (16:52 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 9 Feb 2009 16:52:33 +0000 (16:52 +0000)
- Render: scene buttons RENDER and ANIM now work
- Nodes: text drawing for socket names back

source/blender/editors/space_buttons/Makefile
source/blender/editors/space_buttons/SConscript
source/blender/editors/space_buttons/buttons_scene.c
source/blender/editors/space_node/node_draw.c

index ff82f25ea55c6392292fc31799f3e6dd312d2bb0..b96d1cc5495f2a03d168fec73b2d4959503842e8 100644 (file)
@@ -44,6 +44,7 @@ CPPFLAGS += -I../../blenloader
 CPPFLAGS += -I../../blenkernel
 CPPFLAGS += -I../../blenlib
 CPPFLAGS += -I../../makesdna
+CPPFLAGS += -I../../makesrna
 CPPFLAGS += -I../../imbuf
 CPPFLAGS += -I../../python
 CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
index 0bd5374c3ca312b80c6c96289459085ea4c9a872..d36dd89b68125a57d05b4ac9c4ad04bec8661c3f 100644 (file)
@@ -5,6 +5,6 @@ sources = env.Glob('*.c')
 
 incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
 incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
-incs += ' ../../render/extern/include'
+incs += ' ../../makesrna ../../render/extern/include'
 
 env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), [], libtype=['core'], priority=[120] )
index f278b6379abdde1d0b8fc6a744d8956d425dfc8e..e4cff2f4f064b1ee50c83504f30beb90dc08d009 100644 (file)
 
 #include "RE_pipeline.h"
 
+#include "RNA_access.h"
+#include "RNA_define.h"
+
 #include "UI_interface.h"
 #include "UI_resources.h"
 
+#include "WM_types.h"
+
 #include "buttons_intern.h"
 
 #define R_DISPLAYIMAGE  0
@@ -212,7 +217,8 @@ static void render_panel_render(const bContext *C, ARegion *ar)
        if(uiNewPanel(C, ar, block, "Render", "Render", 320, 0, 318, 204)==0) return;
 
        uiBlockBeginAlign(block);
-       uiDefBut(block, BUT,0,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Render the current frame (F12)");
+       uiDefButO(block, BUT, "SCREEN_OT_render", WM_OP_INVOKE_DEFAULT, "RENDER",  369, 164, 191,37, "Render the current frame (F12)");
+       
 #ifndef DISABLE_YAFRAY
        /* yafray: on request, render engine menu is back again, and moved to Render panel */
        uiDefButS(block, MENU, 0, "Rendering Engine %t|Blender Internal %x0|YafRay %x1", 
@@ -287,12 +293,14 @@ void render_panel_anim(const bContext *C, ARegion *ar)
 {
        Scene *scene= CTX_data_scene(C);
        uiBlock *block;
-
+       uiBut *but;
+       
        block= uiBeginBlock(C, ar,  "render_panel_anim", UI_EMBOSS, UI_HELV);
        if(uiNewPanel(C, ar, block, "Anim", "Render", 640, 0, 318, 204) == 0) return;
 
-       uiDefBut(block, BUT, 0, "ANIM",        692,142,192,47, 0, 0, 0, 0, 0, "Render the animation to disk from start to end frame, (Ctrl+F12)");
-
+       but= uiDefButO(block, BUT, "SCREEN_OT_render", WM_OP_INVOKE_DEFAULT, "ANIM",  692,142,192,47, "Render the animation to disk from start to end frame, (Ctrl+F12)");
+       RNA_boolean_set(uiButGetOperatorPtrRNA(but), "anim", 1);
+       
        uiBlockSetCol(block, TH_BUT_SETTING1);
        uiBlockBeginAlign(block);
        uiDefButBitI(block, TOG, R_DOSEQ, 0, "Do Sequence",692,114,192,20, &scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
index ffb25339bc3157e96c3a68a4206a71e9cfd6d42d..e9d865a371a7c6caa104aaf9102e56b851f192e5 100644 (file)
@@ -823,11 +823,9 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                                }
                        }
                        else {
-                               /* XXX fix
                                UI_ThemeColor(TH_TEXT);
                                ui_rasterpos_safe(sock->locx+8.0f, sock->locy-5.0f, snode->aspect);
                                UI_DrawString(snode->curfont, sock->name, 0);
-                               */
                        }
                }
        }
@@ -835,11 +833,12 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
        /* socket outputs */
        for(sock= node->outputs.first; sock; sock= sock->next) {
                if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+                       float slen;
+                       int ofs= 0;
+                       
                        socket_circle_draw(sock, NODE_SOCKSIZE);
                        
-                       /* XXX fix
                        UI_ThemeColor(TH_TEXT);
-                       ofs= 0;
                        slen= snode->aspect*UI_GetStringWidth(snode->curfont, sock->name, 0);
                        while(slen > node->width) {
                                ofs++;
@@ -847,7 +846,6 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                        }
                        ui_rasterpos_safe(sock->locx-8.0f-slen, sock->locy-5.0f, snode->aspect);
                        UI_DrawString(snode->curfont, sock->name+ofs, 0);
-                       */
                }
        }