diff options
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 1 | ||||
-rw-r--r-- | intern/mikktspace/mikktspace.c | 14 | ||||
-rw-r--r-- | release/scripts/modules/bpy/utils/__init__.py | 5 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 12 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_particleinstance.c | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 1 |
6 files changed, 33 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 340beef9609..6470bb22fef 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -799,6 +799,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order) GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setOrder(): window invalid"); if (order == GHOST_kWindowOrderTop) { + [NSApp activateIgnoringOtherApps:YES]; [m_window makeKeyAndOrderFront:nil]; } else { diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 4f120b7d83c..285529298eb 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -27,6 +27,7 @@ #include <string.h> #include <float.h> #include <stdlib.h> +#include <limits.h> #include "mikktspace.h" @@ -135,6 +136,17 @@ MIKK_INLINE tbool VNotZero(const SVec3 v) } #endif +// Shift operations in C are only defined for shift values which are +// not negative and smaller than sizeof(value) * CHAR_BIT. +// The mask, used with bitwise-and (&), prevents undefined behaviour +// when the shift count is 0 or >= the width of unsigned int. +MIKK_INLINE unsigned int rotl(unsigned int value, unsigned int count) +{ + const unsigned int mask = CHAR_BIT * sizeof(value) - 1; + count &= mask; + return (value << count) | (value >> (-count & mask)); +} + typedef struct { int iNrFaces; int *pTriMembers; @@ -1605,7 +1617,7 @@ static void QuickSortEdges( // Random t = uSeed & 31; - t = (uSeed << t) | (uSeed >> (32 - t)); + t = rotl(uSeed, t); uSeed = uSeed + t + 3; // Random end diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index abe33b0e8ea..ae1e3495cba 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -486,7 +486,10 @@ def is_path_builtin(path): ): return True except FileNotFoundError: - #The path we tried to look up doesn't exist + # The path we tried to look up doesn't exist. + pass + except ValueError: + # Happens on Windows when paths don't have the same drive. pass return False diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 74d01dca66a..4fa7bf64834 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -102,6 +102,16 @@ static BMO_FlagSet bmo_enum_axis_xyz[] = { {0, NULL}, }; +static BMO_FlagSet bmo_enum_axis_neg_xyz_and_xyz[] = { + {0, "-X"}, + {1, "-Y"}, + {2, "-Z"}, + {3, "X"}, + {4, "Y"}, + {5, "Z"}, + {0, NULL}, +}; + static BMO_FlagSet bmo_enum_falloff_type[] = { {SUBD_FALLOFF_SMOOTH, "SMOOTH"}, {SUBD_FALLOFF_SPHERE, "SPHERE"}, @@ -2046,7 +2056,7 @@ static BMOpDefine bmo_symmetrize_def = { "symmetrize", /* slots_in */ {{"input", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, - {"direction", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_axis_xyz}, /* axis to use */ + {"direction", BMO_OP_SLOT_INT, {(int)BMO_OP_SLOT_SUBTYPE_INT_ENUM}, bmo_enum_axis_neg_xyz_and_xyz}, /* axis to use */ {"dist", BMO_OP_SLOT_FLT}, /* minimum distance */ {{'\0'}}, }, diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index 49bb8691764..f4c2e78d1ac 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -164,6 +164,9 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps if (pa->alive == PARS_DEAD && (pimd->flag & eParticleInstanceFlag_Dead) == 0) { return true; } + if (pa->flag & (PARS_UNEXIST | PARS_NO_DISP)) { + return true; + } } if (pimd->particle_amount == 1.0f) { diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 316cbbdbef3..4f70eeefb76 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -395,6 +395,7 @@ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) if (U.uiflag & USER_SAVE_PROMPT) { if (wm_file_or_image_is_modified(C) && !G.background) { + wm_window_raise(win); wm_confirm_quit(C); } else { |