merged 29285:30707 from trunk
145
CMakeLists.txt
@@ -43,6 +43,10 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
||||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
# quiet output for Makefiles, 'make -s' helps too
|
||||
# SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||
|
||||
PROJECT(Blender)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -51,13 +55,15 @@ PROJECT(Blender)
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
# Note! - Could create this from the blender version string
|
||||
# ...but thats quite involved, make sure this matches the blender version.
|
||||
SET(BLENDER_VERSION 2.5)
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
INCLUDE(build_files/cmake/macros.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
|
||||
GET_BLENDER_VERSION()
|
||||
|
||||
# Blender internal features
|
||||
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
|
||||
@@ -106,11 +112,11 @@ OPTION(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON
|
||||
OPTION(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
|
||||
|
||||
# Misc
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
|
||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||
|
||||
IF (APPLE)
|
||||
IF(APPLE)
|
||||
OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
|
||||
OPTION(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
|
||||
OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
|
||||
@@ -124,6 +130,8 @@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
|
||||
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
|
||||
TEST_SSE_SUPPORT()
|
||||
|
||||
# disabled for now, not supported
|
||||
# OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
|
||||
@@ -135,16 +143,11 @@ ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
#
|
||||
# When changing any of this remember to update the notes in doc/blender-cmake.txt
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Load some macros.
|
||||
INCLUDE(CMake/macros.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#Platform specifics
|
||||
|
||||
IF(UNIX AND NOT APPLE)
|
||||
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(NOT OPENAL_FOUND)
|
||||
@@ -166,20 +169,23 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||
ENDIF(WITH_SNDFILE)
|
||||
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
FIND_LIBRARY(ICONV_LIBRARY
|
||||
NAMES iconv
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARY
|
||||
NAMES iconv
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
FIND_PACKAGE(Freetype)
|
||||
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
|
||||
@@ -222,6 +228,10 @@ IF(UNIX AND NOT APPLE)
|
||||
/opt/include/OpenEXR
|
||||
)
|
||||
SET(OPENEXR_LIB Half IlmImf Iex Imath)
|
||||
|
||||
IF(NOT OPENEXR_INC)
|
||||
SET(WITH_OPENEXR OFF)
|
||||
ENDIF(NOT OPENEXR_INC)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
IF(WITH_TIFF)
|
||||
@@ -249,6 +259,7 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
@@ -298,6 +309,12 @@ IF(UNIX AND NOT APPLE)
|
||||
|
||||
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-char-subscripts")
|
||||
|
||||
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
|
||||
ADD_DEFINITIONS(-D__SSE__)
|
||||
ADD_DEFINITIONS(-D__MMX__)
|
||||
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
|
||||
SET(PLATFORM_LINKFLAGS "-pthread")
|
||||
|
||||
# Better warnings
|
||||
@@ -323,10 +340,12 @@ IF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
|
||||
SET(ICONV ${LIBDIR}/iconv)
|
||||
SET(ICONV_INC ${ICONV}/include)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(ICONV ${LIBDIR}/iconv)
|
||||
SET(ICONV_INC ${ICONV}/include)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
@@ -380,6 +399,11 @@ IF(WIN32)
|
||||
SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries)
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
|
||||
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
ADD_DEFINITIONS(-D__SSE__)
|
||||
ADD_DEFINITIONS(-D__MMX__)
|
||||
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
|
||||
IF(MSVC)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
|
||||
@@ -404,14 +428,16 @@ IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettext)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettext)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PNG_LIBRARIES libpng)
|
||||
@@ -457,7 +483,7 @@ IF(WIN32)
|
||||
SET(PCRE_LIB pcre)
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
|
||||
# TODO: IF(WITH_LCMS)
|
||||
# TODO: IF(WITH_LCMS)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
@@ -506,7 +532,7 @@ IF(WIN32)
|
||||
ELSE(MSVC) # MINGW
|
||||
SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "-pipe -funsigned-char -fno-strict-aliasing -mwindows" CACHE STRING "Mingw C++ flags ")
|
||||
SET(CMAKE_CXX_FLAGS "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C++ flags ")
|
||||
SET(CMAKE_C_FLAGS "-pipe -funsigned-char -fno-strict-aliasing" CACHE STRING "Mingw C flags ")
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Mingw debug C++ flags ")
|
||||
@@ -526,12 +552,14 @@ IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gcc/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
SET(GETTEXT_LIB intl)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(GETTEXT ${LIBDIR}/gcc/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
SET(GETTEXT_LIB intl)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
SET(JPEG_LIBRARY jpeg)
|
||||
SET(JPEG_LIBRARY libjpeg)
|
||||
SET(PNG_LIBRARIES png)
|
||||
|
||||
SET(ZLIB ${LIBDIR}/zlib)
|
||||
@@ -577,7 +605,7 @@ IF(WIN32)
|
||||
IF(WITH_OPENEXR)
|
||||
SET(OPENEXR ${LIBDIR}/gcc/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/OpenEXR)
|
||||
SET(OPENEXR_LIB Half IlmImf Iex)
|
||||
SET(OPENEXR_LIB Half IlmImf Imath IlmThread)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
@@ -598,6 +626,12 @@ IF(WIN32)
|
||||
SET(WITH_JACK OFF)
|
||||
ENDIF(WITH_JACK)
|
||||
|
||||
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
|
||||
ADD_DEFINITIONS(-D__SSE__)
|
||||
ADD_DEFINITIONS(-D__MMX__)
|
||||
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
|
||||
ENDIF(MSVC)
|
||||
|
||||
ENDIF(WIN32)
|
||||
@@ -695,13 +729,19 @@ IF(APPLE)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
# TODO: IF(WITH_LCMS)
|
||||
IF(WITH_LCMS)
|
||||
SET(LCMS ${LIBDIR}/lcms)
|
||||
SET(LCMS_INCLUDE_DIR ${LCMS}/include)
|
||||
SET(LCMS_LIBRARY lcms)
|
||||
SET(LCMS_LIBPATH ${LCMS}/lib)
|
||||
ENDIF(WITH_LCMS)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
@@ -772,6 +812,12 @@ IF(APPLE)
|
||||
SET(TIFF_LIBPATH ${TIFF}/lib)
|
||||
ENDIF(WITH_TIFF)
|
||||
|
||||
IF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
SET(PLATFORM_CFLAGS " -msse -msse2 ${PLATFORM_CFLAGS}")
|
||||
ADD_DEFINITIONS(-D__SSE__)
|
||||
ADD_DEFINITIONS(-D__MMX__)
|
||||
ENDIF(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
|
||||
SET(EXETYPE MACOSX_BUNDLE)
|
||||
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
|
||||
@@ -818,10 +864,11 @@ ENDIF(WITH_BUILDINFO)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Common.
|
||||
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_LIb extern_libopenjpeg)
|
||||
IF(WITH_OPENJPEG)
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_LIb extern_libopenjpeg)
|
||||
ENDIF(WITH_OPENJPEG)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender WebPlugin
|
||||
|
||||
4
Makefile
@@ -41,7 +41,7 @@ sinclude user-def.mk
|
||||
# export NAN_NO_OPENAL=true
|
||||
|
||||
export NANBLENDERHOME=$(shell pwd)
|
||||
MAKEFLAGS=-I$(NANBLENDERHOME)/source --no-print-directory
|
||||
MAKEFLAGS=-I$(NANBLENDERHOME)/build_files/make --no-print-directory
|
||||
|
||||
SOURCEDIR =
|
||||
ifeq ($(FREE_WINDOWS),true)
|
||||
@@ -50,7 +50,7 @@ else
|
||||
DIRS ?= extern intern source po
|
||||
endif
|
||||
|
||||
include source/nan_subdirs.mk
|
||||
include build_files/make/nan_subdirs.mk
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
|
||||
61
SConstruct
@@ -46,15 +46,22 @@ import glob
|
||||
import re
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import tools.Blender
|
||||
import tools.btools
|
||||
import tools.bcolors
|
||||
# store path to tools
|
||||
toolpath=os.path.join(".", "build_files", "scons", "tools")
|
||||
|
||||
# needed for importing tools
|
||||
sys.path.append(toolpath)
|
||||
|
||||
import Blender
|
||||
import btools
|
||||
import bcolors
|
||||
|
||||
EnsureSConsVersion(1,0,0)
|
||||
|
||||
BlenderEnvironment = tools.Blender.BlenderEnvironment
|
||||
btools = tools.btools
|
||||
B = tools.Blender
|
||||
BlenderEnvironment = Blender.BlenderEnvironment
|
||||
B = Blender
|
||||
|
||||
VERSION = btools.VERSION # This is used in creating the local config directories
|
||||
|
||||
### globals ###
|
||||
platform = sys.platform
|
||||
@@ -117,7 +124,7 @@ if toolset:
|
||||
print "Using " + toolset
|
||||
if toolset=='mstoolkit':
|
||||
env = BlenderEnvironment(ENV = os.environ)
|
||||
env.Tool('mstoolkit', ['tools'])
|
||||
env.Tool('mstoolkit', [toolpath])
|
||||
else:
|
||||
env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
|
||||
# xxx commented out, as was supressing warnings under mingw..
|
||||
@@ -157,7 +164,7 @@ if crossbuild and platform not in ('win32-vc', 'win64-vc'):
|
||||
|
||||
env['OURPLATFORM'] = platform
|
||||
|
||||
configfile = 'config'+os.sep+platform+'-config.py'
|
||||
configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
|
||||
|
||||
if os.path.exists(configfile):
|
||||
print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
|
||||
@@ -166,7 +173,7 @@ else:
|
||||
|
||||
if crossbuild and env['PLATFORM'] != 'win32':
|
||||
print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
|
||||
env.Tool('crossmingw', ['tools'])
|
||||
env.Tool('crossmingw', [toolpath])
|
||||
# todo: determine proper libs/includes etc.
|
||||
# Needed for gui programs, console programs should do without it
|
||||
|
||||
@@ -193,7 +200,7 @@ if not env['BF_FANCY']:
|
||||
# NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
|
||||
# TODO: perhaps we need an option (off by default) to not do this altogether...
|
||||
if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
|
||||
scriptsDir = env['BF_INSTALLDIR'] + os.sep + '.blender' + os.sep + 'scripts'
|
||||
scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
|
||||
if os.path.isdir(scriptsDir):
|
||||
print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
|
||||
shutil.rmtree(scriptsDir)
|
||||
@@ -434,9 +441,11 @@ else:
|
||||
|
||||
blenderinstall = env.Install(dir=dir, source=B.program_list)
|
||||
|
||||
#-- .blender
|
||||
#- dont do .blender and scripts for darwin, it is already in the bundle
|
||||
#-- local path = config files in install dir: installdir\VERSION
|
||||
#- dont do config and scripts for darwin, it is already in the bundle
|
||||
dotblendlist = []
|
||||
datafileslist = []
|
||||
datafilestargetlist = []
|
||||
dottargetlist = []
|
||||
scriptinstall = []
|
||||
|
||||
@@ -455,20 +464,29 @@ if env['OURPLATFORM']!='darwin':
|
||||
if f.endswith('.ttf'):
|
||||
continue
|
||||
|
||||
dotblendlist.append(os.path.join(dp, f))
|
||||
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[2:])) # skip bin/.blender
|
||||
else: dir= os.path.join(*([BLENDERPATH] + dp.split(os.sep)[1:])) # skip bin
|
||||
|
||||
dottargetlist.append(dir + os.sep + f)
|
||||
|
||||
if 'locale' in dp:
|
||||
datafileslist.append(os.path.join(dp,f))
|
||||
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['datafiles'] + dp.split(os.sep)[2:])) # skip bin/.blender
|
||||
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:])) # skip bin
|
||||
datafilestargetlist.append(dir + os.sep + f)
|
||||
|
||||
else:
|
||||
dotblendlist.append(os.path.join(dp, f))
|
||||
if env['WITH_BF_FHS']: dir= os.path.join(*([BLENDERPATH] + ['config'] + dp.split(os.sep)[2:])) # skip bin/.blender
|
||||
else: dir= os.path.join(*([BLENDERPATH] + [VERSION] + ['config'] + dp.split(os.sep)[1:])) # skip bin
|
||||
|
||||
dottargetlist.append(dir + os.sep + f)
|
||||
|
||||
dotblenderinstall = []
|
||||
for targetdir,srcfile in zip(dottargetlist, dotblendlist):
|
||||
td, tf = os.path.split(targetdir)
|
||||
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
|
||||
for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
|
||||
td, tf = os.path.split(targetdir)
|
||||
dotblenderinstall.append(env.Install(dir=td, source=srcfile))
|
||||
|
||||
if env['WITH_BF_PYTHON']:
|
||||
#-- .blender/scripts
|
||||
#-- local/VERSION/scripts
|
||||
scriptpaths=['release/scripts']
|
||||
for scriptpath in scriptpaths:
|
||||
for dp, dn, df in os.walk(scriptpath):
|
||||
@@ -476,7 +494,7 @@ if env['OURPLATFORM']!='darwin':
|
||||
dn.remove('.svn')
|
||||
|
||||
if env['WITH_BF_FHS']: dir = BLENDERPATH
|
||||
else: dir = os.path.join(env['BF_INSTALLDIR'], '.blender')
|
||||
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
|
||||
dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
|
||||
|
||||
source=[os.path.join(dp, f) for f in df if f[-3:]!='pyc']
|
||||
@@ -612,9 +630,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
'${BF_FFMPEG_LIBPATH}/avdevice-52.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/avutil-50.dll',
|
||||
'${BF_FFMPEG_LIBPATH}/swscale-0.dll']
|
||||
|
||||
if env['WITH_BF_JACK']:
|
||||
dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
|
||||
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
|
||||
allinstall += windlls
|
||||
|
||||
|
||||
131
bin/blender-thumbnailer.py
Executable file
@@ -0,0 +1,131 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
"""
|
||||
Thumbnailer runs with python 2.6 and 3.x.
|
||||
To run automatically with nautilus:
|
||||
gconftool --type boolean --set /desktop/gnome/thumbnailers/application@x-blender/enable true
|
||||
gconftool --type string --set /desktop/gnome/thumbnailers/application@x-blender/command "blender-thumbnailer.py %i %o"
|
||||
"""
|
||||
|
||||
import struct
|
||||
|
||||
def blend_extract_thumb(path):
|
||||
import os
|
||||
|
||||
# def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3])
|
||||
REND = 1145980242 # MAKE_ID(b'REND')
|
||||
TEST = 1414743380 # MAKE_ID(b'TEST')
|
||||
|
||||
blendfile = open(path, 'rb')
|
||||
|
||||
head = blendfile.read(12)
|
||||
|
||||
if head[0:2] == b'\x1f\x8b': # gzip magic
|
||||
import gzip
|
||||
blendfile.close()
|
||||
blendfile = gzip.open(path, 'rb')
|
||||
head = blendfile.read(12)
|
||||
|
||||
if not head.startswith(b'BLENDER'):
|
||||
blendfile.close()
|
||||
return None, 0, 0
|
||||
|
||||
is_64_bit = (head[7] == b'-')
|
||||
|
||||
# true for PPC, false for X86
|
||||
is_big_endian = (head[8] == b'V')
|
||||
|
||||
# blender pre 2.5 had no thumbs
|
||||
if head[9:11] <= b'24':
|
||||
return None, 0, 0
|
||||
|
||||
sizeof_bhead = 24 if is_64_bit else 20
|
||||
int_endian_pair = '>ii' if is_big_endian else '<ii'
|
||||
|
||||
while True:
|
||||
bhead = blendfile.read(sizeof_bhead)
|
||||
|
||||
if len(bhead) < sizeof_bhead:
|
||||
return None, 0, 0
|
||||
|
||||
code, length = struct.unpack(int_endian_pair, bhead[0:8]) # 8 == sizeof(int) * 2
|
||||
|
||||
if code == REND:
|
||||
blendfile.seek(length, os.SEEK_CUR)
|
||||
else:
|
||||
break
|
||||
|
||||
|
||||
if code != TEST:
|
||||
return None, 0, 0
|
||||
|
||||
try:
|
||||
x, y = struct.unpack(int_endian_pair, blendfile.read(8)) # 8 == sizeof(int) * 2
|
||||
except struct.error:
|
||||
return None, 0, 0
|
||||
|
||||
length -= 8 # sizeof(int) * 2
|
||||
|
||||
if length != x * y * 4:
|
||||
return None, 0, 0
|
||||
|
||||
image_buffer = blendfile.read(length)
|
||||
|
||||
if len(image_buffer) != length:
|
||||
return None, 0, 0
|
||||
|
||||
return image_buffer, x, y
|
||||
|
||||
|
||||
def write_png(buf, width, height):
|
||||
import zlib
|
||||
|
||||
# reverse the vertical line order and add null bytes at the start
|
||||
width_byte_4 = width * 4
|
||||
raw_data = b"".join([b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4)])
|
||||
|
||||
def png_pack(png_tag, data):
|
||||
chunk_head = png_tag + data
|
||||
return struct.pack("!I", len(data)) + chunk_head + struct.pack("!I", 0xFFFFFFFF & zlib.crc32(chunk_head))
|
||||
|
||||
return b"".join([
|
||||
b'\x89PNG\r\n\x1a\n',
|
||||
png_pack(b'IHDR', struct.pack("!2I5B", width, height, 8, 6, 0, 0, 0)),
|
||||
png_pack(b'IDAT', zlib.compress(raw_data, 9)),
|
||||
png_pack(b'IEND', b'')])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Expected 2 arguments <input.blend> <output.png>")
|
||||
else:
|
||||
file_in = sys.argv[-2]
|
||||
|
||||
buf, width, height = blend_extract_thumb(file_in)
|
||||
|
||||
if buf:
|
||||
file_out = sys.argv[-1]
|
||||
|
||||
f = open(file_out, "wb")
|
||||
f.write(write_png(buf, width, height))
|
||||
f.close()
|
||||
37
build_files/cmake/example_scripts/cmake_linux_install.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This shell script checks out and compiles blender, tested on ubuntu 10.04
|
||||
# assumes you have dependancies installed alredy
|
||||
|
||||
# See this page for more info:
|
||||
# http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux/Generic_Distro/CMake
|
||||
|
||||
# grab blender
|
||||
mkdir ~/blender-svn
|
||||
cd ~/blender-svn
|
||||
svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender
|
||||
|
||||
# create cmake dir
|
||||
mkdir ~/blender-svn/build-cmake
|
||||
cd ~/blender-svn/build-cmake
|
||||
|
||||
# cmake without copying files for fast rebuilds
|
||||
# the files from svn will be used in place
|
||||
cmake ../blender -DWITH_INSTALL:BOOL=FALSE
|
||||
|
||||
# make blender, will take some time
|
||||
make
|
||||
|
||||
# link the binary to blenders source directory to run quickly
|
||||
ln -s ~/blender-svn/build-cmake/bin/blender ~/blender-svn/blender/blender.bin
|
||||
|
||||
# useful info
|
||||
echo ""
|
||||
echo "* Useful Commands *"
|
||||
echo " Run Blender: ~/blender-svn/blender/blender.bin"
|
||||
echo " Update Blender: svn up ~/blender-svn/blender"
|
||||
echo " Reconfigure Blender: cd ~/blender-svn/build-cmake ; cmake ."
|
||||
echo " Build Blender: cd ~/blender-svn/build-cmake ; make"
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -181,3 +181,53 @@ MACRO(SETUP_LIBLINKS
|
||||
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_LIBLINKS)
|
||||
|
||||
MACRO(TEST_SSE_SUPPORT)
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MESSAGE(STATUS "Detecting SSE support")
|
||||
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(CMAKE_REQUIRED_FLAGS "-msse -msse2")
|
||||
ELSEIF(MSVC)
|
||||
SET(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
|
||||
ENDIF()
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <xmmintrin.h>
|
||||
int main() { __m128 v = _mm_setzero_ps(); return 0; }"
|
||||
SUPPORT_SSE_BUILD)
|
||||
ENDMACRO(TEST_SSE_SUPPORT)
|
||||
|
||||
MACRO(GET_BLENDER_VERSION)
|
||||
FILE(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)
|
||||
STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")
|
||||
STRING(REGEX REPLACE "\t" ";" CONTENT "${CONTENT}")
|
||||
STRING(REGEX REPLACE " " ";" CONTENT "${CONTENT}")
|
||||
|
||||
FOREACH(ITEM ${CONTENT})
|
||||
IF(LASTITEM MATCHES "BLENDER_VERSION")
|
||||
MATH(EXPR BLENDER_VERSION_MAJOR "${ITEM} / 100")
|
||||
MATH(EXPR BLENDER_VERSION_MINOR "${ITEM} % 100")
|
||||
SET(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
|
||||
ENDIF(LASTITEM MATCHES "BLENDER_VERSION")
|
||||
|
||||
IF(LASTITEM MATCHES "BLENDER_SUBVERSION")
|
||||
SET(BLENDER_SUBVERSION ${ITEM})
|
||||
ENDIF(LASTITEM MATCHES "BLENDER_SUBVERSION")
|
||||
|
||||
IF(LASTITEM MATCHES "BLENDER_MINVERSION")
|
||||
MATH(EXPR BLENDER_MINVERSION_MAJOR "${ITEM} / 100")
|
||||
MATH(EXPR BLENDER_MINVERSION_MINOR "${ITEM} % 100")
|
||||
SET(BLENDER_MINVERSION "${BLENDER_MINVERSION_MAJOR}.${BLENDER_MINVERSION_MINOR}")
|
||||
ENDIF(LASTITEM MATCHES "BLENDER_MINVERSION")
|
||||
|
||||
IF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
|
||||
SET(BLENDER_MINSUBVERSION ${ITEM})
|
||||
ENDIF(LASTITEM MATCHES "BLENDER_MINSUBVERSION")
|
||||
|
||||
SET(LASTITEM ${ITEM})
|
||||
ENDFOREACH(ITEM ${CONTENT})
|
||||
|
||||
MESSAGE(STATUS "Version major: ${BLENDER_VERSION_MAJOR}, Version minor: ${BLENDER_VERSION_MINOR}, Subversion: ${BLENDER_SUBVERSION}, Version: ${BLENDER_VERSION}")
|
||||
MESSAGE(STATUS "Minversion major: ${BLENDER_MINVERSION_MAJOR}, Minversion minor: ${BLENDER_MINVERSION_MINOR}, MinSubversion: ${BLENDER_MINSUBVERSION}, Minversion: ${BLENDER_MINVERSION}")
|
||||
ENDMACRO(GET_BLENDER_VERSION)
|
||||
38
build_files/make/example_scripts/linux_nanmakefiles.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# This is an example script to build things with the Nan Makefiles
|
||||
#
|
||||
#
|
||||
|
||||
rm -f /tmp/.nanguess
|
||||
export MAKE=make
|
||||
export NANBLENDERHOME=`pwd`
|
||||
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
|
||||
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
|
||||
|
||||
export NAN_PYTHON=/soft/python-2.2.2b1/progeny1
|
||||
export NAN_PYTHON_VERSION=2.2
|
||||
export NAN_OPENAL=/usr/local
|
||||
export NAN_JPEG=/usr/local
|
||||
export NAN_PNG=/usr/local
|
||||
export NAN_SDL=/usr/local
|
||||
export NAN_ODE=/usr/local
|
||||
export NAN_ZLIB=/usr/local
|
||||
export NAN_FREETYPE=/usr/local
|
||||
|
||||
export NAN_MOZILLA_INC=/usr/local/include/mozilla-1.0.1/
|
||||
export NAN_MOZILLA_LIB=/usr/local/lib/mozilla-1.0.1/
|
||||
#export NAN_NSPR=/scratch/irulan/mein/nspr-4.2.2/mozilla/nsprpub/dist/
|
||||
export CPPFLAGS="$CPPFLAGS"
|
||||
export CFLAGS="$CFLAGS"
|
||||
export INTERNATIONAL=true
|
||||
|
||||
$HMAKE -C intern/
|
||||
if [ $? -eq 0 ]; then
|
||||
$HMAKE -C source/
|
||||
fi
|
||||
$HMAKE -C release
|
||||
|
||||
#cd release
|
||||
#make
|
||||
18
build_files/make/example_scripts/macos_nanmakefiles.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -f /tmp/.nanguess
|
||||
export MAKE=make
|
||||
export NANBLENDERHOME=`pwd`
|
||||
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
|
||||
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
|
||||
echo
|
||||
echo NANBLENDERHOME : ${NANBLENDERHOME}
|
||||
|
||||
export NAN_PYTHON=/sw
|
||||
|
||||
$HMAKE -C intern/
|
||||
if [ $? -eq 0 ]; then
|
||||
$HMAKE -C source/
|
||||
fi
|
||||
cd release
|
||||
make
|
||||
35
build_files/make/example_scripts/sunos_nanmakefiles.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# This is an example build script for SunOS5.8
|
||||
|
||||
rm -f /tmp/.nanguess
|
||||
export MAKE=make
|
||||
export NANBLENDERHOME=`pwd`
|
||||
export MAKEFLAGS="-w -I $NANBLENDERHOME/source --no-print-directory"
|
||||
export HMAKE="$NANBLENDERHOME/source/tools/hmake/hmake"
|
||||
|
||||
export NAN_PYTHON=/soft/python-2.2.2b1/SunOS5.8
|
||||
export NAN_PYTHON_VERSION=2.2
|
||||
export NAN_OPENAL=/usr/local
|
||||
export NAN_JPEG=/usr/local
|
||||
export NAN_PNG=/usr/local
|
||||
export NAN_SDL=/usr/local
|
||||
export NAN_ODE=/usr/local
|
||||
export NAN_OPENSSL=/soft/ssl/openssl-0.9.6e
|
||||
export NAN_ZLIB=/usr/local
|
||||
export NAN_FREETYPE=/usr/local
|
||||
|
||||
export NAN_MOZILLA_INC=/usr/local/include/mozilla-1.0.1/
|
||||
export NAN_MOZILLA_LIB=/usr/local/lib/mozilla-1.0.1/
|
||||
export NAN_NSPR=/scratch/irulan/mein/nspr-4.2.2/mozilla/nsprpub/dist/
|
||||
export CPPFLAGS="$CPPFLAGS"
|
||||
export CFLAGS="$CFLAGS"
|
||||
export INTERNATIONAL=true
|
||||
|
||||
$HMAKE -C intern/
|
||||
if [ $? -eq 0 ]; then
|
||||
$HMAKE -C source/
|
||||
fi
|
||||
$HMAKE -C release
|
||||
|
||||
#cd release
|
||||
#make
|
||||
@@ -101,7 +101,7 @@ ifeq ($(OS),darwin)
|
||||
REL_CCFLAGS += -O2
|
||||
endif
|
||||
|
||||
CPPFLAGS += -D_THREAD_SAFE -fpascal-strings
|
||||
CPPFLAGS += -D_THREAD_SAFE
|
||||
|
||||
ifeq ($(WITH_COCOA), true)
|
||||
CPPFLAGS += -DGHOST_COCOA
|
||||
@@ -31,7 +31,7 @@
|
||||
# set some defaults when these are not overruled (?=) by environment variables
|
||||
#
|
||||
|
||||
sinclude ../user-def.mk
|
||||
sinclude ../../user-def.mk
|
||||
|
||||
# This warning only takes place once in source/
|
||||
ifeq (debug, $(findstring debug, $(MAKECMDGOALS)))
|
||||
@@ -151,6 +151,13 @@ BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf
|
||||
|
||||
WITH_BF_DDS = True
|
||||
|
||||
#Color Management System
|
||||
WITH_BF_LCMS = False
|
||||
BF_LCMS = LIBDIR + '/lcms'
|
||||
BF_LCMS_INC = '${BF_LCMS}/include'
|
||||
BF_LCMS_LIB = 'lcms'
|
||||
BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
|
||||
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
@@ -272,9 +279,9 @@ else:
|
||||
|
||||
CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
|
||||
|
||||
CPPFLAGS = ['-fpascal-strings']+ARCH_FLAGS
|
||||
CCFLAGS = ['-pipe','-funsigned-char','-fpascal-strings']+ARCH_FLAGS
|
||||
CXXFLAGS = ['-pipe','-funsigned-char', '-fpascal-strings']+ARCH_FLAGS
|
||||
CPPFLAGS = []+ARCH_FLAGS
|
||||
CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
|
||||
CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
|
||||
|
||||
if WITH_GHOST_COCOA==True:
|
||||
PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
|
||||
@@ -168,7 +168,7 @@ BF_EXPAT_LIBPATH = '/usr/lib'
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = False
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
|
||||
##
|
||||
@@ -181,6 +181,9 @@ CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFIL
|
||||
|
||||
CPPFLAGS = []
|
||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
|
||||
if WITH_BF_FFMPEG:
|
||||
# libavutil needs UINT64_C()
|
||||
CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
|
||||
REL_CFLAGS = ['-O2']
|
||||
REL_CCFLAGS = ['-O2']
|
||||
##BF_DEPEND = True
|
||||
@@ -153,7 +153,7 @@ BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32 glu32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
WITH_BF_OPENMP = False
|
||||
BF_OPENMP = LIBDIR + '/gcc/gomp'
|
||||
BF_OPENMP_INC = '${BF_OPENMP}/include'
|
||||
BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib'
|
||||
@@ -169,7 +169,7 @@ BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader Open
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib ${BF_ICONV_LIBPATH}'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = False
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
@@ -150,7 +150,7 @@ BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader Open
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = False
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
@@ -163,7 +163,7 @@ BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader Open
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = False
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
|
||||
|
||||
WITH_BF_STATICOPENGL = False
|
||||
794
build_files/scons/tools/Blender.py
Normal file
@@ -0,0 +1,794 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
tools.BlenderEnvironment
|
||||
|
||||
This environment builds on SCons.Script.SConscript.SConsEnvironment
|
||||
|
||||
* library repository
|
||||
* custom printout
|
||||
* wrapper functions
|
||||
|
||||
TODO: clean up and sanitise code - crosscheck with btools and SConstruct
|
||||
to kill any code duplication
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import string
|
||||
import glob
|
||||
import time
|
||||
import sys
|
||||
import zipfile
|
||||
import shutil
|
||||
import cStringIO
|
||||
|
||||
from SCons.Script.SConscript import SConsEnvironment
|
||||
import SCons.Action
|
||||
import SCons.Util
|
||||
import SCons.Builder
|
||||
import SCons.Tool
|
||||
import bcolors
|
||||
bc = bcolors.bcolors()
|
||||
import btools
|
||||
VERSION = btools.VERSION
|
||||
|
||||
Split = SCons.Util.Split
|
||||
Action = SCons.Action.Action
|
||||
Builder = SCons.Builder.Builder
|
||||
GetBuildPath = SConsEnvironment.GetBuildPath
|
||||
|
||||
# a few globals
|
||||
root_build_dir = ''
|
||||
doc_build_dir = ''
|
||||
quickie = None # Anything else than None if BF_QUICK has been passed
|
||||
quicklist = [] # The list of libraries/programs to compile during a quickie
|
||||
program_list = [] # A list holding Nodes to final binaries, used to create installs
|
||||
arguments = None
|
||||
targets = None
|
||||
resources = []
|
||||
|
||||
#some internals
|
||||
blenderdeps = [] # don't manipulate this one outside this module!
|
||||
|
||||
##### LIB STUFF ##########
|
||||
|
||||
possible_types = ['core'] # can be set in ie. SConstruct
|
||||
libs = {}
|
||||
vcp = []
|
||||
|
||||
def getresources():
|
||||
return resources
|
||||
|
||||
def init_lib_dict():
|
||||
for pt in possible_types:
|
||||
libs[pt] = {}
|
||||
|
||||
# helper func for add_lib_to_dict
|
||||
def internal_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100):
|
||||
if not libname in dict[libtype]:
|
||||
done = None
|
||||
while not done:
|
||||
if dict[libtype].has_key(priority):
|
||||
priority = priority + 1
|
||||
else:
|
||||
done = True
|
||||
dict[libtype][priority] = libname
|
||||
|
||||
# libtype and priority can both be lists, for defining lib in multiple places
|
||||
def add_lib_to_dict(env, dict = None, libtype = None, libname = None, priority = 100):
|
||||
if not dict or not libtype or not libname:
|
||||
print "Passed wrong arg"
|
||||
env.Exit()
|
||||
|
||||
if type(libtype) is str and type(priority) is int:
|
||||
internal_lib_to_dict(dict, libtype, libname, priority)
|
||||
elif type(libtype) is list and type(priority) is list:
|
||||
if len(libtype)==len(priority):
|
||||
for lt, p in zip(libtype, priority):
|
||||
internal_lib_to_dict(dict, lt, libname, p)
|
||||
else:
|
||||
print "libtype and priority lists are unequal in length"
|
||||
env.Exit()
|
||||
else:
|
||||
print "Wrong type combinations for libtype and priority. Only str and int or list and list"
|
||||
env.Exit()
|
||||
|
||||
def create_blender_liblist(lenv = None, libtype = None):
|
||||
if not lenv or not libtype:
|
||||
print "missing arg"
|
||||
|
||||
lst = []
|
||||
if libtype in possible_types:
|
||||
curlib = libs[libtype]
|
||||
sortlist = curlib.keys()
|
||||
sortlist.sort()
|
||||
for sk in sortlist:
|
||||
v = curlib[sk]
|
||||
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
|
||||
target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
|
||||
else:
|
||||
target = os.path.abspath(root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
|
||||
lst.append(target)
|
||||
|
||||
return lst
|
||||
|
||||
## TODO: static linking
|
||||
def setup_staticlibs(lenv):
|
||||
statlibs = [
|
||||
#here libs for static linking
|
||||
]
|
||||
|
||||
libincs = []
|
||||
|
||||
if lenv['WITH_BF_FFMPEG']:
|
||||
libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
|
||||
|
||||
libincs.extend([
|
||||
lenv['BF_OPENGL_LIBPATH'],
|
||||
lenv['BF_JPEG_LIBPATH'],
|
||||
lenv['BF_PNG_LIBPATH'],
|
||||
lenv['BF_ZLIB_LIBPATH'],
|
||||
lenv['BF_LIBSAMPLERATE_LIBPATH'],
|
||||
lenv['BF_ICONV_LIBPATH']
|
||||
])
|
||||
|
||||
libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
libincs += Split(lenv['BF_PYTHON_LIBPATH'])
|
||||
if lenv['WITH_BF_SDL']:
|
||||
libincs += Split(lenv['BF_SDL_LIBPATH'])
|
||||
if lenv['WITH_BF_JACK']:
|
||||
libincs += Split(lenv['BF_JACK_LIBPATH'])
|
||||
if lenv['WITH_BF_SNDFILE']:
|
||||
libincs += Split(lenv['BF_SNDFILE_LIBPATH'])
|
||||
if lenv['WITH_BF_OPENEXR']:
|
||||
libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOPENEXR']:
|
||||
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
|
||||
if lenv['WITH_BF_LCMS']:
|
||||
libincs += Split(lenv['BF_LCMS_LIBPATH'])
|
||||
if lenv['WITH_BF_TIFF']:
|
||||
libincs += Split(lenv['BF_TIFF_LIBPATH'])
|
||||
if lenv['WITH_BF_FFTW3']:
|
||||
libincs += Split(lenv['BF_FFTW3_LIBPATH'])
|
||||
if lenv['WITH_BF_INTERNATIONAL']:
|
||||
libincs += Split(lenv['BF_GETTEXT_LIBPATH'])
|
||||
if lenv['WITH_BF_OPENAL']:
|
||||
libincs += Split(lenv['BF_OPENAL_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOPENAL']:
|
||||
statlibs += Split(lenv['BF_OPENAL_LIB_STATIC'])
|
||||
if lenv['WITH_BF_STATICOPENGL']:
|
||||
statlibs += Split(lenv['BF_OPENGL_LIB_STATIC'])
|
||||
if lenv['WITH_BF_STATICCXX']:
|
||||
statlibs += Split(lenv['BF_CXX_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_PYTHON'] and lenv['WITH_BF_STATICPYTHON']:
|
||||
statlibs += Split(lenv['BF_PYTHON_LIB_STATIC'])
|
||||
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
|
||||
|
||||
if lenv['WITH_BF_COLLADA']:
|
||||
libincs += Split(lenv['BF_OPENCOLLADA_LIBPATH'])
|
||||
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
libincs += Split(lenv['BF_PCRE_LIBPATH'])
|
||||
libincs += Split(lenv['BF_EXPAT_LIBPATH'])
|
||||
|
||||
if lenv['WITH_BF_OPENMP']:
|
||||
if lenv['OURPLATFORM'] == 'linuxcross':
|
||||
libincs += Split(lenv['BF_OPENMP_LIBPATH'])
|
||||
|
||||
# setting this last so any overriding of manually libs could be handled
|
||||
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
libincs.append('/usr/lib')
|
||||
|
||||
return statlibs, libincs
|
||||
|
||||
def setup_syslibs(lenv):
|
||||
syslibs = [
|
||||
|
||||
lenv['BF_JPEG_LIB'],
|
||||
lenv['BF_PNG_LIB'],
|
||||
lenv['BF_ZLIB_LIB'],
|
||||
lenv['BF_LIBSAMPLERATE_LIB']
|
||||
]
|
||||
|
||||
syslibs += Split(lenv['BF_FREETYPE_LIB'])
|
||||
if lenv['WITH_BF_PYTHON'] and not lenv['WITH_BF_STATICPYTHON']:
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
|
||||
syslibs.append(lenv['BF_PYTHON_LIB']+'_d')
|
||||
else:
|
||||
syslibs.append(lenv['BF_PYTHON_LIB'])
|
||||
if lenv['WITH_BF_INTERNATIONAL']:
|
||||
syslibs += Split(lenv['BF_GETTEXT_LIB'])
|
||||
if lenv['WITH_BF_OPENAL']:
|
||||
if not lenv['WITH_BF_STATICOPENAL']:
|
||||
syslibs += Split(lenv['BF_OPENAL_LIB'])
|
||||
if lenv['WITH_BF_OPENMP'] and lenv['CC'] != 'icc':
|
||||
if lenv['CC'] == 'cl.exe':
|
||||
syslibs += ['vcomp']
|
||||
else:
|
||||
syslibs += ['gomp']
|
||||
if lenv['WITH_BF_ICONV']:
|
||||
syslibs += Split(lenv['BF_ICONV_LIB'])
|
||||
if lenv['WITH_BF_OPENEXR']:
|
||||
if not lenv['WITH_BF_STATICOPENEXR']:
|
||||
syslibs += Split(lenv['BF_OPENEXR_LIB'])
|
||||
if lenv['WITH_BF_TIFF']:
|
||||
syslibs += Split(lenv['BF_TIFF_LIB'])
|
||||
if lenv['WITH_BF_FFMPEG']:
|
||||
syslibs += Split(lenv['BF_FFMPEG_LIB'])
|
||||
if lenv['WITH_BF_OGG']:
|
||||
syslibs += Split(lenv['BF_OGG_LIB'])
|
||||
if lenv['WITH_BF_JACK']:
|
||||
syslibs += Split(lenv['BF_JACK_LIB'])
|
||||
if lenv['WITH_BF_SNDFILE']:
|
||||
syslibs += Split(lenv['BF_SNDFILE_LIB'])
|
||||
if lenv['WITH_BF_FFTW3']:
|
||||
syslibs += Split(lenv['BF_FFTW3_LIB'])
|
||||
if lenv['WITH_BF_SDL']:
|
||||
syslibs += Split(lenv['BF_SDL_LIB'])
|
||||
if not lenv['WITH_BF_STATICOPENGL']:
|
||||
syslibs += Split(lenv['BF_OPENGL_LIB'])
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
|
||||
syslibs += Split(lenv['BF_PTHREADS_LIB'])
|
||||
if lenv['WITH_BF_LCMS']:
|
||||
syslibs.append(lenv['BF_LCMS_LIB'])
|
||||
if lenv['WITH_BF_COLLADA']:
|
||||
syslibs.append(lenv['BF_PCRE_LIB'])
|
||||
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
|
||||
syslibs.append(lenv['BF_EXPAT_LIB'])
|
||||
|
||||
|
||||
syslibs += lenv['LLIBS']
|
||||
|
||||
return syslibs
|
||||
|
||||
def propose_priorities():
|
||||
print bc.OKBLUE+"Priorities:"+bc.ENDC
|
||||
for t in possible_types:
|
||||
print bc.OKGREEN+"\t"+t+bc.ENDC
|
||||
new_priority = 0
|
||||
curlib = libs[t]
|
||||
sortlist = curlib.keys()
|
||||
sortlist.sort()
|
||||
|
||||
for sk in sortlist:
|
||||
v = curlib[sk]
|
||||
#for p,v in sorted(libs[t].iteritems()):
|
||||
print "\t\t",new_priority, v
|
||||
new_priority += 5
|
||||
|
||||
## TODO: see if this can be made in an emitter
|
||||
def buildinfo(lenv, build_type):
|
||||
"""
|
||||
Generate a buildinfo object
|
||||
"""
|
||||
build_date = time.strftime ("%Y-%m-%d")
|
||||
build_time = time.strftime ("%H:%M:%S")
|
||||
build_rev = os.popen('svnversion').read()[:-1] # remove \n
|
||||
|
||||
obj = []
|
||||
if lenv['BF_BUILDINFO']:
|
||||
lenv.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time),
|
||||
'BUILD_DATE=\'"%s"\''%(build_date),
|
||||
'BUILD_TYPE=\'"dynamic"\'',
|
||||
'BUILD_REV=\'"%s"\''%(build_rev),
|
||||
'NAN_BUILDINFO',
|
||||
'BUILD_PLATFORM=\'"%s"\''%(sys.platform)])
|
||||
obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type,
|
||||
[root_build_dir+'source/creator/buildinfo.c'])]
|
||||
return obj
|
||||
|
||||
##### END LIB STUFF ############
|
||||
|
||||
##### ACTION STUFF #############
|
||||
|
||||
def my_print_cmd_line(self, s, target, source, env):
|
||||
sys.stdout.write(' ' * 70 + '\r')
|
||||
sys.stdout.flush()
|
||||
sys.stdout.write(s + "\r")
|
||||
sys.stdout.flush()
|
||||
|
||||
def my_compile_print(target, source, env):
|
||||
a = '%s' % (source[0])
|
||||
d, f = os.path.split(a)
|
||||
return bc.OKBLUE+"Compiling"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
|
||||
|
||||
def my_moc_print(target, source, env):
|
||||
a = '%s' % (source[0])
|
||||
d, f = os.path.split(a)
|
||||
return bc.OKBLUE+"Creating MOC"+bc.ENDC+ " ==> '"+bc.OKGREEN+"%s" %(f) + "'"+bc.ENDC
|
||||
|
||||
def my_linking_print(target, source, env):
|
||||
t = '%s' % (target[0])
|
||||
d, f = os.path.split(t)
|
||||
return bc.OKBLUE+"Linking library"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
|
||||
|
||||
def my_program_print(target, source, env):
|
||||
t = '%s' % (target[0])
|
||||
d, f = os.path.split(t)
|
||||
return bc.OKBLUE+"Linking program"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
|
||||
|
||||
def msvc_hack(env):
|
||||
static_lib = SCons.Tool.createStaticLibBuilder(env)
|
||||
program = SCons.Tool.createProgBuilder(env)
|
||||
|
||||
env['BUILDERS']['Library'] = static_lib
|
||||
env['BUILDERS']['StaticLibrary'] = static_lib
|
||||
env['BUILDERS']['Program'] = program
|
||||
|
||||
def set_quiet_output(env):
|
||||
mycaction = Action("$CCCOM", strfunction=my_compile_print)
|
||||
myshcaction = Action("$SHCCCOM", strfunction=my_compile_print)
|
||||
mycppaction = Action("$CXXCOM", strfunction=my_compile_print)
|
||||
myshcppaction = Action("$SHCXXCOM", strfunction=my_compile_print)
|
||||
mylibaction = Action("$ARCOM", strfunction=my_linking_print)
|
||||
mylinkaction = Action("$LINKCOM", strfunction=my_program_print)
|
||||
|
||||
static_ob, shared_ob = SCons.Tool.createObjBuilders(env)
|
||||
static_ob.add_action('.c', mycaction)
|
||||
static_ob.add_action('.cpp', mycppaction)
|
||||
shared_ob.add_action('.c', myshcaction)
|
||||
shared_ob.add_action('.cpp', myshcppaction)
|
||||
|
||||
static_lib = SCons.Builder.Builder(action = mylibaction,
|
||||
emitter = '$LIBEMITTER',
|
||||
prefix = '$LIBPREFIX',
|
||||
suffix = '$LIBSUFFIX',
|
||||
src_suffix = '$OBJSUFFIX',
|
||||
src_builder = 'StaticObject')
|
||||
|
||||
program = SCons.Builder.Builder(action = mylinkaction,
|
||||
emitter = '$PROGEMITTER',
|
||||
prefix = '$PROGPREFIX',
|
||||
suffix = '$PROGSUFFIX',
|
||||
src_suffix = '$OBJSUFFIX',
|
||||
src_builder = 'Object',
|
||||
target_scanner = SCons.Defaults.ProgScan)
|
||||
|
||||
env['BUILDERS']['Object'] = static_ob
|
||||
env['BUILDERS']['StaticObject'] = static_ob
|
||||
env['BUILDERS']['StaticLibrary'] = static_lib
|
||||
env['BUILDERS']['Library'] = static_lib
|
||||
env['BUILDERS']['Program'] = program
|
||||
if env['BF_LINE_OVERWRITE']:
|
||||
SCons.Action._ActionAction.print_cmd_line = my_print_cmd_line
|
||||
|
||||
|
||||
class CompZipFile(zipfile.ZipFile):
|
||||
"""Partial copy of python2.6's zipfile.ZipFile (see http://www.python.org)
|
||||
to get a extractall() that works on py2.5 and probably earlier distributions."""
|
||||
def __init__(self, file, mode="r", compression=zipfile.ZIP_STORED, allowZip64=False):
|
||||
if sys.version_info < (2, 6):
|
||||
zipfile.ZipFile.__init__(self, file, mode, compression)
|
||||
else:
|
||||
zipfile.ZipFile.__init__(self, file, mode, compression, allowZip64)
|
||||
|
||||
if not hasattr(self,"extractall"): # use our method
|
||||
print "Debug: Using comp_extractall!"
|
||||
self.extractall= self.comp_extractall
|
||||
|
||||
def comp_extractall(self, path=None, members=None, pwd=None): #renamed method
|
||||
"""Extract all members from the archive to the current working
|
||||
directory. `path' specifies a different directory to extract to.
|
||||
`members' is optional and must be a subset of the list returned
|
||||
by namelist().
|
||||
"""
|
||||
if members is None:
|
||||
members = self.namelist()
|
||||
|
||||
for zipinfo in members:
|
||||
self.comp_extract(zipinfo, path, pwd) # use our method
|
||||
|
||||
def comp_extract(self, member, path=None, pwd=None): #renamed method
|
||||
"""Extract a member from the archive to the current working directory,
|
||||
using its full name. Its file information is extracted as accurately
|
||||
as possible. `member' may be a filename or a ZipInfo object. You can
|
||||
specify a different directory using `path'.
|
||||
"""
|
||||
if not isinstance(member, zipfile.ZipInfo):
|
||||
member = self.getinfo(member)
|
||||
|
||||
if path is None:
|
||||
path = os.getcwd()
|
||||
|
||||
return self.comp_extract_member(member, path, pwd) # use our method
|
||||
|
||||
def comp_extract_member(self, member, targetpath, pwd): #renamed method
|
||||
"""Extract the ZipInfo object 'member' to a physical
|
||||
file on the path targetpath.
|
||||
"""
|
||||
# build the destination pathname, replacing
|
||||
# forward slashes to platform specific separators.
|
||||
if targetpath[-1:] in (os.path.sep, os.path.altsep):
|
||||
targetpath = targetpath[:-1]
|
||||
|
||||
# don't include leading "/" from file name if present
|
||||
if member.filename[0] == '/':
|
||||
targetpath = os.path.join(targetpath, member.filename[1:])
|
||||
else:
|
||||
targetpath = os.path.join(targetpath, member.filename)
|
||||
|
||||
targetpath = os.path.normpath(targetpath)
|
||||
|
||||
# Create all upper directories if necessary.
|
||||
upperdirs = os.path.dirname(targetpath)
|
||||
if upperdirs and not os.path.exists(upperdirs):
|
||||
os.makedirs(upperdirs)
|
||||
|
||||
if member.filename[-1] == '/':
|
||||
os.mkdir(targetpath)
|
||||
return targetpath
|
||||
|
||||
#use StrinIO instead so we don't have to reproduce more functionality.
|
||||
source = cStringIO.StringIO(self.read(member.filename))
|
||||
target = file(targetpath, "wb")
|
||||
shutil.copyfileobj(source, target)
|
||||
source.close()
|
||||
target.close()
|
||||
|
||||
return targetpath
|
||||
|
||||
def unzip_pybundle(from_zip,to_dir,exclude_re):
|
||||
|
||||
zip= CompZipFile(from_zip, mode='r')
|
||||
exclude_re= list(exclude_re) #single re object or list of re objects
|
||||
debug= 0 #list files instead of unpacking
|
||||
good= []
|
||||
if debug: print '\nFiles not being unpacked:\n'
|
||||
for name in zip.namelist():
|
||||
is_bad= 0
|
||||
for r in exclude_re:
|
||||
if r.match(name):
|
||||
is_bad=1
|
||||
if debug: print name
|
||||
break
|
||||
if not is_bad:
|
||||
good.append(name)
|
||||
if debug:
|
||||
print '\nFiles being unpacked:\n'
|
||||
for g in good:
|
||||
print g
|
||||
else:
|
||||
zip.extractall(to_dir, good)
|
||||
|
||||
def my_winpybundle_print(target, source, env):
|
||||
pass
|
||||
|
||||
def WinPyBundle(target=None, source=None, env=None):
|
||||
import re
|
||||
py_zip= env.subst( env['LCGDIR'] )
|
||||
if py_zip[0]=='#':
|
||||
py_zip= py_zip[1:]
|
||||
py_zip+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.zip'
|
||||
|
||||
py_target = env.subst( env['BF_INSTALLDIR'] )
|
||||
if py_target[0]=='#':
|
||||
py_target=py_target[1:]
|
||||
py_target = os.path.join(py_target, VERSION, 'python', 'lib')
|
||||
def printexception(func,path,ex):
|
||||
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
|
||||
print str(func) + ' failed on ' + str(path)
|
||||
print "Trying to remove existing py bundle."
|
||||
shutil.rmtree(py_target, False, printexception)
|
||||
exclude_re=[re.compile('.*/test/.*'),
|
||||
re.compile('^config/.*'),
|
||||
re.compile('^distutils/.*'),
|
||||
re.compile('^idlelib/.*'),
|
||||
re.compile('^lib2to3/.*'),
|
||||
re.compile('^tkinter/.*')]
|
||||
print "Unpacking '" + py_zip + "' to '" + py_target + "'"
|
||||
unzip_pybundle(py_zip,py_target,exclude_re)
|
||||
|
||||
def my_appit_print(target, source, env):
|
||||
a = '%s' % (target[0])
|
||||
d, f = os.path.split(a)
|
||||
return "making bundle for " + f
|
||||
|
||||
def AppIt(target=None, source=None, env=None):
|
||||
import shutil
|
||||
import commands
|
||||
import os.path
|
||||
|
||||
|
||||
a = '%s' % (target[0])
|
||||
builddir, b = os.path.split(a)
|
||||
libdir = env['LCGDIR'][1:]
|
||||
osxarch = env['MACOSX_ARCHITECTURE']
|
||||
installdir = env['BF_INSTALLDIR']
|
||||
print("compiled architecture: %s"%(osxarch))
|
||||
print("Installing to %s"%(installdir))
|
||||
if libdir == '../lib/darwin-9.x.universal':
|
||||
python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
|
||||
else:
|
||||
python_zip = 'python.zip' # compatibility for darwin8 python.zip
|
||||
print("unzipping to app-bundle: %s"%(python_zip))
|
||||
bldroot = env.Dir('.').abspath
|
||||
binary = env['BINARYKIND']
|
||||
|
||||
if b=='verse':
|
||||
print bc.OKBLUE+"no bundle for verse"+bc.ENDC
|
||||
return 0
|
||||
|
||||
sourcedir = bldroot + '/source/darwin/%s.app'%binary
|
||||
sourceinfo = bldroot + "/source/darwin/%s.app/Contents/Info.plist"%binary
|
||||
targetinfo = installdir +'/' + "%s.app/Contents/Info.plist"%binary
|
||||
cmd = installdir + '/' +'%s.app'%binary
|
||||
|
||||
if os.path.isdir(cmd):
|
||||
shutil.rmtree(cmd)
|
||||
shutil.copytree(sourcedir, cmd)
|
||||
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(installdir, binary, VERSION)
|
||||
# print cmd
|
||||
commands.getoutput(cmd)
|
||||
cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
|
||||
shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
|
||||
shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
|
||||
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'find %s/%s.app -name .DS_Store -exec rm -rf {} \;'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'find %s/%s.app -name __MACOSX -exec rm -rf {} \;'%(installdir, binary)
|
||||
commands.getoutput(cmd)
|
||||
|
||||
# extract copy system python, be sure to update other build systems
|
||||
# when making changes to the files that are copied.
|
||||
def my_unixpybundle_print(target, source, env):
|
||||
pass
|
||||
|
||||
def UnixPyBundle(target=None, source=None, env=None):
|
||||
# Any Unix except osx
|
||||
#-- VERSION/python/lib/python3.1
|
||||
|
||||
import commands
|
||||
|
||||
def run(cmd):
|
||||
print 'Install command:', cmd
|
||||
commands.getoutput(cmd)
|
||||
|
||||
if env['WITH_BF_FHS']: dir = os.path.join(env['BF_INSTALLDIR'], 'share', 'blender', env['BF_VERSION']) # BLENDERPATH
|
||||
else: dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
|
||||
|
||||
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
|
||||
py_target = env.subst( dir + '/python/lib/python'+env['BF_PYTHON_VERSION'] )
|
||||
|
||||
# This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow.
|
||||
if os.path.exists(py_target):
|
||||
print 'Using existing python from:'
|
||||
print '\t"%s"' % py_target
|
||||
print '\t(skipping copy)\n'
|
||||
return
|
||||
|
||||
|
||||
# Copied from source/creator/CMakeLists.txt, keep in sync.
|
||||
print 'Install python from:'
|
||||
print '\t"%s" into...' % py_src
|
||||
print '\t"%s"\n' % py_target
|
||||
|
||||
run('rm -rf "%s"' % py_target)
|
||||
try: os.makedirs(os.path.dirname(py_target)) # the final part is copied
|
||||
except:pass
|
||||
|
||||
run('cp -R "%s" "%s"' % (py_src, os.path.dirname(py_target)))
|
||||
run('rm -rf "%s/distutils"' % py_target)
|
||||
run('rm -rf "%s/lib2to3"' % py_target)
|
||||
run('rm -rf "%s/idlelib"' % py_target)
|
||||
run('rm -rf "%s/tkinter"' % py_target)
|
||||
run('rm -rf "%s/config"' % py_target)
|
||||
|
||||
run('rm -rf "%s/site-packages"' % py_target)
|
||||
run('mkdir "%s/site-packages"' % py_target) # python needs it.'
|
||||
|
||||
run('rm -f "%s/lib-dynload/_tkinter.so"' % py_target)
|
||||
run('find "%s" -name "test" -prune -exec rm -rf {} \;' % py_target)
|
||||
run('find "%s" -name "*.py?" -exec rm -rf {} \;' % py_target)
|
||||
run('find "%s" -name "*.so"-exec strip -s {} \;' % py_target)
|
||||
|
||||
#### END ACTION STUFF #########
|
||||
|
||||
def bsc(env, target, source):
|
||||
|
||||
bd = os.path.dirname(target[0].abspath)
|
||||
bscfile = '\"'+target[0].abspath+'\"'
|
||||
bscpathcollect = '\"'+bd + os.sep + '*.sbr\"'
|
||||
bscpathtmp = '\"'+bd + os.sep + 'bscmake.tmp\"'
|
||||
|
||||
os.system('dir /b/s '+bscpathcollect+' >'+bscpathtmp)
|
||||
|
||||
myfile = open(bscpathtmp[1:-1], 'r')
|
||||
lines = myfile.readlines()
|
||||
myfile.close()
|
||||
|
||||
newfile = open(bscpathtmp[1:-1], 'w')
|
||||
for l in lines:
|
||||
newfile.write('\"'+l[:-1]+'\"\n')
|
||||
newfile.close()
|
||||
|
||||
os.system('bscmake /nologo /n /o'+bscfile+' @'+bscpathtmp)
|
||||
os.system('del '+bscpathtmp)
|
||||
|
||||
class BlenderEnvironment(SConsEnvironment):
|
||||
|
||||
def BlenderRes(self=None, libname=None, source=None, libtype=['core'], priority=[100]):
|
||||
global libs
|
||||
if not self or not libname or not source:
|
||||
print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC
|
||||
self.Exit()
|
||||
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross', 'win64-vc'):
|
||||
print bc.FAIL+'BlenderRes is for windows only!'+bc.END
|
||||
self.Exit()
|
||||
|
||||
print bc.HEADER+'Configuring resource '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC
|
||||
lenv = self.Clone()
|
||||
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
|
||||
res = lenv.RES('#'+root_build_dir+'lib/'+libname, source)
|
||||
else:
|
||||
res = lenv.RES(root_build_dir+'lib/'+libname, source)
|
||||
|
||||
|
||||
SConsEnvironment.Default(self, res)
|
||||
resources.append(res)
|
||||
|
||||
def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None, cc_compileflags=None, cxx_compileflags=None):
|
||||
global vcp
|
||||
if not self or not libname or not sources:
|
||||
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
|
||||
self.Exit()
|
||||
|
||||
def list_substring(quickie, libname):
|
||||
for q in quickie:
|
||||
if libname.find(q) != -1:
|
||||
return True
|
||||
return False
|
||||
|
||||
if list_substring(quickie, libname) or len(quickie)==0:
|
||||
if list_substring(quickdebug, libname):
|
||||
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname +bc.ENDC+bc.OKBLUE+ " (debug mode)" + bc.ENDC
|
||||
else:
|
||||
print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname + bc.ENDC
|
||||
lenv = self.Clone()
|
||||
lenv.Append(CPPPATH=includes)
|
||||
lenv.Append(CPPDEFINES=defines)
|
||||
if lenv['BF_DEBUG'] or (libname in quickdebug):
|
||||
lenv.Append(CFLAGS = lenv['BF_DEBUG_CFLAGS'])
|
||||
lenv.Append(CCFLAGS = lenv['BF_DEBUG_CCFLAGS'])
|
||||
lenv.Append(CXXFLAGS = lenv['BF_DEBUG_CXXFLAGS'])
|
||||
else:
|
||||
lenv.Append(CFLAGS = lenv['REL_CFLAGS'])
|
||||
lenv.Append(CCFLAGS = lenv['REL_CCFLAGS'])
|
||||
lenv.Append(CXXFLAGS = lenv['REL_CXXFLAGS'])
|
||||
if lenv['BF_PROFILE']:
|
||||
lenv.Append(CFLAGS = lenv['BF_PROFILE_CFLAGS'])
|
||||
lenv.Append(CCFLAGS = lenv['BF_PROFILE_CCFLAGS'])
|
||||
lenv.Append(CXXFLAGS = lenv['BF_PROFILE_CXXFLAGS'])
|
||||
if compileflags:
|
||||
lenv.Replace(CFLAGS = compileflags)
|
||||
if cc_compileflags:
|
||||
lenv.Replace(CCFLAGS = cc_compileflags)
|
||||
if cxx_compileflags:
|
||||
lenv.Replace(CXXFLAGS = cxx_compileflags)
|
||||
lenv.Append(CFLAGS = lenv['C_WARN'])
|
||||
lenv.Append(CCFLAGS = lenv['CC_WARN'])
|
||||
lenv.Append(CXXFLAGS = lenv['CXX_WARN'])
|
||||
|
||||
if lenv['OURPLATFORM'] == 'win64-vc':
|
||||
lenv.Append(LINKFLAGS = ['/MACHINE:X64'])
|
||||
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
if lenv['BF_DEBUG']:
|
||||
lenv.Append(CCFLAGS = ['/MTd'])
|
||||
else:
|
||||
lenv.Append(CCFLAGS = ['/MT'])
|
||||
|
||||
targetdir = root_build_dir+'lib/' + libname
|
||||
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
|
||||
targetdir = '#'+targetdir
|
||||
lib = lenv.Library(target= targetdir, source=sources)
|
||||
SConsEnvironment.Default(self, lib) # we add to default target, because this way we get some kind of progress info during build
|
||||
if self['BF_MSVS'] and self['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
#if targetdir[0] == '#':
|
||||
# targetdir = targetdir[1:-1]
|
||||
print "! ",targetdir+ '.vcproj' # + self['MSVSPROJECTSUFFIX']
|
||||
vcproject = self.MSVSProject(target = targetdir + '.vcproj', # + self['MSVSPROJECTSUFFIX'],
|
||||
srcs = sources,
|
||||
buildtarget = lib,
|
||||
variant = 'Release',
|
||||
auto_build_solution=0)
|
||||
vcp.append(vcproject)
|
||||
SConsEnvironment.Default(self, vcproject)
|
||||
else:
|
||||
print bc.WARNING+'Not building '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC+' for '+bc.OKBLUE+'BF_QUICK'+bc.ENDC
|
||||
# note: libs is a global
|
||||
add_lib_to_dict(self, libs, libtype, libname, priority)
|
||||
|
||||
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''):
|
||||
global vcp
|
||||
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
||||
lenv = self.Clone()
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE'])
|
||||
if lenv['BF_DEBUG']:
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
|
||||
if lenv['OURPLATFORM']=='linux2':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['OURPLATFORM']=='sunos5':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
if lenv['CXX'].endswith('CC'):
|
||||
lenv.Replace(LINK = '$CXX')
|
||||
if lenv['OURPLATFORM']=='darwin':
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
|
||||
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
|
||||
if lenv['BF_PROFILE']:
|
||||
lenv.Append(LINKFLAGS = lenv['BF_PROFILE_LINKFLAGS'])
|
||||
lenv.Append(CPPPATH=includes)
|
||||
if root_build_dir[0]==os.sep or root_build_dir[1]==':':
|
||||
lenv.Append(LIBPATH=root_build_dir + '/lib')
|
||||
lenv.Append(LIBPATH=libpath)
|
||||
lenv.Append(LIBS=libs)
|
||||
if lenv['WITH_BF_QUICKTIME']:
|
||||
lenv.Append(LIBS = lenv['BF_QUICKTIME_LIB'])
|
||||
lenv.Append(LIBPATH = lenv['BF_QUICKTIME_LIBPATH'])
|
||||
prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc') and lenv['BF_BSC']:
|
||||
f = lenv.File(progname + '.bsc', builddir)
|
||||
brs = lenv.Command(f, prog, [bsc])
|
||||
SConsEnvironment.Default(self, brs)
|
||||
SConsEnvironment.Default(self, prog)
|
||||
if self['BF_MSVS'] and self['OURPLATFORM'] in ('win32-vc', 'win64-vc') and progname == 'blender':
|
||||
print "! ",builddir + "/" + progname + '.sln'
|
||||
sln = self.MSVSProject(target = builddir + "/" + progname + '.sln',
|
||||
projects= vcp,
|
||||
variant = 'Release')
|
||||
SConsEnvironment.Default(self, sln)
|
||||
program_list.append(prog)
|
||||
if lenv['OURPLATFORM']=='darwin':
|
||||
lenv['BINARYKIND'] = binarykind
|
||||
lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
|
||||
elif os.sep == '/' and lenv['OURPLATFORM'] != 'linuxcross': # any unix (except cross-compilation)
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']:
|
||||
lenv.AddPostAction(prog,Action(UnixPyBundle,strfunction=my_unixpybundle_print))
|
||||
elif lenv['OURPLATFORM'].startswith('win') or lenv['OURPLATFORM'] == 'linuxcross': # windows or cross-compilation
|
||||
if lenv['WITH_BF_PYTHON']:
|
||||
if not lenv['WITHOUT_BF_PYTHON_INSTALL']:
|
||||
lenv.AddPostAction(prog,Action(WinPyBundle,strfunction=my_winpybundle_print))
|
||||
return prog
|
||||
|
||||
def Glob(lenv, pattern):
|
||||
path = string.replace(GetBuildPath(lenv,'SConscript'),'SConscript', '')
|
||||
files = []
|
||||
for i in glob.glob(path + pattern):
|
||||
files.append(string.replace(i, path, ''))
|
||||
return files
|
||||
0
build_files/scons/tools/__init__.py
Normal file
16
build_files/scons/tools/bcolors.py
Normal file
@@ -0,0 +1,16 @@
|
||||
class bcolors:
|
||||
HEADER = '\033[95m'
|
||||
OKBLUE = '\033[94m'
|
||||
OKGREEN = '\033[92m'
|
||||
WARNING = '\033[93m'
|
||||
FAIL = '\033[91m'
|
||||
ENDC = '\033[0m'
|
||||
|
||||
def disable(self):
|
||||
self.HEADER = ''
|
||||
self.OKBLUE = ''
|
||||
self.OKGREEN = ''
|
||||
self.WARNING = ''
|
||||
self.FAIL = ''
|
||||
self.ENDC = ''
|
||||
|
||||
566
build_files/scons/tools/btools.py
Normal file
@@ -0,0 +1,566 @@
|
||||
import os
|
||||
import os.path
|
||||
import SCons.Options
|
||||
|
||||
import SCons.Variables
|
||||
try:
|
||||
import subprocess
|
||||
except ImportError:
|
||||
pass
|
||||
import string
|
||||
import glob
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
Variables = SCons.Variables
|
||||
BoolVariable = SCons.Variables.BoolVariable
|
||||
|
||||
VERSION = '2.53' # This is used in creating the local config directories
|
||||
|
||||
def print_arguments(args, bc):
|
||||
if len(args):
|
||||
for k,v in args.iteritems():
|
||||
if type(v)==list:
|
||||
v = ' '.join(v)
|
||||
print '\t'+bc.OKBLUE+k+bc.ENDC+' = '+bc.OKGREEN + v + bc.ENDC
|
||||
else:
|
||||
print '\t'+bc.WARNING+'No command-line arguments given'+bc.ENDC
|
||||
|
||||
def validate_arguments(args, bc):
|
||||
opts_list = [
|
||||
'WITH_BF_PYTHON', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL',
|
||||
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
|
||||
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
|
||||
'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH',
|
||||
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
|
||||
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH',
|
||||
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
|
||||
'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
|
||||
'WITH_BF_DDS',
|
||||
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC',
|
||||
'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
|
||||
'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
|
||||
'WITH_BF_OPENJPEG', 'BF_OPENJPEG', 'BF_OPENJPEG_INC', 'BF_OPENJPEG_LIB', 'BF_OPENJPEG_LIBPATH',
|
||||
'WITH_BF_REDCODE', 'BF_REDCODE', 'BF_REDCODE_INC', 'BF_REDCODE_LIB', 'BF_REDCODE_LIBPATH',
|
||||
'WITH_BF_PNG', 'BF_PNG', 'BF_PNG_INC', 'BF_PNG_LIB', 'BF_PNG_LIBPATH',
|
||||
'WITH_BF_TIFF', 'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH',
|
||||
'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH',
|
||||
'WITH_BF_INTERNATIONAL',
|
||||
'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'BF_GETTEXT_LIBPATH',
|
||||
'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
|
||||
'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
|
||||
'BF_WINTAB', 'BF_WINTAB_INC',
|
||||
'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
|
||||
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
|
||||
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH',
|
||||
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
|
||||
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
|
||||
'WITH_BF_PLAYER',
|
||||
'WITH_BF_NOBLENDER',
|
||||
'WITH_BF_BINRELOC',
|
||||
'WITH_BF_LZO', 'WITH_BF_LZMA',
|
||||
'LCGDIR',
|
||||
'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC',
|
||||
'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
|
||||
'WITHOUT_BF_INSTALL',
|
||||
'WITHOUT_BF_PYTHON_INSTALL',
|
||||
'WITHOUT_BF_OVERWRITE_INSTALL',
|
||||
'WITH_BF_OPENMP',
|
||||
'BF_OPENMP',
|
||||
'BF_OPENMP_INC',
|
||||
'BF_OPENMP_LIBPATH',
|
||||
'WITH_GHOST_COCOA',
|
||||
'USE_QTKIT',
|
||||
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
|
||||
'BF_X264_CONFIG',
|
||||
'BF_XVIDCORE_CONFIG',
|
||||
'WITH_BF_LCMS', 'BF_LCMS', 'BF_LCMS_INC', 'BF_LCMS_LIB', 'BF_LCMS_LIBPATH',
|
||||
'WITH_BF_DOCS',
|
||||
'BF_NUMJOBS',
|
||||
'BF_MSVS',
|
||||
'WITH_BF_FHS',
|
||||
'BF_VERSION',
|
||||
'BF_GHOST_DEBUG',
|
||||
'WITH_BF_RAYOPTIMIZATION',
|
||||
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
||||
'BF_NO_ELBEEM',
|
||||
'BF_VCREDIST' # Windows-only, and useful only when creating installer
|
||||
]
|
||||
|
||||
# Have options here that scons expects to be lists
|
||||
opts_list_split = [
|
||||
'BF_PYTHON_LINKFLAGS',
|
||||
'BF_OPENGL_LINKFLAGS',
|
||||
'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
|
||||
'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
|
||||
'BGE_CXXFLAGS',
|
||||
'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
|
||||
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
|
||||
'C_WARN', 'CC_WARN', 'CXX_WARN',
|
||||
'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE',
|
||||
]
|
||||
|
||||
|
||||
arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
|
||||
'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
|
||||
'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_LINE_OVERWRITE',
|
||||
'BF_BSC', 'BF_CONFIG',
|
||||
'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG',
|
||||
'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG',
|
||||
'BF_UNIT_TEST']
|
||||
|
||||
okdict = {}
|
||||
|
||||
for k,v in args.iteritems():
|
||||
if (k in opts_list) or (k in arg_list):
|
||||
okdict[k] = v
|
||||
elif k in opts_list_split:
|
||||
okdict[k] = v.split() # "" have already been stripped
|
||||
else:
|
||||
print '\t'+bc.WARNING+'Invalid argument: '+bc.ENDC+k+'='+v
|
||||
|
||||
return okdict
|
||||
|
||||
def print_targets(targs, bc):
|
||||
if len(targs)>0:
|
||||
for t in targs:
|
||||
print '\t'+bc.OKBLUE+t+bc.ENDC
|
||||
else:
|
||||
print '\t'+bc.WARNING+'No targets given, using '+bc.ENDC+bc.OKGREEN+'default'+bc.ENDC
|
||||
|
||||
def validate_targets(targs, bc):
|
||||
valid_list = ['.', 'blender', 'blenderstatic', 'blenderplayer', 'webplugin',
|
||||
'blendernogame', 'blenderstaticnogame', 'blenderlite', 'release',
|
||||
'everything', 'clean', 'install-bin', 'install', 'nsis']
|
||||
oklist = []
|
||||
for t in targs:
|
||||
if t in valid_list:
|
||||
oklist.append(t)
|
||||
else:
|
||||
print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t
|
||||
return oklist
|
||||
|
||||
class ourSpawn:
|
||||
def ourspawn(self, sh, escape, cmd, args, env):
|
||||
newargs = string.join(args[1:], ' ')
|
||||
cmdline = cmd + " " + newargs
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
|
||||
data, err = proc.communicate()
|
||||
rv = proc.wait()
|
||||
if rv:
|
||||
print "====="
|
||||
print err
|
||||
print "====="
|
||||
return rv
|
||||
|
||||
def SetupSpawn( env ):
|
||||
buf = ourSpawn()
|
||||
buf.ourenv = env
|
||||
env['SPAWN'] = buf.ourspawn
|
||||
|
||||
|
||||
def read_opts(env, cfg, args):
|
||||
localopts = Variables.Variables(cfg, args)
|
||||
localopts.AddVariables(
|
||||
('LCGDIR', 'location of cvs lib dir'),
|
||||
(BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
|
||||
('BF_PYTHON', 'base path for python', ''),
|
||||
('BF_PYTHON_VERSION', 'Python version to use', ''),
|
||||
('BF_PYTHON_INC', 'include path for Python headers', ''),
|
||||
('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
|
||||
('BF_PYTHON_LIB', 'Python library', ''),
|
||||
('BF_PYTHON_DLL', 'Python dll - used on Windows only', ''),
|
||||
('BF_PYTHON_LIB_STATIC', 'Python static libraries', ''),
|
||||
('BF_PYTHON_LIBPATH', 'Library path', ''),
|
||||
('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
|
||||
(BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
|
||||
|
||||
(BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
|
||||
('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
|
||||
(BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
|
||||
('BF_OPENAL', 'base path for OpenAL', ''),
|
||||
('BF_OPENAL_INC', 'include path for python headers', ''),
|
||||
('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
|
||||
('BF_OPENAL_LIB_STATIC', 'Path to OpenAL static library', ''),
|
||||
('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
|
||||
(BoolVariable('WITH_BF_STATICOPENAL', 'Staticly link to openal', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_SDL', 'Use SDL if true', False)),
|
||||
('BF_SDL', 'SDL base path', ''),
|
||||
('BF_SDL_INC', 'SDL include path', ''),
|
||||
('BF_SDL_LIB', 'SDL library', ''),
|
||||
('BF_SDL_LIBPATH', 'SDL library path', ''),
|
||||
|
||||
('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''),
|
||||
('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''),
|
||||
('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''),
|
||||
('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
|
||||
('BF_JACK', 'jack base path', ''),
|
||||
('BF_JACK_INC', 'jack include path', ''),
|
||||
('BF_JACK_LIB', 'jack library', ''),
|
||||
('BF_JACK_LIBPATH', 'jack library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_SNDFILE', 'Enable sndfile support if true', True)),
|
||||
('BF_SNDFILE', 'sndfile base path', ''),
|
||||
('BF_SNDFILE_INC', 'sndfile include path', ''),
|
||||
('BF_SNDFILE_LIB', 'sndfile library', ''),
|
||||
('BF_SNDFILE_LIBPATH', 'sndfile library path', ''),
|
||||
|
||||
('BF_PTHREADS', 'Pthreads base path', ''),
|
||||
('BF_PTHREADS_INC', 'Pthreads include path', ''),
|
||||
('BF_PTHREADS_LIB', 'Pthreads library', ''),
|
||||
('BF_PTHREADS_LIBPATH', 'Pthreads library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OPENEXR', 'Use OPENEXR if true', True)),
|
||||
(BoolVariable('WITH_BF_STATICOPENEXR', 'Staticly link to OpenEXR', False)),
|
||||
('BF_OPENEXR', 'OPENEXR base path', ''),
|
||||
('BF_OPENEXR_INC', 'OPENEXR include path', ''),
|
||||
('BF_OPENEXR_LIB', 'OPENEXR library', ''),
|
||||
('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
|
||||
('BF_OPENEXR_LIB_STATIC', 'OPENEXR static library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_DDS', 'Use DDS if true', True)),
|
||||
|
||||
(BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)),
|
||||
('BF_FFMPEG', 'FFMPEG base path', ''),
|
||||
('BF_FFMPEG_LIB', 'FFMPEG library', ''),
|
||||
('BF_FFMPEG_EXTRA', 'FFMPEG flags that must be preserved', ''),
|
||||
|
||||
('BF_FFMPEG_INC', 'FFMPEG includes', ''),
|
||||
('BF_FFMPEG_LIBPATH', 'FFMPEG library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OGG', 'Use OGG, THEORA, VORBIS in FFMPEG if true',
|
||||
False)),
|
||||
('BF_OGG', 'OGG base path', ''),
|
||||
('BF_OGG_LIB', 'OGG library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_JPEG', 'Use JPEG if true', True)),
|
||||
('BF_JPEG', 'JPEG base path', ''),
|
||||
('BF_JPEG_INC', 'JPEG include path', ''),
|
||||
('BF_JPEG_LIB', 'JPEG library', ''),
|
||||
('BF_JPEG_LIBPATH', 'JPEG library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OPENJPEG', 'Use OPENJPEG if true', False)),
|
||||
('BF_OPENJPEG', 'OPENJPEG base path', ''),
|
||||
('BF_OPENJPEG_INC', 'OPENJPEG include path', ''),
|
||||
('BF_OPENJPEG_LIB', 'OPENJPEG library', ''),
|
||||
('BF_OPENJPEG_LIBPATH', 'OPENJPEG library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_REDCODE', 'Use REDCODE if true', False)),
|
||||
('BF_REDCODE', 'REDCODE base path', ''),
|
||||
('BF_REDCODE_INC', 'REDCODE include path', ''),
|
||||
('BF_REDCODE_LIB', 'REDCODE library', ''),
|
||||
('BF_REDCODE_LIBPATH', 'REDCODE library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_PNG', 'Use PNG if true', True)),
|
||||
('BF_PNG', 'PNG base path', ''),
|
||||
('BF_PNG_INC', 'PNG include path', ''),
|
||||
('BF_PNG_LIB', 'PNG library', ''),
|
||||
('BF_PNG_LIBPATH', 'PNG library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_TIFF', 'Use TIFF if true', True)),
|
||||
('BF_TIFF', 'TIFF base path', ''),
|
||||
('BF_TIFF_INC', 'TIFF include path', ''),
|
||||
('BF_TIFF_LIB', 'TIFF library', ''),
|
||||
('BF_TIFF_LIBPATH', 'TIFF library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_LCMS', 'Enable color correction with lcms', False)),
|
||||
('BF_LCMS', 'LCMS base path', ''),
|
||||
('BF_LCMS_INC', 'LCMS include path', ''),
|
||||
('BF_LCMS_LIB', 'LCMS library', ''),
|
||||
('BF_LCMS_LIBPATH', 'LCMS library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_ZLIB', 'Use ZLib if true', True)),
|
||||
('BF_ZLIB', 'ZLib base path', ''),
|
||||
('BF_ZLIB_INC', 'ZLib include path', ''),
|
||||
('BF_ZLIB_LIB', 'ZLib library', ''),
|
||||
('BF_ZLIB_LIBPATH', 'ZLib library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_INTERNATIONAL', 'Use Gettext if true', True)),
|
||||
|
||||
('BF_GETTEXT', 'gettext base path', ''),
|
||||
('BF_GETTEXT_INC', 'gettext include path', ''),
|
||||
('BF_GETTEXT_LIB', 'gettext library', ''),
|
||||
('BF_GETTEXT_LIBPATH', 'gettext library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_ICONV', 'Use iconv if true', True)),
|
||||
('BF_ICONV', 'iconv base path', ''),
|
||||
('BF_ICONV_INC', 'iconv include path', ''),
|
||||
('BF_ICONV_LIB', 'iconv library', ''),
|
||||
('BF_ICONV_LIBPATH', 'iconv library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_GAMEENGINE', 'Build with gameengine' , False)),
|
||||
|
||||
(BoolVariable('WITH_BF_BULLET', 'Use Bullet if true', True)),
|
||||
('BF_BULLET', 'Bullet base dir', ''),
|
||||
('BF_BULLET_INC', 'Bullet include path', ''),
|
||||
('BF_BULLET_LIB', 'Bullet library', ''),
|
||||
|
||||
('BF_WINTAB', 'WinTab base dir', ''),
|
||||
('BF_WINTAB_INC', 'WinTab include dir', ''),
|
||||
('BF_CXX', 'c++ base path for libstdc++, only used when static linking', ''),
|
||||
(BoolVariable('WITH_BF_STATICCXX', 'static link to stdc++', False)),
|
||||
('BF_CXX_LIB_STATIC', 'static library path for stdc++', ''),
|
||||
##
|
||||
##WITH_BF_NSPR = True
|
||||
##BF_NSPR = $(LCGDIR)/nspr
|
||||
##BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
##BF_NSPR_LIB =
|
||||
### Uncomment the following line to use Mozilla inplace of netscape
|
||||
##CPPFLAGS += -DMOZ_NOT_NET
|
||||
### Location of MOZILLA/Netscape header files...
|
||||
##BF_MOZILLA = $(LCGDIR)/mozilla
|
||||
##BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
|
||||
##BF_MOZILLA_LIB =
|
||||
### Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
|
||||
### if this is not set.
|
||||
##
|
||||
### Be paranoid regarding library creation (do not update archives)
|
||||
##BF_PARANOID = True
|
||||
##
|
||||
### enable freetype2 support for text objects
|
||||
(BoolVariable('WITH_BF_FREETYPE', 'Use FreeType2 if true', True)),
|
||||
('BF_FREETYPE', 'Freetype base path', ''),
|
||||
('BF_FREETYPE_INC', 'Freetype include path', ''),
|
||||
('BF_FREETYPE_LIB', 'Freetype library', ''),
|
||||
('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
|
||||
('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
|
||||
('BF_OPENMP_INC', 'Path to OpenMP includes (used when cross-compiling with older versions of WinGW)', ''),
|
||||
('BF_OPENMP_LIBPATH', 'Path to OpenMP libraries (used when cross-compiling with older versions of WinGW)', ''),
|
||||
(BoolVariable('WITH_GHOST_COCOA', 'Use Cocoa-framework if true', False)),
|
||||
(BoolVariable('USE_QTKIT', 'Use QTKIT if true', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_QUICKTIME', 'Use QuickTime if true', False)),
|
||||
('BF_QUICKTIME', 'QuickTime base path', ''),
|
||||
('BF_QUICKTIME_INC', 'QuickTime include path', ''),
|
||||
('BF_QUICKTIME_LIB', 'QuickTime library', ''),
|
||||
('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_FFTW3', 'Use FFTW3 if true', False)),
|
||||
('BF_FFTW3', 'FFTW3 base path', ''),
|
||||
('BF_FFTW3_INC', 'FFTW3 include path', ''),
|
||||
('BF_FFTW3_LIB', 'FFTW3 library', ''),
|
||||
('BF_FFTW3_LIBPATH', 'FFTW3 library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_STATICOPENGL', 'Use MESA if true', True)),
|
||||
('BF_OPENGL', 'OpenGL base path', ''),
|
||||
('BF_OPENGL_INC', 'OpenGL include path', ''),
|
||||
('BF_OPENGL_LIB', 'OpenGL libraries', ''),
|
||||
('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
|
||||
('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
|
||||
('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_COLLADA', 'Build COLLADA import/export module if true', False)),
|
||||
('BF_COLLADA', 'COLLADA base path', ''),
|
||||
('BF_COLLADA_INC', 'COLLADA include path', ''),
|
||||
('BF_COLLADA_LIB', 'COLLADA library', ''),
|
||||
('BF_OPENCOLLADA', 'OpenCollada base path', ''),
|
||||
('BF_OPENCOLLADA_INC', 'OpenCollada base include path', ''),
|
||||
('BF_OPENCOLLADA_LIB', 'OpenCollada library', ''),
|
||||
('BF_OPENCOLLADA_LIBPATH', 'OpenCollada library path', ''),
|
||||
('BF_PCRE', 'PCRE base path', ''),
|
||||
('BF_PCRE_LIB', 'PCRE library', ''),
|
||||
('BF_PCRE_LIBPATH', 'PCRE library path', ''),
|
||||
('BF_EXPAT', 'Expat base path', ''),
|
||||
('BF_EXPAT_LIB', 'Expat library', ''),
|
||||
('BF_EXPAT_LIBPATH', 'Expat library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
|
||||
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
|
||||
|
||||
('CFLAGS', 'C only flags', ''),
|
||||
('CCFLAGS', 'Generic C and C++ flags', ''),
|
||||
('CXXFLAGS', 'C++ only flags', ''),
|
||||
('BGE_CXXFLAGS', 'C++ only flags for BGE', ''),
|
||||
('CPPFLAGS', 'Defines', ''),
|
||||
('REL_CFLAGS', 'C only release flags', ''),
|
||||
('REL_CCFLAGS', 'Generic C and C++ release flags', ''),
|
||||
('REL_CXXFLAGS', 'C++ only release flags', ''),
|
||||
|
||||
('C_WARN', 'C warning flags', ''),
|
||||
('CC_WARN', 'Generic C and C++ warning flags', ''),
|
||||
('CXX_WARN', 'C++ only warning flags', ''),
|
||||
|
||||
('LLIBS', 'Platform libs', ''),
|
||||
('PLATFORM_LINKFLAGS', 'Platform linkflags', ''),
|
||||
('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
|
||||
|
||||
(BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
|
||||
('BF_PROFILE_CFLAGS', 'C only profiling flags', ''),
|
||||
('BF_PROFILE_CCFLAGS', 'C and C++ profiling flags', ''),
|
||||
('BF_PROFILE_CXXFLAGS', 'C++ only profiling flags', ''),
|
||||
('BF_PROFILE_LINKFLAGS', 'Profile linkflags', ''),
|
||||
|
||||
(BoolVariable('BF_DEBUG', 'Add debug flags if true', False)),
|
||||
('BF_DEBUG_CFLAGS', 'C only debug flags', ''),
|
||||
('BF_DEBUG_CCFLAGS', 'C and C++ debug flags', ''),
|
||||
('BF_DEBUG_CXXFLAGS', 'C++ only debug flags', ''),
|
||||
|
||||
(BoolVariable('BF_BSC', 'Create .bsc files (msvc only)', True)),
|
||||
|
||||
('BF_BUILDDIR', 'Build dir', ''),
|
||||
('BF_INSTALLDIR', 'Installation dir', ''),
|
||||
|
||||
('CC', 'C compiler to use', env['CC']),
|
||||
('CXX', 'C++ compiler to use', env['CXX']),
|
||||
|
||||
(BoolVariable('BF_BUILDINFO', 'Buildtime in splash if true', True)),
|
||||
|
||||
(BoolVariable('BF_TWEAK_MODE', 'Enable tweak mode if true', False)),
|
||||
(BoolVariable('BF_SPLIT_SRC', 'Split src lib into several chunks if true', False)),
|
||||
(BoolVariable('WITHOUT_BF_INSTALL', 'dont install if true', False)),
|
||||
(BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)),
|
||||
(BoolVariable('WITHOUT_BF_OVERWRITE_INSTALL', 'dont remove existing files before breating the new install directory (set to False when making packages for others)', False)),
|
||||
(BoolVariable('BF_FANCY', 'Enable fancy output if true', True)),
|
||||
(BoolVariable('BF_QUIET', 'Enable silent output if true', True)),
|
||||
(BoolVariable('BF_LINE_OVERWRITE', 'Enable overwriting of compile line in BF_QUIET mode if true', False)),
|
||||
(BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)),
|
||||
(BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
|
||||
|
||||
('BF_X264_CONFIG', 'configuration flags for x264', ''),
|
||||
('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''),
|
||||
(BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)),
|
||||
|
||||
('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'),
|
||||
('BF_NUMJOBS', 'Number of build processes to spawn', '1'),
|
||||
('BF_MSVS', 'Generate MSVS project files and solution', False),
|
||||
|
||||
(BoolVariable('WITH_BF_FHS', 'Use the Unix "Filesystem Hierarchy Standard" rather then a redistributable directory layout', False)),
|
||||
('BF_VERSION', 'The root path for Unix (non-apple)', '2.5'),
|
||||
|
||||
(BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)),
|
||||
|
||||
(BoolVariable('BF_GHOST_DEBUG', 'Make GHOST print events and info to stdout. (very verbose)', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)),
|
||||
('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''),
|
||||
('BF_VCREDIST', 'Full path to vcredist', '')
|
||||
) # end of opts.AddOptions()
|
||||
|
||||
return localopts
|
||||
|
||||
def NSIS_print(target, source, env):
|
||||
return "Creating NSIS installer for Blender"
|
||||
|
||||
def NSIS_Installer(target=None, source=None, env=None):
|
||||
print "="*35
|
||||
|
||||
if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
print "NSIS installer is only available on Windows."
|
||||
Exit()
|
||||
if env['OURPLATFORM'] == 'win32-vc':
|
||||
bitness = '32'
|
||||
elif env['OURPLATFORM'] == 'win64-vc':
|
||||
bitness = '64'
|
||||
else:
|
||||
bitness = '-mingw'
|
||||
|
||||
start_dir = os.getcwd()
|
||||
rel_dir = os.path.join(start_dir,'release','windows','installer')
|
||||
install_base_dir = start_dir + os.sep
|
||||
|
||||
bf_installdir = os.path.join(os.getcwd(),env['BF_INSTALLDIR'])
|
||||
bf_installdir = os.path.normpath(bf_installdir)
|
||||
|
||||
doneroot = False
|
||||
rootdirconts = []
|
||||
datafiles = ''
|
||||
l = len(bf_installdir)
|
||||
|
||||
for dp,dn,df in os.walk(bf_installdir):
|
||||
if not doneroot:
|
||||
for f in df:
|
||||
rootdirconts.append(os.path.join(dp,f))
|
||||
doneroot = True
|
||||
else:
|
||||
if len(df)>0:
|
||||
dp_tmp = dp[l:]
|
||||
if dp_tmp.find('python\\lib') > -1:
|
||||
datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n"
|
||||
else:
|
||||
datafiles += "\n"+r'SetOutPath $BLENDERHOME'+dp[l:]+"\n\n"
|
||||
|
||||
for f in df:
|
||||
outfile = os.path.join(dp,f)
|
||||
datafiles += ' File '+outfile + "\n"
|
||||
|
||||
os.chdir("release")
|
||||
v = open("VERSION")
|
||||
version = v.read()[:-1]
|
||||
v.close()
|
||||
|
||||
#### change to suit install dir ####
|
||||
inst_dir = install_base_dir + env['BF_INSTALLDIR']
|
||||
|
||||
os.chdir("windows/installer")
|
||||
|
||||
ns = open("00.sconsblender.nsi","r")
|
||||
|
||||
ns_cnt = str(ns.read())
|
||||
ns.close()
|
||||
|
||||
# var replacements
|
||||
ns_cnt = string.replace(ns_cnt, "[DISTDIR]", os.path.normpath(inst_dir+os.sep))
|
||||
ns_cnt = string.replace(ns_cnt, "[VERSION]", version)
|
||||
ns_cnt = string.replace(ns_cnt, "[SHORTVERSION]", VERSION)
|
||||
ns_cnt = string.replace(ns_cnt, "[RELDIR]", os.path.normpath(rel_dir))
|
||||
ns_cnt = string.replace(ns_cnt, "[BITNESS]", bitness)
|
||||
|
||||
# do root
|
||||
rootlist = []
|
||||
for rootitem in rootdirconts:
|
||||
rootlist.append("File \"" + rootitem + "\"")
|
||||
rootstring = string.join(rootlist, "\n ")
|
||||
rootstring = rootstring
|
||||
rootstring += "\n\n"
|
||||
ns_cnt = string.replace(ns_cnt, "[ROOTDIRCONTS]", rootstring)
|
||||
|
||||
|
||||
# do delete items
|
||||
delrootlist = []
|
||||
for rootitem in rootdirconts:
|
||||
delrootlist.append("Delete $INSTDIR\\" + rootitem[l+1:])
|
||||
delrootstring = string.join(delrootlist, "\n ")
|
||||
delrootstring += "\n"
|
||||
ns_cnt = string.replace(ns_cnt, "[DELROOTDIRCONTS]", delrootstring)
|
||||
|
||||
ns_cnt = string.replace(ns_cnt, "[DODATAFILES]", datafiles)
|
||||
|
||||
# Setup vcredist part
|
||||
vcredist = "File \""+env['BF_VCREDIST'] + "\"\n"
|
||||
vcredist += " ExecWait '\"$TEMP\\" + os.path.basename(env['BF_VCREDIST']) + "\" /q'\n"
|
||||
vcredist += " Delete \"$TEMP\\" + os.path.basename(env['BF_VCREDIST'])+"\""
|
||||
ns_cnt = string.replace(ns_cnt, "[VCREDIST]", vcredist)
|
||||
|
||||
tmpnsi = os.path.normpath(install_base_dir+os.sep+env['BF_BUILDDIR']+os.sep+"00.blender_tmp.nsi")
|
||||
new_nsis = open(tmpnsi, 'w')
|
||||
new_nsis.write(ns_cnt)
|
||||
new_nsis.close()
|
||||
print "NSIS Installer script created"
|
||||
|
||||
os.chdir(start_dir)
|
||||
print "Launching 'makensis'"
|
||||
|
||||
cmdline = "makensis " + "\""+tmpnsi+"\""
|
||||
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = True)
|
||||
data, err = proc.communicate()
|
||||
rv = proc.wait()
|
||||
|
||||
if rv != 0:
|
||||
print
|
||||
print data.strip().split("\n")[-1]
|
||||
return rv
|
||||
|
||||
184
build_files/scons/tools/crossmingw.py
Normal file
@@ -0,0 +1,184 @@
|
||||
"""SCons.Tool.gcc
|
||||
|
||||
Tool-specific initialization for MinGW (http://www.mingw.org/)
|
||||
|
||||
There normally shouldn't be any need to import this module directly.
|
||||
It will usually be imported through the generic SCons.Tool.Tool()
|
||||
selection method.
|
||||
|
||||
"""
|
||||
|
||||
#
|
||||
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
__revision__ = "src/engine/SCons/Tool/mingw.py 4043 2009/02/23 09:06:45 scons"
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import string
|
||||
|
||||
import SCons.Action
|
||||
import SCons.Builder
|
||||
import SCons.Defaults
|
||||
import SCons.Tool
|
||||
import SCons.Util
|
||||
|
||||
# This is what we search for to find mingw:
|
||||
prefixes = SCons.Util.Split("""
|
||||
mingw32-
|
||||
i386-mingw32msvc-
|
||||
i486-mingw32msvc-
|
||||
i586-mingw32msvc-
|
||||
i686-mingw32msvc-
|
||||
i686-pc-mingw32-
|
||||
""")
|
||||
|
||||
def find(env):
|
||||
for prefix in prefixes:
|
||||
# First search in the SCons path and then the OS path:
|
||||
if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
|
||||
return prefix
|
||||
|
||||
return ''
|
||||
|
||||
def shlib_generator(target, source, env, for_signature):
|
||||
cmd = SCons.Util.CLVar(['$SHLINK'])
|
||||
|
||||
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
|
||||
if dll: cmd.extend(['-o', dll])
|
||||
|
||||
cmd.extend(['$SOURCES', '$SHLINKFLAGS', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
|
||||
|
||||
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
|
||||
if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
|
||||
|
||||
def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
|
||||
insert_def = env.subst("$WINDOWS_INSERT_DEF")
|
||||
if not insert_def in ['', '0', 0] and def_target: \
|
||||
cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
|
||||
|
||||
return [cmd]
|
||||
|
||||
def shlib_emitter(target, source, env):
|
||||
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
|
||||
no_import_lib = env.get('no_import_lib', 0)
|
||||
|
||||
if not dll:
|
||||
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
|
||||
|
||||
if not no_import_lib and \
|
||||
not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
|
||||
|
||||
# Append an import library to the list of targets.
|
||||
target.append(env.ReplaceIxes(dll,
|
||||
'SHLIBPREFIX', 'SHLIBSUFFIX',
|
||||
'LIBPREFIX', 'LIBSUFFIX'))
|
||||
|
||||
# Append a def file target if there isn't already a def file target
|
||||
# or a def file source. There is no option to disable def file
|
||||
# target emitting, because I can't figure out why someone would ever
|
||||
# want to turn it off.
|
||||
def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
|
||||
def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
|
||||
if not def_source and not def_target:
|
||||
target.append(env.ReplaceIxes(dll,
|
||||
'SHLIBPREFIX', 'SHLIBSUFFIX',
|
||||
'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX'))
|
||||
|
||||
return (target, source)
|
||||
|
||||
|
||||
shlib_action = SCons.Action.Action(shlib_generator, generator=1)
|
||||
|
||||
res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
|
||||
|
||||
res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
|
||||
source_scanner=SCons.Tool.SourceFileScanner)
|
||||
SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
|
||||
|
||||
def generate(env):
|
||||
mingw = find(env)
|
||||
if mingw:
|
||||
dir = os.path.dirname(mingw)
|
||||
env.PrependENVPath('PATH', dir )
|
||||
|
||||
|
||||
# Most of mingw is the same as gcc and friends...
|
||||
gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'm4']
|
||||
for tool in gnu_tools:
|
||||
SCons.Tool.Tool(tool)(env)
|
||||
|
||||
#... but a few things differ:
|
||||
env['CC'] = mingw + 'gcc'
|
||||
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
|
||||
env['CXX'] = mingw + 'g++'
|
||||
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
|
||||
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
|
||||
env['SHLINKCOM'] = shlib_action
|
||||
env['LDMODULECOM'] = shlib_action
|
||||
env.Append(SHLIBEMITTER = [shlib_emitter])
|
||||
env['RANLIB'] = mingw + 'ranlib'
|
||||
env['LINK'] = mingw + 'gcc'
|
||||
env['AS'] = mingw + 'as'
|
||||
env['AR'] = mingw + 'ar'
|
||||
|
||||
env['WIN32DEFPREFIX'] = ''
|
||||
env['WIN32DEFSUFFIX'] = '.def'
|
||||
env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
|
||||
env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
|
||||
|
||||
env['SHOBJSUFFIX'] = '.o'
|
||||
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
|
||||
|
||||
env['RC'] = mingw + 'windres'
|
||||
env['RCFLAGS'] = SCons.Util.CLVar('')
|
||||
env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
|
||||
env['RCINCPREFIX'] = '--include-dir '
|
||||
env['RCINCSUFFIX'] = ''
|
||||
env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
|
||||
env['BUILDERS']['RES'] = res_builder
|
||||
|
||||
# Some setting from the platform also have to be overridden:
|
||||
env['OBJPREFIX'] = ''
|
||||
env['OBJSUFFIX'] = '.o'
|
||||
env['LIBPREFIX'] = 'lib'
|
||||
env['LIBSUFFIX'] = '.a'
|
||||
env['SHOBJPREFIX'] = '$OBJPREFIX'
|
||||
env['SHOBJSUFFIX'] = '$OBJSUFFIX'
|
||||
env['PROGPREFIX'] = ''
|
||||
env['PROGSUFFIX'] = '.exe'
|
||||
env['LIBPREFIX'] = ''
|
||||
env['LIBSUFFIX'] = '.lib'
|
||||
env['SHLIBPREFIX'] = ''
|
||||
env['SHLIBSUFFIX'] = '.dll'
|
||||
env['LIBPREFIXES'] = [ '$LIBPREFIX' ]
|
||||
env['LIBSUFFIXES'] = [ '$LIBSUFFIX' ]
|
||||
|
||||
def exists(env):
|
||||
return find(env)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width:4
|
||||
# indent-tabs-mode:nil
|
||||
# End:
|
||||
# vim: set expandtab tabstop=4 shiftwidth=4:
|
||||
353
build_files/scons/tools/mstoolkit.py
Normal file
@@ -0,0 +1,353 @@
|
||||
"""tools.mstoolkit
|
||||
|
||||
Tool-specific initialization for Microsoft Visual C/C++ Toolkit Commandline
|
||||
|
||||
There normally shouldn't be any need to import this module directly.
|
||||
It will usually be imported through the generic SCons.Tool.Tool()
|
||||
selection method.
|
||||
|
||||
"""
|
||||
|
||||
#
|
||||
# Copyright (c) 2004 John Connors
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
import os.path
|
||||
import re
|
||||
import string
|
||||
import types
|
||||
|
||||
import SCons.Action
|
||||
import SCons.Builder
|
||||
import SCons.Errors
|
||||
import SCons.Platform.win32
|
||||
import SCons.Tool
|
||||
import SCons.Util
|
||||
import SCons.Warnings
|
||||
|
||||
CSuffixes = ['.c', '.C']
|
||||
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
|
||||
|
||||
def get_msvctoolkit_paths():
|
||||
"""Return a 4-tuple of (INCLUDE, LIB, PATH, TOOLKIT) as the values of those
|
||||
three environment variables that should be set in order to execute
|
||||
the MSVC .NET tools properly, if the information wasn't available
|
||||
from the registry."""
|
||||
|
||||
MSToolkitDir = None
|
||||
paths = {}
|
||||
exe_path = ''
|
||||
lib_path = ''
|
||||
include_path = ''
|
||||
|
||||
# First, we get the shell folder for this user:
|
||||
if not SCons.Util.can_read_reg:
|
||||
raise SCons.Errors.InternalError, "No Windows registry module was found"
|
||||
|
||||
# look for toolkit
|
||||
if os.environ.has_key('VCToolkitInstallDir'):
|
||||
MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir'])
|
||||
else:
|
||||
# last resort -- default install location
|
||||
MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003'
|
||||
|
||||
# look for platform sdk
|
||||
if os.environ.has_key('MSSdk'):
|
||||
PlatformSDKDir = os.path.normpath(os.environ['MSSdk'])
|
||||
else:
|
||||
try:
|
||||
PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0]
|
||||
PlatformSDKDir = str(PlatformSDKDir)
|
||||
except SCons.Util.RegError:
|
||||
raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable."
|
||||
|
||||
# look for DX Sdk (expecting DX9)
|
||||
# dxsdk docs have a directory key, look for it, extract path
|
||||
#dxsdkdocs = ""
|
||||
DXsdkDir = ""
|
||||
#try:
|
||||
# dxsdkdocs = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\DirectX SDK\DX9SDK Doc Path')
|
||||
#except SCons.Util.RegError:
|
||||
# raise SCons.Errors.InternalError, "The DXSDK directory was not found in the registry."
|
||||
if os.environ.has_key('DXSDK_DIR'):
|
||||
DXsdkDir = os.path.normpath(os.environ['DXSDK_DIR'])
|
||||
|
||||
#DXsdkDir = os.path.split(dxsdkdocs[0])[0]
|
||||
DXsdkDir = os.path.split(DXsdkDir)[0]
|
||||
|
||||
include_path = r'%s\include;%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
|
||||
lib_path = r'%s\lib;%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
|
||||
exe_path = r'%s\bin;%s\bin\win95;%s\bin' % (MSToolkitDir, PlatformSDKDir, PlatformSDKDir)
|
||||
return (include_path, lib_path, exe_path, PlatformSDKDir)
|
||||
|
||||
def validate_vars(env):
|
||||
"""Validate the PDB, PCH, and PCHSTOP construction variables."""
|
||||
if env.has_key('PCH') and env['PCH']:
|
||||
if not env.has_key('PCHSTOP'):
|
||||
raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
|
||||
if not SCons.Util.is_String(env['PCHSTOP']):
|
||||
raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
|
||||
|
||||
def pch_emitter(target, source, env):
|
||||
"""Sets up the PDB dependencies for a pch file, and adds the object
|
||||
file target."""
|
||||
|
||||
validate_vars(env)
|
||||
|
||||
pch = None
|
||||
obj = None
|
||||
|
||||
for t in target:
|
||||
if SCons.Util.splitext(str(t))[1] == '.pch':
|
||||
pch = t
|
||||
if SCons.Util.splitext(str(t))[1] == '.obj':
|
||||
obj = t
|
||||
|
||||
if not obj:
|
||||
obj = SCons.Util.splitext(str(pch))[0]+'.obj'
|
||||
|
||||
target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
|
||||
|
||||
if env.has_key('PDB') and env['PDB']:
|
||||
env.SideEffect(env['PDB'], target)
|
||||
env.Precious(env['PDB'])
|
||||
|
||||
return (target, source)
|
||||
|
||||
def object_emitter(target, source, env, parent_emitter):
|
||||
"""Sets up the PDB and PCH dependencies for an object file."""
|
||||
|
||||
validate_vars(env)
|
||||
|
||||
parent_emitter(target, source, env)
|
||||
|
||||
if env.has_key('PDB') and env['PDB']:
|
||||
env.SideEffect(env['PDB'], target)
|
||||
env.Precious(env['PDB'])
|
||||
|
||||
if env.has_key('PCH') and env['PCH']:
|
||||
env.Depends(target, env['PCH'])
|
||||
|
||||
return (target, source)
|
||||
|
||||
def static_object_emitter(target, source, env):
|
||||
return object_emitter(target, source, env,
|
||||
SCons.Defaults.StaticObjectEmitter)
|
||||
|
||||
def shared_object_emitter(target, source, env):
|
||||
return object_emitter(target, source, env,
|
||||
SCons.Defaults.SharedObjectEmitter)
|
||||
|
||||
pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter)
|
||||
res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res')
|
||||
|
||||
def pdbGenerator(env, target, source, for_signature):
|
||||
if target and env.has_key('PDB') and env['PDB']:
|
||||
return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
|
||||
'/DEBUG']
|
||||
|
||||
def win32ShlinkTargets(target, source, env, for_signature):
|
||||
listCmd = []
|
||||
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
|
||||
if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
|
||||
|
||||
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
|
||||
if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
|
||||
|
||||
return listCmd
|
||||
|
||||
def win32ShlinkSources(target, source, env, for_signature):
|
||||
listCmd = []
|
||||
|
||||
deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
|
||||
for src in source:
|
||||
if src == deffile:
|
||||
# Treat this source as a .def file.
|
||||
listCmd.append("/def:%s" % src.get_string(for_signature))
|
||||
else:
|
||||
# Just treat it as a generic source file.
|
||||
listCmd.append(src)
|
||||
return listCmd
|
||||
|
||||
def win32LibEmitter(target, source, env):
|
||||
# SCons.Tool.msvc.validate_vars(env)
|
||||
|
||||
dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
|
||||
no_import_lib = env.get('no_import_lib', 0)
|
||||
|
||||
if not dll:
|
||||
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
|
||||
|
||||
if env.get("WIN32_INSERT_DEF", 0) and \
|
||||
not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
|
||||
|
||||
# append a def file to the list of sources
|
||||
source.append(env.ReplaceIxes(dll,
|
||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
||||
"WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
|
||||
|
||||
if env.has_key('PDB') and env['PDB']:
|
||||
env.SideEffect(env['PDB'], target)
|
||||
env.Precious(env['PDB'])
|
||||
|
||||
if not no_import_lib and \
|
||||
not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
|
||||
# Append an import library to the list of targets.
|
||||
target.append(env.ReplaceIxes(dll,
|
||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
||||
"LIBPREFIX", "LIBSUFFIX"))
|
||||
# and .exp file is created if there are exports from a DLL
|
||||
target.append(env.ReplaceIxes(dll,
|
||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
||||
"WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
|
||||
|
||||
return (target, source)
|
||||
|
||||
def prog_emitter(target, source, env):
|
||||
#SCons.Tool.msvc.validate_vars(env)
|
||||
|
||||
if env.has_key('PDB') and env['PDB']:
|
||||
env.SideEffect(env['PDB'], target)
|
||||
env.Precious(env['PDB'])
|
||||
|
||||
return (target,source)
|
||||
|
||||
def RegServerFunc(target, source, env):
|
||||
if env.has_key('register') and env['register']:
|
||||
ret = regServerAction([target[0]], [source[0]], env)
|
||||
if ret:
|
||||
raise SCons.Errors.UserError, "Unable to register %s" % target[0]
|
||||
else:
|
||||
print "Registered %s sucessfully" % target[0]
|
||||
return ret
|
||||
return 0
|
||||
|
||||
regServerAction = SCons.Action.Action("$REGSVRCOM")
|
||||
regServerCheck = SCons.Action.Action(RegServerFunc, None)
|
||||
shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
|
||||
compositeLinkAction = shlibLinkAction + regServerCheck
|
||||
|
||||
def generate(env):
|
||||
"""Add Builders and construction variables for MSVC++ to an Environment."""
|
||||
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
|
||||
|
||||
for suffix in CSuffixes:
|
||||
static_obj.add_action(suffix, SCons.Defaults.CAction)
|
||||
shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
|
||||
|
||||
for suffix in CXXSuffixes:
|
||||
static_obj.add_action(suffix, SCons.Defaults.CXXAction)
|
||||
shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
|
||||
|
||||
SCons.Tool.createStaticLibBuilder(env)
|
||||
SCons.Tool.createSharedLibBuilder(env)
|
||||
SCons.Tool.createProgBuilder(env)
|
||||
|
||||
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}'])
|
||||
env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
|
||||
env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
|
||||
env['CC'] = 'cl'
|
||||
env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||
env['CCCOM'] = '$CC $CCFLAGS $CCCOMFLAGS'
|
||||
env['SHCC'] = '$CC'
|
||||
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
|
||||
env['SHCCCOM'] = '$SHCC $SHCCFLAGS $CCCOMFLAGS'
|
||||
env['CXX'] = '$CC'
|
||||
env['CXXFLAGS'] = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
|
||||
env['CXXCOM'] = '$CXX $CXXFLAGS $CCCOMFLAGS'
|
||||
env['SHCXX'] = '$CXX'
|
||||
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
|
||||
env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
|
||||
env['CPPDEFPREFIX'] = '/D'
|
||||
env['CPPDEFSUFFIX'] = ''
|
||||
env['INCPREFIX'] = '/I'
|
||||
env['INCSUFFIX'] = ''
|
||||
env['OBJEMITTER'] = static_object_emitter
|
||||
env['SHOBJEMITTER'] = shared_object_emitter
|
||||
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
|
||||
|
||||
env['RC'] = 'rc'
|
||||
env['RCFLAGS'] = SCons.Util.CLVar('')
|
||||
env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
|
||||
CScan = env.get_scanner('.c')
|
||||
if CScan:
|
||||
CScan.add_skey('.rc')
|
||||
env['BUILDERS']['RES'] = res_builder
|
||||
|
||||
include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
|
||||
env.PrependENVPath('INCLUDE', include_path)
|
||||
env.PrependENVPath('LIB', lib_path)
|
||||
env.PrependENVPath('PATH', exe_path)
|
||||
|
||||
env['ENV']['CPU'] = 'i386'
|
||||
env['ENV']['MSSDK'] = sdk_path
|
||||
env['ENV']['BkOffice'] = sdk_path
|
||||
env['ENV']['Basemake'] = sdk_path + "\\Include\\BKOffice.Mak"
|
||||
env['ENV']['INETSDK'] = sdk_path
|
||||
env['ENV']['MSSDK'] = sdk_path
|
||||
env['ENV']['MSTOOLS'] = sdk_path
|
||||
env['ENV']['TARGETOS'] = 'WINNT'
|
||||
env['ENV']['APPVER'] = '5.0'
|
||||
|
||||
env['CFILESUFFIX'] = '.c'
|
||||
env['CXXFILESUFFIX'] = '.cc'
|
||||
|
||||
env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
|
||||
env['BUILDERS']['PCH'] = pch_builder
|
||||
|
||||
env['AR'] = 'lib.exe' #'"' +sdk_path + '\\bin\\Win64\\lib.exe"'
|
||||
env['ARFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||
env['ARCOM'] = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
|
||||
|
||||
env['SHLINK'] = '$LINK'
|
||||
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
|
||||
env['_SHLINK_TARGETS'] = win32ShlinkTargets
|
||||
env['_SHLINK_SOURCES'] = win32ShlinkSources
|
||||
env['SHLINKCOM'] = compositeLinkAction
|
||||
env['SHLIBEMITTER']= win32LibEmitter
|
||||
env['LINK'] = 'link.exe' #'"' +sdk_path + '\\bin\\Win64\\' + 'link.exe"'
|
||||
env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||
env['_PDB'] = pdbGenerator
|
||||
env["TEMPFILE"] = SCons.Platform.win32.TempFileMunge
|
||||
env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES")}'
|
||||
env['PROGEMITTER'] = prog_emitter
|
||||
env['LIBDIRPREFIX']='/LIBPATH:'
|
||||
env['LIBDIRSUFFIX']=''
|
||||
env['LIBLINKPREFIX']=''
|
||||
env['LIBLINKSUFFIX']='$LIBSUFFIX'
|
||||
|
||||
env['WIN32DEFPREFIX'] = ''
|
||||
env['WIN32DEFSUFFIX'] = '.def'
|
||||
env['WIN32_INSERT_DEF'] = 0
|
||||
|
||||
env['WIN32EXPPREFIX'] = ''
|
||||
env['WIN32EXPSUFFIX'] = '.exp'
|
||||
|
||||
env['REGSVRACTION'] = regServerCheck
|
||||
env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
|
||||
env['REGSVRFLAGS'] = '/s '
|
||||
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
|
||||
|
||||
|
||||
def exists(env):
|
||||
return env.Detect('cl')
|
||||
340
doc/blender.1
Normal file
@@ -0,0 +1,340 @@
|
||||
.TH "BLENDER" "1" "July 15, 2010" "Blender Blender 2\&.52 (sub 5) "
|
||||
|
||||
.SH NAME
|
||||
blender \- a 3D modelling and rendering package
|
||||
.SH SYNOPSIS
|
||||
.B blender [args ...] [file] [args ...]
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.B blender
|
||||
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
|
||||
|
||||
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
|
||||
|
||||
http://www.blender.org
|
||||
.SH OPTIONS
|
||||
|
||||
Blender 2.52 (sub 5) Build
|
||||
Usage: blender [args ...] [file] [args ...]
|
||||
.br
|
||||
.SS "Render Options:"
|
||||
|
||||
.TP
|
||||
.B \-b or \-\-background <file>
|
||||
.br
|
||||
Load <file> in background (often used for UI\-less rendering)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-a or \-\-render\-anim
|
||||
.br
|
||||
Render frames from start to end (inclusive)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-S or \-\-scene <name>
|
||||
.br
|
||||
Set the active scene <name> for rendering
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-f or \-\-render\-frame <frame>
|
||||
.br
|
||||
Render frame <frame> and save it.
|
||||
.br
|
||||
+<frame> start frame relative, \-<frame> end frame relative.
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-s or \-\-frame\-start <frame>
|
||||
.br
|
||||
Set start to frame <frame> (use before the \-a argument)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-e or \-\-frame\-end <frame>
|
||||
.br
|
||||
Set end to frame <frame> (use before the \-a argument)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-j or \-\-frame\-jump <frames>
|
||||
.br
|
||||
Set number of frames to step forward after each rendered frame
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-o or \-\-render\-output <path>
|
||||
.br
|
||||
Set the render path and file name.
|
||||
.br
|
||||
Use // at the start of the path to
|
||||
.br
|
||||
render relative to the blend file.
|
||||
.br
|
||||
The # characters are replaced by the frame number, and used to define zero padding.
|
||||
.br
|
||||
ani_##_test.png becomes ani_01_test.png
|
||||
.br
|
||||
test\-######.png becomes test\-000001.png
|
||||
.br
|
||||
When the filename does not contain #, The suffix #### is added to the filename
|
||||
.br
|
||||
The frame number will be added at the end of the filename.
|
||||
.br
|
||||
eg: blender \-b foobar.blend \-o //render_ \-F PNG \-x 1 \-a
|
||||
.br
|
||||
//render_ becomes //render_####, writing frames as //render_0001.png//
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-E or \-\-engine <engine>
|
||||
.br
|
||||
Specify the render engine
|
||||
.br
|
||||
use \-E help to list available engines
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Format Options:"
|
||||
|
||||
.TP
|
||||
.B \-F or \-\-render\-format <format>
|
||||
.br
|
||||
Set the render format, Valid options are...
|
||||
.br
|
||||
TGA IRIS JPEG MOVIE IRIZ RAWTGA
|
||||
.br
|
||||
AVIRAW AVIJPEG PNG BMP FRAMESERVER
|
||||
.br
|
||||
(formats that can be compiled into blender, not available on all systems)
|
||||
.br
|
||||
HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-x or \-\-use\-extension <bool>
|
||||
.br
|
||||
Set option to add the file extension to the end of the file
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-t or \-\-threads <threads>
|
||||
.br
|
||||
Use amount of <threads> for rendering in background
|
||||
.br
|
||||
[1\-BLENDER_MAX_THREADS], 0 for systems processor count.
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Animation Playback Options:"
|
||||
|
||||
.TP
|
||||
.B \-a <options> <file(s)>
|
||||
.br
|
||||
Playback <file(s)>, only operates this way when not running in background.
|
||||
.br
|
||||
\-p <sx> <sy> Open with lower left corner at <sx>, <sy>
|
||||
.br
|
||||
\-m Read from disk (Don't buffer)
|
||||
.br
|
||||
\-f <fps> <fps\-base> Specify FPS to start with
|
||||
.br
|
||||
\-j <frame> Set frame step to <frame>
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Window Options:"
|
||||
|
||||
.TP
|
||||
.B \-w or \-\-window\-border
|
||||
.br
|
||||
Force opening with borders (default)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-W or \-\-window\-borderless
|
||||
.br
|
||||
Force opening with without borders
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-p or \-\-window\-geometry <sx> <sy> <w> <h>
|
||||
.br
|
||||
Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Game Engine Specific Options:"
|
||||
|
||||
.TP
|
||||
.B \-g Game Engine specific options
|
||||
.br
|
||||
\-g fixedtime Run on 50 hertz without dropping frames
|
||||
.br
|
||||
\-g vertexarrays Use Vertex Arrays for rendering (usually faster)
|
||||
.br
|
||||
\-g nomipmap No Texture Mipmapping
|
||||
.br
|
||||
\-g linearmipmap Linear Texture Mipmapping instead of Nearest (default)
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.SS "Misc Options:"
|
||||
|
||||
.TP
|
||||
.B \-d or \-\-debug
|
||||
.br
|
||||
Turn debugging on
|
||||
.br
|
||||
|
||||
.IP
|
||||
* Prints every operator call and their arguments
|
||||
.br
|
||||
* Disables mouse grab (to interact with a debugger in some cases)
|
||||
.br
|
||||
* Keeps python sys.stdin rather then setting it to None
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-debug\-fpe
|
||||
.br
|
||||
Enable floating point exceptions
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-nojoystick
|
||||
.br
|
||||
Disable joystick support
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-noglsl
|
||||
.br
|
||||
Disable GLSL shading
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-noaudio
|
||||
.br
|
||||
Force sound system to None
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-setaudio
|
||||
.br
|
||||
Force sound system to a specific device
|
||||
.br
|
||||
NULL SDL OPENAL JACK
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-h or \-\-help
|
||||
.br
|
||||
Print this help text and exit
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-y or \-\-enable\-autoexec
|
||||
.br
|
||||
Enable automatic python script execution (default)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-Y or \-\-disable\-autoexec
|
||||
.br
|
||||
Disable automatic python script execution (pydrivers, pyconstraints, pynodes)
|
||||
.br
|
||||
|
||||
.IP
|
||||
|
||||
.TP
|
||||
.B \-P or \-\-python <filename>
|
||||
.br
|
||||
Run the given Python script (filename or Blender Text)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-python\-console
|
||||
.br
|
||||
Run blender with an interactive console
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-v or \-\-version
|
||||
.br
|
||||
Print Blender version and exit
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-\-
|
||||
.br
|
||||
Ends option processing, following arguments passed unchanged. Access via python's sys.argv
|
||||
.br
|
||||
|
||||
.SS "Other Options:"
|
||||
|
||||
.TP
|
||||
.B /?
|
||||
.br
|
||||
Print this help text and exit (windows only)
|
||||
.br
|
||||
|
||||
.TP
|
||||
.B \-R
|
||||
.br
|
||||
Register .blend extension (windows only)
|
||||
.br
|
||||
|
||||
.SS "Argument Parsing:"
|
||||
|
||||
arguments must be separated by white space. eg
|
||||
"blender \-ba test.blend"
|
||||
...will ignore the 'a'
|
||||
"blender \-b test.blend \-f8"
|
||||
...will ignore 8 because there is no space between the \-f and the frame value
|
||||
.br
|
||||
.SS "Argument Order:"
|
||||
|
||||
Arguments are executed in the order they are given. eg
|
||||
"blender \-\-background test.blend \-\-render\-frame 1 \-\-render\-output /tmp"
|
||||
...will not render to /tmp because '\-\-render\-frame 1' renders before the output path is set
|
||||
"blender \-\-background \-\-render\-output /tmp test.blend \-\-render\-frame 1"
|
||||
...will not render to /tmp because loading the blend file overwrites the render output that was set
|
||||
"blender \-\-background test.blend \-\-render\-output /tmp \-\-render\-frame 1" works as expected.
|
||||
.br
|
||||
.br
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
\fIBLENDER_USER_CONFIG\fR Directory for user configuration files.
|
||||
\fIBLENDER_SYSTEM_CONFIG\fR Directory for system wide configuration files.
|
||||
\fIBLENDER_USER_SCRIPTS\fR Directory for user scripts.
|
||||
\fIBLENDER_SYSTEM_SCRIPTS\fR Directory for system wide scripts.
|
||||
\fIBLENDER_USER_DATAFILES\fR Directory for user data files (icons, translations, ..).
|
||||
\fIBLENDER_SYSTEM_DATAFILES\fR Directory for system wide data files.
|
||||
\fIBLENDER_SYSTEM_PYTHON\fR Directory for system python libraries.
|
||||
\fITMP\fR or \fITMPDIR\fR Store temporary files here.
|
||||
\fIPYTHONHOME\fR Path to the python directory, eg. /usr/lib/python.
|
||||
.br
|
||||
.br
|
||||
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.B yafaray(1)
|
||||
|
||||
.br
|
||||
.SH AUTHORS
|
||||
This manpage was written for a Debian GNU/Linux system by Daniel Mester
|
||||
<mester@uni-bremen.de> and updated by Cyril Brulebois
|
||||
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
|
||||
136
doc/blender.1.py
Normal file
@@ -0,0 +1,136 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
import time
|
||||
import datetime
|
||||
|
||||
|
||||
def man_format(data):
|
||||
data = data.replace("-", "\\-")
|
||||
data = data.replace("\t", " ")
|
||||
# data = data.replace("$", "\\fI")
|
||||
|
||||
data_ls = []
|
||||
for w in data.split():
|
||||
if w.startswith("$"):
|
||||
w = "\\fI" + w[1:] + "\\fR"
|
||||
|
||||
data_ls.append(w)
|
||||
|
||||
data = data[:len(data) - len(data.lstrip())] + " ".join(data_ls)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
blender_bin = os.path.join(os.path.dirname(__file__), "../blender")
|
||||
|
||||
blender_help = subprocess.Popen([blender_bin, "--help"], stdout=subprocess.PIPE).communicate()[0].decode()
|
||||
|
||||
blender_version = subprocess.Popen([blender_bin, "--version"], stdout=subprocess.PIPE).communicate()[0].decode().strip()
|
||||
blender_version = blender_version.split("Build")[0]
|
||||
|
||||
date_string = datetime.date.fromtimestamp(time.time()).strftime("%B %d, %Y")
|
||||
|
||||
filepath = os.path.splitext(__file__)[0]
|
||||
|
||||
file = open(filepath, "w")
|
||||
|
||||
fw = file.write
|
||||
|
||||
fw('.TH "BLENDER" "1" "%s" "Blender %s"\n' % (date_string, blender_version.replace(".", "\\&.")))
|
||||
|
||||
fw('''
|
||||
.SH NAME
|
||||
blender \- a 3D modelling and rendering package''')
|
||||
|
||||
fw('''
|
||||
.SH SYNOPSIS
|
||||
.B blender [args ...] [file] [args ...]''')
|
||||
|
||||
fw('''
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.B blender
|
||||
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
|
||||
|
||||
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
|
||||
|
||||
http://www.blender.org''')
|
||||
|
||||
fw('''
|
||||
.SH OPTIONS''')
|
||||
|
||||
fw("\n\n")
|
||||
|
||||
lines = [line.rstrip() for line in blender_help.split("\n")]
|
||||
|
||||
while lines:
|
||||
l = lines.pop(0)
|
||||
if l.startswith("Environment Variables:"):
|
||||
fw('.SH "ENVIRONMENT VARIABLES"\n')
|
||||
elif l.endswith(":"): # one line
|
||||
fw('.SS "%s"\n\n' % l)
|
||||
elif l.startswith("-") or l.startswith("/"): # can be multi line
|
||||
|
||||
fw('.TP\n')
|
||||
fw('.B %s\n' % man_format(l))
|
||||
|
||||
while lines:
|
||||
# line with no
|
||||
if lines[0].strip() and len(lines[0].lstrip()) == len(lines[0]): # no white space
|
||||
break
|
||||
|
||||
if not l: # second blank line
|
||||
fw('.IP\n')
|
||||
else:
|
||||
fw('.br\n')
|
||||
|
||||
l = lines.pop(0)
|
||||
l = l[1:] # remove first whitespace (tab)
|
||||
|
||||
fw('%s\n' % man_format(l))
|
||||
|
||||
else:
|
||||
if not l.strip():
|
||||
fw('.br\n')
|
||||
else:
|
||||
fw('%s\n' % man_format(l))
|
||||
|
||||
# footer
|
||||
|
||||
fw('''
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.B yafaray(1)
|
||||
|
||||
.br
|
||||
.SH AUTHORS
|
||||
This manpage was written for a Debian GNU/Linux system by Daniel Mester
|
||||
<mester@uni-bremen.de> and updated by Cyril Brulebois
|
||||
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
|
||||
''')
|
||||
|
||||
print("written:", filepath)
|
||||
@@ -601,7 +601,7 @@ void btConeTwistConstraint::calcAngleInfo2()
|
||||
m_solveSwingLimit = false;
|
||||
// compute rotation of A wrt B (in constraint space)
|
||||
if (m_bMotorEnabled && (!m_useSolveConstraintObsolete))
|
||||
{ // it is assumed that setMotorTarget() was alredy called
|
||||
{ // it is assumed that setMotorTarget() was already called
|
||||
// and motor target m_qTarget is within constraint limits
|
||||
// TODO : split rotation to pure swing and pure twist
|
||||
// compute desired transforms in world
|
||||
|
||||
8
extern/glew/include/GL/glew.h
vendored
@@ -2702,7 +2702,7 @@ typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
|
||||
typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
|
||||
@@ -2723,7 +2723,7 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum targ
|
||||
#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
|
||||
#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
|
||||
#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
|
||||
#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer)
|
||||
#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)
|
||||
#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
|
||||
#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
|
||||
#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
|
||||
@@ -8288,7 +8288,6 @@ typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum
|
||||
typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);
|
||||
typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
|
||||
typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
|
||||
typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint* params);
|
||||
|
||||
#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)
|
||||
#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)
|
||||
@@ -10563,7 +10562,7 @@ GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
|
||||
GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
|
||||
GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
|
||||
GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;
|
||||
@@ -11612,7 +11611,6 @@ GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;
|
||||
GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;
|
||||
GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;
|
||||
GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;
|
||||
GLEW_FUN_EXPORT PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV;
|
||||
|
||||
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;
|
||||
GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;
|
||||
|
||||
6
extern/glew/src/glew.c
vendored
@@ -547,7 +547,7 @@ PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL;
|
||||
PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL;
|
||||
PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL;
|
||||
PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL;
|
||||
@@ -1596,7 +1596,6 @@ PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL;
|
||||
PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL;
|
||||
PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL;
|
||||
PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL;
|
||||
PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV = NULL;
|
||||
|
||||
PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL;
|
||||
PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL;
|
||||
@@ -2739,7 +2738,7 @@ static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r;
|
||||
r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r;
|
||||
r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r;
|
||||
r = ((glFramebufferTexturLayer = (PFNGLFRAMEBUFFERTEXTURLAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexturLayer")) == NULL) || r;
|
||||
r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r;
|
||||
r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r;
|
||||
r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r;
|
||||
r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r;
|
||||
@@ -5303,7 +5302,6 @@ static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT)
|
||||
r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r;
|
||||
r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r;
|
||||
r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r;
|
||||
r = ((glVideoParameterivNV = (PFNGLVIDEOPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoParameterivNV")) == NULL) || r;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
10
extern/libopenjpeg/dwt.c
vendored
@@ -610,7 +610,7 @@ static void v4dwt_decode_step1_sse(v4* w, int count, const __m128 c){
|
||||
int i;
|
||||
for(i = 0; i < count; ++i){
|
||||
__m128 tmp = vw[i*2];
|
||||
vw[i*2] = tmp * c;
|
||||
vw[i*2] = _mm_mul_ps(tmp, c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,18 +622,18 @@ static void v4dwt_decode_step2_sse(v4* l, v4* w, int k, int m, __m128 c){
|
||||
__m128 tmp1 = vl[ 0];
|
||||
__m128 tmp2 = vw[-1];
|
||||
__m128 tmp3 = vw[ 0];
|
||||
vw[-1] = tmp2 + ((tmp1 + tmp3) * c);
|
||||
vw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));
|
||||
vl = vw;
|
||||
vw += 2;
|
||||
}
|
||||
if(m >= k){
|
||||
return;
|
||||
}
|
||||
c += c;
|
||||
c *= vl[0];
|
||||
c = _mm_add_ps(c, c);
|
||||
c = _mm_mul_ps(c, vl[0]);
|
||||
for(; m < k; ++m){
|
||||
__m128 tmp = vw[-1];
|
||||
vw[-1] = tmp + c;
|
||||
vw[-1] = _mm_add_ps(tmp, c);
|
||||
vw += 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ SET(SRC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ISystem.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ModifierKeys.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_NDOFManager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Path-api.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Rect.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_System.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_TimerManager.cpp
|
||||
@@ -84,6 +85,9 @@ ELSEIF(UNIX)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DPREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
ENDIF(APPLE)
|
||||
|
||||
BLENDERLIB(bf_ghost "${SRC}" "${INC}")
|
||||
|
||||
@@ -822,20 +822,6 @@ extern GHOST_TUns8* GHOST_getClipboard(int selection);
|
||||
*/
|
||||
extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
|
||||
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
*/
|
||||
extern const GHOST_TUns8* GHOST_getSystemDir();
|
||||
|
||||
/**
|
||||
* Determine the base dir in which user configuration is stored, not including versioning.
|
||||
* If needed, it will create the base directory.
|
||||
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
|
||||
*/
|
||||
extern const GHOST_TUns8* GHOST_getUserDir();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -363,12 +363,7 @@ public:
|
||||
*/
|
||||
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Determine special paths.
|
||||
***************************************************************************************/
|
||||
|
||||
/**
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
@@ -382,6 +377,11 @@ public:
|
||||
*/
|
||||
virtual const GHOST_TUns8* getUserDir() const = 0;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
virtual const GHOST_TUns8* getBinaryDir() const = 0;
|
||||
protected:
|
||||
/**
|
||||
* Initialize the system.
|
||||
|
||||
63
intern/ghost/GHOST_Path-api.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2010 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef GHOST_PATH_API_H
|
||||
#define GHOST_PATH_API_H
|
||||
|
||||
#include "GHOST_Types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
*/
|
||||
extern const GHOST_TUns8* GHOST_getSystemDir();
|
||||
|
||||
/**
|
||||
* Determine the base dir in which user configuration is stored, not including versioning.
|
||||
* @return Unsigned char string pointing to user dir (eg ~).
|
||||
*/
|
||||
extern const GHOST_TUns8* GHOST_getUserDir();
|
||||
|
||||
|
||||
/**
|
||||
* Determine the dir in which the binary file is found.
|
||||
* @return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/).
|
||||
*/
|
||||
extern const GHOST_TUns8* GHOST_getBinaryDir();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -56,9 +56,8 @@ else:
|
||||
|
||||
if env['BF_GHOST_DEBUG']:
|
||||
defs.append('BF_GHOST_DEBUG')
|
||||
|
||||
|
||||
incs = '. ../string #extern/glew/include #source/blender/imbuf #source/blender/makesdna ' + env['BF_OPENGL_INC']
|
||||
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
|
||||
incs = env['BF_WINTAB_INC'] + ' ' + incs
|
||||
env.BlenderLib ('bf_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )
|
||||
|
||||
|
||||
@@ -849,15 +849,3 @@ void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection)
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
system->putClipboard(buffer, selection);
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_getSystemDir()
|
||||
{
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
return system->getSystemDir();
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_getUserDir()
|
||||
{
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
return system->getUserDir();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
* @param time The time this event was generated.
|
||||
* @param type The type of this event.
|
||||
* @param dataType The type of the drop candidate object
|
||||
* @param window The window where the event occured
|
||||
* @param window The window where the event occurred
|
||||
* @param x The x-coordinate of the location the cursor was at at the time of the event.
|
||||
* @param y The y-coordinate of the location the cursor was at at the time of the event.
|
||||
* @param data The "content" dropped in the window
|
||||
|
||||
50
intern/ghost/intern/GHOST_Path-api.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2010 by Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "intern/GHOST_Debug.h"
|
||||
#include "GHOST_Path-api.h"
|
||||
#include "GHOST_ISystem.h"
|
||||
|
||||
const GHOST_TUns8* GHOST_getSystemDir()
|
||||
{
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
return system ? system->getSystemDir() : NULL;
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_getUserDir()
|
||||
{
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
return system ? system->getUserDir() : NULL; /* will be NULL in background mode */
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_getBinaryDir()
|
||||
{
|
||||
GHOST_ISystem* system = GHOST_ISystem::getSystem();
|
||||
return system ? system->getBinaryDir() : NULL; /* will be NULL in background mode */
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
*/
|
||||
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
@@ -298,6 +298,11 @@ public:
|
||||
*/
|
||||
virtual const GHOST_TUns8* getUserDir() const = 0;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
virtual const GHOST_TUns8* getBinaryDir() const = 0;
|
||||
protected:
|
||||
/**
|
||||
* Initialize the system.
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
* @param draggedObjectType The type object concerned (currently array of file names, string, TIFF image)
|
||||
* @param mouseX x mouse coordinate (in cocoa base window coordinates)
|
||||
* @param mouseY y mouse coordinate
|
||||
* @param window The window on which the event occured
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
|
||||
@@ -227,10 +227,16 @@ public:
|
||||
*/
|
||||
virtual const GHOST_TUns8* getUserDir() const;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
virtual const GHOST_TUns8* getBinaryDir() const;
|
||||
|
||||
/**
|
||||
* Handles a window event. Called by GHOST_WindowCocoa window delegate
|
||||
* @param eventType The type of window event
|
||||
* @param window The window on which the event occured
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
|
||||
|
||||
@@ -808,8 +808,12 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
|
||||
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
|
||||
if (!window) return GHOST_kFailure;
|
||||
|
||||
//Cursor and mouse dissociation placed here not to interfere with continuous grab
|
||||
// (in cont. grab setMouseCursorPosition is directly called)
|
||||
CGAssociateMouseAndMouseCursorPosition(false);
|
||||
setMouseCursorPosition(x, y);
|
||||
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
|
||||
//Force mouse move event (not pushed by Cocoa)
|
||||
window->screenToClient(x, y, wx, wy);
|
||||
pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, wx,wy));
|
||||
@@ -1611,7 +1615,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
||||
//Normal cursor operation: send mouse position in window
|
||||
pushEvent(new GHOST_EventCursor([event timestamp]*1000, GHOST_kEventCursorMove, window, mousePos.x, mousePos.y));
|
||||
m_cursorDelta_x=0;
|
||||
m_cursorDelta_y=0; //Mouse motion occured between two cursor warps, so we can reset the delta counter
|
||||
m_cursorDelta_y=0; //Mouse motion occurred between two cursor warps, so we can reset the delta counter
|
||||
warp_dx = 0;
|
||||
warp_dy = 0;
|
||||
} // END cursor grab mode
|
||||
@@ -1848,26 +1852,20 @@ const GHOST_TUns8* GHOST_SystemCocoa::getSystemDir() const
|
||||
{
|
||||
static GHOST_TUns8 tempPath[512] = "";
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSFileManager *fileManager;
|
||||
NSString *basePath;
|
||||
NSArray *paths;
|
||||
|
||||
|
||||
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSLocalDomainMask, YES);
|
||||
|
||||
|
||||
if ([paths count] > 0)
|
||||
basePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Blender"];
|
||||
else { //Fall back to standard unix path in case of issue
|
||||
basePath = @"/usr/share/blender";
|
||||
basePath = [paths objectAtIndex:0];
|
||||
else {
|
||||
[pool drain];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Ensure path exists, creates it if needed */
|
||||
fileManager = [NSFileManager defaultManager];
|
||||
if (![fileManager fileExistsAtPath:basePath isDirectory:NULL]) {
|
||||
[fileManager createDirectoryAtPath:basePath attributes:nil];
|
||||
}
|
||||
|
||||
|
||||
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
|
||||
|
||||
[pool drain];
|
||||
return tempPath;
|
||||
}
|
||||
@@ -1876,22 +1874,35 @@ const GHOST_TUns8* GHOST_SystemCocoa::getUserDir() const
|
||||
{
|
||||
static GHOST_TUns8 tempPath[512] = "";
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSFileManager *fileManager;
|
||||
NSString *basePath;
|
||||
NSArray *paths;
|
||||
|
||||
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||
|
||||
if ([paths count] > 0)
|
||||
basePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Blender"];
|
||||
else { //Fall back to HOME in case of issue
|
||||
basePath = [NSHomeDirectory() stringByAppendingPathComponent:@".blender"];
|
||||
basePath = [paths objectAtIndex:0];
|
||||
else {
|
||||
[pool drain];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Ensure path exists, creates it if needed */
|
||||
fileManager = [NSFileManager defaultManager];
|
||||
if (![fileManager fileExistsAtPath:basePath isDirectory:NULL]) {
|
||||
[fileManager createDirectoryAtPath:basePath attributes:nil];
|
||||
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
|
||||
[pool drain];
|
||||
return tempPath;
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemCocoa::getBinaryDir() const
|
||||
{
|
||||
static GHOST_TUns8 tempPath[512] = "";
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString *basePath;
|
||||
|
||||
basePath = [[NSBundle mainBundle] bundlePath];
|
||||
|
||||
if (basePath == nil) {
|
||||
[pool drain];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
strcpy((char*)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
|
||||
#include <stdio.h> // for debug [mce]
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
|
||||
// win64 doesn't define GWL_USERDATA
|
||||
#ifdef WIN32
|
||||
#ifndef GWL_USERDATA
|
||||
@@ -255,6 +258,8 @@ GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
|
||||
{
|
||||
if (!GetActiveWindow())
|
||||
return GHOST_kFailure;
|
||||
return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
|
||||
}
|
||||
|
||||
@@ -1287,10 +1292,36 @@ void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemWin32::getSystemDir() const
|
||||
{
|
||||
static char knownpath[MAX_PATH];
|
||||
HRESULT hResult = SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
return (GHOST_TUns8*)knownpath;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemWin32::getUserDir() const
|
||||
{
|
||||
static char knownpath[MAX_PATH];
|
||||
HRESULT hResult = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, knownpath);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
return (GHOST_TUns8*)knownpath;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemWin32::getBinaryDir() const
|
||||
{
|
||||
static char fullname[MAX_PATH];
|
||||
if(GetModuleFileName(0, fullname, MAX_PATH)) {
|
||||
return (GHOST_TUns8*)fullname;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -191,22 +191,27 @@ public:
|
||||
* @return No return
|
||||
*/
|
||||
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
|
||||
|
||||
|
||||
/**
|
||||
* Determine the base dir in which shared resources are located. It will first try to use
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/).
|
||||
*/
|
||||
virtual const GHOST_TUns8* getSystemDir() const;
|
||||
|
||||
/**
|
||||
* Determine the base dir in which user configuration is stored, not including versioning.
|
||||
* If needed, it will create the base directory.
|
||||
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
|
||||
* @return Unsigned char string pointing to user dir (eg ~/).
|
||||
*/
|
||||
virtual const GHOST_TUns8* getUserDir() const;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
virtual const GHOST_TUns8* getBinaryDir() const;
|
||||
|
||||
/**
|
||||
* Creates a drag'n'drop event and pushes it immediately onto the event queue.
|
||||
* Called by GHOST_DropTargetWin32 class.
|
||||
@@ -214,7 +219,7 @@ public:
|
||||
* @param draggedObjectType The type object concerned (currently array of file names, string, ?bitmap)
|
||||
* @param mouseX x mouse coordinate (in window coordinates)
|
||||
* @param mouseY y mouse coordinate
|
||||
* @param window The window on which the event occured
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,GHOST_IWindow* window, int mouseX, int mouseY, void* data);
|
||||
|
||||
@@ -67,6 +67,10 @@
|
||||
#include <stdio.h> // for fprintf only
|
||||
#include <cstdlib> // for exit
|
||||
|
||||
#ifndef PREFIX
|
||||
# define PREFIX "/usr/local"
|
||||
#endif
|
||||
|
||||
// [mce] these are for communication with the plugin
|
||||
typedef struct NDOFPlatformInfo {
|
||||
Display *display;
|
||||
@@ -465,7 +469,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
|
||||
|
||||
/* could also clamp to screen bounds
|
||||
* wrap with a window outside the view will fail atm */
|
||||
bounds.wrapPoint(x_new, y_new, 2); /* offset of one incase blender is at screen bounds */
|
||||
bounds.wrapPoint(x_new, y_new, 8); /* offset of one incase blender is at screen bounds */
|
||||
window->getCursorGrabAccum(x_accum, y_accum);
|
||||
|
||||
if(x_new != xme.x_root || y_new != xme.y_root) {
|
||||
@@ -1483,19 +1487,21 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemX11::getSystemDir() const
|
||||
{
|
||||
return (GHOST_TUns8*)"/usr/share/blender";
|
||||
return (GHOST_TUns8*) PREFIX "/share";
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemX11::getUserDir() const
|
||||
{
|
||||
static char path[256];
|
||||
char* env = getenv("HOME");
|
||||
if(env) {
|
||||
strncpy(path, env, 245);
|
||||
path[245]=0;
|
||||
strcat(path, "/.blender/");
|
||||
return (GHOST_TUns8*) path;
|
||||
return (GHOST_TUns8*) env;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemX11::getBinaryDir() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -242,6 +242,12 @@ public:
|
||||
*/
|
||||
const GHOST_TUns8* getUserDir() const;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
const GHOST_TUns8* getBinaryDir() const;
|
||||
|
||||
/**
|
||||
* Atom used for ICCCM, WM-spec and Motif.
|
||||
* We only need get this atom at the start, it's relative
|
||||
|
||||
@@ -348,10 +348,11 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
|
||||
|
||||
pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
|
||||
//pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,; // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
|
||||
|
||||
|
||||
pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
|
||||
pixelFormatAttrsWindow[i++] = (NSOpenGLPixelFormatAttribute) 32;
|
||||
|
||||
|
||||
if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
|
||||
|
||||
if (numOfAASamples>0) {
|
||||
@@ -732,7 +733,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
|
||||
#ifdef MAC_OS_X_VERSION_10_6
|
||||
//10.6 provides Cocoa functions to autoshow menu bar, and to change a window style
|
||||
//Hide menu & dock if needed
|
||||
if ([[m_window screen] isEqual:[NSScreen mainScreen]])
|
||||
if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]])
|
||||
{
|
||||
[NSApp setPresentationOptions:(NSApplicationPresentationHideDock | NSApplicationPresentationAutoHideMenuBar)];
|
||||
}
|
||||
@@ -743,7 +744,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
|
||||
#else
|
||||
//With 10.5, we need to create a new window to change its style to borderless
|
||||
//Hide menu & dock if needed
|
||||
if ([[m_window screen] isEqual:[NSScreen mainScreen]])
|
||||
if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]])
|
||||
{
|
||||
//Cocoa function in 10.5 does not allow to set the menu bar in auto-show mode [NSMenu setMenuBarVisible:NO];
|
||||
//One of the very few 64bit compatible Carbon function
|
||||
|
||||
@@ -1102,7 +1102,7 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd) {
|
||||
!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||
|
||||
!(pfd.dwFlags & PFD_DOUBLEBUFFER) || /* Blender _needs_ this */
|
||||
( pfd.cDepthBits <= 8 ) ||
|
||||
!(pfd.iPixelType == PFD_TYPE_RGBA) )
|
||||
!(pfd.iPixelType == PFD_TYPE_RGBA))
|
||||
return 0;
|
||||
|
||||
weight = 1; /* it's usable */
|
||||
|
||||
@@ -57,6 +57,9 @@ typedef struct {
|
||||
|
||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||
|
||||
|
||||
// #define GHOST_X11_GRAB
|
||||
|
||||
/*
|
||||
* A Client can't change the window property, that is
|
||||
* the work of the window manager. In case, we send
|
||||
@@ -1442,7 +1445,9 @@ setWindowCursorGrab(
|
||||
setWindowCursorVisibility(false);
|
||||
|
||||
}
|
||||
#ifdef GHOST_X11_GRAB
|
||||
XGrabPointer(m_display, m_window, False, ButtonPressMask| ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (m_cursorGrab==GHOST_kGrabHide) {
|
||||
@@ -1460,7 +1465,9 @@ setWindowCursorGrab(
|
||||
/* Almost works without but important otherwise the mouse GHOST location can be incorrect on exit */
|
||||
setCursorGrabAccum(0, 0);
|
||||
m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1; /* disable */
|
||||
#ifdef GHOST_X11_GRAB
|
||||
XUngrabPointer(m_display, CurrentTime);
|
||||
#endif
|
||||
}
|
||||
|
||||
XFlush(m_display);
|
||||
|
||||
@@ -38,7 +38,7 @@ CCSRCS += GHOST_EventManager.cpp GHOST_EventPrinter.cpp GHOST_WindowManager.cpp
|
||||
CCSRCS += GHOST_ISystem.cpp GHOST_ModifierKeys.cpp GHOST_TimerManager.cpp
|
||||
CCSRCS += GHOST_Rect.cpp GHOST_DisplayManager.cpp GHOST_C-api.cpp
|
||||
CCSRCS += GHOST_CallbackEventConsumer.cpp
|
||||
CCSRCS += GHOST_NDOFManager.cpp
|
||||
CCSRCS += GHOST_NDOFManager.cpp GHOST_Path-api.cpp
|
||||
|
||||
ifeq ($(OS),$(findstring $(OS), "darwin"))
|
||||
ifeq ($(WITH_COCOA), true)
|
||||
|
||||
@@ -468,6 +468,10 @@
|
||||
RelativePath="..\..\GHOST_IWindow.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\GHOST_Path-api.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\GHOST_Rect.h"
|
||||
>
|
||||
@@ -525,6 +529,10 @@
|
||||
RelativePath="..\..\intern\GHOST_NDOFManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\GHOST_Path-api.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\intern\GHOST_Rect.cpp"
|
||||
>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Returns the lenght of the allocated memory segment pointed at
|
||||
/** Returns the length of the allocated memory segment pointed at
|
||||
* by vmemh. If the pointer was not previously allocated by this
|
||||
* module, the result is undefined.*/
|
||||
size_t MEM_allocN_len(void *vmemh);
|
||||
|
||||
@@ -416,7 +416,7 @@ void vectoradd(
|
||||
A[i] += B[i];
|
||||
}
|
||||
|
||||
// same with seperate output vector
|
||||
// same with separate output vector
|
||||
|
||||
template <class T>
|
||||
void vectoradd(
|
||||
|
||||
@@ -52,7 +52,7 @@ void MovingFrame::pushInternalFrame(CacheTS timestamp)
|
||||
}
|
||||
}
|
||||
|
||||
// load pose just preceeding timestamp
|
||||
// load pose just preceding timestamp
|
||||
// return false if no cache position was found
|
||||
bool MovingFrame::popInternalFrame(CacheTS timestamp)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include "OBSTACLE.h"
|
||||
// #include "WTURBULENCE.h"
|
||||
|
||||
@@ -359,7 +359,7 @@ int STR_String::Find(char c, int pos) const
|
||||
|
||||
|
||||
//
|
||||
// Find the first occurence of <str> in the string
|
||||
// Find the first occurrence of <str> in the string
|
||||
//
|
||||
int STR_String::Find(const char *str, int pos) const
|
||||
{
|
||||
@@ -373,7 +373,7 @@ int STR_String::Find(const char *str, int pos) const
|
||||
|
||||
|
||||
//
|
||||
// Find the first occurence of <str> in the string
|
||||
// Find the first occurrence of <str> in the string
|
||||
//
|
||||
int STR_String::Find(rcSTR_String str, int pos) const
|
||||
{
|
||||
@@ -387,7 +387,7 @@ int STR_String::Find(rcSTR_String str, int pos) const
|
||||
|
||||
|
||||
//
|
||||
// Find the last occurence of <c> in the string
|
||||
// Find the last occurrence of <c> in the string
|
||||
//
|
||||
int STR_String::RFind(char c) const
|
||||
{
|
||||
@@ -399,7 +399,7 @@ int STR_String::RFind(char c) const
|
||||
|
||||
|
||||
//
|
||||
// Find the first occurence of any character in character set <set> in the string
|
||||
// Find the first occurrence of any character in character set <set> in the string
|
||||
//
|
||||
int STR_String::FindOneOf(const char *set, int pos) const
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib OpenCOLLADABaseUtils.lib OpenCOLLADAFramework.lib OpenCOLLADAStreamWriter.lib OpenCOLLADASaxFrameworkLoader.lib pcre.lib UTF.lib GeneratedSaxParser.lib MathMLSolver.lib xml2.lib buffer.lib ftoa.lib"
|
||||
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib OpenCOLLADABaseUtils.lib OpenCOLLADAFramework.lib OpenCOLLADAStreamWriter.lib OpenCOLLADASaxFrameworkLoader.lib pcre.lib GeneratedSaxParser.lib MathMLSolver.lib xml2.lib buffer.lib ftoa.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="..\..\..\install\msvc_9\blender.exe"
|
||||
LinkIncremental="1"
|
||||
@@ -169,7 +169,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386
"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib libsamplerate.lib libjack.lib OpenCOLLADABaseUtils_d.lib OpenCOLLADAFramework_d.lib OpenCOLLADAStreamWriter_d.lib OpenCOLLADASaxFrameworkLoader_d.lib pcre_d.lib UTF_d.lib GeneratedSaxParser_d.lib MathMLSolver_d.lib xml2_d.lib buffer_d.lib ftoa_d.lib"
|
||||
AdditionalDependencies="SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib libsamplerate.lib libjack.lib OpenCOLLADABaseUtils_d.lib OpenCOLLADAFramework_d.lib OpenCOLLADAStreamWriter_d.lib OpenCOLLADASaxFrameworkLoader_d.lib pcre_d.lib GeneratedSaxParser_d.lib MathMLSolver_d.lib xml2_d.lib buffer_d.lib ftoa_d.lib"
|
||||
ShowProgress="0"
|
||||
OutputFile="..\..\..\install\msvc_9d\blender.exe"
|
||||
LinkIncremental="2"
|
||||
|
||||
@@ -527,6 +527,10 @@
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\bpath.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\cpu.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\DLRB_tree.c"
|
||||
>
|
||||
@@ -684,6 +688,10 @@
|
||||
RelativePath="..\..\..\source\blender\blenlib\intern\BLI_callbacks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_cpu.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\blenlib\BLI_dlrbTree.h"
|
||||
>
|
||||
|
||||
@@ -355,10 +355,6 @@
|
||||
Name="datafiles"
|
||||
Filter="c"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\editors\datafiles\B.blend.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\editors\datafiles\Bfont.c"
|
||||
>
|
||||
@@ -387,6 +383,10 @@
|
||||
RelativePath="..\..\..\source\blender\editors\datafiles\splash.png.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\editors\datafiles\startup.blend.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="interface"
|
||||
@@ -1347,6 +1347,10 @@
|
||||
RelativePath="..\..\..\source\blender\editors\sculpt_paint\sculpt_intern.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\editors\sculpt_paint\sculpt_undo.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="uvedit"
|
||||
|
||||
@@ -508,7 +508,7 @@
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\gpu\gpu_buffers.h"
|
||||
RelativePath="..\..\..\source\blender\gpu\GPU_buffers.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
||||
@@ -589,6 +589,10 @@
|
||||
RelativePath="..\..\..\source\blender\imbuf\intern\thumbs.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\imbuf\intern\thumbs_blend.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\imbuf\intern\tiff.c"
|
||||
>
|
||||
|
||||
@@ -605,6 +605,10 @@
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_actuator.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_actuator_api.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_animation.c"
|
||||
>
|
||||
@@ -657,6 +661,10 @@
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_controller.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_controller_api.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_curve.c"
|
||||
>
|
||||
@@ -809,10 +817,18 @@
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sensor.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sensor_api.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sequencer.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_sequencer_api.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\source\blender\makesrna\intern\rna_smoke.c"
|
||||
>
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.5-alpha2
|
||||
2.5-beta
|
||||
|
||||
BIN
release/datafiles/brushicons/add.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
release/datafiles/brushicons/blob.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
release/datafiles/brushicons/blur.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
release/datafiles/brushicons/clay.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
release/datafiles/brushicons/clone.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
release/datafiles/brushicons/crease.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
release/datafiles/brushicons/darken.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
release/datafiles/brushicons/draw.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
release/datafiles/brushicons/fill.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
release/datafiles/brushicons/flatten.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
release/datafiles/brushicons/grab.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
release/datafiles/brushicons/inflate.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
release/datafiles/brushicons/layer.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
release/datafiles/brushicons/lighten.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
release/datafiles/brushicons/mix.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
release/datafiles/brushicons/multiply.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
release/datafiles/brushicons/nudge.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
release/datafiles/brushicons/pinch.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
release/datafiles/brushicons/scrape.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
release/datafiles/brushicons/smear.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
release/datafiles/brushicons/smooth.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
release/datafiles/brushicons/snake_hook.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
release/datafiles/brushicons/soften.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
release/datafiles/brushicons/subtract.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
release/datafiles/brushicons/texdraw.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
release/datafiles/brushicons/thumb.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
release/datafiles/brushicons/twist.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
release/datafiles/brushicons/vertexdraw.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 181 KiB |
@@ -3,7 +3,7 @@ Encoding=UTF-8
|
||||
Name=Blender
|
||||
Comment=3D modeling, animation, rendering and post-production
|
||||
Exec=blender
|
||||
Icon=blender.png
|
||||
Icon=blender.svg
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Graphics;3DGraphics;
|
||||
|
||||
@@ -134,7 +134,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
||||
|
||||
def exportCamera():
|
||||
camera = scene.camera
|
||||
matrix = camera.matrix
|
||||
matrix = camera.matrix_world
|
||||
|
||||
# compute resolution
|
||||
Qsize = float(render.resolution_x) / float(render.resolution_y)
|
||||
@@ -155,7 +155,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
||||
for ob in lamps:
|
||||
lamp = ob.data
|
||||
|
||||
matrix = ob.matrix
|
||||
matrix = ob.matrix_world
|
||||
|
||||
color = tuple([c * lamp.energy for c in lamp.color]) # Colour is modified by energy
|
||||
|
||||
@@ -263,7 +263,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
||||
|
||||
writeObjectMaterial(material)
|
||||
|
||||
writeMatrix(ob.matrix)
|
||||
writeMatrix(ob.matrix_world)
|
||||
|
||||
file.write('}\n')
|
||||
|
||||
@@ -292,7 +292,7 @@ def write_pov(filename, scene=None, info_callback=None):
|
||||
# continue
|
||||
# me = ob.data
|
||||
|
||||
matrix = ob.matrix
|
||||
matrix = ob.matrix_world
|
||||
try:
|
||||
uv_layer = me.active_uv_texture.data
|
||||
except:
|
||||
@@ -762,12 +762,22 @@ class PovrayRender(bpy.types.RenderEngine):
|
||||
|
||||
if 1:
|
||||
# TODO, when povray isnt found this gives a cryptic error, would be nice to be able to detect if it exists
|
||||
self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||
try:
|
||||
self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||
except OSError:
|
||||
# TODO, report api
|
||||
print("POVRAY: could not execute '%s', possibly povray isn't installed" % pov_binary)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print ("***-DONE-***")
|
||||
return False
|
||||
|
||||
else:
|
||||
# This works too but means we have to wait until its done
|
||||
os.system('%s %s' % (pov_binary, self._temp_file_ini))
|
||||
|
||||
print ("***-DONE-***")
|
||||
return True
|
||||
|
||||
def _cleanup(self):
|
||||
for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out):
|
||||
@@ -783,7 +793,10 @@ class PovrayRender(bpy.types.RenderEngine):
|
||||
self.update_stats("", "POVRAY: Exporting data from Blender")
|
||||
self._export(scene)
|
||||
self.update_stats("", "POVRAY: Parsing File")
|
||||
self._render()
|
||||
|
||||
if not self._render():
|
||||
self.update_stats("", "POVRAY: Not found")
|
||||
return
|
||||
|
||||
r = scene.render
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ def create_derived_objects(scene, ob):
|
||||
ob.create_dupli_list(scene)
|
||||
return True, [(dob.object, dob.matrix) for dob in ob.dupli_list]
|
||||
else:
|
||||
return False, [(ob, ob.matrix)]
|
||||
return False, [(ob, ob.matrix_world)]
|
||||
|
||||
# also used by X3D exporter
|
||||
def free_derived_objects(ob):
|
||||
@@ -1006,7 +1006,7 @@ def save_3ds(filename, context):
|
||||
mat = mat_ls[mat_index]
|
||||
if mat: mat_name = mat.name
|
||||
else: mat_name = None
|
||||
# else there alredy set to none
|
||||
# else there already set to none
|
||||
|
||||
img = uf.image
|
||||
# img = f.image
|
||||
@@ -1122,12 +1122,11 @@ class Export3DS(bpy.types.Operator):
|
||||
# to the class instance from the operator settings before calling.
|
||||
|
||||
|
||||
# filename = StringProperty(name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
|
||||
path = StringProperty(name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= "")
|
||||
filepath = StringProperty(name="File Path", description="Filepath used for exporting the 3DS file", maxlen= 1024, default= "")
|
||||
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
|
||||
|
||||
def execute(self, context):
|
||||
save_3ds(self.properties.path, context)
|
||||
save_3ds(self.properties.filepath, context)
|
||||
return {'FINISHED'}
|
||||
|
||||
def invoke(self, context, event):
|
||||
@@ -1141,8 +1140,8 @@ class Export3DS(bpy.types.Operator):
|
||||
|
||||
# Add to a menu
|
||||
def menu_func(self, context):
|
||||
default_path = bpy.data.filepath.replace(".blend", ".3ds")
|
||||
self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").path = default_path
|
||||
default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
|
||||
self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").filepath = default_path
|
||||
|
||||
|
||||
def register():
|
||||
@@ -1155,4 +1154,3 @@ def unregister():
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
||||
|
||||