Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:11:42 +0000 (18:11 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:11:42 +0000 (18:11 +0100)
1  2 
intern/cycles/blender/addon/ui.py
source/blender/editors/space_action/action_draw.c

index 7a59698e15e059fc689af4cc7765988b64391028,ddcefaf4c012d2dde147d4867f57027d66a98946..a1e78623d29324514bd496b21b340e88a628485c
@@@ -217,7 -217,7 +217,7 @@@ class CyclesRender_PT_sampling(CyclesBu
          draw_samples_info(layout, context)
  
  
- class CyclesRender_PT_geometery(CyclesButtonsPanel, Panel):
+ class CyclesRender_PT_geometry(CyclesButtonsPanel, Panel):
      bl_label = "Geometry"
      bl_options = {'DEFAULT_CLOSED'}
  
@@@ -1584,7 -1584,6 +1584,7 @@@ class CyclesScene_PT_simplify(CyclesBut
          row.prop(rd, "simplify_subdivision", text="Viewport")
          row.prop(rd, "simplify_subdivision_render", text="Render")
  
 +
          col = layout.column(align=True)
          col.label(text="Child Particles")
          row = col.row(align=True)
index d82d38ac0eb2a157c230e0375688245523986c9d,0764f586de98380fe7b75323c14b3409155892c7..feea9cf5b13d882c25eb67a59fc2d51a44235aaf
@@@ -61,7 -61,6 +61,7 @@@
  #include "ED_keyframes_draw.h"
  
  #include "action_intern.h"
 +#include "GPU_immediate.h"
  
  /* ************************************************************************* */
  /* Channel List */
@@@ -206,12 -205,6 +206,12 @@@ void draw_channel_strips(bAnimContext *
        
        /* first backdrop strips */
        y = (float)(-ACHANNEL_HEIGHT(ac));
 +
 +      VertexFormat* format = immVertexFormat();
 +      unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
 +
 +      immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 +
        glEnable(GL_BLEND);
        
        for (ale = anim_data.first; ale; ale = ale->next) {
                                /* determine if channel is selected */
                                if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT))
                                        sel = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT);
 -                              
 +
                                if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
                                        switch (ale->type) {
                                                case ANIMTYPE_SUMMARY:
                                                case ANIMTYPE_SCENE:
                                                case ANIMTYPE_OBJECT:
                                                {
 -                                                      if (sel) glColor4ub(col1b[0], col1b[1], col1b[2], 0x45); 
 -                                                      else glColor4ub(col1b[0], col1b[1], col1b[2], 0x22); 
 +                                                      if (sel) immUniformColor4ub(col1b[0], col1b[1], col1b[2], 0x45);
 +                                                      else immUniformColor4ub(col1b[0], col1b[1], col1b[2], 0x22);
                                                        break;
                                                }
                                                case ANIMTYPE_FILLACTD:
                                                case ANIMTYPE_DSSKEY:
                                                case ANIMTYPE_DSWOR:
                                                {
 -                                                      if (sel) glColor4ub(col2b[0], col2b[1], col2b[2], 0x45); 
 -                                                      else glColor4ub(col2b[0], col2b[1], col2b[2], 0x22); 
 +                                                      if (sel) immUniformColor4ub(col2b[0], col2b[1], col2b[2], 0x45);
 +                                                      else immUniformColor4ub(col2b[0], col2b[1], col2b[2], 0x22);
                                                        break;
                                                }
                                                case ANIMTYPE_GROUP:
                                                        bActionGroup *agrp = ale->data;
                                                        if (show_group_colors && agrp->customCol) {
                                                                if (sel) {
 -                                                                      unsigned char *cp = (unsigned char *)agrp->cs.select;
 -                                                                      glColor4ub(cp[0], cp[1], cp[2], 0x45);
 +                                                                      unsigned char *cp = agrp->cs.select;
 +                                                                      immUniformColor4ub(cp[0], cp[1], cp[2], 0x45);
                                                                }
                                                                else {
 -                                                                      unsigned char *cp = (unsigned char *)agrp->cs.solid;
 -                                                                      glColor4ub(cp[0], cp[1], cp[2], 0x1D);
 +                                                                      unsigned char *cp = agrp->cs.solid;
 +                                                                      immUniformColor4ub(cp[0], cp[1], cp[2], 0x1D);
                                                                }
                                                        }
                                                        else {
 -                                                              if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
 -                                                              else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
 +                                                              if (sel) immUniformColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
 +                                                              else immUniformColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
                                                        }
                                                        break;
                                                }
                                                {
                                                        FCurve *fcu = ale->data;
                                                        if (show_group_colors && fcu->grp && fcu->grp->customCol) {
-                                                               unsigned char *cp = fcu->grp->cs.active;
+                                                               unsigned char *cp = (unsigned char *)fcu->grp->cs.active;
                                                                
 -                                                              if (sel) glColor4ub(cp[0], cp[1], cp[2], 0x65);
 -                                                              else glColor4ub(cp[0], cp[1], cp[2], 0x0B);
 +                                                              if (sel) immUniformColor4ub(cp[0], cp[1], cp[2], 0x65);
 +                                                              else immUniformColor4ub(cp[0], cp[1], cp[2], 0x0B);
                                                        }
                                                        else {
 -                                                              if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
 -                                                              else glColor4ub(col2[0], col2[1], col2[2], 0x22);
 +                                                              if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x22);
 +                                                              else immUniformColor4ub(col2[0], col2[1], col2[2], 0x22);
                                                        }
                                                        break;
                                                }
                                                default:
                                                {
 -                                                      if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
 -                                                      else glColor4ub(col2[0], col2[1], col2[2], 0x22);
 +                                                      if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x22);
 +                                                      else immUniformColor4ub(col2[0], col2[1], col2[2], 0x22);
                                                        break;
                                                }
                                        }
                                        
                                        /* draw region twice: firstly backdrop, then the current range */
 -                                      glRectf(v2d->cur.xmin,  (float)y - ACHANNEL_HEIGHT_HALF(ac),  v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                      immRectf(pos, v2d->cur.xmin,  (float)y - ACHANNEL_HEIGHT_HALF(ac),  v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
                                        
                                        if (ac->datatype == ANIMCONT_ACTION)
 -                                              glRectf(act_start,  (float)y - ACHANNEL_HEIGHT_HALF(ac),  act_end,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                              immRectf(pos, act_start,  (float)y - ACHANNEL_HEIGHT_HALF(ac),  act_end,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
                                }
                                else if (ac->datatype == ANIMCONT_GPENCIL) {
                                        /* frames less than one get less saturated background */
 -                                      if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
 -                                      else glColor4ub(col2[0], col2[1], col2[2], 0x22);
 -                                      glRectf(0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                      if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x22);
 +                                      else immUniformColor4ub(col2[0], col2[1], col2[2], 0x22);
 +                                      immRectf(pos, 0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
                                        
                                        /* frames one and higher get a saturated background */
 -                                      if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44);
 -                                      else glColor4ub(col2[0], col2[1], col2[2], 0x44);
 -                                      glRectf(v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                      if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x44);
 +                                      else immUniformColor4ub(col2[0], col2[1], col2[2], 0x44);
 +                                      immRectf(pos, v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
                                }
                                else if (ac->datatype == ANIMCONT_MASK) {
                                        /* TODO --- this is a copy of gpencil */
                                        /* frames less than one get less saturated background */
 -                                      if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
 -                                      else glColor4ub(col2[0], col2[1], col2[2], 0x22);
 -                                      glRectf(0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                      if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x22);
 +                                      else immUniformColor4ub(col2[0], col2[1], col2[2], 0x22);
 +                                      immRectf(pos, 0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac));
  
                                        /* frames one and higher get a saturated background */
 -                                      if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44);
 -                                      else glColor4ub(col2[0], col2[1], col2[2], 0x44);
 -                                      glRectf(v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
 +                                      if (sel) immUniformColor4ub(col1[0], col1[1], col1[2], 0x44);
 +                                      else immUniformColor4ub(col2[0], col2[1], col2[2], 0x44);
 +                                      immRectf(pos, v2d->cur.xmin, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmax + EXTRA_SCROLL_PAD,  (float)y + ACHANNEL_HEIGHT_HALF(ac));
                                }
                        }
                }
  
        /* black line marking 'current frame' for Time-Slide transform mode */
        if (saction->flag & SACTION_MOVING) {
 -              glColor3f(0.0f, 0.0f, 0.0f);
 -              
 -              glBegin(GL_LINES);
 -              glVertex2f(saction->timeslide, v2d->cur.ymin - EXTRA_SCROLL_PAD);
 -              glVertex2f(saction->timeslide, v2d->cur.ymax);
 -              glEnd();
 +              immUniformColor3f(0.0f, 0.0f, 0.0f);
 +
 +              immBegin(GL_LINES, 2);
 +              immVertex2f(pos, saction->timeslide, v2d->cur.ymin - EXTRA_SCROLL_PAD);
 +              immVertex2f(pos, saction->timeslide, v2d->cur.ymax);
 +              immEnd();
        }
 +      immUnbindProgram();
  }