Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_draw.c
| Show First 20 Lines • Show All 1,746 Lines • ▼ Show 20 Lines | for (curdepth = depth; curdepth > 0; path = path->next, curdepth--) { | ||||
| } | } | ||||
| } | } | ||||
| /* top-level edit tree */ | /* top-level edit tree */ | ||||
| ntree = path->nodetree; | ntree = path->nodetree; | ||||
| if (ntree) { | if (ntree) { | ||||
| snode_setup_v2d(snode, ar, center); | snode_setup_v2d(snode, ar, center); | ||||
| if((snode->flag & SNODE_SHOW_GRID) == 0){ | |||||
| /* grid, uses theme color based on node path depth */ | /* grid, uses theme color based on node path depth */ | ||||
| UI_view2d_multi_grid_draw( | UI_view2d_multi_grid_draw( | ||||
| v2d, (depth > 0 ? TH_NODE_GROUP : TH_BACK), ED_node_grid_size(), NODE_GRID_STEPS, 2); | v2d, (depth > 0 ? TH_NODE_GROUP : TH_BACK), ED_node_grid_size(), NODE_GRID_STEPS, 2); | ||||
| } | |||||
| /* backdrop */ | /* backdrop */ | ||||
| draw_nodespace_back_pix(C, ar, snode, path->parent_key); | draw_nodespace_back_pix(C, ar, snode, path->parent_key); | ||||
| { | { | ||||
| float original_proj[4][4]; | float original_proj[4][4]; | ||||
| GPU_matrix_projection_get(original_proj); | GPU_matrix_projection_get(original_proj); | ||||
| Show All 24 Lines | if (snode->treepath.last) { | ||||
| if (snode->flag & SNODE_SHOW_GPENCIL) { | if (snode->flag & SNODE_SHOW_GPENCIL) { | ||||
| /* draw grease-pencil ('canvas' strokes) */ | /* draw grease-pencil ('canvas' strokes) */ | ||||
| ED_annotation_draw_view2d(C, true); | ED_annotation_draw_view2d(C, true); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* default grid */ | /* default grid */ | ||||
| if((snode->flag & SNODE_SHOW_GRID) == 0){ | |||||
| UI_view2d_multi_grid_draw(v2d, TH_BACK, ED_node_grid_size(), NODE_GRID_STEPS, 2); | UI_view2d_multi_grid_draw(v2d, TH_BACK, ED_node_grid_size(), NODE_GRID_STEPS, 2); | ||||
| } | |||||
| /* backdrop */ | /* backdrop */ | ||||
| draw_nodespace_back_pix(C, ar, snode, NODE_INSTANCE_KEY_NONE); | draw_nodespace_back_pix(C, ar, snode, NODE_INSTANCE_KEY_NONE); | ||||
| } | } | ||||
| ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); | ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW); | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| Show All 17 Lines | |||||