Merge branch 'master' into soc-2018-npr
authorYiming Wu <xp8110@outlook.com>
Fri, 8 Mar 2019 11:12:37 +0000 (19:12 +0800)
committerYiming Wu <xp8110@outlook.com>
Fri, 8 Mar 2019 11:12:37 +0000 (19:12 +0800)
# Conflicts:
# release/datafiles/locale
# release/scripts/addons
# release/scripts/addons_contrib
# source/blender/draw/intern/DRW_render.h
# source/blender/makesdna/DNA_light_types.h
# source/blender/makesdna/DNA_scene_types.h
# source/blender/makesrna/intern/rna_scene.c
# source/tools

35 files changed:
1  2 
intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
release/scripts/startup/bl_operators/__init__.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/CMakeLists.txt
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_280.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/draw/CMakeLists.txt
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_texture.c
source/blender/draw/modes/object_mode.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/render/render_intern.h
source/blender/editors/render/render_ops.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesdna/DNA_light_types.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/MOD_modifiertypes.h
source/blender/modifiers/intern/MOD_util.c

Simple merge
index a63b7afbcd09d106dd5cd69ae542a0339c5c941b,8a3e948e4d28863f0bf548b1384393f974e9c2a9..3d9ae899a32facea075600c05c31585e032adbfc
@@@ -1562,35 -1538,9 +1538,35 @@@ void blo_do_versions_280(FileData *fd, 
                        }
                }
  
 +              if (!DNA_struct_find(fd->filesdna, "SceneLANPR")) {
 +                      for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
 +
 +                              scene->lanpr.crease_threshold = 0.7;
 +
 +                              scene->lanpr.line_thickness = 1.5;
 +                              scene->lanpr.depth_clamp = 0.001;
 +                              scene->lanpr.depth_strength = 800;
 +                              scene->lanpr.normal_clamp = 2;
 +                              scene->lanpr.normal_strength = 10;
 +                              
 +                              scene->lanpr.enable_intersections = 1;
 +                              
 +                              scene->lanpr.background_color[0] = 0.76;
 +                              scene->lanpr.background_color[1] = 0.54;
 +                              scene->lanpr.background_color[2] = 0.29;
 +                              scene->lanpr.background_color[3] = 1;
 +                              
 +                              scene->lanpr.line_color[0] = 0.39;
 +                              scene->lanpr.line_color[1] = 0.12;
 +                              scene->lanpr.line_color[2] = 0.04;
 +                              scene->lanpr.line_color[3] = 1;
 +
 +                      }
 +              }
 +
  
                if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) {
-                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                       for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
                                scene->display.matcap_ssao_distance = 0.2f;
                                scene->display.matcap_ssao_attenuation = 1.0f;
                                scene->display.matcap_ssao_samples = 16;
index 10734ec985e538ab3a96ac676442f474ab153e20,aea08f87a8461d19aeb34e01ae627e43420da6d1..0503dc61e8074b4a59dfe40e27836f22d4699cc7
@@@ -120,22 -117,14 +117,20 @@@ set(SR
        engines/workbench/workbench_render.c
        engines/workbench/workbench_studiolight.c
        engines/workbench/workbench_volume.c
-       engines/workbench/solid_mode.c
-       engines/workbench/transparent_mode.c
        engines/external/external_engine.c
-       engines/gpencil/gpencil_engine.h
-       engines/gpencil/gpencil_engine.c
-       engines/gpencil/gpencil_render.c
        engines/gpencil/gpencil_cache_utils.c
-       engines/gpencil/gpencil_draw_utils.c
        engines/gpencil/gpencil_draw_cache_impl.c
+       engines/gpencil/gpencil_draw_utils.c
+       engines/gpencil/gpencil_engine.c
+       engines/gpencil/gpencil_engine.h
+       engines/gpencil/gpencil_render.c
        engines/gpencil/gpencil_shader_fx.c
 +      engines/lanpr/lanpr_dpix.c
 +      engines/lanpr/lanpr_engine.c
 +      engines/lanpr/lanpr_snake.c
 +      engines/lanpr/lanpr_ops.c
 +      engines/lanpr/lanpr_util.c
 +      engines/lanpr/lanpr_chain.c
  
        DRW_engine.h
        intern/DRW_render.h
index 2607e7e13b5c4851df1e927d5a0f5e859bc45a9b,dee686e270eed12d79737adbae614e10ca9cdf9a..6258d39312825e574fdaca4f8ff96abaa9c14b7e
@@@ -197,31 -194,24 +194,29 @@@ typedef enum 
  /* Textures from DRW_texture_pool_query_* have the options
   * DRW_TEX_FILTER for color float textures, and no options
   * for depth textures and integer textures. */
- struct GPUTexture *DRW_texture_pool_query_2D(int w, int h, GPUTextureFormat format, DrawEngineType *engine_type);
+ struct GPUTexture *DRW_texture_pool_query_2D(int w, int h, eGPUTextureFormat format, DrawEngineType *engine_type);
  
  struct GPUTexture *DRW_texture_create_1D(
-         int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
+         int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
  struct GPUTexture *DRW_texture_create_2D(
-         int w, int h, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
- struct GPUTexture *DRW_texture_create_2D_multisample(
-         int w, int h, GPUTextureFormat format, int samples, DRWTextureFlag flags, const float *fpixels);
+         int w, int h, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
  struct GPUTexture *DRW_texture_create_2D_array(
-         int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
+         int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
  struct GPUTexture *DRW_texture_create_3D(
-         int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
+         int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
  struct GPUTexture *DRW_texture_create_cube(
-         int w, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
+         int w, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels);
  
  void DRW_texture_ensure_fullscreen_2D(
-         struct GPUTexture **tex, GPUTextureFormat format, DRWTextureFlag flags);
+         struct GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags);
  void DRW_texture_ensure_2D(
-         struct GPUTexture **tex, int w, int h, GPUTextureFormat format, DRWTextureFlag flags);
+         struct GPUTexture **tex, int w, int h, eGPUTextureFormat format, DRWTextureFlag flags);
  
 +void DRW_texture_ensure_fullscreen_2D_multisample(
 +        struct GPUTexture **tex, GPUTextureFormat format, int samples, DRWTextureFlag flags);
 +void DRW_texture_ensure_2D_multisample(
 +        struct GPUTexture **tex, int w, int h, GPUTextureFormat format, int samples, DRWTextureFlag flags);
 +
  void DRW_texture_generate_mipmaps(struct GPUTexture *tex);
  void DRW_texture_free(struct GPUTexture *tex);
  #define DRW_TEXTURE_FREE_SAFE(tex) do { \
index 89e2b958ecca61d52bac241e2006a1539797d847,235523f15c5d701951e77a824716761bf84a9e54..0a804a9d37f741832f1ebd292172d931163aa14d
@@@ -92,16 -89,8 +89,16 @@@ GPUTexture *DRW_texture_create_2D(int w
        return tex;
  }
  
 +GPUTexture *DRW_texture_create_2D_multisample(int w, int h, GPUTextureFormat format, int samples, DRWTextureFlag flags, const float *fpixels)
 +{
 +      GPUTexture *tex = GPU_texture_create_2D_multisample(w, h, format, fpixels, samples, NULL);
 +      drw_texture_set_parameters(tex, flags);
 +
 +      return tex;
 +}
 +
  GPUTexture *DRW_texture_create_2D_array(
-         int w, int h, int d, GPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
+         int w, int h, int d, eGPUTextureFormat format, DRWTextureFlag flags, const float *fpixels)
  {
        GPUTexture *tex = GPU_texture_create_2D_array(w, h, d, format, fpixels, NULL);
        drw_texture_set_parameters(tex, flags);
index 1baddad5a6e0932a63a200c1fec0bd6235c232ef,ec913aa2b48e36acfac63b8a3036d109c77bd8cf..a98b03f847c6f45914e6e463bf02792a460cfd24
@@@ -126,30 -122,30 +122,30 @@@ typedef struct Light 
  /* #define LA_NO_DIFF         (1 << 11) */ /* not used anywhere */
  /* #define LA_NO_SPEC         (1 << 12) */ /* not used anywhere */
  /* #define LA_SHAD_RAY                (1 << 13) */ /* not used anywhere - cleaned */
- /* yafray: lamp shadowbuffer flag, softlight */
- /* Since it is used with LOCAL lamp, can't use LA_SHAD */
+ /* yafray: light  shadowbuffer flag, softlight */
+ /* Since it is used with LOCAL light, can't use LA_SHAD */
  /* #define LA_YF_SOFT         (1 << 14) */ /* not used anymore */
  /* #define LA_LAYER_SHADOW    (1 << 15) */ /* not used anymore */
 -/* #define LA_SHAD_TEX        (1 << 16) */ /* not used anymore */
 +/* #define LA_SHAD_TEX      (1 << 16) */ /* not used anymore */
  #define LA_SHOW_CONE    (1 << 17)
  /* #define LA_SHOW_SHADOW_BOX (1 << 18) */
  #define LA_SHAD_CONTACT (1 << 19)
  #define LA_CUSTOM_ATTENUATION (1 << 20)
  
  /* falloff_type */
 -#define LA_FALLOFF_CONSTANT                   0
 -#define LA_FALLOFF_INVLINEAR          1
 -#define LA_FALLOFF_INVSQUARE          2
 -#define LA_FALLOFF_CURVE                      3
 -#define LA_FALLOFF_SLIDERS                    4
 -#define LA_FALLOFF_INVCOEFFICIENTS    5
 +#define LA_FALLOFF_CONSTANT         0
 +#define LA_FALLOFF_INVLINEAR        1
 +#define LA_FALLOFF_INVSQUARE        2
 +#define LA_FALLOFF_CURVE            3
 +#define LA_FALLOFF_SLIDERS          4
 +#define LA_FALLOFF_INVCOEFFICIENTS  5
  
  /* area shape */
- #define LA_AREA_SQUARE  0
- #define LA_AREA_RECT    1
- #define LA_AREA_CUBE    2
- #define LA_AREA_BOX     3
- #define LA_AREA_DISK    4
- #define LA_AREA_ELLIPSE 5
- #endif /* __DNA_LAMP_TYPES_H__ */
+ #define LA_AREA_SQUARE        0
+ #define LA_AREA_RECT  1
+ /* #define LA_AREA_CUBE 2 */ /* UNUSED */
+ /* #define LA_AREA_BOX  3 */ /* UNUSED */
+ #define LA_AREA_DISK  4
+ #define LA_AREA_ELLIPSE       5
+ #endif /* __DNA_LIGHT_TYPES_H__ */
index b053cec6a25267eda75a135a84cf10be53d8de67,2607ca5f3331a636cc8020c73320642db5242efb..483012027785d2c059244e8a68fa84fcfd61a927
@@@ -371,21 -396,29 +396,29 @@@ typedef enum eStereo3dInterlaceType 
   * this is used for NodeImageFile and IMAGE_OT_save_as operator too.
   *
   * note: its a bit strange that even though this is an image format struct
 - * the imtype can still be used to select video formats.
 - * RNA ensures these enum's are only selectable for render output.
 + *  the imtype can still be used to select video formats.
 + *  RNA ensures these enum's are only selectable for render output.
   */
  typedef struct ImageFormatData {
-       char imtype;   /* R_IMF_IMTYPE_PNG, R_... */
-                      /* note, video types should only ever be set from this
-                       * structure when used from RenderData */
-       char depth;    /* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
-                       * not a flag, only set 1 at a time */
+       /**
+        * R_IMF_IMTYPE_PNG, R_...
+        * \note, video types should only ever be set from this structure when used from RenderData.
+        */
+       char imtype;
+       /**
+        * bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
+        * not a flag, only set 1 at a time. */
+       char depth;
  
-       char planes;   /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */
-       char flag;     /* generic options for all image types, alpha zbuffer */
+       /** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */
+       char planes;
+       /** Generic options for all image types, alpha zbuffer. */
+       char flag;
  
-       char quality;  /* (0 - 100), eg: jpeg quality */
-       char compress; /* (0 - 100), eg: png compression */
+       /** (0 - 100), eg: jpeg quality. */
+       char quality;
+       /** (0 - 100), eg: png compression. */
+       char compress;
  
  
        /* --- format specific --- */
@@@ -1877,22 -1961,17 +2030,17 @@@ extern const char *RE_engine_id_CYCLES
  /* Current precision is 16 for the sub-frames closer to MAXFRAME. */
  
  /* for general use */
 -#define MAXFRAME      1048574
 -#define MAXFRAMEF     1048574.0f
 +#define MAXFRAME    1048574
 +#define MAXFRAMEF   1048574.0f
  
 -#define MINFRAME      0
 -#define MINFRAMEF     0.0f
 +#define MINFRAME    0
 +#define MINFRAMEF   0.0f
  
  /* (minimum frame number for current-frame) */
 -#define MINAFRAME     -1048574
 -#define MINAFRAMEF    -1048574.0f
 +#define MINAFRAME   -1048574
 +#define MINAFRAMEF  -1048574.0f
  
- /* deprecate this! */
  #define BASE_VISIBLE(v3d, base) (                                                                        \
-       (((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) &&                  \
-       (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) &&                        \
-       (((base)->flag & BASE_VISIBLE) != 0))
- #define BASE_VISIBLE_BGMODE(v3d, base) (                                                                 \
        ((v3d == NULL) || ((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
        ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) &&     \
        (((base)->flag & BASE_VISIBLE) != 0))
@@@ -2169,27 -2246,30 +2315,30 @@@ enum 
  
  /* ToolSettings.uvcalc_flag */
  #define UVCALC_FILLHOLES                      (1 << 0)
- #define UVCALC_NO_ASPECT_CORRECT      (1 << 1)        /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
- #define UVCALC_TRANSFORM_CORRECT      (1 << 2)        /* adjust UV's while transforming to avoid distortion */
- #define UVCALC_USESUBSURF                     (1 << 3)        /* Use mesh data after subsurf to compute UVs*/
+ /** would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
+ #define UVCALC_NO_ASPECT_CORRECT      (1 << 1)
+ /** adjust UV's while transforming to avoid distortion */
+ #define UVCALC_TRANSFORM_CORRECT      (1 << 2)
+ /** Use mesh data after subsurf to compute UVs*/
+ #define UVCALC_USESUBSURF                     (1 << 3)
  
  /* ToolSettings.uv_flag */
 -#define UV_SYNC_SELECTION     1
 -#define UV_SHOW_SAME_IMAGE    2
 +#define UV_SYNC_SELECTION   1
 +#define UV_SHOW_SAME_IMAGE  2
  
  /* ToolSettings.uv_selectmode */
 -#define UV_SELECT_VERTEX      1
 -#define UV_SELECT_EDGE                2
 -#define UV_SELECT_FACE                4
 -#define UV_SELECT_ISLAND      8
 +#define UV_SELECT_VERTEX    1
 +#define UV_SELECT_EDGE      2
 +#define UV_SELECT_FACE      4
 +#define UV_SELECT_ISLAND    8
  
  /* ToolSettings.edge_mode */
 -#define EDGE_MODE_SELECT                              0
 -#define EDGE_MODE_TAG_SEAM                            1
 -#define EDGE_MODE_TAG_SHARP                           2
 -#define EDGE_MODE_TAG_CREASE                  3
 -#define EDGE_MODE_TAG_BEVEL                           4
 -#define EDGE_MODE_TAG_FREESTYLE                       5
 +#define EDGE_MODE_SELECT                0
 +#define EDGE_MODE_TAG_SEAM              1
 +#define EDGE_MODE_TAG_SHARP             2
 +#define EDGE_MODE_TAG_CREASE            3
 +#define EDGE_MODE_TAG_BEVEL             4
 +#define EDGE_MODE_TAG_FREESTYLE         5
  
  /* ToolSettings.gizmo_flag */
  enum {
Simple merge
index 7086359c383680c8bb5782a4edfc17402a9a0ef0,4aee3458a9230224fbcc4af3c3f2c060b928724c..9fdaacc8f6cbd76ed7abdd3ff96f7d7d1a285052
@@@ -53,12 -48,11 +48,12 @@@ set(DEFSR
        rna_gpencil_modifier.c
        rna_image.c
        rna_key.c
-       rna_lamp.c
        rna_lattice.c
        rna_layer.c
+       rna_light.c
        rna_lightprobe.c
        rna_linestyle.c
 +      rna_lanpr.c
        rna_main.c
        rna_mask.c
        rna_material.c
index 3a318ac58f30098aa436dab896e70ff863a2ffe0,6aec918f7f9028245b943b0e8b43192b64f5730c..347cb9fc3795e32b72ae47f704861f82bca0f508
@@@ -3628,10 -3652,10 +3703,10 @@@ void rna_def_freestyle_settings(Blender
  
        static const EnumPropertyItem freestyle_ui_mode_items[] = {
                {FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode",
 -                                              "Advanced mode for using style modules written in Python"},
 +               "Advanced mode for using style modules written in Python"},
                {FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode",
-                "Basic mode for interactive style parameter editing"},
-               {0, NULL, 0, NULL, NULL}
+                                               "Basic mode for interactive style parameter editing"},
+               {0, NULL, 0, NULL, NULL},
        };
  
        static const EnumPropertyItem visibility_items[] = {
@@@ -4893,10 -4917,10 +4968,10 @@@ static void rna_def_scene_render_data(B
  
        static const EnumPropertyItem views_format_items[] = {
                {SCE_VIEWS_FORMAT_STEREO_3D, "STEREO_3D", 0, "Stereo 3D",
 -                                      "Single stereo camera system, adjust the stereo settings in the camera panel"},
 +               "Single stereo camera system, adjust the stereo settings in the camera panel"},
                {SCE_VIEWS_FORMAT_MULTIVIEW, "MULTIVIEW", 0, "Multi-View",
-                "Multi camera system, adjust the cameras individually"},
-               {0, NULL, 0, NULL, NULL}
+                                       "Multi camera system, adjust the cameras individually"},
+               {0, NULL, 0, NULL, NULL},
        };
  
        static const EnumPropertyItem hair_shape_type_items[] = {
@@@ -5860,10 -5890,10 +5941,10 @@@ static void rna_def_scene_eevee(Blender
        StructRNA *srna;
        PropertyRNA *prop;
  
 -      static const  EnumPropertyItem eevee_shadow_method_items[] = {
 +      static const EnumPropertyItem eevee_shadow_method_items[] = {
                {SHADOW_ESM, "ESM", 0, "ESM", "Exponential Shadow Mapping"},
                {SHADOW_VSM, "VSM", 0, "VSM", "Variance Shadow Mapping"},
-               {0, NULL, 0, NULL, NULL}
+               {0, NULL, 0, NULL, NULL},
        };
  
        static const EnumPropertyItem eevee_shadow_size_items[] = {