forked from bartvdbraak/blender
Merge branch 'master' into blender2.8
This commit is contained in:
commit
4de1e673a4
@ -124,6 +124,7 @@ void BVH8::pack_aligned_node(int idx,
|
||||
data[0].a = __uint_as_float(visibility & ~PATH_RAY_NODE_UNALIGNED);
|
||||
data[0].b = time_from;
|
||||
data[0].c = time_to;
|
||||
|
||||
for(int i = 0; i < num; i++) {
|
||||
float3 bb_min = bounds[i].min;
|
||||
float3 bb_max = bounds[i].max;
|
||||
@ -140,8 +141,8 @@ void BVH8::pack_aligned_node(int idx,
|
||||
|
||||
for(int i = num; i < 8; i++) {
|
||||
/* We store BB which would never be recorded as intersection
|
||||
* so kernel might safely assume there are always 4 child nodes.
|
||||
*/
|
||||
* so kernel might safely assume there are always 4 child nodes.
|
||||
*/
|
||||
data[1][i] = FLT_MAX;
|
||||
data[2][i] = -FLT_MAX;
|
||||
|
||||
@ -153,6 +154,7 @@ void BVH8::pack_aligned_node(int idx,
|
||||
|
||||
data[7][i] = __int_as_float(0);
|
||||
}
|
||||
|
||||
memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_ONODE_SIZE);
|
||||
}
|
||||
|
||||
@ -189,6 +191,7 @@ void BVH8::pack_unaligned_node(int idx,
|
||||
{
|
||||
float8 data[BVH_UNALIGNED_ONODE_SIZE];
|
||||
memset(data, 0, sizeof(data));
|
||||
|
||||
data[0].a = __uint_as_float(visibility | PATH_RAY_NODE_UNALIGNED);
|
||||
data[0].b = time_from;
|
||||
data[0].c = time_to;
|
||||
@ -222,21 +225,21 @@ void BVH8::pack_unaligned_node(int idx,
|
||||
* so kernel might safely assume there are always 4 child nodes.
|
||||
*/
|
||||
|
||||
data[1][i] = 1.0f;
|
||||
data[2][i] = 0.0f;
|
||||
data[3][i] = 0.0f;
|
||||
data[1][i] = NAN;
|
||||
data[2][i] = NAN;
|
||||
data[3][i] = NAN;
|
||||
|
||||
data[4][i] = 0.0f;
|
||||
data[5][i] = 0.0f;
|
||||
data[6][i] = 0.0f;
|
||||
data[4][i] = NAN;
|
||||
data[5][i] = NAN;
|
||||
data[6][i] = NAN;
|
||||
|
||||
data[7][i] = 0.0f;
|
||||
data[8][i] = 0.0f;
|
||||
data[9][i] = 0.0f;
|
||||
data[7][i] = NAN;
|
||||
data[8][i] = NAN;
|
||||
data[9][i] = NAN;
|
||||
|
||||
data[10][i] = -FLT_MAX;
|
||||
data[11][i] = -FLT_MAX;
|
||||
data[12][i] = -FLT_MAX;
|
||||
data[10][i] = NAN;
|
||||
data[11][i] = NAN;
|
||||
data[12][i] = NAN;
|
||||
|
||||
data[13][i] = __int_as_float(0);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
|
||||
avxf cnodes;
|
||||
/* TODO(sergey): Investigate whether moving cnodes upwards
|
||||
* gives a speedup (will be different cache pattern but will
|
||||
* avoid extra check here),
|
||||
* avoid extra check here).
|
||||
*/
|
||||
#if BVH_FEATURE(BVH_HAIR)
|
||||
if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) {
|
||||
|
@ -188,7 +188,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
|
||||
float4 cnodes;
|
||||
/* TODO(sergey): Investigate whether moving cnodes upwards
|
||||
* gives a speedup (will be different cache pattern but will
|
||||
* avoid extra check here),
|
||||
* avoid extra check here).
|
||||
*/
|
||||
#if BVH_FEATURE(BVH_HAIR)
|
||||
if(__float_as_uint(inodes.x) & PATH_RAY_NODE_UNALIGNED) {
|
||||
|
@ -939,6 +939,11 @@ extern int GHOST_SupportsNativeDialogs(void);
|
||||
*/
|
||||
extern int GHOST_UseNativePixels(void);
|
||||
|
||||
/**
|
||||
* Focus window after opening, or put them in the background.
|
||||
*/
|
||||
extern void GHOST_UseWindowFocus(int use_focus);
|
||||
|
||||
/**
|
||||
* If window was opened using native pixel size, it returns scaling factor.
|
||||
*/
|
||||
|
@ -321,6 +321,11 @@ public:
|
||||
*/
|
||||
virtual bool useNativePixel(void) = 0;
|
||||
|
||||
/**
|
||||
* Focus window after opening, or put them in the background.
|
||||
*/
|
||||
virtual void useWindowFocus(const bool use_focus) = 0;
|
||||
|
||||
/***************************************************************************************
|
||||
* Event management functionality
|
||||
***************************************************************************************/
|
||||
|
@ -939,6 +939,12 @@ int GHOST_UseNativePixels(void)
|
||||
return system->useNativePixel();
|
||||
}
|
||||
|
||||
void GHOST_UseWindowFocus(int use_focus)
|
||||
{
|
||||
GHOST_ISystem *system = GHOST_ISystem::getSystem();
|
||||
return system->useWindowFocus(use_focus);
|
||||
}
|
||||
|
||||
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
|
||||
{
|
||||
GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
|
||||
|
@ -48,6 +48,7 @@
|
||||
|
||||
GHOST_System::GHOST_System()
|
||||
: m_nativePixel(false),
|
||||
m_windowFocus(true),
|
||||
m_displayManager(NULL),
|
||||
m_timerManager(NULL),
|
||||
m_windowManager(NULL),
|
||||
@ -394,3 +395,8 @@ bool GHOST_System::useNativePixel(void)
|
||||
m_nativePixel = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GHOST_System::useWindowFocus(const bool use_focus)
|
||||
{
|
||||
m_windowFocus = use_focus;
|
||||
}
|
||||
|
@ -177,6 +177,12 @@ public:
|
||||
bool useNativePixel(void);
|
||||
bool m_nativePixel;
|
||||
|
||||
/**
|
||||
* Focus window after opening, or put them in the background.
|
||||
*/
|
||||
void useWindowFocus(const bool use_focus);
|
||||
bool m_windowFocus;
|
||||
|
||||
/***************************************************************************************
|
||||
* Event management functionality
|
||||
***************************************************************************************/
|
||||
|
@ -309,11 +309,13 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
// raise application to front, convenient when starting from the terminal
|
||||
// and important for launching the animation player. we call this after the
|
||||
// application finishes launching, as doing it earlier can make us end up
|
||||
// with a frontmost window but an inactive application
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
if (systemCocoa->m_windowFocus) {
|
||||
// Raise application to front, convenient when starting from the terminal
|
||||
// and important for launching the animation player. we call this after the
|
||||
// application finishes launching, as doing it earlier can make us end up
|
||||
// with a frontmost window but an inactive application.
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
|
||||
|
@ -201,6 +201,11 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
|
||||
// Store a pointer to this class in the window structure
|
||||
::SetWindowLongPtr(m_hWnd, GWLP_USERDATA, (LONG_PTR) this);
|
||||
|
||||
if (!m_system->m_windowFocus) {
|
||||
// Lower to bottom and don't activate if we don't want focus
|
||||
::SetWindowPos(m_hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Store the device context
|
||||
m_hDC = ::GetDC(m_hWnd);
|
||||
|
||||
@ -214,11 +219,11 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
|
||||
nCmdShow = SW_SHOWMAXIMIZED;
|
||||
break;
|
||||
case GHOST_kWindowStateMinimized:
|
||||
nCmdShow = SW_SHOWMINIMIZED;
|
||||
nCmdShow = (m_system->m_windowFocus) ? SW_SHOWMINIMIZED : SW_SHOWMINNOACTIVE;
|
||||
break;
|
||||
case GHOST_kWindowStateNormal:
|
||||
default:
|
||||
nCmdShow = SW_SHOWNORMAL;
|
||||
nCmdShow = (m_system->m_windowFocus) ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,7 @@ GHOST_WindowX11(GHOST_SystemX11 *system,
|
||||
natom++;
|
||||
}
|
||||
|
||||
if (m_system->m_atom.WM_TAKE_FOCUS) {
|
||||
if (m_system->m_atom.WM_TAKE_FOCUS && m_system->m_windowFocus) {
|
||||
atoms[natom] = m_system->m_atom.WM_TAKE_FOCUS;
|
||||
natom++;
|
||||
}
|
||||
@ -532,7 +532,7 @@ GHOST_WindowX11(GHOST_SystemX11 *system,
|
||||
{
|
||||
XWMHints *xwmhints = XAllocWMHints();
|
||||
xwmhints->initial_state = NormalState;
|
||||
xwmhints->input = True;
|
||||
xwmhints->input = (m_system->m_windowFocus) ? True : False;
|
||||
xwmhints->flags = InputHint | StateHint;
|
||||
XSetWMHints(display, m_window, xwmhints);
|
||||
XFree(xwmhints);
|
||||
@ -586,11 +586,15 @@ GHOST_WindowX11(GHOST_SystemX11 *system,
|
||||
|
||||
setTitle(title);
|
||||
|
||||
if (exclusive) {
|
||||
if (exclusive && system->m_windowFocus) {
|
||||
XMapRaised(m_display, m_window);
|
||||
}
|
||||
else {
|
||||
XMapWindow(m_display, m_window);
|
||||
|
||||
if (!system->m_windowFocus) {
|
||||
XLowerWindow(m_display, m_window);
|
||||
}
|
||||
}
|
||||
GHOST_PRINT("Mapped window\n");
|
||||
|
||||
|
@ -88,6 +88,7 @@ const char *WM_init_state_app_template_get(void);
|
||||
void WM_init_state_size_set (int stax, int stay, int sizx, int sizy);
|
||||
void WM_init_state_fullscreen_set(void);
|
||||
void WM_init_state_normal_set(void);
|
||||
void WM_init_window_focus_set(bool do_it);
|
||||
void WM_init_native_pixels(bool do_it);
|
||||
|
||||
void WM_init (struct bContext *C, int argc, const char **argv);
|
||||
|
@ -117,8 +117,9 @@ static struct WMInitStruct {
|
||||
int windowstate;
|
||||
WinOverrideFlag override_flag;
|
||||
|
||||
bool window_focus;
|
||||
bool native_pixels;
|
||||
} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true};
|
||||
} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true, true};
|
||||
|
||||
/* ******** win open & close ************ */
|
||||
|
||||
@ -671,7 +672,9 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
|
||||
|
||||
#ifndef __APPLE__
|
||||
/* set the state here, so minimized state comes up correct on windows */
|
||||
GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
|
||||
if (wm_init_state.window_focus) {
|
||||
GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
|
||||
}
|
||||
#endif
|
||||
/* until screens get drawn, make it nice gray */
|
||||
glClearColor(0.55, 0.55, 0.55, 0.0);
|
||||
@ -1682,6 +1685,8 @@ void wm_ghost_init(bContext *C)
|
||||
if (wm_init_state.native_pixels) {
|
||||
GHOST_UseNativePixels();
|
||||
}
|
||||
|
||||
GHOST_UseWindowFocus(wm_init_state.window_focus);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1961,6 +1966,11 @@ void WM_init_state_normal_set(void)
|
||||
wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE;
|
||||
}
|
||||
|
||||
void WM_init_window_focus_set(bool do_it)
|
||||
{
|
||||
wm_init_state.window_focus = do_it;
|
||||
}
|
||||
|
||||
void WM_init_native_pixels(bool do_it)
|
||||
{
|
||||
wm_init_state.native_pixels = do_it;
|
||||
|
@ -504,6 +504,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
|
||||
BLI_argsPrintArgDoc(ba, "--window-geometry");
|
||||
BLI_argsPrintArgDoc(ba, "--start-console");
|
||||
BLI_argsPrintArgDoc(ba, "--no-native-pixels");
|
||||
BLI_argsPrintArgDoc(ba, "--no-window-focus");
|
||||
|
||||
printf("\n");
|
||||
printf("Python Options:\n");
|
||||
@ -1115,6 +1116,15 @@ static int arg_handle_without_borders(int UNUSED(argc), const char **UNUSED(argv
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char arg_handle_no_window_focus_doc[] =
|
||||
"\n\tOpen behind other windows and without taking focus."
|
||||
;
|
||||
static int arg_handle_no_window_focus(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
|
||||
{
|
||||
WM_init_window_focus_set(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern bool wm_start_with_console; /* wm_init_exit.c */
|
||||
|
||||
static const char arg_handle_start_with_console_doc[] =
|
||||
@ -1927,6 +1937,7 @@ void main_args_setup(bContext *C, bArgs *ba)
|
||||
BLI_argsAdd(ba, 2, "-p", "--window-geometry", CB(arg_handle_window_geometry), NULL);
|
||||
BLI_argsAdd(ba, 2, "-w", "--window-border", CB(arg_handle_with_borders), NULL);
|
||||
BLI_argsAdd(ba, 2, "-W", "--window-fullscreen", CB(arg_handle_without_borders), NULL);
|
||||
BLI_argsAdd(ba, 2, NULL, "--no-window-focus", CB(arg_handle_no_window_focus), NULL);
|
||||
BLI_argsAdd(ba, 2, "-con", "--start-console", CB(arg_handle_start_with_console), NULL);
|
||||
BLI_argsAdd(ba, 2, "-R", NULL, CB(arg_handle_register_extension), NULL);
|
||||
BLI_argsAdd(ba, 2, "-r", NULL, CB_EX(arg_handle_register_extension, silent), ba);
|
||||
|
@ -36,6 +36,9 @@ if inside_blender:
|
||||
def render_file(filepath, output_filepath):
|
||||
command = (
|
||||
BLENDER,
|
||||
"--no-window-focus",
|
||||
"--window-geometry",
|
||||
"0", "0", "1024", "768",
|
||||
"-noaudio",
|
||||
"--factory-startup",
|
||||
"--enable-autoexec",
|
||||
|
Loading…
Reference in New Issue
Block a user