Merge branch 'master' into pie-menus
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -11,6 +11,10 @@ __pycache__/
|
||||
*.swo
|
||||
*#
|
||||
|
||||
# conflicts
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
# QtCreator
|
||||
CMakeLists.txt.user
|
||||
|
||||
|
15
SConstruct
15
SConstruct
@@ -832,7 +832,17 @@ for x in B.create_blender_liblist(env, 'system'):
|
||||
thelibincs.append(os.path.dirname(x))
|
||||
|
||||
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
||||
env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
blender_progname = "blender"
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
blender_progname = "blender-app"
|
||||
|
||||
lenv = env.Clone()
|
||||
lenv.Append(LINKFLAGS = env['PLATFORM_LINKFLAGS'])
|
||||
targetpath = B.root_build_dir + '/blender'
|
||||
launcher_obj = [env.Object(B.root_build_dir + 'source/creator/creator/creator_launch_win', ['#source/creator/creator_launch_win.c'])]
|
||||
env.BlenderProg(B.root_build_dir, 'blender', [launcher_obj] + B.resources, [], [], 'blender')
|
||||
|
||||
env.BlenderProg(B.root_build_dir, blender_progname, creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
if env['WITH_BF_PLAYER']:
|
||||
playerlist = B.create_blender_liblist(env, 'player')
|
||||
playerlist += B.create_blender_liblist(env, 'player2')
|
||||
@@ -882,6 +892,9 @@ if env['OURPLATFORM']!='darwin':
|
||||
td, tf = os.path.split(targetdir)
|
||||
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
|
||||
|
||||
scriptinstall.append(env.InstallAs(env['BF_INSTALLDIR'] + '/blender-app.exe.manifest',
|
||||
'source/icons/blender.exe.manifest'))
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
#-- local/VERSION/scripts
|
||||
scriptpaths=['release/scripts']
|
||||
|
@@ -46,6 +46,7 @@
|
||||
|
||||
#include <shlobj.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <Psapi.h>
|
||||
|
||||
#include "utfconv.h"
|
||||
|
||||
@@ -1383,6 +1384,30 @@ void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD GetParentProcessID(void)
|
||||
{
|
||||
HANDLE snapshot;
|
||||
PROCESSENTRY32 pe32 = {0};
|
||||
DWORD ppid = 0, pid = GetCurrentProcessId();
|
||||
snapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
|
||||
if (snapshot == INVALID_HANDLE_VALUE) {
|
||||
return -1;
|
||||
}
|
||||
pe32.dwSize = sizeof( pe32 );
|
||||
if (!Process32First(snapshot, &pe32)) {
|
||||
CloseHandle(snapshot);
|
||||
return -1;
|
||||
}
|
||||
do {
|
||||
if (pe32.th32ProcessID == pid) {
|
||||
ppid = pe32.th32ParentProcessID;
|
||||
break;
|
||||
}
|
||||
} while (Process32Next(snapshot, &pe32));
|
||||
CloseHandle(snapshot);
|
||||
return ppid;
|
||||
}
|
||||
|
||||
static bool isStartedFromCommandPrompt()
|
||||
{
|
||||
HWND hwnd = GetConsoleWindow();
|
||||
@@ -1392,7 +1417,10 @@ static bool isStartedFromCommandPrompt()
|
||||
|
||||
GetWindowThreadProcessId(hwnd, &pid);
|
||||
|
||||
if (pid == GetCurrentProcessId())
|
||||
/* Because we're starting from a wrapper we need to comare with
|
||||
* parent process ID.
|
||||
*/
|
||||
if (pid == GetParentProcessID())
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -393,8 +393,8 @@ static LinkNode *bm_edgenet_path_calc_best(
|
||||
if (path == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
else if (path_cost <= 1) {
|
||||
/* any face that takes 1-2 iterations to find we consider valid */
|
||||
else if (path_cost < 1) {
|
||||
/* any face that takes 1 iteration to find we consider valid */
|
||||
return path;
|
||||
}
|
||||
else {
|
||||
@@ -465,7 +465,6 @@ void BM_mesh_edgenet(BMesh *bm,
|
||||
|
||||
if (use_edge_tag == false) {
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
BM_elem_flag_enable(e, BM_ELEM_TAG);
|
||||
BM_elem_flag_set(e, BM_ELEM_TAG, bm_edge_step_ok(e));
|
||||
}
|
||||
}
|
||||
|
@@ -3602,7 +3602,7 @@ void uiTemplateColormanagedViewSettings(uiLayout *layout, bContext *UNUSED(C), P
|
||||
col = uiLayoutColumn(layout, false);
|
||||
|
||||
row = uiLayoutRow(col, false);
|
||||
uiItemR(row, &view_transform_ptr, "view_transform", UI_ITEM_R_EXPAND, IFACE_("View"), ICON_NONE);
|
||||
uiItemR(row, &view_transform_ptr, "view_transform", 0, IFACE_("View"), ICON_NONE);
|
||||
|
||||
col = uiLayoutColumn(layout, false);
|
||||
uiItemR(col, &view_transform_ptr, "exposure", 0, NULL, ICON_NONE);
|
||||
|
@@ -239,12 +239,14 @@ void ED_space_image_uv_sculpt_update(wmWindowManager *wm, ToolSettings *settings
|
||||
|
||||
BKE_paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT);
|
||||
|
||||
WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
|
||||
brush_drawcursor_uvsculpt, NULL);
|
||||
settings->uvsculpt->paint.paint_cursor = WM_paint_cursor_activate(wm, uv_sculpt_brush_poll,
|
||||
brush_drawcursor_uvsculpt, NULL);
|
||||
}
|
||||
else {
|
||||
if (settings->uvsculpt)
|
||||
settings->uvsculpt->paint.flags &= ~PAINT_SHOW_BRUSH;
|
||||
if (settings->uvsculpt) {
|
||||
WM_paint_cursor_end(wm, settings->uvsculpt->paint.paint_cursor);
|
||||
settings->uvsculpt->paint.paint_cursor = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -168,14 +168,10 @@ typedef struct PreviewImage {
|
||||
|
||||
#ifdef __BIG_ENDIAN__
|
||||
/* big endian */
|
||||
# define MAKE_ID2(c, d) ( (c)<<8 | (d) )
|
||||
# define MOST_SIG_BYTE 0
|
||||
# define BBIG_ENDIAN
|
||||
# define MAKE_ID2(c, d) ((c) << 8 | (d))
|
||||
#else
|
||||
/* little endian */
|
||||
# define MAKE_ID2(c, d) ( (d)<<8 | (c) )
|
||||
# define MOST_SIG_BYTE 1
|
||||
# define BLITTLE_ENDIAN
|
||||
# define MAKE_ID2(c, d) ((d) << 8 | (c))
|
||||
#endif
|
||||
|
||||
/* ID from database */
|
||||
|
@@ -83,14 +83,23 @@ static const char *euler_order_str(EulerObject *self)
|
||||
short euler_order_from_string(const char *str, const char *error_prefix)
|
||||
{
|
||||
if ((str[0] && str[1] && str[2] && str[3] == '\0')) {
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
# define MAKE_ID3(a, b, c) (((a)) | ((b) << 8) | ((c) << 16))
|
||||
#else
|
||||
# define MAKE_ID3(a, b, c) (((a) << 24) | ((b) << 16) | ((c) << 8))
|
||||
#endif
|
||||
|
||||
switch (*((PY_INT32_T *)str)) {
|
||||
case 'X' | 'Y' << 8 | 'Z' << 16: return EULER_ORDER_XYZ;
|
||||
case 'X' | 'Z' << 8 | 'Y' << 16: return EULER_ORDER_XZY;
|
||||
case 'Y' | 'X' << 8 | 'Z' << 16: return EULER_ORDER_YXZ;
|
||||
case 'Y' | 'Z' << 8 | 'X' << 16: return EULER_ORDER_YZX;
|
||||
case 'Z' | 'X' << 8 | 'Y' << 16: return EULER_ORDER_ZXY;
|
||||
case 'Z' | 'Y' << 8 | 'X' << 16: return EULER_ORDER_ZYX;
|
||||
case MAKE_ID3('X', 'Y', 'Z'): return EULER_ORDER_XYZ;
|
||||
case MAKE_ID3('X', 'Z', 'Y'): return EULER_ORDER_XZY;
|
||||
case MAKE_ID3('Y', 'X', 'Z'): return EULER_ORDER_YXZ;
|
||||
case MAKE_ID3('Y', 'Z', 'X'): return EULER_ORDER_YZX;
|
||||
case MAKE_ID3('Z', 'X', 'Y'): return EULER_ORDER_ZXY;
|
||||
case MAKE_ID3('Z', 'Y', 'X'): return EULER_ORDER_ZYX;
|
||||
}
|
||||
|
||||
#undef MAKE_ID3
|
||||
}
|
||||
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
|
@@ -932,3 +932,18 @@ setup_blender_sorted_libs()
|
||||
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
|
||||
|
||||
setup_liblinks(blender)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Setup launcher
|
||||
|
||||
if(WIN32 AND NOT WITH_PYTHON_MODULE)
|
||||
set(LAUNCHER_SRC
|
||||
creator_launch_win.c
|
||||
../icons/winblender.rc
|
||||
)
|
||||
add_executable(blender-launcher ${LAUNCHER_SRC})
|
||||
target_link_libraries(blender-launcher ${PLATFORM_LINKLIBS})
|
||||
|
||||
set_target_properties(blender PROPERTIES OUTPUT_NAME blender-app)
|
||||
set_target_properties(blender-launcher PROPERTIES OUTPUT_NAME blender)
|
||||
endif()
|
||||
|
69
source/creator/creator_launch_win.c
Normal file
69
source/creator/creator_launch_win.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2014 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Contributor(s): Sergey Sharybin.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/* Binary name to launch. */
|
||||
#define BLENDER_BINARY "blender-app.exe"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
PROCESS_INFORMATION processInformation = {0};
|
||||
STARTUPINFOA startupInfo = {0};
|
||||
BOOL result;
|
||||
char command[65536];
|
||||
int i, len = sizeof(command);
|
||||
|
||||
_putenv_s("OMP_WAIT_POLICY", "PASSIVE");
|
||||
|
||||
startupInfo.cb = sizeof(startupInfo);
|
||||
|
||||
strncpy(command, BLENDER_BINARY, len - 1);
|
||||
len -= strlen(BLENDER_BINARY);
|
||||
for (i = 1; i < argc; ++i) {
|
||||
strncat(command, " ", len - 1);
|
||||
strncat(command, argv[i], len - 2);
|
||||
len -= strlen(argv[i]) + 1;
|
||||
}
|
||||
|
||||
result = CreateProcessA(NULL, command, NULL, NULL, TRUE,
|
||||
0, NULL, NULL,
|
||||
&startupInfo, &processInformation);
|
||||
|
||||
if (!result) {
|
||||
fprintf(stderr, "Error launching " BLENDER_BINARY "\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
WaitForSingleObject(processInformation.hProcess, INFINITE);
|
||||
|
||||
CloseHandle(processInformation.hProcess);
|
||||
CloseHandle(processInformation.hThread);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user