Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 28 Sep 2017 11:13:09 +0000 (16:13 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 28 Sep 2017 11:13:09 +0000 (16:13 +0500)
CMakeLists.txt
build_files/build_environment/windows/build_deps.cmd
source/blender/blenkernel/intern/curve.c
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/versioning_defaults.c
source/blender/python/generic/bgl.c

index 53c66a6302cc23bd7a5751c5af0c3188048791ee..2f920474f0912799e11acccd1334e421264c0997 100644 (file)
@@ -1423,6 +1423,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
                "/wd4800"  # forcing value to bool 'true' or 'false'
                # errors:
                "/we4013"  # 'function' undefined; assuming extern returning int
+               "/we4133"  # incompatible pointer types
                "/we4431"  # missing type specifier - int assumed
        )
 
index a18eb085e4fc2d78171c92233f01a764a33d145a..96280014df29365a4b5d0432cc550a5eda093ae8 100644 (file)
@@ -101,8 +101,8 @@ cd %Staging%\%BuildDir%%ARCH%R
 echo %DATE% %TIME% : Start > %StatusFile%
 cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DBUILD_MODE=Release -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/
 echo %DATE% %TIME% : Release Configuration done >> %StatusFile%
-msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log 
-msbuild /m "BlenderDependencies.sln" /p:Configuration=Release /fl /flp:logfile=BlenderDeps.log 
+msbuild /m "ll.vcxproj" /p:Configuration=Release /fl /flp:logfile=BlenderDeps_llvm.log;Verbosity=normal
+msbuild /m "BlenderDependencies.sln" /p:Configuration=Release /fl /flp:logfile=BlenderDeps.log;Verbosity=minimal  /verbosity:minimal
 echo %DATE% %TIME% : Release Build done >> %StatusFile%
 cmake --build . --target Harvest_Release_Results  > Harvest_Release.txt
 echo %DATE% %TIME% : Release Harvest done >> %StatusFile%
@@ -111,8 +111,8 @@ mkdir %STAGING%\%BuildDir%%ARCH%D
 cd %Staging%\%BuildDir%%ARCH%D
 cmake -G "%CMAKE_BUILDER%" %SOURCE_DIR% -DDOWNLOAD_DIR=%BUILD_DIR%/downloads -DCMAKE_BUILD_TYPE=Debug -DBUILD_MODE=Debug -DHARVEST_TARGET=%HARVEST_DIR%/%HARVESTROOT%%VSVER_SHORT%/  %CMAKE_DEBUG_OPTIONS%
 echo %DATE% %TIME% : Debug Configuration done >> %StatusFile%
-msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log 
-msbuild /m "BlenderDependencies.sln" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps.log
+msbuild /m "ll.vcxproj" /p:Configuration=Debug /fl /flp:logfile=BlenderDeps_llvm.log;;Verbosity=normal 
+msbuild /m "BlenderDependencies.sln" /p:Configuration=Debug /verbosity:n /fl /flp:logfile=BlenderDeps.log;;Verbosity=normal
 echo %DATE% %TIME% : Debug Build done >> %StatusFile%
 cmake --build . --target Harvest_Debug_Results> Harvest_Debug.txt
 echo %DATE% %TIME% : Debug Harvest done >> %StatusFile%
index 88077c3bf4e3c5315dfd590c7257378a60a0c8a5..5fbaae7212b7994f8f93ee195ef12d250826d2ec 100644 (file)
@@ -4044,7 +4044,7 @@ bool BKE_nurb_check_valid_u(struct Nurb *nu)
                return true;           /* not a nurb, lets assume its valid */
 
        if (nu->pntsu < nu->orderu) return false;
