Merge branch 'master' into blender2.8
authorGermano <germano.costa@ig.com.br>
Sun, 21 Jan 2018 20:45:47 +0000 (18:45 -0200)
committerGermano <germano.costa@ig.com.br>
Sun, 21 Jan 2018 20:45:47 +0000 (18:45 -0200)
# Conflicts:
# intern/cycles/blender/blender_mesh.cpp
# source/blender/editors/screen/screen_ops.c
# source/blender/editors/space_view3d/drawobject.c

1  2 
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/screen/screen_draw.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/nodes/intern/node_socket.c

Simple merge
index 694770d088d7a73f0d7a8b701b210da4d7b70e88,e67ae4e321cab2906bd9344ac5c14aa740829cb7..2e4e9127ed6c45bd15e4f082dd5034317ce13e94
@@@ -315,22 -277,24 +315,28 @@@ void ED_screen_draw_edges(wmWindow *win
        }
  
        glLineWidth(1);
 -      glColor3ub(0, 0, 0);
 -      glBegin(GL_LINES);
 -      for (sa = win->screen->areabase.first; sa; sa = sa->next) {
 -              drawscredge_area(sa, winsize_x, winsize_y);
 +      immUniformColor3ub(0, 0, 0);
 +
 +      for (sa = screen->areabase.first; sa; sa = sa->next) {
 +              drawscredge_area(sa, winsize_x, winsize_y, pos);
        }
 -      glEnd();
  
 -      win->screen->do_draw = false;
 +      immUnbindProgram();
 +
 +      screen->do_draw = false;
  }
  
+ /**
+  * The blended join arrows.
+  *
+  * \param sa1: Area from which the resultant originates.
+  * \param sa2: Target area that will be replaced.
+  */
  void ED_screen_draw_join_shape(ScrArea *sa1, ScrArea *sa2)
  {
 +      unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 +      immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 +
        glLineWidth(1);
  
        /* blended join arrow */
index 0e5c5ddc0c79d2a1b51d2dcef95db88ba2cd6cb0,90a60a45b27273019d86684b73fa6a215685bd9f..ce6ce802a5ba464765e5afa7d1a5ac8899b4d834
@@@ -2789,10 -2788,11 +2789,11 @@@ static int graph_driver_delete_invalid_
  
        if (deleted > 0) {
                /* notify the world of any changes */
 -              DAG_relations_tag_update(CTX_data_main(C));
 +              DEG_relations_tag_update(CTX_data_main(C));
                WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_REMOVED, NULL);
                WM_reportf(RPT_INFO, "Deleted %u drivers", deleted);
-       } else {
+       }
+       else {
                WM_report(RPT_INFO, "No drivers deleted");
        }
  
index 3bc2481a608dbc33dd0ba35741c899b2a1b40986,828617d14470d245e498ec496a0b7316eadb8657..51dc56bafaf0bbce536bff91857a854c604227fe
@@@ -1034,23 -982,15 +1034,23 @@@ static void drawcube_size(float size, u
                { size,  size,  size}
        };
  
