Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2011-09-07 19:34:04 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2011-09-07 19:34:04 +0400
commitdbd6658d737b1592a633ddf6397be14e50e434d9 (patch)
tree57081721d70622a3c3141909b258f9bce8a5b1e3 /source/creator
parentb5bd86e5907c3fa98546dabeda9703dfb15862f4 (diff)
parent884fc84793be1c5fdd6643ad267331381f8e1c6b (diff)
svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/CMakeLists.txt67
-rw-r--r--source/creator/SConscript47
-rw-r--r--source/creator/buildinfo.c24
-rw-r--r--source/creator/creator.c63
4 files changed, 82 insertions, 119 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 9c9f0d0905c..243f51f04db 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -25,9 +25,6 @@
#
# ***** END GPL LICENSE BLOCK *****
-# So BUILDINFO and BLENDERPATH strings are automatically quoted
-cmake_policy(SET CMP0005 NEW)
-
setup_libdirs()
blender_include_dirs(
@@ -97,7 +94,7 @@ endif()
if(WITH_BINRELOC)
add_definitions(-DWITH_BINRELOC)
- blender_include_dirs(${BINRELOC_INC})
+ blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
endif()
# Setup the exe sources and buildinfo
@@ -136,6 +133,7 @@ if(WIN32 AND NOT UNIX)
endif()
if(WITH_BUILDINFO)
+ add_definitions(-DWITH_BUILDINFO)
# --------------------------------------------------------------------------
# These defines could all be moved into the header below
string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
@@ -231,7 +229,17 @@ else()
set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
endif()
-# install target
+
+# -----------------------------------------------------------------------------
+# Install Targets
+
+set(BLENDER_TEXT_FILES
+ ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
+ ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
+ ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
+ ${CMAKE_SOURCE_DIR}/release/text/readme.html
+)
+
if(UNIX AND NOT APPLE)
if(WITH_INSTALL_PORTABLE)
@@ -274,9 +282,8 @@ if(UNIX AND NOT APPLE)
)
install(
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+ FILES ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
- PATTERN ".svn" EXCLUDE
)
else()
@@ -332,21 +339,20 @@ if(UNIX AND NOT APPLE)
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
)
install(
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+ FILES ${BLENDER_TEXT_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
- PATTERN ".svn" EXCLUDE
)
endif()
install(
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
- DESTINATION ${TARGETDIR_VER}/config
+ DESTINATION ${TARGETDIR_VER}
)
if(WITH_INTERNATIONAL)
install(
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
- DESTINATION ${TARGETDIR_VER}/config
+ DESTINATION ${TARGETDIR_VER}
)
install(
@@ -409,20 +415,19 @@ elseif(WIN32)
)
install( # same as linux!, deduplicate
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/text
+ FILES ${BLENDER_TEXT_FILES}
DESTINATION ${TARGETDIR}
- PATTERN ".svn" EXCLUDE
)
install( # same as linux!, deduplicate
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
- DESTINATION ${TARGETDIR_VER}/config
+ DESTINATION ${TARGETDIR_VER}
)
if(WITH_INTERNATIONAL) # same as linux!, deduplicate
install(
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
- DESTINATION ${TARGETDIR_VER}/config
+ DESTINATION ${TARGETDIR_VER}
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
@@ -540,11 +545,11 @@ elseif(WIN32)
if(WITH_CODEC_FFMPEG)
install(
FILES
- ${LIBDIR}/ffmpeg/lib/avcodec-52.dll
- ${LIBDIR}/ffmpeg/lib/avformat-52.dll
- ${LIBDIR}/ffmpeg/lib/avdevice-52.dll
- ${LIBDIR}/ffmpeg/lib/avutil-50.dll
- ${LIBDIR}/ffmpeg/lib/swscale-0.dll
+ ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
+ ${LIBDIR}/ffmpeg/lib/avformat-53.dll
+ ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
+ ${LIBDIR}/ffmpeg/lib/avutil-51.dll
+ ${LIBDIR}/ffmpeg/lib/swscale-2.dll
DESTINATION ${TARGETDIR}
)
@@ -630,9 +635,9 @@ elseif(APPLE)
endmacro()
# install release and app files
- install_dir(
- ${CMAKE_SOURCE_DIR}/release/text/
- \${TARGETDIR}
+ install(
+ FILES ${BLENDER_TEXT_FILES}
+ DESTINATION ${TARGETDIR}
)
install(
@@ -647,7 +652,7 @@ elseif(APPLE)
install(
FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf
- DESTINATION ${TARGETDIR_VER}/datafiles
+ DESTINATION ${TARGETDIR_VER}
)
# localization
@@ -697,6 +702,12 @@ elseif(APPLE)
endif()
endif()
+unset(BLENDER_TEXT_FILES)
+
+
+# -----------------------------------------------------------------------------
+# Setup link libs
+
add_dependencies(blender makesdna)
get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
@@ -707,7 +718,6 @@ if(WITH_MOD_FLUID)
list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
endif()
-
#if(UNIX)
# Sort libraries
set(BLENDER_SORTED_LIBS
@@ -755,6 +765,7 @@ endif()
bf_intern_opennl
bf_python
bf_python_ext
+ bf_python_mathutils
bf_ikplugin
bf_modifiers
bf_blenkernel
@@ -852,6 +863,12 @@ endif()
message(STATUS "Blender Skipping: (${REM_MSG})")
endif()
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
+
+ unset(SEARCHLIB)
+ unset(SORTLIB)
+ unset(REMLIB)
+ unset(REM_MSG)
+
#else()
# target_link_libraries(blender ${BLENDER_LINK_LIBS})
#endif()
diff --git a/source/creator/SConscript b/source/creator/SConscript
index 79e03c8dddc..80428ba7bb6 100644
--- a/source/creator/SConscript
+++ b/source/creator/SConscript
@@ -1,48 +1,3 @@
#!/usr/bin/python
-Import ('env')
-import os
-sources = 'creator.c'
-
-incs = '#/intern/guardedalloc ../blender/blenlib ../blender/blenkernel'
-incs += ' ../blender/editors/include ../blender/blenloader ../blender/imbuf'
-incs += ' ../blender/renderconverter ../blender/render/extern/include ../blender/windowmanager'
-incs += ' ../blender/makesdna ../blender/makesrna'
-incs += ' ../gameengine/BlenderRoutines #/extern/glew/include ../blender/gpu'
-incs += ' ' + env['BF_OPENGL_INC']
-
-defs = []
-if env['WITH_BF_QUICKTIME']:
- incs += ' ' + env['BF_QUICKTIME_INC']
- defs.append('WITH_QUICKTIME')
-
-if env['WITH_BF_BINRELOC']:
- incs += ' ../../extern/binreloc/include'
- defs.append('WITH_BINRELOC')
-
-if env['WITH_BF_OPENEXR']:
- defs.append('WITH_OPENEXR')
-
-if env['WITH_BF_TIFF']:
- defs.append('WITH_TIFF')
-
-if not env['WITH_BF_SDL']:
- defs.append('DISABLE_SDL')
-
-if env['WITH_BF_PYTHON']:
- incs += ' ../blender/python'
- defs.append('WITH_PYTHON')
- if env['BF_DEBUG']:
- defs.append('_DEBUG')
-
-if env['BF_BUILDINFO']:
- defs.append('BUILD_DATE')
- defs.append('NAN_BUILDINFO')
-
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
- incs += ' ' + env['BF_PTHREADS_INC']
-
-if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
- incs += ' ' + env['BF_PTHREADS_INC']
-
-env.BlenderLib ( libname = 'bf_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 0 )
+# dummy, code has been moved to Blender.creator()
diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c
index 48a4352b11b..3853d6ca693 100644
--- a/source/creator/buildinfo.c
+++ b/source/creator/buildinfo.c
@@ -33,28 +33,24 @@
#ifdef WITH_BUILDINFO_HEADER
-#include "buildinfo.h"
+# include "buildinfo.h"
#endif
#ifdef BUILD_DATE
-/* copied from BLI_utildefines.h */
-#define STRINGIFY_ARG(x) #x
-#define STRINGIFY(x) STRINGIFY_ARG(x)
-
/* currently only these are defined in the header */
-char build_date[]= STRINGIFY(BUILD_DATE);
-char build_time[]= STRINGIFY(BUILD_TIME);
-char build_rev[]= STRINGIFY(BUILD_REV);
+char build_date[]= BUILD_DATE;
+char build_time[]= BUILD_TIME;
+char build_rev[]= BUILD_REV;
-char build_platform[]= STRINGIFY(BUILD_PLATFORM);
-char build_type[]= STRINGIFY(BUILD_TYPE);
+char build_platform[]= BUILD_PLATFORM;
+char build_type[]= BUILD_TYPE;
#ifdef BUILD_CFLAGS
-char build_cflags[]= STRINGIFY(BUILD_CFLAGS);
-char build_cxxflags[]= STRINGIFY(BUILD_CXXFLAGS);
-char build_linkflags[]= STRINGIFY(BUILD_LINKFLAGS);
-char build_system[]= STRINGIFY(BUILD_SYSTEM);
+char build_cflags[]= BUILD_CFLAGS;
+char build_cxxflags[]= BUILD_CXXFLAGS;
+char build_linkflags[]= BUILD_LINKFLAGS;
+char build_system[]= BUILD_SYSTEM;
#else
char build_cflags[]= "unmaintained buildsystem alert!";
char build_cxxflags[]= "unmaintained buildsystem alert!";
diff --git a/source/creator/creator.c b/source/creator/creator.c
index fe9bd57d035..9b2cfb08382 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -64,6 +64,7 @@
#include "BLI_threads.h"
#include "BLI_scanfill.h" // for BLI_setErrorCallBack, TODO, move elsewhere
#include "BLI_utildefines.h"
+#include "BLI_callbacks.h"
#include "DNA_ID.h"
#include "DNA_scene_types.h"
@@ -181,20 +182,6 @@ static void blender_esc(int sig)
}
#endif
-/* buildinfo can have quotes */
-#ifdef BUILD_DATE
-static void strip_quotes(char *str)
-{
- if(str[0] == '"') {
- int len= strlen(str) - 1;
- memmove(str, str+1, len);
- if(str[len-1] == '"') {
- str[len-1]= '\0';
- }
- }
-}
-#endif
-
static int print_version(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
{
printf (BLEND_VERSION_STRING_FMT);
@@ -368,9 +355,9 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
printf(BLEND_VERSION_STRING_FMT);
MEM_set_memory_debug();
-#ifdef NAN_BUILDINFO
+#ifdef WITH_BUILDINFO
printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type);
-#endif // NAN_BUILDINFO
+#endif // WITH_BUILDINFO
BLI_argsPrint(data);
return 0;
@@ -433,9 +420,12 @@ static int playback_mode(int UNUSED(argc), const char **UNUSED(argv), void *UNUS
{
/* not if -b was given first */
if (G.background == 0) {
-
-// XXX playanim(argc, argv); /* not the same argc and argv as before */
+#if 0 /* TODO, bring player back? */
+ playanim(argc, argv); /* not the same argc and argv as before */
+#else
+ fprintf(stderr, "Playback mode not supported in blender 2.5x\n");
exit(0);
+#endif
}
return -2;
@@ -538,7 +528,7 @@ static int set_output(int argc, const char **argv, void *data)
if (argc >= 1){
if (CTX_data_scene(C)) {
Scene *scene= CTX_data_scene(C);
- BLI_strncpy(scene->r.pic, argv[1], FILE_MAXDIR);
+ BLI_strncpy(scene->r.pic, argv[1], sizeof(scene->r.pic));
} else {
printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n");
}
@@ -767,7 +757,9 @@ static int render_frame(int argc, const char **argv, void *data)
frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame));
- RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step, &reports);
+ RE_SetReports(re, &reports);
+ RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step);
+ RE_SetReports(re, NULL);
return 1;
} else {
printf("\nError: frame number must follow '-f / --render-frame'.\n");
@@ -788,7 +780,9 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d
Render *re= RE_NewRender(scene->id.name);
ReportList reports;
BKE_reports_init(&reports, RPT_PRINT);
- RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports);
+ RE_SetReports(re, &reports);
+ RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step);
+ RE_SetReports(re, NULL);
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
@@ -990,6 +984,7 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
#ifdef WITH_PYTHON
/* run any texts that were loaded in and flagged as modules */
BPY_driver_reset();
+ BPY_app_handlers_reset();
BPY_modules_load_user(C);
#endif
@@ -1128,7 +1123,8 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
#ifdef WITH_PYTHON_MODULE
/* allow python module to call main */
-#define main main_python
+#define main main_python_enter
+static void *evil_C= NULL;
#endif
int main(int argc, const char **argv)
@@ -1139,6 +1135,7 @@ int main(int argc, const char **argv)
#ifdef WITH_PYTHON_MODULE
#undef main
+ evil_C= C;
#endif
#ifdef WITH_BINRELOC
@@ -1170,18 +1167,6 @@ int main(int argc, const char **argv)
// need this.
BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]);
-
-#ifdef BUILD_DATE
- strip_quotes(build_date);
- strip_quotes(build_time);
- strip_quotes(build_rev);
- strip_quotes(build_platform);
- strip_quotes(build_type);
- strip_quotes(build_cflags);
- strip_quotes(build_cxxflags);
- strip_quotes(build_linkflags);
- strip_quotes(build_system);
-#endif
BLI_threadapi_init();
@@ -1199,6 +1184,8 @@ int main(int argc, const char **argv)
IMB_init();
+ BLI_cb_init();
+
#ifdef WITH_GAMEENGINE
syshandle = SYS_GetSystem();
#else
@@ -1305,6 +1292,14 @@ int main(int argc, const char **argv)
return 0;
} /* end of int main(argc,argv) */
+#ifdef WITH_PYTHON_MODULE
+void main_python_exit(void)
+{
+ WM_exit((bContext *)evil_C);
+ evil_C= NULL;
+}
+#endif
+
static void error_cb(const char *err)
{