Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenloader/intern/readfile.c7
-rw-r--r--source/blender/editors/space_node/node_draw.c2
-rw-r--r--source/blender/editors/space_node/space_node.c44
-rw-r--r--source/blender/makesdna/DNA_node_types.h2
4 files changed, 51 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 82fe3199eaf..766386e54b0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5214,6 +5214,13 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
ar->v2d.scroll= V2D_SCROLL_BOTTOM;
ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
break;
+ case SPACE_NODE:
+ ar= MEM_callocN(sizeof(ARegion), "nodetree area for node");
+ BLI_addtail(lb, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+ ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+ ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
case SPACE_FILE:
/* channel (bookmarks/directories) region */
ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 77e37895160..4008e43e83a 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -1072,7 +1072,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
glEnable(GL_MAP1_VERTEX_3);
/* aspect+font, set each time */
- snode->aspect= (v2d->cur.xmax - v2d->cur.xmin)/((float)sa->winx);
+ snode->aspect= (v2d->cur.xmax - v2d->cur.xmin)/((float)ar->winx);
//snode->curfont= uiSetCurFont_ext(snode->aspect);
UI_view2d_constant_grid_draw(C, v2d);
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index c54f4ede898..e9405c29546 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -78,6 +78,15 @@ static SpaceLink *node_new(const bContext *C)
ar->regiontype= RGN_TYPE_HEADER;
ar->alignment= RGN_ALIGN_BOTTOM;
+ /* channels */
+ ar= MEM_callocN(sizeof(ARegion), "nodetree area for node");
+
+ BLI_addtail(&snode->regionbase, ar);
+ ar->regiontype= RGN_TYPE_CHANNELS;
+ ar->alignment= RGN_ALIGN_LEFT;
+
+ ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+
/* main area */
ar= MEM_callocN(sizeof(ARegion), "main area for node");
@@ -136,6 +145,35 @@ static SpaceLink *node_duplicate(SpaceLink *sl)
return (SpaceLink *)snoden;
}
+static void node_channel_area_init(wmWindowManager *wm, ARegion *ar)
+{
+ UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
+}
+
+static void node_channel_area_draw(const bContext *C, ARegion *ar)
+{
+ View2D *v2d= &ar->v2d;
+ View2DScrollers *scrollers;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_SHADE2, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+ /* reset view matrix */
+ UI_view2d_view_restore(C);
+
+ /* scrollers */
+ scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+ UI_view2d_scrollers_draw(C, v2d, scrollers);
+ UI_view2d_scrollers_free(scrollers);
+}
+
/* Initialise main area, setting handlers. */
static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
{
@@ -257,11 +295,11 @@ void ED_spacetype_node(void)
/* regions: channels */
art= MEM_callocN(sizeof(ARegionType), "spacetype node region");
art->regionid = RGN_TYPE_CHANNELS;
- art->minsizex= 80;
+ art->minsizex= 200;
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
-// art->init= node_channel_area_init;
-// art->draw= node_channel_area_draw;
+ art->init= node_channel_area_init;
+ art->draw= node_channel_area_draw;
BLI_addhead(&st->regiontypes, art);
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index d5eb4024dcc..49711963870 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -154,6 +154,8 @@ typedef struct bNodeLink {
bNode *fromnode, *tonode;
bNodeSocket *fromsock, *tosock;
+ int flag, pad;
+
} bNodeLink;
/* the basis for a Node tree, all links and nodes reside internal here */