-       if (((nu->flag & CU_NURB_CYCLIC) == 0) && (nu->flagu & CU_NURB_BEZIER)) { /* Bezier U Endpoints */
+       if (((nu->flagu & CU_NURB_CYCLIC) == 0) && (nu->flagu & CU_NURB_BEZIER)) { /* Bezier U Endpoints */
                if (nu->orderu == 4) {
                        if (nu->pntsu < 5)
                                return false;  /* bezier with 4 orderu needs 5 points */
@@ -4065,7 +4065,7 @@ bool BKE_nurb_check_valid_v(struct Nurb *nu)
 
        if (nu->pntsv < nu->orderv)
                return false;
-       if (((nu->flag & CU_NURB_CYCLIC) == 0) && (nu->flagv & CU_NURB_BEZIER)) { /* Bezier V Endpoints */
+       if (((nu->flagv & CU_NURB_CYCLIC) == 0) && (nu->flagv & CU_NURB_BEZIER)) { /* Bezier V Endpoints */
                if (nu->orderv == 4) {
                        if (nu->pntsv < 5)
                                return false;  /* bezier with 4 orderu needs 5 points */
index 3ff51f5879e1a0e2242051b2886059964f5ffa61..8c414c31b81097894fb0d9ea6e30b0c823ddc896 100644 (file)
@@ -1703,24 +1703,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                                }
                        }
                }
-
-               {
-                       Brush *br;
-                       br = (Brush *)BKE_libblock_find_name_ex(main, ID_BR, "Average");
-                       if (!br) {
-                               br = BKE_brush_add(main, "Average", OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT);
-                               br->vertexpaint_tool = PAINT_BLEND_AVERAGE;
-                               br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
-                       }
-
-                       br = (Brush *)BKE_libblock_find_name_ex(main, ID_BR, "Smear");
-                       if (!br) {
-                               br = BKE_brush_add(main, "Smear", OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT);
-                               br->vertexpaint_tool = PAINT_BLEND_SMEAR;
-                               br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
-                       }
-               }
-
        }
 }
 
index fd8067bab35230f49b1b8da04a36fd79d15d5ec3..54ed29ab6fa24937dbeca6996e3830cf341d7491 100644 (file)
@@ -275,6 +275,20 @@ void BLO_update_defaults_startup_blend(Main *bmain)
                        br->ob_mode = OB_MODE_TEXTURE_PAINT;
                }
 
+               /* Vertex/Weight Paint */
+               br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Average");
+               if (!br) {
+                       br = BKE_brush_add(bmain, "Average", OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT);
+                       br->vertexpaint_tool = PAINT_BLEND_AVERAGE;
+                       br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
+               }
+               br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Smear");
+               if (!br) {
+                       br = BKE_brush_add(bmain, "Smear", OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT);
+                       br->vertexpaint_tool = PAINT_BLEND_SMEAR;
+                       br->ob_mode = OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT;
+               }
+
                br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Mask");
                if (br) {
                        br->imagepaint_tool = PAINT_TOOL_MASK;
index ada7f7d8afbc69c08bca3077cda92c8d5f26fa6f..c290e5bd7a025928c63407f0a6db4b8d9c01d2df 100644 (file)
@@ -476,20 +476,35 @@ int BGL_typeSize(int type)
        return -1;
 }
 
-static int gl_buffer_type_from_py_format_char(char format)
+static int gl_buffer_type_from_py_format_char(char *typestr)
 {
+       if (ELEM(typestr[0], '<', '>', '|')) {
+               typestr += 1;
+       }
+       char format = typestr[0];
+       char byte_num = typestr[1];
+
        switch (format) {
+               case 't':
                case 'b':
-                       return GL_BYTE;
                case 'h':
+                       if (!byte_num) return GL_BYTE;
+                       ATTR_FALLTHROUGH;
                case 'i':
-                       return GL_SHORT;
+                       if (!byte_num) return GL_SHORT;
+                       ATTR_FALLTHROUGH;
                case 'l':
-                       return GL_INT;
+                       if (!byte_num || byte_num == '4') return GL_INT;
+                       if (byte_num == '1') return GL_BYTE;
+                       if (byte_num == '2') return GL_SHORT;
+                       break;
                case 'f':
-                       return GL_FLOAT;
+                       if (!byte_num) return GL_FLOAT;
+                       ATTR_FALLTHROUGH;
                case 'd':
-                       return GL_DOUBLE;
+                       if (!byte_num || byte_num == '8') return GL_DOUBLE;
+                       if (byte_num == '4') return GL_FLOAT;
+                       break;
        }
        return -1; /* UNKNOWN */
 }
@@ -786,9 +801,9 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
                        return NULL;
                }
 
-               if (type != gl_buffer_type_from_py_format_char(*pybuffer.format)) {
+               if (type != gl_buffer_type_from_py_format_char(pybuffer.format)) {
                        PyErr_Format(PyExc_TypeError,
-                                    "`GL_TYPE` and `format` of object with buffer interface do not match");
+                                    "`GL_TYPE` and `typestr` of object with buffer interface do not match. '%s'", pybuffer.format);
                }
                else if (ndimensions != pybuffer.ndim ||
                        !compare_dimensions(ndimensions, dimensions, pybuffer.shape))