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:
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/CMakeLists.txt342
-rw-r--r--source/creator/Makefile14
-rw-r--r--source/creator/SConscript12
-rw-r--r--source/creator/buildinfo.c4
-rw-r--r--source/creator/creator.c537
5 files changed, 540 insertions, 369 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 1afae47e21f..9920752f9d2 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -29,35 +29,48 @@ CMAKE_POLICY(SET CMP0005 NEW)
SETUP_LIBDIRS()
-INCLUDE_DIRECTORIES(../../intern/guardedalloc
+INCLUDE_DIRECTORIES(
+ ../../intern/guardedalloc
../blender/blenlib
../blender/blenkernel
../blender/editors/include
../blender/makesrna
- ../blender/makesrna/intern
- ../blender/nodes
- ../blender/include
- ../blender/blenloader
../blender/imbuf
- ../blender/renderconverter
../blender/render/extern/include
../blender/makesdna
../blender/gpu
../blender/windowmanager
../kernel/gen_messaging
../kernel/gen_system
- ../../extern/glew/include
)
-
+IF(WIN32)
+ INCLUDE_DIRECTORIES(${PTHREADS_INC})
+ENDIF(WIN32)
IF(WITH_QUICKTIME)
ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME)
-IF(WITH_OPENEXR)
+IF(WITH_IMAGE_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
-ENDIF(WITH_OPENEXR)
+ENDIF(WITH_IMAGE_OPENEXR)
+
+IF(WITH_IMAGE_TIFF)
+ ADD_DEFINITIONS(-DWITH_TIFF)
+ENDIF(WITH_IMAGE_TIFF)
+
+IF(WITH_IMAGE_DDS)
+ ADD_DEFINITIONS(-DWITH_DDS)
+ENDIF(WITH_IMAGE_DDS)
+
+IF(WITH_IMAGE_CINEON)
+ ADD_DEFINITIONS(-DWITH_CINEON)
+ENDIF(WITH_IMAGE_CINEON)
+
+IF(WITH_IMAGE_HDR)
+ ADD_DEFINITIONS(-DWITH_HDR)
+ENDIF(WITH_IMAGE_HDR)
IF(WITH_PYTHON)
INCLUDE_DIRECTORIES(../blender/python)
@@ -122,16 +135,16 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND rm -Rf ${TARGETDIR}/.blender
- COMMAND mkdir ${TARGETDIR}/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/
+ COMMAND rm -Rf ${TARGETDIR}/${BLENDER_VERSION}
+ COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/${BLENDER_VERSION}/
)
IF(WITH_INTERNATIONAL)
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/${BLENDER_VERSION}/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/${BLENDER_VERSION}/
)
ENDIF(WITH_INTERNATIONAL)
@@ -139,35 +152,35 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
COMMENT "copying blender scripts..."
- COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/.blender/
+ COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/${BLENDER_VERSION}/
COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
)
-
- # Copy the systems python into the install directory
- # Scons copy in tools/Blender.py
- ADD_CUSTOM_COMMAND(
- TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMENT "copying a subset of the systems python..."
-
- COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here
- COMMAND mkdir ${TARGETDIR}/.blender/python/lib/
- COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/
-
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config
-
- COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages
- COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages # python needs it.
-
- COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
- COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
- COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
- COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
- )
-
+ IF(WITH_PYTHON_INSTALL)
+ # Copy the systems python into the install directory
+ # Scons copy in tools/Blender.py
+ ADD_CUSTOM_COMMAND(
+ TARGET blender POST_BUILD MAIN_DEPENDENCY blender
+ COMMENT "copying a subset of the systems python..."
+
+ COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python # PYTHONPATH and PYTHONHOME is set here
+ COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python/lib/
+ COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/${BLENDER_VERSION}/python/lib/
+
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/distutils
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/lib2to3
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/idlelib
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/tkinter
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/config
+
+ COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/site-packages
+ COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/site-packages # python needs it.
+
+ COMMAND rm -f ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
+ COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
+ COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
+ COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
+ )
+ ENDIF(WITH_PYTHON_INSTALL)
ENDIF(WITH_PYTHON)
ADD_CUSTOM_COMMAND(
@@ -176,7 +189,7 @@ IF(WITH_INSTALL)
)
- # Above we bundle a portable distrobution in ./bin
+ # Above we bundle a portable distribution in ./bin
# This is an optional "make install" which installs blender on the system.
INSTALL(
PROGRAMS ${TARGETDIR}/blender
@@ -191,9 +204,45 @@ IF(WITH_INSTALL)
ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
INSTALL(
- DIRECTORY ${TARGETDIR}/.blender/
- DESTINATION ${BLENDERPATH}
+ FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
+ )
+ INSTALL(
+ FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/blender.svg
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps
+ )
+ INSTALL(
+ PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+ )
+ INSTALL(
+ FILES ${CMAKE_SOURCE_DIR}/doc/blender.1
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
+ )
+ INSTALL(
+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
+ PATTERN ".svn" EXCLUDE
+ )
+ INSTALL(
+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/
+ DESTINATION ${BLENDERPATH}/scripts
+ PATTERN ".svn" EXCLUDE
+ PATTERN "*.pyc" EXCLUDE
+ )
+ INSTALL(
+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/brushicons/
+ DESTINATION ${BLENDERPATH}/datafiles/brushicons
+ PATTERN ".svn" EXCLUDE
)
+ IF(WITH_INTERNATIONAL)
+ INSTALL(
+ DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/
+ DESTINATION ${BLENDERPATH}/datafiles/locale
+ PATTERN ".svn" EXCLUDE
+ )
+ ENDIF(WITH_INTERNATIONAL)
+
# end "make install"
ENDIF(UNIX AND NOT APPLE)
@@ -209,32 +258,27 @@ IF(WITH_INSTALL)
COMMAND cp -Rf ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
COMMAND cp -Rf ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
- COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender
- COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
+ COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles
+ COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
)
IF(WITH_INTERNATIONAL)
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/
+ COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
+ COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
)
ENDIF(WITH_INTERNATIONAL)
IF(WITH_PYTHON)
- IF(WITH_LIBS10.5)
- SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
- ELSE(WITH_LIBS10.5)
- SET(PYTHON_ZIP "python.zip")
- ENDIF(WITH_LIBS10.5)
+ SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
ADD_CUSTOM_COMMAND(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
- COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
- COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
+ COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/
+ COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/python/
+ COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/python/
+ COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/python/
COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
)
ENDIF(WITH_PYTHON)
@@ -248,8 +292,6 @@ IF(WITH_INSTALL)
ENDIF(APPLE)
IF(WIN32)
- FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR)
-
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
@@ -257,39 +299,36 @@ IF(WITH_INSTALL)
COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
- COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
- COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
+ COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\"
+ COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
+ COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
+ COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
+ COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
+ COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
# TODO, copy python bundle
- # COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
+ # COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
)
- FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
-
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
+ COMMAND copy /Y \"${LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
+ # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
)
IF(WITH_INTERNATIONAL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_INTERNATIONAL)
@@ -297,16 +336,16 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_FFMPEG)
@@ -314,7 +353,7 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_SNDFILE)
@@ -322,7 +361,7 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_JACK)
@@ -330,8 +369,8 @@ IF(WITH_INSTALL)
ADD_CUSTOM_COMMAND(TARGET blender
POST_BUILD
MAIN_DEPENDENCY blender
- COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
- COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
+ COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
)
ENDIF(WITH_OPENAL)
@@ -344,11 +383,11 @@ ADD_DEPENDENCIES(blender makesdna)
FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
-SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render)
+SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render)
-IF(WITH_ELBEEM)
- SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem)
-ENDIF(WITH_ELBEEM)
+IF(WITH_FLUID)
+ SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_intern_elbeem)
+ENDIF(WITH_FLUID)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
@@ -358,48 +397,85 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# Sort libraries
SET(BLENDER_SORTED_LIBS
bf_windowmanager
- bf_editors
- bf_decimation
- blender_BSP
- bf_ghost
- bf_string
- blender_render
- blender_ONL
+
+ bf_editor_space_api
+ bf_editor_space_action
+ bf_editor_space_buttons
+ bf_editor_space_console
+ bf_editor_space_file
+ bf_editor_space_graph
+ bf_editor_space_image
+ bf_editor_space_info
+ bf_editor_space_logic
+ bf_editor_space_nla
+ bf_editor_space_node
+ bf_editor_space_outliner
+ bf_editor_space_script
+ bf_editor_space_sequencer
+ bf_editor_space_sound
+ bf_editor_space_time
+ bf_editor_space_userpref
+ bf_editor_space_view3d
+
+ bf_editor_text
+ bf_editor_transform
+ bf_editor_util
+ bf_editor_uvedit
+ bf_editor_curve
+ bf_editor_armature
+ bf_editor_gpencil
+ bf_editor_interface
+ bf_editor_mesh
+ bf_editor_metaball
+ bf_editor_object
+ bf_editor_physics
+ bf_editor_render
+ bf_editor_screen
+ bf_editor_sculpt_paint
+ bf_editor_sound
+ bf_editor_animation
+ bf_editor_datafiles
+
+ bf_intern_bsp
+ bf_render
+ bf_intern_opennl
bf_python
- bf_gen_python
+ bf_python_ext
bf_ikplugin
- bf_blenkernel
+ bf_modifiers
+ bf_blenkernel
bf_nodes
bf_gpu
- bf_blenloader
+ bf_blenloader
+ bf_blenlib
+ bf_intern_ghost
+ bf_intern_string
bf_blenpluginapi
bf_imbuf
- bf_blenlib
bf_avi
bf_cineon
bf_openexr
bf_dds
bf_readblenfile
bf_collada
- blender_BSP
- blender_bop
+ bf_intern_bsp
+ bf_intern_bop
bf_kernel
- bf_decimation
- bf_elbeem
- bf_IK
- bf_memutil
- bf_guardedalloc
- blender_CTR
- bf_moto
+ bf_intern_decimate
+ bf_intern_elbeem
+ bf_intern_ik
+ bf_intern_memutil
+ bf_intern_guardedalloc
+ bf_intern_ctr
+ bf_intern_moto
bf_windowmanager
- bf_editors
bf_blroutines
bf_converter
bf_dummy
bf_bullet
- bf_smoke
- bf_minilzo
- bf_lzma
+ bf_intern_smoke
+ extern_minilzo
+ extern_lzma
bf_common
bf_ketsji
bf_logic
@@ -407,30 +483,32 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
bf_oglrasterizer
bf_expressions
bf_scenegraph
- bf_moto
+ bf_intern_moto
bf_blroutines
kx_network
bf_kernel
bf_ngnetwork
extern_bullet
bf_loopbacknetwork
- bf_ITASC
+ bf_intern_itasc
bf_common
- bf_moto
+ bf_intern_moto
bf_python
- bf_gen_python
+ bf_python_ext
extern_binreloc
extern_glew
- extern_libopenjpeg
+ extern_openjpeg
bf_videotex
bf_rna
bf_dna
bf_blenfont
- bf_audaspace
+ bf_intern_audaspace
+ bf_intern_decimate
+
)
IF(WITH_CXX_GUARDEDALLOC)
- SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
+ SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_intern_guardedalloc_cpp)
ENDIF(WITH_CXX_GUARDEDALLOC)
IF(WITH_QUICKTIME)
diff --git a/source/creator/Makefile b/source/creator/Makefile
index 592cf913dfa..08f732ad486 100644
--- a/source/creator/Makefile
+++ b/source/creator/Makefile
@@ -17,7 +17,7 @@
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
@@ -69,4 +69,16 @@ ifeq ($(WITH_BINRELOC), true)
CPPFLAGS += -I$(NANBLENDERHOME)/extern/binreloc/include -DWITH_BINRELOC
endif
+ifeq ($(WITH_TIFF), true)
+ CPPFLAGS += -DWITH_TIFF
+endif
+
+ifeq ($(WITH_CINEON), true)
+ CPPFLAGS += -DWITH_CINEON
+endif
+
+ifeq ($(WITH_HDR), true)
+ CPPFLAGS += -DWITH_HDR
+endif
+
CPPFLAGS += -I$(OPENGL_HEADERS)
diff --git a/source/creator/SConscript b/source/creator/SConscript
index 8c71e0e8566..01e62d33269 100644
--- a/source/creator/SConscript
+++ b/source/creator/SConscript
@@ -23,6 +23,9 @@ if env['WITH_BF_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')
@@ -32,12 +35,15 @@ if env['WITH_BF_PYTHON']:
defs.append('_DEBUG')
else:
defs.append('DISABLE_PYTHON')
-
-if env['WITH_BF_FHS']: # /usr -> /usr/share/blender/2.5
- defs.append('BLENDERPATH=\\"' + os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) + '\\"')
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 )
diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c
index 8b02dde1a5f..d745d826bd6 100644
--- a/source/creator/buildinfo.c
+++ b/source/creator/buildinfo.c
@@ -27,10 +27,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#define STRINGIFY(x) XSTRINGIFY(x)
#define XSTRINGIFY(x) #x
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 185c98c3f44..e99935f64a3 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -32,6 +32,12 @@
#include <fenv.h>
#endif
+#define OSX_SSE_FPE (defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__)))
+
+#if OSX_SSE_FPE
+#include <xmmintrin.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
@@ -50,6 +56,7 @@
#endif
#include "BLI_args.h"
+#include "BLI_threads.h"
#include "GEN_messaging.h"
@@ -71,7 +78,7 @@
#include "BKE_report.h"
#include "BKE_sound.h"
-#include "IMB_imbuf.h" // for quicktime_init
+#include "IMB_imbuf.h" // for IMB_init
#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
@@ -124,19 +131,11 @@ extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */
char bprogname[FILE_MAXDIR+FILE_MAXFILE]; /* from blenpluginapi:pluginapi.c */
char btempdir[FILE_MAXDIR+FILE_MAXFILE];
-/* unix path support.
- * defined by the compiler. eg "/usr/share/blender/2.5" "/opt/blender/2.5" */
-#ifndef BLENDERPATH
-#define BLENDERPATH ""
-#endif
-
-char blender_path[FILE_MAXDIR+FILE_MAXFILE] = BLENDERPATH;
-
/* Initialise callbacks for the modules that need them */
static void setCallbacks(void);
-/* on linux set breakpoints here when running in debug mode, useful to catch floating point errors */
-#if defined(__sgi) || defined(__linux__)
+/* set breakpoints here when running in debug mode, useful to catch floating point errors */
+#if defined(__sgi) || defined(__linux__) || defined(_WIN32) || OSX_SSE_FPE
static void fpe_handler(int sig)
{
// printf("SIGFPE trapped\n");
@@ -194,101 +193,110 @@ static int print_version(int argc, char **argv, void *data)
static int print_help(int argc, char **argv, void *data)
{
+ bArgs *ba = (bArgs*)data;
+
printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
- printf ("Usage: blender [args ...] [file] [args ...]\n");
- printf ("\nRender options:\n");
- printf (" -b <file>\tLoad <file> in background (often used for background rendering)\n");
- printf (" -a render frames from start to end (inclusive), only works when used after -b\n");
- printf (" -S <name>\tSet scene <name>\n");
- printf (" -f <frame>\tRender frame <frame> and save it\n");
- printf (" -s <frame>\tSet start to frame <frame> (use before the -a argument)\n");
- printf (" -e <frame>\tSet end to frame <frame> (use before the -a argument)\n");
- printf (" -o <path>\tSet the render path and file name.\n");
- printf (" Use // at the start of the path to\n");
- printf (" render relative to the blend file.\n");
- printf (" The # characters are replaced by the frame number, and used to define zero padding.\n");
- printf (" ani_##_test.png becomes ani_01_test.png\n");
- printf (" test-######.png becomes test-000001.png\n");
- printf (" When the filename has no #, The suffix #### is added to the filename\n");
- printf (" The frame number will be added at the end of the filename.\n");
- printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
- printf (" -E <engine>\tSpecify the render engine.\n");
- printf (" use -E help to list available engines.\n");
- printf ("\nFormat options:\n");
- printf (" -F <format>\tSet the render format, Valid options are...\n");
- printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n");
- printf (" \tAVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
- printf (" (formats that can be compiled into blender, not available on all systems)\n");
- printf (" \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
- printf (" -x <bool>\tSet option to add the file extension to the end of the file.\n");
- printf (" -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
- printf (" [1-8], 0 for systems processor count.\n");
- printf ("\nAnimation playback options:\n");
- printf (" -a <options> <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
- printf (" -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
- printf (" -m\t\tRead from disk (Don't buffer)\n");
- printf (" -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
- printf (" -j <frame>\tSet frame step to <frame>\n");
+ printf ("Usage: blender [args ...] [file] [args ...]\n\n");
+
+ printf ("Render Options:\n");
+ BLI_argsPrintArgDoc(ba, "--background");
+ BLI_argsPrintArgDoc(ba, "--render-anim");
+ BLI_argsPrintArgDoc(ba, "--scene");
+ BLI_argsPrintArgDoc(ba, "--render-frame");
+ BLI_argsPrintArgDoc(ba, "--frame-start");
+ BLI_argsPrintArgDoc(ba, "--frame-end");
+ BLI_argsPrintArgDoc(ba, "--frame-jump");
+ BLI_argsPrintArgDoc(ba, "--render-output");
+ BLI_argsPrintArgDoc(ba, "--engine");
+
+ printf("\n");
+ printf ("Format Options:\n");
+ BLI_argsPrintArgDoc(ba, "--render-format");
+ BLI_argsPrintArgDoc(ba, "--use-extension");
+ BLI_argsPrintArgDoc(ba, "--threads");
+
+ printf("\n");
+ printf ("Animation Playback Options:\n");
+ BLI_argsPrintArgDoc(ba, "-a");
- printf ("\nWindow options:\n");
- printf (" -w\t\tForce opening with borders (default)\n");
- printf (" -W\t\tForce opening without borders\n");
- printf (" -p <sx> <sy> <w> <h>\tOpen with lower left corner at <sx>, <sy>\n");
- printf (" \tand width and height <w>, <h>\n");
- printf ("\nGame Engine specific options:\n");
- printf (" -g fixedtime\t\tRun on 50 hertz without dropping frames\n");
- printf (" -g vertexarrays\tUse Vertex Arrays for rendering (usually faster)\n");
- printf (" -g nomipmap\t\tNo Texture Mipmapping\n");
- printf (" -g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)\n");
-
- printf ("\nMisc options:\n");
- printf (" -d\t\tTurn debugging on\n");
- printf (" \t\t * prints every operator call and their arguments\n");
- printf (" \t\t * disables mouse grab (to interact with a debugger in some cases)\n");
- printf (" \t\t * keeps python sys.stdin rather then setting it to None\n");
- printf (" -nojoystick\tDisable joystick support\n");
- printf (" -noglsl\tDisable GLSL shading\n");
- printf (" -noaudio\tForce sound system to None\n");
- printf (" -setaudio\tForce sound system to a specific device\n");
- printf (" \tNULL SDL OPENAL JACK\n");
- printf (" -h\t\tPrint this help text\n");
- printf (" -y\t\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)\n");
- printf (" -P <filename>\tRun the given Python script (filename or Blender Text)\n");
+ printf("\n");
+ printf ("Window Options:\n");
+ BLI_argsPrintArgDoc(ba, "--window-border");
+ BLI_argsPrintArgDoc(ba, "--window-borderless");
+ BLI_argsPrintArgDoc(ba, "--window-geometry");
+
+ printf("\n");
+ printf ("Game Engine Specific Options:\n");
+ BLI_argsPrintArgDoc(ba, "-g");
+
+ printf("\n");
+ printf ("Misc Options:\n");
+ BLI_argsPrintArgDoc(ba, "--debug");
+ BLI_argsPrintArgDoc(ba, "--debug-fpe");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "-nojoystick");
+ BLI_argsPrintArgDoc(ba, "-noglsl");
+ BLI_argsPrintArgDoc(ba, "-noaudio");
+ BLI_argsPrintArgDoc(ba, "-setaudio");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--help");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+ BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+ printf("\n");
+
+ BLI_argsPrintArgDoc(ba, "--python");
+ BLI_argsPrintArgDoc(ba, "--python-console");
+
#ifdef WIN32
- printf (" -R\t\tRegister .blend extension\n");
+ BLI_argsPrintArgDoc(ba, "-R");
#endif
- printf (" -v\t\tPrint Blender version and exit\n");
- printf (" --\t\tEnds option processing. Following arguments are \n");
- printf (" \t\t passed unchanged. Access via Python's sys.argv\n");
+ BLI_argsPrintArgDoc(ba, "--version");
+
+ BLI_argsPrintArgDoc(ba, "--");
+
+ printf ("Other Options:\n");
+ BLI_argsPrintOtherDoc(ba);
+
+ printf ("Argument Parsing:\n");
+ printf ("\targuments must be separated by white space. eg\n");
+ printf ("\t\t\"blender -ba test.blend\"\n");
+ printf ("\t...will ignore the 'a'\n");
+ printf ("\t\t\"blender -b test.blend -f8\"\n");
+ printf ("\t...will ignore 8 because there is no space between the -f and the frame value\n\n");
+
+ printf ("Argument Order:\n");
+ printf ("Arguments are executed in the order they are given. eg\n");
+ printf ("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
+ printf ("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
+ printf ("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
+ printf ("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
+ printf ("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
+
printf ("\nEnvironment Variables:\n");
- printf (" $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n");
- printf (" $BLENDERPATH\tSystem directory to use for data files and scripts.\n");
- printf (" \tFor this build of blender the default BLENDERPATH is...\n");
- printf (" \t\"%s\"\n", blender_path);
- printf (" \tseting the $BLENDERPATH will override this\n");
+ printf (" $BLENDER_USER_CONFIG Directory for user configuration files.\n");
+ printf (" $BLENDER_SYSTEM_CONFIG Directory for system wide configuration files.\n");
+ printf (" $BLENDER_USER_SCRIPTS Directory for user scripts.\n");
+ printf (" $BLENDER_SYSTEM_SCRIPTS Directory for system wide scripts.\n");
+ printf (" $BLENDER_USER_DATAFILES Directory for user data files (icons, translations, ..).\n");
+ printf (" $BLENDER_SYSTEM_DATAFILES Directory for system wide data files.\n");
+ printf (" $BLENDER_SYSTEM_PYTHON Directory for system python libraries.\n");
#ifdef WIN32
- printf (" $TEMP\t\tStore temporary files here.\n");
+ printf (" $TEMP Store temporary files here.\n");
#else
- printf (" $TMP or $TMPDIR\tStore temporary files here.\n");
- printf (" $BF_TIFF_LIB\t\tUse an alternative libtiff.so for loading tiff image files.\n");
+ printf (" $TMP or $TMPDIR Store temporary files here.\n");
#endif
#ifndef DISABLE_SDL
- printf (" $SDL_AUDIODRIVER\tLibSDL audio driver - alsa, esd, alsa, dma.\n");
+ printf (" $SDL_AUDIODRIVER LibSDL audio driver - alsa, esd, dma.\n");
#endif
- printf (" $IMAGEEDITOR\t\tImage editor executable, launch with the IKey from the file selector.\n");
- printf (" $WINEDITOR\t\tText editor executable, launch with the EKey from the file selector.\n");
- printf (" $PYTHONHOME\t\tPath to the python directory, eg. /usr/lib/python.\n");
- printf ("\nNote: Arguments must be separated by white space. eg:\n");
- printf (" \"blender -ba test.blend\"\n");
- printf (" ...will ignore the 'a'\n");
- printf (" \"blender -b test.blend -f8\"\n");
- printf (" ...will ignore 8 because there is no space between the -f and the frame value\n");
- printf ("Note: Arguments are executed in the order they are given. eg:\n");
- printf (" \"blender -b test.blend -f 1 -o /tmp\"\n");
- printf (" ...may not render to /tmp because '-f 1' renders before the output path is set\n");
- printf (" \"blender -b -o /tmp test.blend -f 1\"\n");
- printf (" ...may not render to /tmp because loading the blend file overwrites the output path that was set\n");
- printf (" \"blender -b test.blend -o /tmp -f 1\" works as expected.\n\n");
+ printf (" $PYTHONHOME Path to the python directory, eg. /usr/lib/python.\n\n");
exit(0);
@@ -315,29 +323,15 @@ static int end_arguments(int argc, char **argv, void *data)
return -1;
}
-static int disable_python(int argc, char **argv, void *data)
+static int enable_python(int argc, char **argv, void *data)
{
- G.f &= ~G_SCRIPT_AUTOEXEC;
+ G.f |= G_SCRIPT_AUTOEXEC;
return 0;
}
-
-static int forked_tongue(int argc, char **argv, void *data)
+static int disable_python(int argc, char **argv, void *data)
{
- printf ("-y was used to disable script links because,\n");
- printf ("\t-p being taken, Ton was of the opinion that Y\n");
- printf ("\tlooked like a split (disabled) snake, and also\n");
- printf ("\twas similar to a python's tongue (unproven).\n\n");
-
- printf ("\tZr agreed because it gave him a reason to add a\n");
- printf ("\tcompletely useless text into Blender.\n\n");
-
- printf ("\tADDENDUM! Ton, in defense, found this picture of\n");
- printf ("\tan Australian python, exhibiting her (his/its) forked\n");
- printf ("\tY tongue. It could be part of an H Zr retorted!\n\n");
- printf ("\thttp://www.users.bigpond.com/snake.man/\n");
-
- exit(252);
+ G.f &= ~G_SCRIPT_AUTOEXEC;
return 0;
}
@@ -363,15 +357,26 @@ static int debug_mode(int argc, char **argv, void *data)
static int set_fpe(int argc, char **argv, void *data)
{
-#if defined(__sgi) || defined(__linux__)
+#if defined(__sgi) || defined(__linux__) || defined(_WIN32) || OSX_SSE_FPE
/* zealous but makes float issues a heck of a lot easier to find!
* set breakpoints on fpe_handler */
signal(SIGFPE, fpe_handler);
-#if defined(__linux__) && defined(__GNUC__)
+# if defined(__linux__) && defined(__GNUC__)
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
+# endif /* defined(__linux__) && defined(__GNUC__) */
+# if OSX_SSE_FPE
+ /* OSX uses SSE for floating point by default, so here
+ * use SSE instructions to throw floating point exceptions */
+ _MM_SET_EXCEPTION_MASK(_MM_MASK_MASK &~
+ (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO));
+# endif /* OSX_SSE_FPE */
+# if defined(_WIN32) && defined(_MSC_VER)
+ _controlfp_s(NULL, 0, _MCW_EM); /* enables all fp exceptions */
+ _controlfp_s(NULL, _EM_DENORMAL | _EM_UNDERFLOW | _EM_INEXACT, _MCW_EM); /* hide the ones we don't care about */
+# endif /* _WIN32 && _MSC_VER */
#endif
-#endif
+
return 0;
}
@@ -379,8 +384,6 @@ static int playback_mode(int argc, char **argv, void *data)
{
/* not if -b was given first */
if (G.background == 0) {
- /* exception here, see below, it probably needs happens after qt init? */
- libtiff_init();
// XXX playanim(argc, argv); /* not the same argc and argv as before */
exit(0);
@@ -478,11 +481,11 @@ static int set_output(int argc, char **argv, void *data)
Scene *scene= CTX_data_scene(C);
BLI_strncpy(scene->r.pic, argv[1], FILE_MAXDIR);
} else {
- printf("\nError: no blend loaded. cannot use '-o'.\n");
+ printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n");
}
return 1;
} else {
- printf("\nError: you must specify a path after '-o '.\n");
+ printf("\nError: you must specify a path after '-o / --render-output'.\n");
return 0;
}
}
@@ -506,7 +509,7 @@ static int set_engine(int argc, char **argv, void *data)
{
if (CTX_data_scene(C)==NULL)
{
- printf("\nError: no blend loaded. order the arguments so '-E ' is after a blend is loaded.\n");
+ printf("\nError: no blend loaded. order the arguments so '-E / --engine ' is after a blend is loaded.\n");
}
else
{
@@ -539,17 +542,15 @@ static int set_image_type(int argc, char **argv, void *data)
if (argc >= 1){
char *imtype = argv[1];
if (CTX_data_scene(C)==NULL) {
- printf("\nError: no blend loaded. order the arguments so '-F ' is after the blend is loaded.\n");
+ printf("\nError: no blend loaded. order the arguments so '-F / --render-format' is after the blend is loaded.\n");
} else {
Scene *scene= CTX_data_scene(C);
if (!strcmp(imtype,"TGA")) scene->r.imtype = R_TARGA;
else if (!strcmp(imtype,"IRIS")) scene->r.imtype = R_IRIS;
- else if (!strcmp(imtype,"HAMX")) scene->r.imtype = R_HAMX;
#ifdef WITH_DDS
else if (!strcmp(imtype,"DDS")) scene->r.imtype = R_DDS;
#endif
else if (!strcmp(imtype,"JPEG")) scene->r.imtype = R_JPEG90;
- else if (!strcmp(imtype,"MOVIE")) scene->r.imtype = R_MOVIE;
else if (!strcmp(imtype,"IRIZ")) scene->r.imtype = R_IRIZ;
else if (!strcmp(imtype,"RAWTGA")) scene->r.imtype = R_RAWTGA;
else if (!strcmp(imtype,"AVIRAW")) scene->r.imtype = R_AVIRAW;
@@ -558,24 +559,30 @@ static int set_image_type(int argc, char **argv, void *data)
else if (!strcmp(imtype,"AVICODEC")) scene->r.imtype = R_AVICODEC;
else if (!strcmp(imtype,"QUICKTIME")) scene->r.imtype = R_QUICKTIME;
else if (!strcmp(imtype,"BMP")) scene->r.imtype = R_BMP;
+#ifdef WITH_HDR
else if (!strcmp(imtype,"HDR")) scene->r.imtype = R_RADHDR;
+#endif
+#ifdef WITH_TIFF
else if (!strcmp(imtype,"TIFF")) scene->r.imtype = R_TIFF;
+#endif
#ifdef WITH_OPENEXR
else if (!strcmp(imtype,"EXR")) scene->r.imtype = R_OPENEXR;
else if (!strcmp(imtype,"MULTILAYER")) scene->r.imtype = R_MULTILAYER;
#endif
else if (!strcmp(imtype,"MPEG")) scene->r.imtype = R_FFMPEG;
else if (!strcmp(imtype,"FRAMESERVER")) scene->r.imtype = R_FRAMESERVER;
+#ifdef WITH_CINEON
else if (!strcmp(imtype,"CINEON")) scene->r.imtype = R_CINEON;
else if (!strcmp(imtype,"DPX")) scene->r.imtype = R_DPX;
+#endif
#if WITH_OPENJPEG
else if (!strcmp(imtype,"JP2")) scene->r.imtype = R_JP2;
#endif
- else printf("\nError: Format from '-F' not known or not compiled in this release.\n");
+ else printf("\nError: Format from '-F / --render-format' not known or not compiled in this release.\n");
}
return 1;
} else {
- printf("\nError: you must specify a format after '-F '.\n");
+ printf("\nError: you must specify a format after '-F / --render-foramt'.\n");
return 0;
}
}
@@ -590,7 +597,7 @@ static int set_threads(int argc, char **argv, void *data)
}
return 1;
} else {
- printf("\nError: you must specify a number of threads between 0 and 8 '-t '.\n");
+ printf("\nError: you must specify a number of threads between 0 and 8 '-t / --threads'.\n");
return 0;
}
}
@@ -606,7 +613,7 @@ static int set_extension(int argc, char **argv, void *data)
} else if (argv[1][0] == '1') {
scene->r.scemode |= R_EXTENSION;
} else {
- printf("\nError: Use '-x 1' or '-x 0' To set the extension option.\n");
+ printf("\nError: Use '-x 1 / -x 0' To set the extension option or '--use-extension'\n");
}
} else {
printf("\nError: no blend loaded. order the arguments so '-o ' is after '-x '.\n");
@@ -675,25 +682,38 @@ static int render_frame(int argc, char **argv, void *data)
{
bContext *C = data;
if (CTX_data_scene(C)) {
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
if (argc > 1) {
- int frame = atoi(argv[1]);
Render *re = RE_NewRender(scene->id.name);
+ int frame;
ReportList reports;
+ switch(*argv[1]) {
+ case '+':
+ frame= scene->r.sfra + atoi(argv[1]+1);
+ break;
+ case '-':
+ frame= (scene->r.efra - atoi(argv[1]+1)) + 1;
+ break;
+ default:
+ frame= atoi(argv[1]);
+ break;
+ }
+
BKE_reports_init(&reports, RPT_PRINT);
frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame));
- RE_BlenderAnim(re, scene, scene->lay, frame, frame, scene->r.frame_step, &reports);
+ RE_BlenderAnim(re, bmain, scene, scene->lay, frame, frame, scene->r.frame_step, &reports);
return 1;
} else {
- printf("\nError: frame number must follow '-f'.\n");
+ printf("\nError: frame number must follow '-f / --render-frame'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-f'.\n");
+ printf("\nError: no blend loaded. cannot use '-f / --render-frame'.\n");
return 0;
}
}
@@ -702,11 +722,12 @@ static int render_animation(int argc, char **argv, void *data)
{
bContext *C = data;
if (CTX_data_scene(C)) {
+ Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
Render *re= RE_NewRender(scene->id.name);
ReportList reports;
BKE_reports_init(&reports, RPT_PRINT);
- RE_BlenderAnim(re, scene, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports);
+ RE_BlenderAnim(re, bmain, scene, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step, &reports);
} else {
printf("\nError: no blend loaded. cannot use '-a'.\n");
}
@@ -716,10 +737,14 @@ static int render_animation(int argc, char **argv, void *data)
static int set_scene(int argc, char **argv, void *data)
{
if(argc > 1) {
- set_scene_name(argv[1]);
+ bContext *C= data;
+ Scene *sce= set_scene_name(CTX_data_main(C), argv[1]);
+ if(sce) {
+ CTX_data_scene_set(C, sce);
+ }
return 1;
} else {
- printf("\nError: Scene name must follow '-S'.\n");
+ printf("\nError: Scene name must follow '-S / --scene'.\n");
return 0;
}
}
@@ -734,11 +759,11 @@ static int set_start_frame(int argc, char **argv, void *data)
(scene->r.sfra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
return 1;
} else {
- printf("\nError: frame number must follow '-s'.\n");
+ printf("\nError: frame number must follow '-s / --frame-start'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-s'.\n");
+ printf("\nError: no blend loaded. cannot use '-s / --frame-start'.\n");
return 0;
}
}
@@ -753,11 +778,11 @@ static int set_end_frame(int argc, char **argv, void *data)
(scene->r.efra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
return 1;
} else {
- printf("\nError: frame number must follow '-e'.\n");
+ printf("\nError: frame number must follow '-e / --frame-end'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-e'.\n");
+ printf("\nError: no blend loaded. cannot use '-e / --frame-end'.\n");
return 0;
}
}
@@ -772,49 +797,53 @@ static int set_skip_frame(int argc, char **argv, void *data)
(scene->r.frame_step) = CLAMPIS(frame, 1, MAXFRAME);
return 1;
} else {
- printf("\nError: number of frames to step must follow '-j'.\n");
+ printf("\nError: number of frames to step must follow '-j / --frame-jump'.\n");
return 0;
}
} else {
- printf("\nError: no blend loaded. cannot use '-j'.\n");
+ printf("\nError: no blend loaded. cannot use '-j / --frame-jump'.\n");
return 0;
}
}
+/* macro for ugly context setup/reset */
+#ifndef DISABLE_PYTHON
+#define BPY_CTX_SETUP(_cmd) \
+{ \
+ wmWindowManager *wm= CTX_wm_manager(C); \
+ wmWindow *prevwin= CTX_wm_window(C); \
+ Scene *prevscene= CTX_data_scene(C); \
+ if(wm->windows.first) { \
+ CTX_wm_window_set(C, wm->windows.first); \
+ _cmd; \
+ CTX_wm_window_set(C, prevwin); \
+ } \
+ else { \
+ fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]); \
+ _cmd; \
+ } \
+ CTX_data_scene_set(C, prevscene); \
+} \
+
+#endif /* DISABLE_PYTHON */
+
static int run_python(int argc, char **argv, void *data)
{
#ifndef DISABLE_PYTHON
bContext *C = data;
- /* Make the path absolute because its needed for relative linked blends to be found */
- char filename[FILE_MAXDIR + FILE_MAXFILE];
- BLI_strncpy(filename, argv[1], sizeof(filename));
- BLI_path_cwd(filename);
-
/* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */
if (argc > 1) {
- /* XXX, temp setting the WM is ugly, splash also does this :S */
- wmWindowManager *wm= CTX_wm_manager(C);
- wmWindow *prevwin= CTX_wm_window(C);
- Scene *prevscene= CTX_data_scene(C);
-
- if(wm->windows.first) {
- CTX_wm_window_set(C, wm->windows.first);
-
- BPY_run_python_script(C, filename, NULL, NULL); // use reports?
-
- CTX_wm_window_set(C, prevwin);
- }
- else {
- fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]);
- BPY_run_python_script(C, filename, NULL, NULL); // use reports?
- }
+ /* Make the path absolute because its needed for relative linked blends to be found */
+ char filename[FILE_MAXDIR + FILE_MAXFILE];
+ BLI_strncpy(filename, argv[1], sizeof(filename));
+ BLI_path_cwd(filename);
- CTX_data_scene_set(C, prevscene);
+ BPY_CTX_SETUP( BPY_run_python_script(C, filename, NULL, NULL) )
return 1;
} else {
- printf("\nError: you must specify a Python script after '-P '.\n");
+ printf("\nError: you must specify a Python script after '-P / --python'.\n");
return 0;
}
#else
@@ -823,6 +852,21 @@ static int run_python(int argc, char **argv, void *data)
#endif /* DISABLE_PYTHON */
}
+static int run_python_console(int argc, char **argv, void *data)
+{
+#ifndef DISABLE_PYTHON
+ bContext *C = data;
+ const char *expr= "__import__('code').interact()";
+
+ BPY_CTX_SETUP( BPY_eval_string(C, expr) )
+
+ return 0;
+#else
+ printf("This blender was built without python support\n");
+ return 0;
+#endif /* DISABLE_PYTHON */
+}
+
static int load_file(int argc, char **argv, void *data)
{
bContext *C = data;
@@ -838,11 +882,19 @@ static int load_file(int argc, char **argv, void *data)
/*we successfully loaded a blend file, get sure that
pointcache works */
if (retval!=0) {
+ wmWindowManager *wm= CTX_wm_manager(C);
CTX_wm_manager_set(C, NULL); /* remove wm to force check */
WM_check(C);
G.relbase_valid = 1;
+ if (CTX_wm_manager(C) == NULL) CTX_wm_manager_set(C, wm); /* reset wm */
}
+ /* WM_read_file() runs normally but since we're in background mode do here */
+#ifndef DISABLE_PYTHON
+ /* run any texts that were loaded in and flagged as modules */
+ BPY_load_user_modules(C);
+#endif
+
/* happens for the UI on file reading too (huh? (ton))*/
// XXX BKE_reset_undo();
// BKE_write_undo("original"); /* save current state */
@@ -859,56 +911,94 @@ static int load_file(int argc, char **argv, void *data)
void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
{
- //BLI_argsAdd(ba, arg, pass, BA_ArgCallback cb, C);
+ static char output_doc[] = "<path>"
+ "\n\tSet the render path and file name."
+ "\n\tUse // at the start of the path to"
+ "\n\t\trender relative to the blend file."
+ "\n\tThe # characters are replaced by the frame number, and used to define zero padding."
+ "\n\t\tani_##_test.png becomes ani_01_test.png"
+ "\n\t\ttest-######.png becomes test-000001.png"
+ "\n\t\tWhen the filename does not contain #, The suffix #### is added to the filename"
+ "\n\tThe frame number will be added at the end of the filename."
+ "\n\t\teg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a"
+ "\n\t\t//render_ becomes //render_####, writing frames as //render_0001.png//";
+
+ static char format_doc[] = "<format>"
+ "\n\tSet the render format, Valid options are..."
+ "\n\t\tTGA IRIS JPEG MOVIE IRIZ RAWTGA"
+ "\n\t\tAVIRAW AVIJPEG PNG BMP FRAMESERVER"
+ "\n\t(formats that can be compiled into blender, not available on all systems)"
+ "\n\t\tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS";
+
+ static char playback_doc[] = "<options> <file(s)>"
+ "\n\tPlayback <file(s)>, only operates this way when not running in background."
+ "\n\t\t-p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>"
+ "\n\t\t-m\t\tRead from disk (Don't buffer)"
+ "\n\t\t-f <fps> <fps-base>\t\tSpecify FPS to start with"
+ "\n\t\t-j <frame>\tSet frame step to <frame>";
+
+ static char game_doc[] = "Game Engine specific options"
+ "\n\t-g fixedtime\t\tRun on 50 hertz without dropping frames"
+ "\n\t-g vertexarrays\tUse Vertex Arrays for rendering (usually faster)"
+ "\n\t-g nomipmap\t\tNo Texture Mipmapping"
+ "\n\t-g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)";
+
+ static char debug_doc[] = "\n\tTurn debugging on\n"
+ "\n\t* Prints every operator call and their arguments"
+ "\n\t* Disables mouse grab (to interact with a debugger in some cases)"
+ "\n\t* Keeps python sys.stdin rather then setting it to None";
+
+ //BLI_argsAdd(ba, pass, short_arg, long_arg, doc, cb, C);
/* end argument processing after -- */
- BLI_argsAdd(ba, "--", -1, end_arguments, NULL);
+ BLI_argsAdd(ba, -1, "--", NULL, "\n\tEnds option processing, following arguments passed unchanged. Access via python's sys.argv", end_arguments, NULL);
/* first pass: background mode, disable python and commands that exit after usage */
- BLI_argsAdd(ba, "--help", 1, print_help, NULL);
- BLI_argsAdd(ba, "-h", 1, print_help, NULL);
- BLI_argsAdd(ba, "/?", 1, print_help, NULL);
+ BLI_argsAdd(ba, 1, "-h", "--help", "\n\tPrint this help text and exit", print_help, ba);
+ /* Windows only */
+ BLI_argsAdd(ba, 1, "/?", NULL, "\n\tPrint this help text and exit (windows only)", print_help, ba);
- BLI_argsAdd(ba, "--version", 1, print_version, NULL);
- BLI_argsAdd(ba, "-v", 1, print_version, NULL);
+ BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
- BLI_argsAdd(ba, "-Y", 1, forked_tongue, NULL);
- BLI_argsAdd(ba, "-y", 1, disable_python, NULL);
+ BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
+ BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
- BLI_argsAdd(ba, "-fpe", 1, set_fpe, NULL);
+ BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
- BLI_argsAdd(ba, "-B", 1, background_mode, NULL);
- BLI_argsAdd(ba, "-b", 1, background_mode, NULL);
- BLI_argsAdd(ba, "-a", 1, playback_mode, NULL);
+ BLI_argsAdd(ba, 1, "-a", NULL, playback_doc, playback_mode, NULL);
- BLI_argsAdd(ba, "-d", 1, debug_mode, ba);
+ BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
+ BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
/* second pass: custom window stuff */
- BLI_argsAdd(ba, "-p", 2, prefsize, NULL);
- BLI_argsAdd(ba, "-w", 2, with_borders, NULL);
- BLI_argsAdd(ba, "-W", 2, without_borders, NULL);
- BLI_argsAdd(ba, "-R", 2, register_extension, ba);
+ BLI_argsAdd(ba, 2, "-p", "--window-geometry", "<sx> <sy> <w> <h>\n\tOpen with lower left corner at <sx>, <sy> and width and height as <w>, <h>", prefsize, NULL);
+ BLI_argsAdd(ba, 2, "-w", "--window-border", "\n\tForce opening with borders (default)", with_borders, NULL);
+ BLI_argsAdd(ba, 2, "-W", "--window-borderless", "\n\tForce opening with without borders", without_borders, NULL);
+ BLI_argsAdd(ba, 2, "-R", NULL, "\n\tRegister .blend extension (windows only)", register_extension, ba);
/* third pass: disabling things and forcing settings */
- BLI_argsAddCase(ba, "-nojoystick", 3, no_joystick, syshandle);
- BLI_argsAddCase(ba, "-noglsl", 3, no_glsl, NULL);
- BLI_argsAddCase(ba, "-noaudio", 3, no_audio, NULL);
- BLI_argsAddCase(ba, "-setaudio", 3, set_audio, NULL);
+ BLI_argsAddCase(ba, 3, "-nojoystick", 1, NULL, 0, "\n\tDisable joystick support", no_joystick, syshandle);
+ BLI_argsAddCase(ba, 3, "-noglsl", 1, NULL, 0, "\n\tDisable GLSL shading", no_glsl, NULL);
+ BLI_argsAddCase(ba, 3, "-noaudio", 1, NULL, 0, "\n\tForce sound system to None", no_audio, NULL);
+ BLI_argsAddCase(ba, 3, "-setaudio", 1, NULL, 0, "\n\tForce sound system to a specific device\n\tNULL SDL OPENAL JACK", set_audio, NULL);
/* fourth pass: processing arguments */
- BLI_argsAdd(ba, "-g", 4, set_ge_parameters, syshandle);
- BLI_argsAdd(ba, "-f", 4, render_frame, C);
- BLI_argsAdd(ba, "-a", 4, render_animation, C);
- BLI_argsAdd(ba, "-S", 4, set_scene, NULL);
- BLI_argsAdd(ba, "-s", 4, set_start_frame, C);
- BLI_argsAdd(ba, "-e", 4, set_end_frame, C);
- BLI_argsAdd(ba, "-j", 4, set_skip_frame, C);
- BLI_argsAdd(ba, "-P", 4, run_python, C);
- BLI_argsAdd(ba, "-o", 4, set_output, C);
- BLI_argsAdd(ba, "-E", 4, set_engine, C);
- BLI_argsAdd(ba, "-F", 4, set_image_type, C);
- BLI_argsAdd(ba, "-t", 4, set_threads, NULL);
- BLI_argsAdd(ba, "-x", 4, set_extension, C);
+ BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle);
+ BLI_argsAdd(ba, 4, "-f", "--render-frame", "<frame>\n\tRender frame <frame> and save it.\n\t+<frame> start frame relative, -<frame> end frame relative.", render_frame, C);
+ BLI_argsAdd(ba, 4, "-a", "--render-anim", "\n\tRender frames from start to end (inclusive)", render_animation, C);
+ BLI_argsAdd(ba, 4, "-S", "--scene", "<name>\n\tSet the active scene <name> for rendering", set_scene, C);
+ BLI_argsAdd(ba, 4, "-s", "--frame-start", "<frame>\n\tSet start to frame <frame> (use before the -a argument)", set_start_frame, C);
+ BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C);
+ BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C);
+ BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script (filename or Blender Text)", run_python, C);
+ BLI_argsAdd(ba, 4, NULL, "--python-console", "\n\tRun blender with an interactive console", run_python_console, C);
+
+ BLI_argsAdd(ba, 4, "-o", "--render-output", output_doc, set_output, C);
+ BLI_argsAdd(ba, 4, "-E", "--engine", "<engine>\n\tSpecify the render engine\n\tuse -E help to list available engines", set_engine, C);
+
+ BLI_argsAdd(ba, 4, "-F", "--render-format", format_doc, set_image_type, C);
+ BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering in background\n\t[1-" QUOTE(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL);
+ BLI_argsAdd(ba, 4, "-x", "--use-extension", "<bool>\n\tSet option to add the file extension to the end of the file", set_extension, C);
}
@@ -948,12 +1038,6 @@ int main(int argc, char **argv)
BLI_where_am_i(bprogname, argv[0]);
- { /* override the hard coded blender path */
- char *blender_path_env = getenv("BLENDERPATH");
- if(blender_path_env)
- BLI_strncpy(blender_path, blender_path_env, sizeof(blender_path));
- }
-
#ifdef BUILD_DATE
strip_quotes(build_date);
strip_quotes(build_time);
@@ -962,6 +1046,8 @@ int main(int argc, char **argv)
strip_quotes(build_type);
#endif
+ BLI_threadapi_init();
+
RNA_init();
RE_engines_init();
@@ -974,13 +1060,12 @@ int main(int argc, char **argv)
initglobals(); /* blender.c */
+ IMB_init();
+
syshandle = SYS_GetSystem();
GEN_init_messaging_system();
/* first test for background */
-
- G.f |= G_SCRIPT_AUTOEXEC; /* script links enabled by default */
-
ba = BLI_argsInit(argc, argv); /* skip binary path */
setupArguments(C, ba, &syshandle);
@@ -996,6 +1081,10 @@ int main(int argc, char **argv)
/* background render uses this font too */
BKE_font_register_builtin(datatoc_Bfont, datatoc_Bfont_size);
+
+ /* Initialiaze ffmpeg if built in, also needed for bg mode if videos are
+ rendered via ffmpeg */
+ sound_init_once();
init_def_material();
@@ -1006,15 +1095,17 @@ int main(int argc, char **argv)
WM_init(C, argc, argv);
/* this is properly initialized with user defs, but this is default */
- BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */
+ BLI_where_is_temp( btempdir, 1 ); /* call after loading the startup.blend so we can read U.tempdir */
#ifndef DISABLE_SDL
BLI_setenv("SDL_VIDEODRIVER", "dummy");
+/* I think this is not necessary anymore (04-24-2010 neXyon)
#ifdef __linux__
- /* On linux the default SDL driver dma often would not play
- * use alsa if none is set */
+ // On linux the default SDL driver dma often would not play
+ // use alsa if none is set
setenv("SDL_AUDIODRIVER", "alsa", 0);
#endif
+*/
#endif
}
else {
@@ -1022,7 +1113,7 @@ int main(int argc, char **argv)
WM_init(C, argc, argv);
- BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */
+ BLI_where_is_temp( btempdir, 0 ); /* call after loading the startup.blend so we can read U.tempdir */
}
#ifndef DISABLE_PYTHON
/**
@@ -1041,20 +1132,6 @@ int main(int argc, char **argv)
CTX_py_init_set(C, 1);
WM_keymap_init(C);
-#ifdef WITH_QUICKTIME
-
- quicktime_init();
-
-#endif /* WITH_QUICKTIME */
-
- /* dynamically load libtiff, if available */
- libtiff_init();
- if (!G.have_libtiff && (G.f & G_DEBUG)) {
- printf("Unable to load: libtiff.\n");
- printf("Try setting the BF_TIFF_LIB environment variable if you want this support.\n");
- printf("Example: setenv BF_TIFF_LIB /usr/lib/libtiff.so\n");
- }
-
/* OK we are ready for it */
BLI_argsParse(ba, 4, load_file, C);
@@ -1067,8 +1144,10 @@ int main(int argc, char **argv)
else {
if((G.fileflags & G_FILE_AUTOPLAY) && (G.f & G_SCRIPT_AUTOEXEC))
- WM_init_game(C);
-
+ {
+ if(WM_init_game(C))
+ return 0;
+ }
else if(!G.file_loaded)
WM_init_splash(C);
}