diff options
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 85 | ||||
-rw-r--r-- | source/creator/buildinfo.c | 4 | ||||
-rw-r--r-- | source/creator/creator.c | 66 | ||||
-rw-r--r-- | source/creator/creator_args.c | 240 | ||||
-rw-r--r-- | source/creator/creator_intern.h | 7 | ||||
-rw-r--r-- | source/creator/creator_signals.c | 12 |
6 files changed, 124 insertions, 290 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index e844d2c8c0f..ce9bb24a66f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -16,11 +16,6 @@ # # The Original Code is Copyright (C) 2006, Blender Foundation # All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# # ***** END GPL LICENSE BLOCK ***** setup_libdirs() @@ -76,12 +71,6 @@ if(WITH_HEADLESS) add_definitions(-DWITH_HEADLESS) endif() -if(WITH_GAMEENGINE) - blender_include_dirs(../gameengine/BlenderRoutines) - - add_definitions(-DWITH_GAMEENGINE) -endif() - if(WITH_SDL) if(WITH_SDL_DYNLOAD) add_definitions(-DWITH_SDL_DYNLOAD) @@ -944,52 +933,6 @@ elseif(APPLE) unset(_py_inc_suffix) endif() - # install blenderplayer bundle - copy of blender.app above. re-using macros et al - # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it - if(WITH_GAMEENGINE AND WITH_PLAYER) - set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app) - set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist) - set(PLAYER_TARGETDIR_VER blenderplayer.app/Contents/Resources/${BLENDER_VERSION}) - - - # important to make a clean install each time else old scripts get loaded. - install( - CODE - "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})" - ) - - # Give the bundle actual creation/modification date - execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE} - ${EXECUTABLE_OUTPUT_PATH}/blenderplayer.app) - - install( - FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo - DESTINATION blenderplayer.app/Contents - ) - - install_dir( - ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources - blenderplayer.app/Contents/ - ) - - if(WITH_OPENMP AND OPENMP_CUSTOM) - install( - FILES ${LIBDIR}/openmp/lib/libomp.dylib - DESTINATION blenderplayer.app/Contents/Resources/lib - ) - endif() - - # python - if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK) - # Copy the python libs into the install directory - install_dir( - ${PYTHON_LIBPATH} - ${PLAYER_TARGETDIR_VER}/python/lib - ) - endif() - - endif() - endif() # ----------------------------------------------------------------------------- @@ -1025,6 +968,34 @@ unset(BLENDER_TEXT_FILES_DESTINATION) # ----------------------------------------------------------------------------- +# Geometry Icons + +# Geometry icons. +get_property(_icon_names GLOBAL PROPERTY ICON_GEOM_NAMES) +set(_icon_files) +foreach(_f ${_icon_names}) + list(APPEND _icon_files + "${CMAKE_SOURCE_DIR}/release/datafiles/icons/${_f}.dat" + ) +endforeach() +install( + FILES ${_icon_files} + DESTINATION ${TARGETDIR_VER}/datafiles/icons +) + +unset(_icon_names) +unset(_icon_files) +unset(_f) + +# ----------------------------------------------------------------------------- +# Studio Lights +install( + DIRECTORY + ${CMAKE_SOURCE_DIR}/release/datafiles/studiolights + DESTINATION ${TARGETDIR_VER}/datafiles +) + +# ----------------------------------------------------------------------------- # Setup link libs add_dependencies(blender makesdna) diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c index 7b6cbad3e0a..6f3948ada55 100644 --- a/source/creator/buildinfo.c +++ b/source/creator/buildinfo.c @@ -17,8 +17,8 @@ * All rights reserved. */ -/** \file creator/buildinfo.c - * \ingroup creator +/** \file + * \ingroup creator */ diff --git a/source/creator/creator.c b/source/creator/creator.c index 1d70079b9fd..ad768f13e71 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -17,8 +17,8 @@ * All rights reserved. */ -/** \file creator/creator.c - * \ingroup creator +/** \file + * \ingroup creator */ #include <stdlib.h> @@ -51,16 +51,18 @@ #include "BKE_brush.h" #include "BKE_cachefile.h" #include "BKE_context.h" -#include "BKE_depsgraph.h" /* for DAG_init */ #include "BKE_font.h" #include "BKE_global.h" #include "BKE_material.h" #include "BKE_modifier.h" +#include "BKE_gpencil_modifier.h" #include "BKE_node.h" +#include "BKE_shader_fx.h" #include "BKE_sound.h" #include "BKE_image.h" #include "BKE_particle.h" +#include "DEG_depsgraph.h" #include "IMB_imbuf.h" /* for IMB_init */ @@ -70,6 +72,7 @@ #include "ED_datafiles.h" #include "WM_api.h" +#include "WM_toolsystem.h" #include "RNA_define.h" @@ -77,13 +80,6 @@ # include "FRS_freestyle.h" #endif -/* for passing information between creator and gameengine */ -#ifdef WITH_GAMEENGINE -# include "BL_System.h" -#else /* dummy */ -# define SYS_SystemHandle int -#endif - #include <signal.h> #ifdef __FreeBSD__ @@ -123,11 +119,10 @@ struct ApplicationState app_state = { }, .exit_code_on_error = { .python = 0, - } + }, }; /* -------------------------------------------------------------------- */ - /** \name Application Level Callbacks * * Initialize callbacks for the modules that need them. @@ -183,9 +178,7 @@ static void callback_clg_fatal(void *fp) /** \} */ - /* -------------------------------------------------------------------- */ - /** \name Main Function * \{ */ @@ -218,7 +211,6 @@ int main( ) { bContext *C; - SYS_SystemHandle syshandle; #ifndef WITH_PYTHON_MODULE bArgs *ba; @@ -235,6 +227,11 @@ int main( struct CreatorAtExitData app_init_data = {NULL}; BKE_blender_atexit_register(callback_main_atexit, &app_init_data); + /* Unbuffered stdout makes stdout and stderr better synchronized, and helps + * when stepping through code in a debugger (prints are immediately + * visible). */ + setvbuf(stdout, NULL, _IONBF, 0); + #ifdef WIN32 /* We delay loading of openmp so we can set the policy here. */ # if defined(_MSC_VER) @@ -367,7 +364,9 @@ int main( BKE_cachefiles_init(); BKE_images_init(); BKE_modifier_init(); - DAG_init(); + BKE_gpencil_modifier_init(); + BKE_shaderfx_init(); + DEG_register_node_types(); BKE_brush_system_init(); RE_texture_rng_init(); @@ -375,12 +374,6 @@ int main( BLI_callback_global_init(); -#ifdef WITH_GAMEENGINE - syshandle = SYS_GetSystem(); -#else - syshandle = 0; -#endif - /* first test for background */ #ifndef WITH_PYTHON_MODULE ba = BLI_argsInit(argc, (const char **)argv); /* skip binary path */ @@ -388,15 +381,15 @@ int main( /* ensure we free on early exit */ app_init_data.ba = ba; - main_args_setup(C, ba, &syshandle); + main_args_setup(C, ba); BLI_argsParse(ba, 1, NULL, NULL); main_signal_setup(); #else - G.factory_startup = true; /* using preferences or user startup makes no sense for py-as-module */ - (void)syshandle; + /* using preferences or user startup makes no sense for py-as-module */ + G.factory_startup = true; #endif #ifdef WITH_FFMPEG @@ -464,7 +457,7 @@ int main( #endif CTX_py_init_set(C, 1); - WM_keymap_init(C); + WM_keyconfig_init(C); #ifdef WITH_FREESTYLE /* initialize Freestyle */ @@ -475,13 +468,6 @@ int main( /* OK we are ready for it */ #ifndef WITH_PYTHON_MODULE main_args_setup_post(C, ba); - - if (G.background == 0) { - if (!G.file_loaded) - if (U.uiflag2 & USER_KEEP_SESSION) - WM_recover_last_session(C, NULL); - } - #endif /* Explicitly free data allocated for argument parsing: @@ -511,20 +497,6 @@ int main( WM_exit(C); } else { - if (G.fileflags & G_FILE_AUTOPLAY) { - if (G.f & G_SCRIPT_AUTOEXEC) { - if (WM_init_game(C)) { - return 0; - } - } - else { - if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) { - G.f |= G_SCRIPT_AUTOEXEC_FAIL; - BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Game AutoStart"); - } - } - } - if (!G.file_loaded) { WM_init_splash(C); } diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 676bb036b90..bdd4f49c528 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -14,8 +14,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file creator/creator_args.c - * \ingroup creator +/** \file + * \ingroup creator */ #ifndef WITH_PYTHON_MODULE @@ -49,16 +49,13 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_image.h" #include "BKE_library.h" +#include "BKE_library_override.h" #include "BKE_main.h" -#include "BKE_scene.h" #include "BKE_report.h" +#include "BKE_scene.h" #include "BKE_sound.h" -#include "BKE_image.h" - -#include "DNA_screen_types.h" - -#include "DEG_depsgraph.h" #ifdef WITH_FFMPEG #include "IMB_imbuf.h" @@ -75,16 +72,7 @@ #include "WM_api.h" -#include "GPU_basic_shader.h" #include "GPU_draw.h" -#include "GPU_extensions.h" - -/* for passing information between creator and gameengine */ -#ifdef WITH_GAMEENGINE -# include "BL_System.h" -#else /* dummy */ -# define SYS_SystemHandle int -#endif #ifdef WITH_LIBMV # include "libmv-capi.h" @@ -94,11 +82,14 @@ # include "CCL_api.h" #endif +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" +#include "DEG_depsgraph_debug.h" + #include "creator_intern.h" /* own include */ /* -------------------------------------------------------------------- */ - /** \name Utility String Parsing * \{ */ @@ -429,9 +420,7 @@ static void arg_py_context_restore( /** \} */ - /* -------------------------------------------------------------------- */ - /** \name Handle Argument Callbacks * * \note Doc strings here are used in differently: @@ -524,15 +513,11 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--window-border"); BLI_argsPrintArgDoc(ba, "--window-fullscreen"); BLI_argsPrintArgDoc(ba, "--window-geometry"); + BLI_argsPrintArgDoc(ba, "--window-maximized"); BLI_argsPrintArgDoc(ba, "--start-console"); BLI_argsPrintArgDoc(ba, "--no-native-pixels"); BLI_argsPrintArgDoc(ba, "--no-window-focus"); - - printf("\n"); - printf("Game Engine Specific Options:\n"); - BLI_argsPrintArgDoc(ba, "-g"); - printf("\n"); printf("Python Options:\n"); BLI_argsPrintArgDoc(ba, "--enable-autoexec"); @@ -553,6 +538,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--log-level"); BLI_argsPrintArgDoc(ba, "--log-show-basename"); BLI_argsPrintArgDoc(ba, "--log-show-backtrace"); + BLI_argsPrintArgDoc(ba, "--log-show-timestamp"); BLI_argsPrintArgDoc(ba, "--log-file"); printf("\n"); @@ -595,13 +581,13 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo printf("Misc Options:\n"); BLI_argsPrintArgDoc(ba, "--app-template"); BLI_argsPrintArgDoc(ba, "--factory-startup"); + BLI_argsPrintArgDoc(ba, "--enable-static-override"); + BLI_argsPrintArgDoc(ba, "--enable-event-simulate"); printf("\n"); BLI_argsPrintArgDoc(ba, "--env-system-datafiles"); BLI_argsPrintArgDoc(ba, "--env-system-scripts"); BLI_argsPrintArgDoc(ba, "--env-system-python"); printf("\n"); - BLI_argsPrintArgDoc(ba, "-nojoystick"); - BLI_argsPrintArgDoc(ba, "-noglsl"); BLI_argsPrintArgDoc(ba, "-noaudio"); BLI_argsPrintArgDoc(ba, "-setaudio"); @@ -617,10 +603,8 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--"); - printf("\n"); - printf("Experimental Features:\n"); - BLI_argsPrintArgDoc(ba, "--enable-new-depsgraph"); - BLI_argsPrintArgDoc(ba, "--enable-new-basic-shader-glsl"); + //printf("\n"); + //printf("Experimental Features:\n"); /* Other options _must_ be last (anything not handled will show here) */ printf("\n"); @@ -695,12 +679,12 @@ static const char arg_handle_python_set_doc_disable[] = static int arg_handle_python_set(int UNUSED(argc), const char **UNUSED(argv), void *data) { if ((bool)data) { - G.f |= G_SCRIPT_AUTOEXEC; + G.f |= G_FLAG_SCRIPT_AUTOEXEC; } else { - G.f &= ~G_SCRIPT_AUTOEXEC; + G.f &= ~G_FLAG_SCRIPT_AUTOEXEC; } - G.f |= G_SCRIPT_OVERRIDE_PREF; + G.f |= G_FLAG_SCRIPT_OVERRIDE_PREF; return 0; } @@ -779,6 +763,15 @@ static int arg_handle_log_show_backtrace_set(int UNUSED(argc), const char **UNUS return 0; } +static const char arg_handle_log_show_timestamp_set_doc[] = +"\n\tShow a timestamp for each log message in seconds since start." +; +static int arg_handle_log_show_timestamp_set(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + CLG_output_use_timestamp_set(true); + return 0; +} + static const char arg_handle_log_file_set_doc[] = "<filename>\n" "\n" @@ -892,7 +885,7 @@ static const char arg_handle_debug_mode_generic_set_doc_events[] = static const char arg_handle_debug_mode_generic_set_doc_handlers[] = "\n\tEnable debug messages for event handling."; static const char arg_handle_debug_mode_generic_set_doc_wm[] = -"\n\tEnable debug messages for the window manager, also prints every operator call."; +"\n\tEnable debug messages for the window manager, shows all operators in search, shows keymap errors."; static const char arg_handle_debug_mode_generic_set_doc_jobs[] = "\n\tEnable time profiling for background jobs."; static const char arg_handle_debug_mode_generic_set_doc_gpu[] = @@ -1033,6 +1026,24 @@ static int arg_handle_factory_startup_set(int UNUSED(argc), const char **UNUSED( return 0; } +static const char arg_handle_enable_static_override_doc[] = +"\n\tEnable Static Override features in the UI." +; +static int arg_handle_enable_static_override(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + BKE_override_static_enable(true); + return 0; +} + +static const char arg_handle_enable_event_simulate_doc[] = +"\n\tEnable event simulation testing feature 'bpy.types.Window.event_simulate'." +; +static int arg_handle_enable_event_simulate(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + G.f |= G_FLAG_EVENT_SIMULATE; + return 0; +} + static const char arg_handle_env_system_set_doc_datafiles[] = "\n\tSet the "STRINGIFY_ARG (BLENDER_SYSTEM_DATAFILES)" environment variable."; static const char arg_handle_env_system_set_doc_scripts[] = @@ -1148,6 +1159,15 @@ static int arg_handle_without_borders(int UNUSED(argc), const char **UNUSED(argv return 0; } +static const char arg_handle_window_maximized_doc[] = +"\n\tForce opening maximized." +; +static int arg_handle_window_maximized(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) +{ + WM_init_state_maximized_set(); + return 0; +} + static const char arg_handle_no_window_focus_doc[] = "\n\tOpen behind other windows and without taking focus." ; @@ -1186,36 +1206,6 @@ static int arg_handle_register_extension(int UNUSED(argc), const char **UNUSED(a return 0; } -static const char arg_handle_joystick_disable_doc[] = -"\n\tDisable joystick support." -; -static int arg_handle_joystick_disable(int UNUSED(argc), const char **UNUSED(argv), void *data) -{ -#ifndef WITH_GAMEENGINE - (void)data; -#else - SYS_SystemHandle *syshandle = data; - - /** - * don't initialize joysticks if user doesn't want to use joysticks - * failed joystick initialization delays over 5 seconds, before game engine start - */ - SYS_WriteCommandLineInt(*syshandle, "nojoystick", 1); - if (G.debug & G_DEBUG) printf("disabling nojoystick\n"); -#endif - - return 0; -} - -static const char arg_handle_glsl_disable_doc[] = -"\n\tDisable GLSL shading." -; -static int arg_handle_glsl_disable(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) -{ - GPU_extensions_disable(); - return 0; -} - static const char arg_handle_audio_disable_doc[] = "\n\tForce sound system to None." ; @@ -1293,10 +1283,8 @@ static int arg_handle_engine_set(int argc, const char **argv, void *data) else { Scene *scene = CTX_data_scene(C); if (scene) { - RenderData *rd = &scene->r; - if (BLI_findstring(&R_engines, argv[1], offsetof(RenderEngineType, idname))) { - BLI_strncpy_utf8(rd->engine, argv[1], sizeof(rd->engine)); + BLI_strncpy_utf8(scene->r.engine, argv[1], sizeof(scene->r.engine)); } else { printf("\nError: engine not found '%s'\n", argv[1]); @@ -1323,7 +1311,7 @@ static const char arg_handle_image_type_set_doc[] = "\tValid options are 'TGA' 'RAWTGA' 'JPEG' 'IRIS' 'IRIZ' 'AVIRAW' 'AVIJPEG' 'PNG' 'BMP'\n" "\n" "\tFormats that can be compiled into Blender, not available on all systems: 'HDR' 'TIFF' 'EXR' 'MULTILAYER'\n" -"\t'MPEG' 'FRAMESERVER' 'CINEON' 'DPX' 'DDS' 'JP2'" +"\t'MPEG' 'CINEON' 'DPX' 'DDS' 'JP2'" ; static int arg_handle_image_type_set(int argc, const char **argv, void *data) { @@ -1379,26 +1367,6 @@ static int arg_handle_threads_set(int argc, const char **argv, void *UNUSED(data } } -static const char arg_handle_depsgraph_use_new_doc[] = -"\n\tUse new dependency graph." -; -static int arg_handle_depsgraph_use_new(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) -{ - printf("Using new dependency graph.\n"); - DEG_depsgraph_switch_to_new(); - return 0; -} - -static const char arg_handle_basic_shader_glsl_use_new_doc[] = -"\n\tUse new GLSL basic shader." -; -static int arg_handle_basic_shader_glsl_use_new(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) -{ - printf("Using new GLSL basic shader.\n"); - GPU_basic_shader_use_glsl_set(true); - return 0; -} - static const char arg_handle_verbosity_set_doc[] = "<verbose>\n" "\tSet logging verbosity level." @@ -1461,76 +1429,6 @@ static int arg_handle_extension_set(int argc, const char **argv, void *data) } } -static const char arg_handle_ge_parameters_set_doc[] = -"Game Engine specific options\n" -"\n" -"\t'fixedtime'\n" -"\t\tRun on 50 hertz without dropping frames.\n" -"\t'vertexarrays'\n" -"\t\tUse Vertex Arrays for rendering (usually faster).\n" -"\t'nomipmap'\n" -"\t\tNo Texture Mipmapping.\n" -"\t'linearmipmap'\n" -"\t\tLinear Texture Mipmapping instead of Nearest (default)." -; -static int arg_handle_ge_parameters_set(int argc, const char **argv, void *data) -{ - int a = 0; -#ifdef WITH_GAMEENGINE - SYS_SystemHandle syshandle = *(SYS_SystemHandle *)data; -#else - (void)data; -#endif - - /** - * gameengine parameters are automatically put into system - * -g [paramname = value] - * -g [boolparamname] - * example: - * -g novertexarrays - * -g maxvertexarraysize = 512 - */ - - if (argc >= 1) { - const char *paramname = argv[a]; - /* check for single value versus assignment */ - if (a + 1 < argc && (*(argv[a + 1]) == '=')) { - a++; - if (a + 1 < argc) { - a++; - /* assignment */ -#ifdef WITH_GAMEENGINE - SYS_WriteCommandLineString(syshandle, paramname, argv[a]); -#endif - } - else { - printf("Error: argument assignment (%s) without value.\n", paramname); - return 0; - } - /* name arg eaten */ - - } - else { -#ifdef WITH_GAMEENGINE - SYS_WriteCommandLineInt(syshandle, argv[a], 1); -#endif - /* doMipMap */ - if (STREQ(argv[a], "nomipmap")) { - GPU_set_mipmap(G_MAIN, 0); //doMipMap = 0; - } - /* linearMipMap */ - if (STREQ(argv[a], "linearmipmap")) { - GPU_set_mipmap(G_MAIN, 1); - GPU_set_linear_mipmap(1); //linearMipMap = 1; - } - - - } /* if (*(argv[a + 1]) == '=') */ - } - - return a; -} - static const char arg_handle_render_frame_doc[] = "<frame>\n" "\tRender frame <frame> and save it.\n" @@ -1564,7 +1462,6 @@ static int arg_handle_render_frame(int argc, const char **argv, void *data) re = RE_NewSceneRender(scene); BLI_threaded_malloc_begin(); BKE_reports_init(&reports, RPT_STORE); - RE_SetReports(re, &reports); for (int i = 0; i < frames_range_len; i++) { /* We could pass in frame ranges, @@ -1574,7 +1471,7 @@ static int arg_handle_render_frame(int argc, const char **argv, void *data) } for (int frame = frame_range_arr[i][0]; frame <= frame_range_arr[i][1]; frame++) { - RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step); + RE_BlenderAnim(re, bmain, scene, NULL, NULL, frame, frame, scene->r.frame_step); } } RE_SetReports(re, NULL); @@ -1608,7 +1505,7 @@ static int arg_handle_render_animation(int UNUSED(argc), const char **UNUSED(arg BLI_threaded_malloc_begin(); BKE_reports_init(&reports, RPT_STORE); RE_SetReports(re, &reports); - RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); + RE_BlenderAnim(re, bmain, scene, NULL, NULL, scene->r.sfra, scene->r.efra, scene->r.frame_step); RE_SetReports(re, NULL); BKE_reports_clear(&reports); BLI_threaded_malloc_end(); @@ -1638,7 +1535,7 @@ static int arg_handle_scene_set(int argc, const char **argv, void *data) win = CTX_wm_manager(C)->windows.first; } if (win != NULL) { - win->screen->scene = scene; + WM_window_set_active_scene(CTX_data_main(C), C, win, scene); } } return 1; @@ -1759,6 +1656,7 @@ static int arg_handle_python_file_run(int argc, const char **argv, void *data) BPY_CTX_SETUP(ok = BPY_execute_filepath(C, filename, NULL)); if (!ok && app_state.exit_code_on_error.python) { printf("\nError: script failed, file: '%s', exiting.\n", argv[1]); + BPY_python_end(); exit(app_state.exit_code_on_error.python); } return 1; @@ -1800,6 +1698,7 @@ static int arg_handle_python_text_run(int argc, const char **argv, void *data) if (!ok && app_state.exit_code_on_error.python) { printf("\nError: script failed, text: '%s', exiting.\n", argv[1]); + BPY_python_end(); exit(app_state.exit_code_on_error.python); } @@ -1831,6 +1730,7 @@ static int arg_handle_python_expr_run(int argc, const char **argv, void *data) BPY_CTX_SETUP(ok = BPY_execute_string_ex(C, NULL, argv[1], false)); if (!ok && app_state.exit_code_on_error.python) { printf("\nError: script failed, expr: '%s', exiting.\n", argv[1]); + BPY_python_end(); exit(app_state.exit_code_on_error.python); } return 1; @@ -1985,7 +1885,7 @@ static int arg_handle_load_file(int UNUSED(argc), const char **argv, void *data) } -void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) +void main_args_setup(bContext *C, bArgs *ba) { #define CB(a) a##_doc, a @@ -2017,6 +1917,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 1, NULL, "--log-level", CB(arg_handle_log_level_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-show-basename", CB(arg_handle_log_show_basename_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-show-backtrace", CB(arg_handle_log_show_backtrace_set), ba); + BLI_argsAdd(ba, 1, NULL, "--log-show-timestamp", CB(arg_handle_log_show_timestamp_set), ba); BLI_argsAdd(ba, 1, NULL, "--log-file", CB(arg_handle_log_file_set), ba); BLI_argsAdd(ba, 1, "-d", "--debug", CB(arg_handle_debug_mode_set), ba); @@ -2078,14 +1979,15 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_MEM); BLI_argsAdd(ba, 1, NULL, "--debug-gpu-shaders", CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_SHADERS); - - BLI_argsAdd(ba, 1, NULL, "--enable-new-depsgraph", CB(arg_handle_depsgraph_use_new), NULL); - BLI_argsAdd(ba, 1, NULL, "--enable-new-basic-shader-glsl", CB(arg_handle_basic_shader_glsl_use_new), NULL); + BLI_argsAdd(ba, 1, NULL, "--debug-gpu-force-workarounds", + CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_FORCE_WORKAROUNDS); BLI_argsAdd(ba, 1, NULL, "--verbose", CB(arg_handle_verbosity_set), NULL); BLI_argsAdd(ba, 1, NULL, "--app-template", CB(arg_handle_app_template), NULL); BLI_argsAdd(ba, 1, NULL, "--factory-startup", CB(arg_handle_factory_startup_set), NULL); + BLI_argsAdd(ba, 1, NULL, "--enable-static-override", CB(arg_handle_enable_static_override), NULL); + BLI_argsAdd(ba, 1, NULL, "--enable-event-simulate", CB(arg_handle_enable_event_simulate), NULL); /* TODO, add user env vars? */ BLI_argsAdd(ba, 1, NULL, "--env-system-datafiles", CB_EX(arg_handle_env_system_set, datafiles), NULL); @@ -2096,6 +1998,7 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) 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, "-M", "--window-maximized", CB(arg_handle_window_maximized), 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); @@ -2103,13 +2006,10 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 2, NULL, "--no-native-pixels", CB(arg_handle_native_pixels_set), ba); /* third pass: disabling things and forcing settings */ - BLI_argsAddCase(ba, 3, "-nojoystick", 1, NULL, 0, CB(arg_handle_joystick_disable), syshandle); - BLI_argsAddCase(ba, 3, "-noglsl", 1, NULL, 0, CB(arg_handle_glsl_disable), NULL); BLI_argsAddCase(ba, 3, "-noaudio", 1, NULL, 0, CB(arg_handle_audio_disable), NULL); BLI_argsAddCase(ba, 3, "-setaudio", 1, NULL, 0, CB(arg_handle_audio_set), NULL); /* fourth pass: processing arguments */ - BLI_argsAdd(ba, 4, "-g", NULL, CB(arg_handle_ge_parameters_set), syshandle); BLI_argsAdd(ba, 4, "-f", "--render-frame", CB(arg_handle_render_frame), C); BLI_argsAdd(ba, 4, "-a", "--render-anim", CB(arg_handle_render_animation), C); BLI_argsAdd(ba, 4, "-S", "--scene", CB(arg_handle_scene_set), C); diff --git a/source/creator/creator_intern.h b/source/creator/creator_intern.h index 9f336c1036d..c2500c2ac06 100644 --- a/source/creator/creator_intern.h +++ b/source/creator/creator_intern.h @@ -17,8 +17,8 @@ #ifndef __CREATOR_INTERN_H__ #define __CREATOR_INTERN_H__ -/** \file creator/creator_intern.h - * \ingroup creator +/** \file + * \ingroup creator * * Functionality for main() initialization. */ @@ -29,7 +29,7 @@ struct bContext; #ifndef WITH_PYTHON_MODULE /* creator_args.c */ -void main_args_setup(struct bContext *C, struct bArgs *ba, SYS_SystemHandle *syshandle); +void main_args_setup(struct bContext *C, struct bArgs *ba); void main_args_setup_post(struct bContext *C, struct bArgs *ba); @@ -52,7 +52,6 @@ struct ApplicationState { struct { unsigned char python; } exit_code_on_error; - }; extern struct ApplicationState app_state; /* creator.c */ diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c index 0b6fa1b7bd5..a3d3dc4b870 100644 --- a/source/creator/creator_signals.c +++ b/source/creator/creator_signals.c @@ -14,8 +14,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/** \file creator/creator_signals.c - * \ingroup creator +/** \file + * \ingroup creator */ #ifndef WITH_PYTHON_MODULE @@ -60,14 +60,6 @@ #include "BKE_main.h" #include "BKE_report.h" - -/* for passing information between creator and gameengine */ -#ifdef WITH_GAMEENGINE -# include "BL_System.h" -#else /* dummy */ -# define SYS_SystemHandle int -#endif - #include <signal.h> #include "creator_intern.h" /* own include */ |