From a92468c7d7bd3171cc04dc956f559f6c8f4f338c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 20 Jun 2013 11:47:09 +0000 Subject: [PATCH 01/14] Fix #35807: blender internal motion blur render without antialiasing would give black speckles (self intersection errors) in raytraced shadows. Motion blur does some extra offsets for free antialiasing in the motion blur samples, but did not take them into account everywhere. --- source/blender/render/intern/source/shadeinput.c | 4 ++++ source/blender/render/intern/source/zbuf.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index eb9e72fedfa..2dcb55f1f5d 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1416,6 +1416,10 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y) xs = (float)x + R.samples->centLut[b & 15] + 0.5f; ys = (float)y + R.samples->centLut[b >> 4] + 0.5f; } + else if (R.i.curblur) { + xs= (float)x + R.mblur_jit[R.i.curblur-1][0] + 0.5f; + ys= (float)y + R.mblur_jit[R.i.curblur-1][1] + 0.5f; + } else { xs = (float)x + 0.5f; ys = (float)y + 0.5f; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index b974022790d..2f45ad756d3 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3824,6 +3824,10 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int xs= (float)x + R.samples->centLut[b & 15] + 0.5f; ys= (float)y + R.samples->centLut[b>>4] + 0.5f; } + else if (R.i.curblur) { + xs= (float)x + R.mblur_jit[R.i.curblur-1][0] + 0.5f; + ys= (float)y + R.mblur_jit[R.i.curblur-1][1] + 0.5f; + } else { xs= (float)x + 0.5f; ys= (float)y + 0.5f; From 8d6e5e2feeecdcff4d4b0d3651043ca561af2cb4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 20 Jun 2013 13:10:47 +0000 Subject: [PATCH 02/14] Cycles: update build configurations to include CUDA sm_35 architecture. When using a compiler older than CUDA 5.0 it will give a warning and skip this architecture. --- CMakeLists.txt | 2 +- .../config/user-config-cuda-glibc211-i686.py | 2 +- .../user-config-cuda-glibc211-x86_64.py | 2 +- .../buildbot/config/user-config-mac-i386.py | 2 +- .../buildbot/config/user-config-mac-x86_64.py | 2 +- build_files/scons/config/darwin-config.py | 2 +- build_files/scons/config/linux-config.py | 2 +- .../scons/config/win32-mingw-config.py | 2 +- build_files/scons/config/win32-vc-config.py | 2 +- .../scons/config/win64-mingw-config.py | 2 +- build_files/scons/config/win64-vc-config.py | 2 +- intern/cycles/device/device_cuda.cpp | 2 +- intern/cycles/kernel/CMakeLists.txt | 28 +++++++++++-------- intern/cycles/kernel/SConscript | 4 +++ intern/cycles/util/util_types.h | 2 +- 15 files changed, 33 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2dda8553d6..acd01f43fcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -264,7 +264,7 @@ option(WITH_CYCLES "Enable cycles Render Engine" ON) option(WITH_CYCLES_TEST "Build cycles test application" OFF) option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF) option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF) -set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 CACHE STRING "CUDA architectures to build binaries for") +set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 CACHE STRING "CUDA architectures to build binaries for") mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH) unset(PLATFORM_DEFAULT) diff --git a/build_files/buildbot/config/user-config-cuda-glibc211-i686.py b/build_files/buildbot/config/user-config-cuda-glibc211-i686.py index 0e56c4326f9..69053d7ff39 100644 --- a/build_files/buildbot/config/user-config-cuda-glibc211-i686.py +++ b/build_files/buildbot/config/user-config-cuda-glibc211-i686.py @@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686' BF_INSTALLDIR = '../blender-install/linux-glibc211-i686' BF_NUMJOBS = 1 -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] diff --git a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py index 59725522e18..c9b765f55ac 100644 --- a/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py +++ b/build_files/buildbot/config/user-config-cuda-glibc211-x86_64.py @@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64' BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64' BF_NUMJOBS = 1 -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] diff --git a/build_files/buildbot/config/user-config-mac-i386.py b/build_files/buildbot/config/user-config-mac-i386.py index e7b1b688100..60f8b5705ac 100644 --- a/build_files/buildbot/config/user-config-mac-i386.py +++ b/build_files/buildbot/config/user-config-mac-i386.py @@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' WITH_BF_CYCLES_CUDA_BINARIES = True BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] #Freestyle WITH_BF_FREESTYLE = True diff --git a/build_files/buildbot/config/user-config-mac-x86_64.py b/build_files/buildbot/config/user-config-mac-x86_64.py index f5f6bf84796..4fab8d6d566 100644 --- a/build_files/buildbot/config/user-config-mac-x86_64.py +++ b/build_files/buildbot/config/user-config-mac-x86_64.py @@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' WITH_BF_CYCLES_CUDA_BINARIES = True BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] #Freestyle WITH_BF_FREESTYLE = True diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 0e413711210..f7192e3dd81 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' WITH_BF_CYCLES_CUDA_BINARIES = False BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] #Freestyle WITH_BF_FREESTYLE = True diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index 418d2ef41b8..6106142f8a9 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -210,7 +210,7 @@ WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST WITH_BF_CYCLES_CUDA_BINARIES = False BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] WITH_BF_OPENMP = True diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py index 5d3c285f530..d71feb8d2e9 100644 --- a/build_files/scons/config/win32-mingw-config.py +++ b/build_files/scons/config/win32-mingw-config.py @@ -149,7 +149,7 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada' WITH_BF_CYCLES = True WITH_BF_CYCLES_CUDA_BINARIES = False BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] WITH_BF_OIIO = True BF_OIIO = LIBDIR + '/openimageio' diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index bceab628b47..101d0402757 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -215,7 +215,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' #CUDA WITH_BF_CYCLES_CUDA_BINARIES = False #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True diff --git a/build_files/scons/config/win64-mingw-config.py b/build_files/scons/config/win64-mingw-config.py index b817f24da11..e82b6e8a73f 100644 --- a/build_files/scons/config/win64-mingw-config.py +++ b/build_files/scons/config/win64-mingw-config.py @@ -146,7 +146,7 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada' WITH_BF_CYCLES = True WITH_BF_CYCLES_CUDA_BINARIES = False BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] WITH_BF_OIIO = True BF_OIIO = LIBDIR + '/openimageio' diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index c7bf2fa0bd2..803cac144ab 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -212,7 +212,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' #CUDA WITH_BF_CYCLES_CUDA_BINARIES = False #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35'] #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 1f96ed0ae83..27c54af5153 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -304,7 +304,7 @@ public: } } else { - /* CUDA 4.x */ + /* CUDA 5.x */ if(major == 1) { /* sm_1x */ arch_flags = "--maxrregcount=24 --opencc-options -OPT:Olimit=0 --use_fast_math"; diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 5e9dd15b812..2fa1393e935 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -130,6 +130,12 @@ if(WITH_CYCLES_CUDA_BINARIES) string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT}) set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}") + # warn for other versions + if(CUDA_VERSION MATCHES "50") + else() + message(WARNING "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported") + endif() + # build for each arch set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS}) set(cuda_cubins) @@ -139,12 +145,6 @@ if(WITH_CYCLES_CUDA_BINARIES) set(cuda_version_flags "-D__KERNEL_CUDA_VERSION__=${CUDA_VERSION}") - # warn for other versions - if(CUDA_VERSION MATCHES "50") - else() - message(STATUS "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported") - endif() - # build flags depending on CUDA version and arch if(CUDA_VERSION LESS 50) # CUDA 4.x @@ -176,13 +176,17 @@ if(WITH_CYCLES_CUDA_BINARIES) set(cuda_math_flags "--use_fast_math") endif() - add_custom_command( - OUTPUT ${cuda_cubin} - COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC - DEPENDS ${cuda_sources}) + if(CUDA_VERSION LESS 50 AND ${arch} MATCHES "sm_35") + message(WARNING "Can't build kernel for CUDA sm_35 architecture, skipping") + else() + add_custom_command( + OUTPUT ${cuda_cubin} + COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC + DEPENDS ${cuda_sources}) - delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib) - list(APPEND cuda_cubins ${cuda_cubin}) + delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib) + list(APPEND cuda_cubins ${cuda_cubin}) + endif() endforeach() add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins}) diff --git a/intern/cycles/kernel/SConscript b/intern/cycles/kernel/SConscript index 353ec1ce9d8..6459c3ed183 100644 --- a/intern/cycles/kernel/SConscript +++ b/intern/cycles/kernel/SConscript @@ -88,6 +88,10 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']: # build flags depending on CUDA version and arch if cuda_version < 50: + if arch == "sm_35": + print("Can't build kernel for CUDA sm_35 architecture, skipping") + continue + # CUDA 4.x if arch.startswith("sm_1"): # sm_1x diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 4fd1e9d8807..a67c55acf3d 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -517,7 +517,7 @@ __device_inline const __m128 shuffle_swap(const __m128& a, const shuffle_swap_t& #else -/* somewhat slower version for SSE3 */ +/* somewhat slower version for SSE2 */ typedef int shuffle_swap_t; __device_inline const shuffle_swap_t shuffle_swap_identity(void) From 70212510438fdb1494892b8f75b59cd018b47d5b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Jun 2013 13:24:07 +0000 Subject: [PATCH 03/14] transform: 2d option for proportional editmode, Uses for view orientation for distance calculation, can give nicer results when you dont want twisting caused by changes in depth. --- source/blender/editors/transform/transform.c | 21 +++++++------ source/blender/editors/transform/transform.h | 2 ++ .../editors/transform/transform_conversions.c | 24 +++++++++++++-- .../editors/transform/transform_generics.c | 30 +++++++++++-------- source/blender/makesdna/DNA_scene_types.h | 3 +- source/blender/makesrna/intern/rna_scene.c | 2 ++ 6 files changed, 56 insertions(+), 26 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 7a8d4c6750e..ca31a4a98de 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1736,12 +1736,15 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } /* convert flag to enum */ - switch (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + switch (t->flag & T_PROP_EDIT_ALL) { + case T_PROP_EDIT: + proportional = PROP_EDIT_ON; + break; case (T_PROP_EDIT | T_PROP_CONNECTED): proportional = PROP_EDIT_CONNECTED; break; - case T_PROP_EDIT: - proportional = PROP_EDIT_ON; + case (T_PROP_EDIT | T_PROP_PROJECTED): + proportional = PROP_EDIT_PROJECTED; break; default: proportional = PROP_EDIT_OFF; @@ -2945,7 +2948,7 @@ static void headerResize(TransInfo *t, float vec[3], char *str) } } - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size); } } @@ -3143,7 +3146,7 @@ int Resize(TransInfo *t, const int mval[2]) /* vertices in the radius of the brush end */ /* outside the clipping area */ /* XXX HACK - dg */ - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { clipUVData(t); } } @@ -3663,7 +3666,7 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2])) RAD2DEGF(final), t->con.text, t->proptext); } - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size); } @@ -3764,7 +3767,7 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2])) RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext); } - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size); } @@ -3912,7 +3915,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) } } - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size); } } @@ -4019,7 +4022,7 @@ int Translation(TransInfo *t, const int UNUSED(mval[2])) /* vertices in the radius of the brush end */ /* outside the clipping area */ /* XXX HACK - dg */ - if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) { + if (t->flag & T_PROP_EDIT_ALL) { clipUVData(t); } } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 2cef3209b4e..53ecfe3a685 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -394,6 +394,8 @@ typedef struct TransInfo { #define T_PROP_EDIT (1 << 11) #define T_PROP_CONNECTED (1 << 12) +#define T_PROP_PROJECTED (1 << 25) +#define T_PROP_EDIT_ALL (T_PROP_EDIT | T_PROP_CONNECTED | T_PROP_PROJECTED) #define T_V3D_ALIGN (1 << 14) /* for 2d views like uv or ipo */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index d1b57e2e402..2a982517d3e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -201,6 +201,17 @@ static void set_prop_dist(TransInfo *t, const bool with_dist) TransData *tob; int a; + float _proj_vec[3]; + const float *proj_vec = NULL; + + if (t->flag & T_PROP_PROJECTED) { + if (t->spacetype == SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) { + RegionView3D *rv3d = t->ar->regiondata; + normalize_v3_v3(_proj_vec, rv3d->viewinv[2]); + proj_vec = _proj_vec; + } + } + for (a = 0, tob = t->data; a < t->total; a++, tob++) { tob->rdist = 0.0f; // init, it was mallocced @@ -216,6 +227,13 @@ static void set_prop_dist(TransInfo *t, const bool with_dist) if (td->flag & TD_SELECTED) { sub_v3_v3v3(vec, tob->center, td->center); mul_m3_v3(tob->mtx, vec); + + if (proj_vec) { + float vec_p[3]; + project_v3_v3v3(vec_p, vec, proj_vec); + sub_v3_v3(vec, vec_p); + } + dist = len_squared_v3(vec); if ((tob->rdist == -1.0f) || (dist < (tob->rdist * tob->rdist))) { tob->rdist = sqrtf(dist); @@ -989,7 +1007,7 @@ static void createTransPose(TransInfo *t, Object *ob) t->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */ /* disable PET, its not usable in pose mode yet [#32444] */ - t->flag &= ~(T_PROP_EDIT | T_PROP_CONNECTED); + t->flag &= ~T_PROP_EDIT_ALL; /* init trans data */ td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransPoseBone"); @@ -2013,7 +2031,7 @@ static void createTransEditVerts(TransInfo *t) float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL; float *dists = NULL; int count = 0, countsel = 0, a, totleft; - int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) : 0; + int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & T_PROP_EDIT_ALL) : 0; int mirror = 0; char *selstate = NULL; short selectmode = ts->selectmode; @@ -5827,7 +5845,7 @@ static void createTransNodeData(bContext *UNUSED(C), TransInfo *t) } /* nodes dont support PET and probably never will */ - t->flag &= ~(T_PROP_EDIT | T_PROP_CONNECTED); + t->flag &= ~T_PROP_EDIT_ALL; /* set transform flags on nodes */ for (node = snode->edittree->nodes.first; node; node = node->next) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 369b5a82a84..3e4316b1277 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1023,6 +1023,20 @@ void resetTransRestrictions(TransInfo *t) t->flag &= ~T_ALL_RESTRICTIONS; } +static int initTransInfo_edit_pet_to_flag(const int proportional) +{ + switch (proportional) { + case PROP_EDIT_ON: + return T_PROP_EDIT; + case PROP_EDIT_CONNECTED: + return T_PROP_EDIT | T_PROP_CONNECTED; + case PROP_EDIT_PROJECTED: + return T_PROP_EDIT | T_PROP_PROJECTED; + default: + return 0; + } +} + /* the *op can be NULL */ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event) { @@ -1245,24 +1259,14 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even /* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */ if (op && (prop = RNA_struct_find_property(op->ptr, "proportional"))) { if (RNA_property_is_set(op->ptr, prop)) { - switch (RNA_property_enum_get(op->ptr, prop)) { - case PROP_EDIT_CONNECTED: - t->flag |= T_PROP_CONNECTED; - case PROP_EDIT_ON: - t->flag |= T_PROP_EDIT; - break; - } + t->flag |= initTransInfo_edit_pet_to_flag(RNA_property_enum_get(op->ptr, prop)); } else { /* use settings from scene only if modal */ if (t->flag & T_MODAL) { if ((t->options & CTX_NO_PET) == 0) { - if (t->obedit && ts->proportional != PROP_EDIT_OFF) { - t->flag |= T_PROP_EDIT; - - if (ts->proportional == PROP_EDIT_CONNECTED) { - t->flag |= T_PROP_CONNECTED; - } + if (t->obedit) { + t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional); } else if (t->options & CTX_MASK) { if (ts->proportional_mask) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index bc911f9addc..e08ecf6dff8 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1501,7 +1501,8 @@ typedef struct Scene { /* toolsettings->proportional */ #define PROP_EDIT_OFF 0 #define PROP_EDIT_ON 1 -#define PROP_EDIT_CONNECTED 2 +#define PROP_EDIT_CONNECTED 2 +#define PROP_EDIT_PROJECTED 3 /* toolsettings->weightuser */ enum { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 44eee642081..0c3f4aa073b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -120,6 +120,8 @@ EnumPropertyItem proportional_falloff_curve_only_items[] = { EnumPropertyItem proportional_editing_items[] = { {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"}, {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"}, + {PROP_EDIT_PROJECTED, "PROJECTED", ICON_PROP_ON, "Projected (2D)", + "Proportional Editing using screen space locations"}, {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"}, {0, NULL, 0, NULL, NULL} From f35264706a403a666e7f3077c4b807bd1aaa3765 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 20 Jun 2013 13:27:48 +0000 Subject: [PATCH 04/14] Construct orco UV layer for curve when applying constructive modifier Also construct orco uv layer when converting curve to a mesh. This makes it possible to preserve automatically generated coordinates ("use uv for mapping" option) when using constructive modifiers or converting curve to the mesh. With cycles nothing special is needed to preserve texture mapping after such operations, in blender internal you'll need to change texture mapping from Generated to UV. This feature is useful on it's own and also would help in potential switch 3d viewport to always use DM to draw objects, which would help making drawing more thread-safe. --- source/blender/blenkernel/intern/cdderivedmesh.c | 11 ++++++++++- source/blender/blenkernel/intern/mesh.c | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 64d6ca6666e..73c722a4849 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1823,16 +1823,19 @@ DerivedMesh *CDDM_from_curve(Object *ob) DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase) { + Curve *cu = (Curve *) ob->data; DerivedMesh *dm; CDDerivedMesh *cddm; MVert *allvert; MEdge *alledge; MLoop *allloop; MPoly *allpoly; + MLoopUV *alluv = NULL; int totvert, totedge, totloop, totpoly; + bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0; if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert, &alledge, - &totedge, &allloop, &allpoly, NULL, + &totedge, &allloop, &allpoly, (use_orco_uv) ? &alluv : NULL, &totloop, &totpoly) != 0) { /* Error initializing mdata. This often happens when curve is empty */ @@ -1850,6 +1853,12 @@ DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase) memcpy(cddm->mloop, allloop, totloop * sizeof(MLoop)); memcpy(cddm->mpoly, allpoly, totpoly * sizeof(MPoly)); + if (alluv) { + const char *uvname = "Orco"; + CustomData_add_layer_named(&cddm->dm.polyData, CD_MTEXPOLY, CD_DEFAULT, NULL, totpoly, uvname); + CustomData_add_layer_named(&cddm->dm.loopData, CD_MLOOPUV, CD_ASSIGN, alluv, totloop, uvname); + } + MEM_freeN(allvert); MEM_freeN(alledge); MEM_freeN(allloop); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 7d728aad9cd..aeb1538ccf0 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1636,7 +1636,10 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use void BKE_mesh_from_nurbs(Object *ob) { - BKE_mesh_from_nurbs_displist(ob, &ob->disp, false); + Curve *cu = (Curve *) ob->data; + bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0; + + BKE_mesh_from_nurbs_displist(ob, &ob->disp, use_orco_uv); } typedef struct EdgeLink { From e85a39b7473b3f08aa5517f761da4c0901301796 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Jun 2013 13:52:58 +0000 Subject: [PATCH 05/14] Sequencer: fix names when adding several video (or audio) files at once (all strips were getting the same, annoying ;) ). --- source/blender/blenkernel/intern/sequencer.c | 5 ++--- source/blender/editors/space_sequencer/sequencer_add.c | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9b276912087..68fac399c51 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -4171,6 +4171,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad BKE_sequence_calc_disp(scene, seq); + if (seq_load->name[0] == '\0') + BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name)); if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) { int start_frame_back = seq_load->start_frame; @@ -4182,9 +4184,6 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad seq_load->channel--; } - if (seq_load->name[0] == '\0') - BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name)); - /* can be NULL */ seq_load_apply(scene, seq, seq_load); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 571779a7524..65199ee9c3d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -562,10 +562,14 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad RNA_string_get(&itemptr, "name", file_only); BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only); + /* Set seq_load.name, else all video/audio files get the same name! ugly! */ + BLI_strncpy(seq_load.name, file_only, sizeof(seq_load.name)); + seq = seq_load_func(C, ed->seqbasep, &seq_load); if (seq) { if (overlap == FALSE) { - if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene); + if (BKE_sequence_test_overlap(ed->seqbasep, seq)) + BKE_sequence_base_shuffle(ed->seqbasep, seq, scene); } } } From 2749875945856b2aab0b888f1730b9c191112193 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 20 Jun 2013 14:19:46 +0000 Subject: [PATCH 06/14] Move DLL copying to before actual build process. --- build_files/buildbot/slave_compile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 33879ccff17..f9aa45a4023 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -155,9 +155,9 @@ else: scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config)) - retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) - if builder.find('win') != -1: + if not os.path.exists(install_dir): + os.makedirs(install_dir) if builder.endswith('vc2012'): dlls = ('msvcp110.dll', 'msvcr110.dll', 'vcomp110.dll') else: @@ -169,4 +169,6 @@ else: for dll in dlls: shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll)) + retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options) + sys.exit(retcode) From 2dc88ca338b5b8952e3c9a6982f9cdb7b89af9a0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Jun 2013 18:19:42 +0000 Subject: [PATCH 07/14] support proportional editing with x-mirror enabled. --- release/scripts/startup/bl_ui/space_view3d_toolbar.py | 1 - source/blender/editors/transform/transform_conversions.c | 2 +- source/blender/editors/transform/transform_generics.c | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index cb1d374ce6b..a892a91d505 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -232,7 +232,6 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): mesh = ob.data col = layout.column(align=True) - col.active = tool_settings.proportional_edit == 'DISABLED' col.prop(mesh, "use_mirror_x") row = col.row() diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 2a982517d3e..1df5a7e323c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2038,7 +2038,7 @@ static void createTransEditVerts(TransInfo *t) int cd_vert_bweight_offset = -1; if (t->flag & T_MIRROR) { - EDBM_verts_mirror_cache_begin(em, 0, false, true); + EDBM_verts_mirror_cache_begin(em, 0, false, (t->flag & T_PROP_EDIT) == 0); mirror = 1; } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 3e4316b1277..7afced78746 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1314,9 +1314,11 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even } // Mirror is not supported with PET, turn it off. +#if 0 if (t->flag & T_PROP_EDIT) { t->flag &= ~T_MIRROR; } +#endif setTransformViewMatrices(t); initNumInput(&t->num); From c721d82f25b2cde800959711b8b4d4e501b8c819 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Jun 2013 19:09:18 +0000 Subject: [PATCH 08/14] move sort from vert/edge/face into mesh menu only (sorting isn't such a common operation). correct own recently added assert. --- release/scripts/startup/bl_ui/space_view3d.py | 14 ++++++++------ source/blender/blenlib/intern/BLI_heap.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index cfd8fd2080f..74f9d36db0a 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1800,9 +1800,7 @@ class VIEW3D_MT_edit_mesh(Menu): layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...") layout.separator() - layout.operator("mesh.symmetrize") - layout.operator("mesh.symmetry_snap") - layout.separator() + layout.operator("mesh.duplicate_move") layout.menu("VIEW3D_MT_edit_mesh_extrude") layout.menu("VIEW3D_MT_edit_mesh_delete") @@ -1816,6 +1814,12 @@ class VIEW3D_MT_edit_mesh(Menu): layout.separator() + layout.operator("mesh.symmetrize") + layout.operator("mesh.symmetry_snap") + layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...") + + layout.separator() + layout.prop(toolsettings, "use_mesh_automerge") layout.prop_menu_enum(toolsettings, "proportional_edit") layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") @@ -1871,6 +1875,7 @@ class VIEW3D_MT_edit_mesh_specials(Menu): layout.operator("mesh.shortest_path_select") layout.operator("mesh.sort_elements") layout.operator("mesh.symmetrize") + layout.operator("mesh.symmetry_snap") class VIEW3D_MT_edit_mesh_select_mode(Menu): @@ -1939,7 +1944,6 @@ class VIEW3D_MT_edit_mesh_vertices(Menu): layout.operator("mesh.bevel").vertex_only = True layout.operator("mesh.vertices_smooth") layout.operator("mesh.remove_doubles") - layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'} layout.operator("mesh.blend_from_shape") @@ -1996,7 +2000,6 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.operator("mesh.bevel").vertex_only = False layout.operator("mesh.edge_split") layout.operator("mesh.bridge_edge_loops") - layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'} layout.separator() @@ -2026,7 +2029,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu): layout.operator("mesh.bevel").vertex_only = False layout.operator("mesh.solidify") layout.operator("mesh.wireframe") - layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'} layout.separator() diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 2da36377e55..c62c79b492f 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -208,7 +208,7 @@ void *BLI_heap_popmin(Heap *heap) { void *ptr = heap->tree[0]->ptr; - BLI_assert(heap->size == 0); + BLI_assert(heap->size != 0); heap->tree[0]->ptr = heap->freenodes; heap->freenodes = heap->tree[0]; From 6a269e2a8e327fdc81f158b4e24c8909837f013c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Jun 2013 19:19:11 +0000 Subject: [PATCH 09/14] Install_deps.sh: ask suse users whether they want to install packman or not (can be already installed/enabled from a different URL, Suse repositories management is to complex to be handled automatically at this point). --- build_files/build_environment/install_deps.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index fbd4c2f46d7..514e9f4ee58 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -1550,7 +1550,7 @@ compile_OSL() { tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \ -xf $_src.tar.gz cd $_src - git checkout blender-fixes + #git checkout blender-fixes cd $CWD fi @@ -2278,8 +2278,18 @@ install_RPM() { fi _suse_rel="`grep VERSION /etc/SuSE-release | gawk '{print $3}'`" - sudo zypper ar -f http://packman.inode.at/suse/openSUSE_$_suse_rel/ packman + INFO "" + INFO "About to add 'packman' repository from http://packman.inode.at/suse/openSUSE_$_suse_rel/" + INFO "This is only needed if you do not already have a packman repository enabled..." + read -p "Do you want to add this repo (Y/n)?" + if [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" == "y" ]; then + INFO " Installing packman..." + sudo zypper ar -f http://packman.inode.at/suse/openSUSE_$_suse_rel/ packman + INFO " Done." + else + INFO " Skipping packman installation." + fi sudo zypper --non-interactive --gpg-auto-import-keys update --auto-agree-with-licenses fi From 2efea8cf03f9bcb923d969b9ba4c905503e306dc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Jun 2013 19:39:29 +0000 Subject: [PATCH 10/14] reduce sign comparisons for ghash and add more strict warnings for gcc. --- source/blender/blenlib/BLI_ghash.h | 2 +- source/blender/blenlib/intern/BLI_ghash.c | 10 ++++++---- source/blender/blenlib/intern/BLI_heap.c | 2 ++ source/blender/blenlib/intern/BLI_mempool.c | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 07ab6f3869e..930715b4bc6 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -60,7 +60,7 @@ typedef struct GHash { typedef struct GHashIterator { GHash *gh; - int curBucket; + unsigned int curBucket; struct Entry *curEntry; } GHashIterator; diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 749c008d8c3..5cd5a904996 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -44,6 +44,8 @@ #ifdef __GNUC__ # pragma GCC diagnostic error "-Wsign-conversion" +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wconversion" #endif const unsigned int hashsizes[] = { @@ -152,7 +154,7 @@ bool BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFr void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) { - int i; + unsigned int i; if (keyfreefp || valfreefp) { for (i = 0; i < gh->nbuckets; i++) { @@ -220,7 +222,7 @@ bool BLI_ghash_haskey(GHash *gh, const void *key) void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) { - int i; + unsigned int i; if (keyfreefp || valfreefp) { for (i = 0; i < gh->nbuckets; i++) { @@ -252,7 +254,7 @@ GHashIterator *BLI_ghashIterator_new(GHash *gh) GHashIterator *ghi = MEM_mallocN(sizeof(*ghi), "ghash iterator"); ghi->gh = gh; ghi->curEntry = NULL; - ghi->curBucket = -1; + ghi->curBucket = (unsigned int)-1; while (!ghi->curEntry) { ghi->curBucket++; if (ghi->curBucket == ghi->gh->nbuckets) @@ -265,7 +267,7 @@ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh) { ghi->gh = gh; ghi->curEntry = NULL; - ghi->curBucket = -1; + ghi->curBucket = (unsigned int)-1; while (!ghi->curEntry) { ghi->curBucket++; if (ghi->curBucket == ghi->gh->nbuckets) diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index c62c79b492f..93c99fed8e2 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -41,6 +41,8 @@ #ifdef __GNUC__ # pragma GCC diagnostic error "-Wsign-conversion" +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wconversion" #endif /***/ diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 136ecc244fa..ff9a5abfaa1 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -45,6 +45,8 @@ #ifdef __GNUC__ # pragma GCC diagnostic error "-Wsign-conversion" +# pragma GCC diagnostic error "-Wsign-compare" +# pragma GCC diagnostic error "-Wconversion" #endif /* note: copied from BLO_blend_defs.h, don't use here because we're in BLI */ @@ -102,8 +104,8 @@ BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag) } /* set the elem size */ - if (esize < MEMPOOL_ELEM_SIZE_MIN) { - esize = MEMPOOL_ELEM_SIZE_MIN; + if (esize < (int)MEMPOOL_ELEM_SIZE_MIN) { + esize = (int)MEMPOOL_ELEM_SIZE_MIN; } if (flag & BLI_MEMPOOL_ALLOW_ITER) { From b2e01fa6bb42aa8abe41edf9743fed3faccbef4b Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Thu, 20 Jun 2013 21:36:30 +0000 Subject: [PATCH 11/14] Updating suse packman repo url, name and alias to go in line with what suse does right now. At least this should avoid duplicate packman repos on 12.3 --- build_files/build_environment/install_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 514e9f4ee58..2ac3a75688e 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -2285,7 +2285,7 @@ install_RPM() { read -p "Do you want to add this repo (Y/n)?" if [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" == "y" ]; then INFO " Installing packman..." - sudo zypper ar -f http://packman.inode.at/suse/openSUSE_$_suse_rel/ packman + sudo zypper ar --refresh --name 'Packman Repository' http://ftp.gwdg.de/pub/linux/packman/suse/openSUSE_$_suse_rel/ ftp.gwdg.de-suse INFO " Done." else INFO " Skipping packman installation." From d3fc2bd95bd722f46e9ad3034e519e4bfcaa41e2 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 20 Jun 2013 22:37:55 +0000 Subject: [PATCH 12/14] BGE: Fix for [#33163] "Text Font Bug" reported and fixed by HG1. The embedded player was calling glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) before rendering font objects, but someone forgot to add this to the Blenderplayer. --- source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index d81140992ec..39579f5629f 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -363,6 +363,8 @@ void GPC_RenderTools::RenderText3D( int fontid, double* mat, float aspect) { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */ + if (GLEW_ARB_multitexture) { for (int i=0; i Date: Thu, 20 Jun 2013 23:20:33 +0000 Subject: [PATCH 13/14] Default paint context will be image paint if object is not in a paint mode. It solves not being able to tweak textures in the new texture context button system if an image editor is set up for painting and active object is in object mode. --- source/blender/blenkernel/intern/paint.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 8218f474620..0dbe4c56a09 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -189,6 +189,8 @@ Paint *BKE_paint_get_active_from_context(const bContext *C) return &ts->uvsculpt->paint; else return &ts->imapaint.paint; + default: + return &ts->imapaint.paint; } } else { @@ -238,6 +240,8 @@ PaintMode BKE_paintmode_get_active_from_context(const bContext *C) return PAINT_SCULPT_UV; else return PAINT_TEXTURE_2D; + default: + return PAINT_TEXTURE_2D; } } else { From d6f38e4e018a75458290e3ed26dd80c2cf0af882 Mon Sep 17 00:00:00 2001 From: Daniel Stokes Date: Fri, 21 Jun 2013 06:56:43 +0000 Subject: [PATCH 14/14] BGE: fix [#32775] LibFree crashing Used the engine's RemoveScene (which ultimately calls the converter's RemoveScene) instead of the converter's RemoveScene when the converter free a blend file. This handles the scene removal in a safer fashion and solves the crash described in part 2 of the bug report. Part 1 no longer appears to cause a crash. --- source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 19287c1fd62..5df431db4b3 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -1261,7 +1261,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie) { KX_Scene* scene = scenes->at(scene_idx); if (IS_TAGGED(scene->GetBlenderScene())) { - RemoveScene(scene); // XXX - not tested yet + m_ketsjiEngine->RemoveScene(scene->GetName()); scene_idx--; numScenes--; }