Commit: a5cba9aab9a2ade00caefc1a7697f8fbd3f7304f
Author: Julian Eisel
Date:   Mon Mar 6 13:00:46 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBa5cba9aab9a2ade00caefc1a7697f8fbd3f7304f

Merge branch 'master' into blender2.8

Conflicts:
        source/blender/editors/space_nla/nla_draw.c
        source/blender/editors/space_view3d/view3d_draw.c

===================================================================



===================================================================

diff --cc source/blender/blenloader/intern/versioning_270.c
index 12045dfdb8,d3f33cf725..be15070d0c
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -1598,30 -1598,18 +1598,41 @@@ void blo_do_versions_270(FileData *fd, 
                                }
                        } FOREACH_NODETREE_END
                }
+ 
+               if (!DNA_struct_elem_find(fd->filesdna, 
"SurfaceDeformModifierData", "float", "mat[4][4]")) {
+                       for (Object *ob = main->object.first; ob; ob = 
ob->id.next) {
+                               for (ModifierData *md = ob->modifiers.first; 
md; md = md->next) {
+                                       if (md->type == 
eModifierType_SurfaceDeform) {
+                                               SurfaceDeformModifierData *smd 
= (SurfaceDeformModifierData *)md;
+                                               unit_m4(smd->mat);
+                                       }
+                               }
+                       }
+               }
        }
 +
 +      {
 +              if (!DNA_struct_elem_find(fd->filesdna, "View3DDebug", "char", 
"background")) {
 +                      bScreen *screen;
 +
 +                      for (screen = main->screen.first; screen; screen = 
screen->id.next) {
 +                              ScrArea *sa;
 +                              for (sa = screen->areabase.first; sa; sa = 
sa->next) {
 +                                      SpaceLink *sl;
 +
 +                                      for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
 +                                              switch (sl->spacetype) {
 +                                                      case SPACE_VIEW3D:
 +                                                      {
 +                                                              View3D *v3d = 
(View3D *)sl;
 +                                                              
v3d->debug.background = V3D_DEBUG_BACKGROUND_NONE;
 +                                                      }
 +                                              }
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
  }
  
  void do_versions_after_linking_270(Main *main)
diff --cc source/blender/editors/include/ED_view3d.h
index b192a6c5c0,5514dc0d3d..e8944f1e65
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@@ -47,9 -47,9 +47,10 @@@ struct Main
  struct MetaElem;
  struct Nurb;
  struct Object;
+ struct RV3DMatrixStore;
  struct RegionView3D;
  struct Scene;
 +struct SceneLayer;
  struct ScrArea;
  struct View3D;
  struct ViewContext;
@@@ -334,11 -331,11 +335,11 @@@ void ED_view3d_check_mats_rv3d(struct R
  #endif
  int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
  
- void *ED_view3d_mats_rv3d_backup(struct RegionView3D *rv3d);
- void  ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, void 
*rv3dmat_pt);
+ struct RV3DMatrixStore *ED_view3d_mats_rv3d_backup(struct RegionView3D *rv3d);
+ void                    ED_view3d_mats_rv3d_restore(struct RegionView3D 
*rv3d, struct RV3DMatrixStore *rv3dmat);
  
  bool ED_view3d_context_activate(struct bContext *C);
 -void ED_view3d_draw_offscreen_init(struct Scene *scene, struct View3D *v3d);
 +void ED_view3d_draw_offscreen_init(struct Scene *scene, struct SceneLayer 
*sl, struct View3D *v3d);
  void ED_view3d_draw_offscreen(
          struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int 
winx, int winy, float viewmat[4][4],
          float winmat[4][4], bool do_bgpic, bool do_sky, bool is_persp, const 
char *viewname,
diff --cc source/blender/editors/space_nla/nla_draw.c
index 65582b994e,93dcdbb5c0..ae9a9e3a36
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@@ -307,11 -290,11 +306,12 @@@ static void nla_draw_strip_curves(NlaSt
                 *      - min y-val is yminc, max is y-maxc, so clamp in those 
regions
                 */
                for (cfra = strip->start; cfra <= strip->end; cfra += 1.0f) {
 -                      float y = evaluate_fcurve(fcu, cfra);
 +                      float y = evaluate_fcurve(fcu, cfra); /* assume this to 
be in 0-1 range */
+                       CLAMP(y, 0.0f, 1.0f);
 -                      glVertex2f(cfra, ((y * yheight) + yminc));
 +                      immVertex2f(pos, cfra, ((y * yheight) + yminc));
                }
 -              glEnd(); // GL_LINE_STRIP
 +
 +              immEnd();
        }
        else {
                /* use blend in/out values only if both aren't zero */
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index 84a845ee25,0c5cf1bd93..ef8b0c3c24
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -28,57 -28,78 +28,59 @@@
   *  \ingroup spview3d
   */
  
 -#include <string.h>
 -#include <stdio.h>
  #include <math.h>
  
 -#include "DNA_armature_types.h"
 -#include "DNA_camera_types.h"
 -#include "DNA_customdata_types.h"
 -#include "DNA_object_types.h"
 -#include "DNA_group_types.h"
 -#include "DNA_mesh_types.h"
 -#include "DNA_key_types.h"
 -#include "DNA_lamp_types.h"
 -#include "DNA_scene_types.h"
 -#include "DNA_world_types.h"
 -#include "DNA_brush_types.h"
 -
 -#include "MEM_guardedalloc.h"
 -
 -#include "BLI_blenlib.h"
 -#include "BLI_math.h"
 -#include "BLI_jitter.h"
 -#include "BLI_utildefines.h"
 -#include "BLI_endian_switch.h"
 -#include "BLI_threads.h"
 +#include "BIF_gl.h"
 +#include "BIF_glutil.h"
  
 -#include "BKE_anim.h"
  #include "BKE_camera.h"
  #include "BKE_context.h"
 -#include "BKE_customdata.h"
 -#include "BKE_DerivedMesh.h"
 -#include "BKE_image.h"
  #include "BKE_key.h"
 -#include "BKE_main.h"
 +#include "BKE_scene.h"
  #include "BKE_object.h"
 -#include "BKE_global.h"
  #include "BKE_paint.h"
 -#include "BKE_scene.h"
 -#include "BKE_screen.h"
  #include "BKE_unit.h"
 -#include "BKE_movieclip.h"
 -
 -#include "RE_engine.h"
 -
 -#include "IMB_imbuf_types.h"
 -#include "IMB_imbuf.h"
 -#include "IMB_colormanagement.h"
  
 -#include "BIF_gl.h"
 -#include "BIF_glutil.h"
 +#include "BLF_api.h"
  
 -#include "WM_api.h"
 +#include "BLI_listbase.h"
 +#include "BLI_math.h"
 +#include "BLI_rect.h"
 +#include "BLI_string.h"
 +#include "BLI_threads.h"
  
 -#include "BLF_api.h"
  #include "BLT_translation.h"
  
 +#include "DNA_armature_types.h"
 +#include "DNA_brush_types.h"
 +#include "DNA_camera_types.h"
 +#include "DNA_key_types.h"
 +#include "DNA_mesh_types.h"
 +#include "DNA_object_types.h"
 +#include "DNA_view3d_types.h"
 +#include "DNA_windowmanager_types.h"
 +
 +#include "ED_keyframing.h"
  #include "ED_armature.h"
+ #include "ED_keyframing.h"
+ #include "ED_gpencil.h"
  #include "ED_screen.h"
 -#include "ED_space_api.h"
 -#include "ED_screen_types.h"
  #include "ED_transform.h"
 +#include "ED_gpencil.h"
 +
 +#include "GPU_matrix.h"
 +#include "GPU_immediate.h"
 +#include "GPU_material.h"
 +#include "GPU_viewport.h"
 +
 +#include "MEM_guardedalloc.h"
  
  #include "UI_interface.h"
 -#include "UI_interface_icons.h"
  #include "UI_resources.h"
  
 -#include "GPU_draw.h"
 -#include "GPU_framebuffer.h"
 -#include "GPU_material.h"
 -#include "GPU_compositing.h"
 -#include "GPU_extensions.h"
 +#include "RE_engine.h"
 +
 +#include "WM_api.h"
  
  #include "view3d_intern.h"  /* own include */
  
@@@ -1527,333 -2866,479 +1529,331 @@@ static bool is_cursor_visible(Scene *sc
                                }
                        }
                }
 -      }
  
 -      /* perspective floor goes last to use scene depth and avoid writing to 
depth buffer */
 -      if (draw_grids_after) {
 -              drawfloor(scene, v3d, grid_unit, false);
 -      }
 -
 -      /* must be before xray draw which clears the depth buffer */
 -      if (v3d->flag2 & V3D_SHOW_GPENCIL) {
 -              wmWindowManager *wm = (C != NULL) ? CTX_wm_manager(C) : NULL;
 -              
 -              /* must be before xray draw which clears the depth buffer */
 -              if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
 -              ED_gpencil_draw_view3d(wm, scene, v3d, ar, true);
 -              if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
 +              /* no exception met? then don't draw cursor! */
 +              return false;
        }
  
 -      /* transp and X-ray afterdraw stuff */
 -      if (v3d->afterdraw_transp.first)     view3d_draw_transp(scene, ar, v3d);
 +      return true;
 +}
  
 -      /* always do that here to cleanup depth buffers if none needed */
 -      if (fx) {
 -              do_composite_xray = v3d->zbuf && (v3d->afterdraw_xray.first || 
v3d->afterdraw_xraytransp.first);
 -              GPU_fx_compositor_setup_XRay_pass(fx, do_composite_xray);
 -      }
 +static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
 +{
 +      int co[2];
  
 -      if (v3d->afterdraw_xray.first)       view3d_draw_xray(scene, ar, v3d, 
&xrayclear);
 -      if (v3d->afterdraw_xraytransp.first) view3d_draw_xraytransp(scene, ar, 
v3d, xrayclear);
 +      /* we don't want the clipping for cursor */
 +      if (ED_view3d_project_int_global(ar, ED_view3d_cursor3d_get(scene, 
v3d), co, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) {
 +              const float f5 = 0.25f * U.widget_unit;
 +              const float f10 = 0.5f * U.widget_unit;
 +              const float f20 = U.widget_unit;
 +              
 +              glLineWidth(1.0f);
  
 -      if (fx && do_composite_xray) {
 -              GPU_fx_compositor_XRay_resolve(fx);
 -      }
 +              VertexFormat *format = immVertexFormat();
 +              unsigned int pos = add_attrib(format, "pos", COMP_F32, 2, 
KEEP_FLOAT);
 +              unsigned int color = add_attrib(format, "color", COMP_U8, 3, 
NORMALIZE_INT_TO_FLOAT);
  
 -      if (!draw_offscreen) {
 -              ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
 -      }
 +              immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
  
 -      if (rv3d->rflag & RV3D_CLIPPING)
 -              ED_view3d_clipping_disable();
 +              const int segments = 16;
  
 -      /* important to do after clipping */
 -      if (do_bgpic) {
 -              view3d_draw_bgpic_test(scene, ar, v3d, true, do_camera_frame);
 -      }
 +              immBegin(GL_LINE_LOOP, segments);
  
 -      if (!draw_offscreen) {
 -              BIF_draw_manipulator(C);
 -      }
 +              for (int i = 0; i < segments; ++i) {
 +                      float angle = 2 * M_PI * ((float)i / (float)segments);
 +                      float x = co[0] + f10 * cosf(angle);
 +                      float y = co[1] + f10 * sinf(angle);
  
 -      /* cleanup */
 -      if (v3d->zbuf) {
 -              v3d->zbuf = false;
 -              glDisable(GL_DEPTH_TEST);
 -      }
 +                      if (i % 2 == 0)
 +                              immAttrib3ub(color, 255, 0, 0);
 +                      else
 +                              immAttrib3ub(color, 255, 255, 255);
  
 -      if ((v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
 -              GPU_free_images_old();
 -      }
 -}
 +                      immVertex2f(pos, x, y);
 +              }
 +              immEnd();
  
 -static void view3d_main_region_setup_view(Scene *scene, View3D *v3d, ARegion 
*ar, float viewmat[4][4], float winmat[4][4])
 -{
 -      RegionView3D *rv3d = ar->regiondata;
 +              immUnbindProgram();
  
 -      ED_view3d_update_viewmat(scene, v3d, ar, viewmat, winmat);
 +              VertexFormat_clear(format);
 +              pos = add_attrib(format, "pos", COMP_F32, 2, KEEP_FLOAT);
  
 -      /* set for opengl */
 -      glMatrixMode(GL_PROJECTION);
 -      glLoadMatrixf(rv3d->winmat);
 -      glMatrixMode(GL_MODELVIEW);
 -      glLoadMatrixf(rv3d->viewmat);
 -}
 +              immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
  
 -/**
 - * Store values from #RegionView3D, set when drawing.
 - * This is needed when we draw with to a viewport using a different matrix 
(offscreen drawing for example).
 - *
 - * Values set by #ED_view3d_update_viewmat should be handled here.
 - */
 -struct RV3DMatrixStore {
 -      floa

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to