diff options
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 88 | ||||
-rw-r--r-- | source/creator/creator.c | 41 | ||||
-rw-r--r-- | source/creator/creator_args.c | 166 | ||||
-rw-r--r-- | source/creator/creator_intern.h | 2 | ||||
-rw-r--r-- | source/creator/creator_signals.c | 7 |
5 files changed, 55 insertions, 249 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 47016cbbb3b..367180407ba 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -76,12 +76,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) @@ -428,6 +422,13 @@ if(WITH_OPENCOLORIO) ) endif() +# Add default workspaces.blend to build (under [version]/datafiles +install( + FILES ${CMAKE_SOURCE_DIR}/release/datafiles/workspaces.blend + DESTINATION ${TARGETDIR_VER}/datafiles +) + + # helpful tip when using make if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*") # message after building. @@ -939,53 +940,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 CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4') - install( - FILES ${LIBDIR}/openmp/lib/libiomp5.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() @@ -1022,6 +976,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/creator.c b/source/creator/creator.c index 962d6720760..c2fd990f451 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -59,7 +59,6 @@ #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" @@ -69,6 +68,7 @@ #include "BKE_image.h" #include "BKE_particle.h" +#include "DEG_depsgraph.h" #include "IMB_imbuf.h" /* for IMB_init */ @@ -78,6 +78,7 @@ #include "ED_datafiles.h" #include "WM_api.h" +#include "WM_toolsystem.h" #include "RNA_define.h" @@ -85,13 +86,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__ @@ -226,7 +220,6 @@ int main( ) { bContext *C; - SYS_SystemHandle syshandle; #ifndef WITH_PYTHON_MODULE bArgs *ba; @@ -373,7 +366,7 @@ int main( BKE_cachefiles_init(); BKE_images_init(); BKE_modifier_init(); - DAG_init(); + DEG_register_node_types(); BKE_brush_system_init(); RE_texture_rng_init(); @@ -381,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 */ @@ -394,7 +381,7 @@ 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); @@ -402,7 +389,6 @@ int main( #else G.factory_startup = true; /* using preferences or user startup makes no sense for py-as-module */ - (void)syshandle; #endif #ifdef WITH_FFMPEG @@ -472,6 +458,11 @@ int main( CTX_py_init_set(C, 1); WM_keymap_init(C); + /* Called on load, however Python is not yet initialized, so call again here. */ + if (!G.background) { + WM_toolsystem_init(C); + } + #ifdef WITH_FREESTYLE /* initialize Freestyle */ FRS_initialize(); @@ -517,20 +508,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 98147e45c4e..da5dcf9ff8b 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -60,8 +60,6 @@ #include "BKE_sound.h" #include "BKE_image.h" -#include "DEG_depsgraph.h" - #ifdef WITH_FFMPEG #include "IMB_imbuf.h" #endif @@ -77,16 +75,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" @@ -96,6 +85,10 @@ # 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 */ @@ -431,7 +424,6 @@ static void arg_py_context_restore( /** \} */ - /* -------------------------------------------------------------------- */ /** \name Handle Argument Callbacks @@ -513,11 +505,6 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo BLI_argsPrintArgDoc(ba, "--start-console"); BLI_argsPrintArgDoc(ba, "--no-native-pixels"); - - printf("\n"); - printf("Game Engine Specific Options:\n"); - BLI_argsPrintArgDoc(ba, "-g"); - printf("\n"); printf("Python Options:\n"); BLI_argsPrintArgDoc(ba, "--enable-autoexec"); @@ -584,8 +571,6 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo 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"); @@ -601,10 +586,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"); @@ -875,7 +858,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[] = @@ -1144,36 +1127,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." ; @@ -1251,10 +1204,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]); @@ -1281,7 +1232,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) { @@ -1337,26 +1288,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." @@ -1419,76 +1350,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(0); //doMipMap = 0; - } - /* linearMipMap */ - if (STREQ(argv[a], "linearmipmap")) { - GPU_set_mipmap(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" @@ -1522,7 +1383,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, @@ -1932,7 +1792,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 @@ -2026,9 +1886,6 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) 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, "--verbose", CB(arg_handle_verbosity_set), NULL); BLI_argsAdd(ba, 1, NULL, "--factory-startup", CB(arg_handle_factory_startup_set), NULL); @@ -2048,13 +1905,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 a972a926677..311c8b74006 100644 --- a/source/creator/creator_intern.h +++ b/source/creator/creator_intern.h @@ -33,7 +33,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); diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c index cd1188f5750..94e5874f71b 100644 --- a/source/creator/creator_signals.c +++ b/source/creator/creator_signals.c @@ -65,13 +65,6 @@ #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 */ |