-       const GLubyte indices[24] = {0,1,1,3,3,2,2,0,0,4,4,5,5,7,7,6,6,4,1,5,3,7,2,6};
+       const GLubyte indices[24] = {0, 1, 1, 3, 3, 2, 2, 0, 0, 4, 4, 5, 5, 7, 7, 6, 6, 4, 1, 5, 3, 7, 2, 6};
  
 +#if 0
        glEnableClientState(GL_VERTEX_ARRAY);
 -      glVertexPointer(3, GL_FLOAT, 0, pos);
 +      glVertexPointer(3, GL_FLOAT, 0, verts);
        glDrawRangeElements(GL_LINES, 0, 7, 24, GL_UNSIGNED_BYTE, indices);
        glDisableClientState(GL_VERTEX_ARRAY);
 +#else
 +      immBegin(GWN_PRIM_LINES, 24);
 +      for (int i = 0; i < 24; ++i) {
 +              immVertex3fv(pos, verts[indices[i]]);
 +      }
 +      immEnd();
 +#endif
  }
  
 -static void drawshadbuflimits(Lamp *la, float mat[4][4])
 +static void drawshadbuflimits(const Lamp *la, const float mat[4][4], unsigned pos)
  {
        float sta[3], end[3], lavec[3];
  
@@@ -8056,39 -6998,31 +8056,40 @@@ static void draw_forcefield(Object *ob
                }
        }
        setlinestyle(0);
 +
 +      immUnbindProgram();
  }
  
 -static void draw_box(const float vec[8][3], bool solid)
 +static void imm_draw_box(const float vec[8][3], bool solid, unsigned pos)
  {
 -      glEnableClientState(GL_VERTEX_ARRAY);
 -      glVertexPointer(3, GL_FLOAT, 0, vec);
 -      
        if (solid) {
 -              const GLubyte indices[24] = {0, 1, 2, 3, 7, 6, 5, 4, 4, 5, 1, 0, 3, 2, 6, 7, 3, 7, 4, 0, 1, 5, 6, 2};
 -              glDrawRangeElements(GL_QUADS, 0, 7, 24, GL_UNSIGNED_BYTE, indices);
 +              /* Adpated from "Optimizing Triangle Strips for Fast Rendering" by F. Evans, S. Skiena and A. Varshney
 +               *              (http://www.cs.umd.edu/gvil/papers/av_ts.pdf). */
-               static const GLubyte tris_strip_indices[14] = {0,1,3,2,6,1,5,0,4,3,7,6,4,5};
++              static const GLubyte tris_strip_indices[14] = {0, 1, 3, 2, 6, 1, 5, 0, 4, 3, 7, 6, 4, 5};
 +              immBegin(GWN_PRIM_TRI_STRIP, 14);
 +              for (int i = 0; i < 14; ++i) {
 +                      immVertex3fv(pos, vec[tris_strip_indices[i]]);
 +              }
 +              immEnd();
        }
        else {
-               static const GLubyte line_indices[24] = {0,1,1,2,2,3,3,0,0,4,4,5,5,6,6,7,7,4,1,5,2,6,3,7};
 -              const GLubyte indices[24] = {0, 1, 1, 2, 2, 3, 3, 0, 0, 4, 4, 5, 5, 6, 6, 7, 7, 4, 1, 5, 2, 6, 3, 7};
 -              glDrawRangeElements(GL_LINES, 0, 7, 24, GL_UNSIGNED_BYTE, indices);
++              static const GLubyte line_indices[24] =
++                     {0, 1, 1, 2, 2, 3, 3, 0, 0, 4, 4, 5, 5, 6, 6, 7, 7, 4, 1, 5, 2, 6, 3, 7};
 +              immBegin(GWN_PRIM_LINES, 24);
 +              for (int i = 0; i < 24; ++i) {
 +                      immVertex3fv(pos, vec[line_indices[i]]);
 +              }
 +              immEnd();
        }
  
 -      glDisableClientState(GL_VERTEX_ARRAY);
  }
  
 -static void draw_bb_quadric(BoundBox *bb, char type, bool around_origin)
 +static void imm_draw_bb(BoundBox *bb, char type, bool around_origin, const unsigned char ob_wire_col[4])
  {
        float size[3], cent[3];
 -      GLUquadricObj *qobj = gluNewQuadric();
 -      
 -      gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
 +      Gwn_Batch *sphere = GPU_batch_preset_sphere_wire(0);
 +      GWN_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
 +      if (ob_wire_col) GWN_batch_uniform_4f(sphere, "color", ob_wire_col[0] / 255.0f, ob_wire_col[1] / 255.0f, ob_wire_col[2] / 255.0f, 1.0f);
        
        BKE_boundbox_calc_size_aabb(bb, size);