This commit is contained in:
Brecht Van Lommel 2011-05-18 13:56:20 +00:00
commit 88d9d89c97
412 changed files with 5367 additions and 7192 deletions

@ -180,6 +180,10 @@ option(WITH_API_INSTALL "Copy API header files into the blender install fold
# Cycles
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
mark_as_advanced(WITH_MEM_JEMALLOC)
# Debug
option(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking (only enable for development)" OFF)
mark_as_advanced(WITH_CXX_GUARDEDALLOC)
@ -203,9 +207,6 @@ if(APPLE)
option(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
endif()
# only for developers who want to make this functional
# option(WITH_LCMS "Enable color correction with lcms" OFF)
if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
endif()
@ -380,13 +381,6 @@ if(UNIX AND NOT APPLE)
find_package(ZLIB REQUIRED)
if(WITH_LCMS)
set(LCMS /usr CACHE FILEPATH "LCMS directory")
set(LCMS_INCLUDE_DIR ${LCMS}/include)
set(LCMS_LIBRARY lcms)
set(LCMS_LIBPATH ${LCMS}/lib)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
mark_as_advanced(FFMPEG)
@ -429,6 +423,15 @@ if(UNIX AND NOT APPLE)
set(EXPAT_LIB expat)
endif()
if(WITH_MEM_JEMALLOC)
set(JEMALLOC /usr)
set(JEMALLOC_LIBRARY jemalloc CACHE STRING "JeMalloc library")
set(JEMALLOC_LIBPATH ${JEMALLOC}/lib CACHE FILEPATH "JeMalloc library path")
# no use for this yet.
# set(JEMALLOC_INCLUDE_DIR ${JEMALLOC}/include CACHE FILEPATH "JeMalloc include path")
unset(JEMALLOC)
endif()
find_package(X11 REQUIRED)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
@ -632,14 +635,7 @@ elseif(WIN32)
set(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa UTF)
set(PCRE_LIB pcre)
endif()
if(WITH_LCMS)
set(LCMS ${LIBDIR}/lcms)
set(LCMS_INCLUDE_DIR ${LCMS}/include)
set(LCMS_LIBPATH ${LCMS}/lib)
set(LCMS_LIB lcms)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
@ -875,7 +871,7 @@ elseif(APPLE)
set(GETTEXT_LIB intl iconv)
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
endif()
if(WITH_FFTW3)
set(FFTW3 ${LIBDIR}/fftw3)
set(FFTW3_INC ${FFTW3}/include)
@ -902,13 +898,6 @@ elseif(APPLE)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
endif()
if(WITH_LCMS)
set(LCMS ${LIBDIR}/lcms)
set(LCMS_INCLUDE_DIR ${LCMS}/include)
set(LCMS_LIBRARY lcms)
set(LCMS_LIBPATH ${LCMS}/lib)
endif()
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INC ${FFMPEG}/include)

@ -568,9 +568,10 @@ pluglist.append('source/blender/blenpluginapi/plugin.DEF')
plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.def'))
plugininstall = []
for targetdir,srcfile in zip(plugtargetlist, pluglist):
td, tf = os.path.split(targetdir)
plugininstall.append(env.Install(dir=td, source=srcfile))
# plugins in blender 2.5 don't work at the moment.
#for targetdir,srcfile in zip(plugtargetlist, pluglist):
# td, tf = os.path.split(targetdir)
# plugininstall.append(env.Install(dir=td, source=srcfile))
textlist = []
texttargetlist = []

@ -74,6 +74,12 @@ WITH_BF_BULLET = True
# Blender player (would be enabled in it's own config)
WITH_BF_PLAYER = False
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib32'
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']

@ -59,6 +59,12 @@ WITH_BF_BULLET = True
WITH_BF_NOBLENDER = True
WITH_BF_PLAYER = True
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib32'
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']

@ -59,6 +59,12 @@ WITH_BF_BULLET = True
WITH_BF_NOBLENDER = True
WITH_BF_PLAYER = True
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib64'
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']

@ -74,6 +74,12 @@ WITH_BF_BULLET = True
# Blender player (would be enabled in it's own config)
WITH_BF_PLAYER = False
# Use jemalloc memory manager
WITH_BF_JEMALLOC = True
WITH_BF_STATICJEMALLOC = True
BF_JEMALLOC = '/home/sources/staticlibs/jemalloc'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib64'
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']

@ -0,0 +1,230 @@
#!/usr/bin/env python
# $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.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>
"""
Example linux usage
python .~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
Windows not supported so far
"""
from project_info import *
import os
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
def create_nb_project_main():
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()
if SIMPLE_PROJECTFILE:
pass
else:
includes, defines = cmake_advanced_info()
# for some reason it doesnt give all internal includes
includes = list(set(includes) | set(dirname(f) for f in files if is_c_header(f)))
includes.sort()
PROJECT_NAME = "Blender"
FILE_NAME = PROJECT_NAME.lower()
# --------------- NB spesific
defines = [("%s=%s" % cdef) if cdef[1] else cdef[0] for cdef in defines]
defines += [cdef.replace("#define", "").strip() for cdef in cmake_compiler_defines()]
def file_list_to_nested(files):
# convert paths to hierarchy
paths_nested = {}
def ensure_path(filepath):
filepath_split = filepath.split(os.sep)
pn = paths_nested
for subdir in filepath_split[:-1]:
pn = pn.setdefault(subdir, {})
pn[filepath_split[-1]] = None
for path in files:
ensure_path(path)
return paths_nested
PROJECT_DIR_NB = join(PROJECT_DIR, "nbproject")
if not exists(PROJECT_DIR_NB):
os.mkdir(PROJECT_DIR_NB)
SOURCE_DIR_REL = relpath(SOURCE_DIR, PROJECT_DIR)
f = open(join(PROJECT_DIR_NB, "project.xml"), 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
f.write('<project xmlns="http://www.netbeans.org/ns/project/1">\n')
f.write(' <type>org.netbeans.modules.cnd.makeproject</type>\n')
f.write(' <configuration>\n')
f.write(' <data xmlns="http://www.netbeans.org/ns/make-project/1">\n')
f.write(' <name>%s</name>\n' % PROJECT_NAME)
f.write(' <c-extensions>c,m</c-extensions>\n')
f.write(' <cpp-extensions>cpp,mm</cpp-extensions>\n')
f.write(' <header-extensions>h,hpp,inl</header-extensions>\n')
f.write(' <sourceEncoding>UTF-8</sourceEncoding>\n')
f.write(' <make-dep-projects/>\n')
f.write(' <sourceRootList>\n')
f.write(' <sourceRootElem>%s</sourceRootElem>\n' % SOURCE_DIR) # base_root_rel
f.write(' </sourceRootList>\n')
f.write(' <confList>\n')
f.write(' <confElem>\n')
f.write(' <name>Default</name>\n')
f.write(' <type>0</type>\n')
f.write(' </confElem>\n')
f.write(' </confList>\n')
f.write(' </data>\n')
f.write(' </configuration>\n')
f.write('</project>\n')
f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
f.write('<configurationDescriptor version="79">\n')
f.write(' <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">\n')
f.write(' <df name="blender" root="%s">\n' % SOURCE_DIR) # base_root_rel
# write files!
files_rel_local = [normpath(relpath(join(CMAKE_DIR, path), SOURCE_DIR)) for path in files_rel]
files_rel_hierarchy = file_list_to_nested(files_rel_local)
# print(files_rel_hierarchy)
def write_df(hdir, ident):
dirs = []
files = []
for key, item in sorted(hdir.items()):
if item is None:
files.append(key)
else:
dirs.append((key, item))
for key, item in dirs:
f.write('%s <df name="%s">\n' % (ident, key))
write_df(item, ident + " ")
f.write('%s </df>\n' % ident)
for key in files:
f.write('%s<in>%s</in>\n' % (ident, key))
write_df(files_rel_hierarchy, ident=" ")
f.write(' </df>\n')
f.write(' <logicalFolder name="ExternalFiles"\n')
f.write(' displayName="Important Files"\n')
f.write(' projectFiles="false"\n')
f.write(' kind="IMPORTANT_FILES_FOLDER">\n')
# f.write(' <itemPath>../GNUmakefile</itemPath>\n')
f.write(' </logicalFolder>\n')
f.write(' </logicalFolder>\n')
# default, but this dir is infact not in blender dir so we can ignore it
# f.write(' <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n')
f.write(' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
f.write(' <sourceRootList>\n')
f.write(' <Elem>%s</Elem>\n' % SOURCE_DIR) # base_root_rel
f.write(' </sourceRootList>\n')
f.write(' <projectmakefile>Makefile</projectmakefile>\n')
# paths again
f.write(' <confs>\n')
f.write(' <conf name="Default" type="0">\n')
f.write(' <toolsSet>\n')
f.write(' <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>\n')
f.write(' <compilerSet>default</compilerSet>\n')
f.write(' </toolsSet>\n')
f.write(' <makefileType>\n')
f.write(' <makeTool>\n')
f.write(' <buildCommandWorkingDir>.</buildCommandWorkingDir>\n')
f.write(' <buildCommand>${MAKE} -f Makefile</buildCommand>\n')
f.write(' <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>\n')
f.write(' <executablePath>./bin/blender</executablePath>\n')
def write_toolinfo():
f.write(' <incDir>\n')
for inc in includes:
f.write(' <pElem>%s</pElem>\n' % inc)
f.write(' </incDir>\n')
f.write(' <preprocessorList>\n')
for cdef in defines:
f.write(' <Elem>%s</Elem>\n' % cdef)
f.write(' </preprocessorList>\n')
f.write(' <cTool>\n')
write_toolinfo()
f.write(' </cTool>\n')
f.write(' <ccTool>\n')
write_toolinfo()
f.write(' </ccTool>\n')
f.write(' </makeTool>\n')
f.write(' </makefileType>\n')
# finishe makefle info
f.write(' \n')
for path in files_rel_local:
f.write(' <item path="%s"\n' % path)
f.write(' ex="false"\n')
f.write(' tool="1"\n')
f.write(' flavor="0">\n')
f.write(' </item>\n')
f.write(' <runprofile version="9">\n')
f.write(' <runcommandpicklist>\n')
f.write(' </runcommandpicklist>\n')
f.write(' <runcommand>%s</runcommand>\n' % os.path.join(CMAKE_DIR, "bin/blender"))
f.write(' <rundir>%s</rundir>\n' % SOURCE_DIR)
f.write(' <buildfirst>false</buildfirst>\n')
f.write(' <terminal-type>0</terminal-type>\n')
f.write(' <remove-instrumentation>0</remove-instrumentation>\n')
f.write(' <environment>\n')
f.write(' </environment>\n')
f.write(' </runprofile>\n')
f.write(' </conf>\n')
f.write(' </confs>\n')
# todo
f.write('</configurationDescriptor>\n')
def main():
create_nb_project_main()
if __name__ == "__main__":
main()

178
build_files/cmake/cmake_qtcreator_project.py Normal file → Executable file

@ -1,6 +1,6 @@
#!/usr/bin/env python
# $Id:
# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@ -31,182 +31,16 @@ example linux usage
python .~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake
"""
import sys
from project_info import *
import os
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
base = join(os.path.dirname(__file__), "..", "..")
base = normpath(base)
base = abspath(base)
SIMPLE_PROJECTFILE = False
# get cmake path
CMAKE_DIR = sys.argv[-1]
if not os.path.exists(os.path.join(CMAKE_DIR, "CMakeCache.txt")):
CMAKE_DIR = os.getcwd()
if not os.path.exists(os.path.join(CMAKE_DIR, "CMakeCache.txt")):
print("CMakeCache.txt not found in %r or %r\n Pass CMake build dir as an argument, or run from that dir, aborting" % (CMAKE_DIR, os.getcwd()))
sys.exit(1)
# could be either.
# PROJECT_DIR = base
PROJECT_DIR = CMAKE_DIR
def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path):
# skip '.svn'
if dirpath.startswith("."):
continue
for filename in filenames:
filepath = join(dirpath, filename)
if filename_check is None or filename_check(filepath):
yield filepath
# extension checking
def is_cmake(filename):
ext = splitext(filename)[1]
return (ext == ".cmake") or (filename.endswith("CMakeLists.txt"))
def is_c_header(filename):
ext = splitext(filename)[1]
return (ext in (".h", ".hpp", ".hxx"))
def is_py(filename):
ext = splitext(filename)[1]
return (ext == ".py")
def is_glsl(filename):
ext = splitext(filename)[1]
return (ext == ".glsl")
def is_c(filename):
ext = splitext(filename)[1]
return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc"))
def is_c_any(filename):
return is_c(filename) or is_c_header(filename)
def is_svn_file(filename):
dn, fn = os.path.split(filename)
filename_svn = join(dn, ".svn", "text-base", "%s.svn-base" % fn)
return exists(filename_svn)
def is_project_file(filename):
return (is_c_any(filename) or is_cmake(filename) or is_glsl(filename)) # and is_svn_file(filename)
def cmake_advanced_info():
""" Extracr includes and defines from cmake.
"""
def create_eclipse_project(CMAKE_DIR):
print("CMAKE_DIR %r" % CMAKE_DIR)
if sys.platform == "win32":
cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
else:
cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR
os.system(cmd)
includes = []
defines = []
create_eclipse_project(CMAKE_DIR)
from xml.dom.minidom import parse
tree = parse(os.path.join(CMAKE_DIR, ".cproject"))
'''
f = open(".cproject_pretty", 'w')
f.write(tree.toprettyxml(indent=" ", newl=""))
'''
ELEMENT_NODE = tree.ELEMENT_NODE
cproject, = tree.getElementsByTagName("cproject")
for storage in cproject.childNodes:
if storage.nodeType != ELEMENT_NODE:
continue
if storage.attributes["moduleId"].value == "org.eclipse.cdt.core.settings":
cconfig = storage.getElementsByTagName("cconfiguration")[0]
for substorage in cconfig.childNodes:
if substorage.nodeType != ELEMENT_NODE:
continue
moduleId = substorage.attributes["moduleId"].value
# org.eclipse.cdt.core.settings
# org.eclipse.cdt.core.language.mapping
# org.eclipse.cdt.core.externalSettings
# org.eclipse.cdt.core.pathentry
# org.eclipse.cdt.make.core.buildtargets
if moduleId == "org.eclipse.cdt.core.pathentry":
for path in substorage.childNodes:
if path.nodeType != ELEMENT_NODE:
continue
kind = path.attributes["kind"].value
if kind == "mac":
# <pathentry kind="mac" name="PREFIX" path="" value="&quot;/opt/blender25&quot;"/>
defines.append((path.attributes["name"].value, path.attributes["value"].value))
elif kind == "inc":
# <pathentry include="/data/src/blender/blender/source/blender/editors/include" kind="inc" path="" system="true"/>
includes.append(path.attributes["include"].value)
else:
pass
return includes, defines
def cmake_cache_var(var):
cache_file = open(os.path.join(CMAKE_DIR, "CMakeCache.txt"))
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
cache_file.close()
for l in lines:
if l.split(":")[0] == var:
return l.split("=", 1)[-1]
return None
def cmake_compiler_defines():
compiler = cmake_cache_var("CMAKE_C_COMPILER") # could do CXX too
if compiler is None:
print("Couldn't find the compiler, os defines will be omitted...")
return
import tempfile
temp_c = tempfile.mkstemp(suffix=".c")[1]
temp_def = tempfile.mkstemp(suffix=".def")[1]
os.system("%s -dM -E %s > %s" % (compiler, temp_c, temp_def))
temp_def_file = open(temp_def)
lines = [l.strip() for l in temp_def_file if l.strip()]
temp_def_file.close()
os.remove(temp_c)
os.remove(temp_def)
return lines
import sys
def create_qtc_project_main():
files = list(source_list(base, filename_check=is_project_file))
files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()
@ -260,7 +94,7 @@ def create_qtc_project_main():
def create_qtc_project_python():
files = list(source_list(base, filename_check=is_py))
files = list(source_list(SOURCE_DIR, filename_check=is_py))
files_rel = [relpath(f, start=PROJECT_DIR) for f in files]
files_rel.sort()

@ -88,9 +88,6 @@ macro(SETUP_LIBDIRS)
if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
link_directories(${OPENJPEG_LIBPATH})
endif()
if(WITH_LCMS)
link_directories(${LCMS_LIBPATH})
endif()
if(WITH_CODEC_QUICKTIME)
link_directories(${QUICKTIME_LIBPATH})
endif()
@ -114,6 +111,9 @@ macro(SETUP_LIBDIRS)
link_directories(${PCRE_LIBPATH})
link_directories(${EXPAT_LIBPATH})
endif()
if(WITH_MEM_JEMALLOC)
link_directories(${JEMALLOC_LIBPATH})
endif()
if(WIN32 AND NOT UNIX)
link_directories(${PTHREADS_LIBPATH})
@ -190,9 +190,6 @@ macro(setup_liblinks
if(WITH_IMAGE_OPENJPEG AND UNIX AND NOT APPLE)
target_link_libraries(${target} ${OPENJPEG_LIB})
endif()
if(WITH_LCMS)
target_link_libraries(${target} ${LCMS_LIBRARY})
endif()
if(WITH_CODEC_FFMPEG)
target_link_libraries(${target} ${FFMPEG_LIB})
endif()
@ -214,11 +211,8 @@ macro(setup_liblinks
target_link_libraries(${target} ${EXPAT_LIB})
endif()
endif()
if(WITH_LCMS)
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} debug ${LCMS_LIB}_d)
target_link_libraries(${target} optimized ${LCMS_LIB})
endif()
if(WITH_MEM_JEMALLOC)
target_link_libraries(${target} ${JEMALLOC_LIBRARY})
endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIB})

@ -31,17 +31,20 @@ set(BUILD_REV ${MY_WC_REVISION})
# Force Package Name
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CPACK_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# RPM packages
include(build_files/cmake/RpmBuild.cmake)
if(RPMBUILD_FOUND AND NOT WIN32)
set(CPACK_GENERATOR "RPM")
set(CPACK_SET_DESTDIR TRUE)
set(CPACK_RPM_PACKAGE_RELEASE "1.r${BUILD_REV}")
set(CPACK_SET_DESTDIR "true")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
set(CPACK_PACKAGE_RELOCATABLE "false")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_PACKAGE_GROUP "Amusements/Graphics")
set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_SOURCE_DIR}/build_files/package_spec/rpm/blender.spec.in")
endif()
endif()

218
build_files/cmake/project_info.py Executable file

@ -0,0 +1,218 @@
#!/usr/bin/env python
# $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.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>
"""
Example Win32 usage:
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
example linux usage
python .~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake
"""
__all__ = (
"SIMPLE_PROJECTFILE",
"SOURCE_DIR",
"CMAKE_DIR",
"PROJECT_DIR",
"source_list",
"is_project_file",
"is_c_header",
"is_py",
"cmake_advanced_info",
"cmake_compiler_defines",
)
import sys
import os
from os.path import join, dirname, normpath, abspath, splitext, relpath, exists
SOURCE_DIR = join(dirname(__file__), "..", "..")
SOURCE_DIR = normpath(SOURCE_DIR)
SOURCE_DIR = abspath(SOURCE_DIR)
SIMPLE_PROJECTFILE = False
# get cmake path
CMAKE_DIR = sys.argv[-1]
if not exists(join(CMAKE_DIR, "CMakeCache.txt")):
CMAKE_DIR = os.getcwd()
if not exists(join(CMAKE_DIR, "CMakeCache.txt")):
print("CMakeCache.txt not found in %r or %r\n Pass CMake build dir as an argument, or run from that dir, aborting" % (CMAKE_DIR, os.getcwd()))
sys.exit(1)
# could be either.
# PROJECT_DIR = SOURCE_DIR
PROJECT_DIR = CMAKE_DIR
def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path):
# skip '.svn'
if dirpath.startswith("."):
continue
for filename in filenames:
filepath = join(dirpath, filename)
if filename_check is None or filename_check(filepath):
yield filepath
# extension checking
def is_cmake(filename):
ext = splitext(filename)[1]
return (ext == ".cmake") or (filename.endswith("CMakeLists.txt"))
def is_c_header(filename):
ext = splitext(filename)[1]
return (ext in (".h", ".hpp", ".hxx"))
def is_py(filename):
ext = splitext(filename)[1]
return (ext == ".py")
def is_glsl(filename):
ext = splitext(filename)[1]
return (ext == ".glsl")
def is_c(filename):
ext = splitext(filename)[1]
return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc"))
def is_c_any(filename):
return is_c(filename) or is_c_header(filename)
def is_svn_file(filename):
dn, fn = os.path.split(filename)
filename_svn = join(dn, ".svn", "text-base", "%s.svn-base" % fn)
return exists(filename_svn)
def is_project_file(filename):
return (is_c_any(filename) or is_cmake(filename) or is_glsl(filename)) # and is_svn_file(filename)
def cmake_advanced_info():
""" Extracr includes and defines from cmake.
"""
def create_eclipse_project(CMAKE_DIR):
print("CMAKE_DIR %r" % CMAKE_DIR)
if sys.platform == "win32":
cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
else:
cmd = 'cmake "%s" -G"Eclipse CDT4 - Unix Makefiles"' % CMAKE_DIR
os.system(cmd)
includes = []
defines = []
create_eclipse_project(CMAKE_DIR)
from xml.dom.minidom import parse
tree = parse(join(CMAKE_DIR, ".cproject"))
'''
f = open(".cproject_pretty", 'w')
f.write(tree.toprettyxml(indent=" ", newl=""))
'''
ELEMENT_NODE = tree.ELEMENT_NODE
cproject, = tree.getElementsByTagName("cproject")
for storage in cproject.childNodes:
if storage.nodeType != ELEMENT_NODE:
continue
if storage.attributes["moduleId"].value == "org.eclipse.cdt.core.settings":
cconfig = storage.getElementsByTagName("cconfiguration")[0]
for substorage in cconfig.childNodes:
if substorage.nodeType != ELEMENT_NODE:
continue
moduleId = substorage.attributes["moduleId"].value
# org.eclipse.cdt.core.settings
# org.eclipse.cdt.core.language.mapping
# org.eclipse.cdt.core.externalSettings
# org.eclipse.cdt.core.pathentry
# org.eclipse.cdt.make.core.buildtargets
if moduleId == "org.eclipse.cdt.core.pathentry":
for path in substorage.childNodes:
if path.nodeType != ELEMENT_NODE:
continue
kind = path.attributes["kind"].value
if kind == "mac":
# <pathentry kind="mac" name="PREFIX" path="" value="&quot;/opt/blender25&quot;"/>
defines.append((path.attributes["name"].value, path.attributes["value"].value))
elif kind == "inc":
# <pathentry include="/data/src/blender/blender/source/blender/editors/include" kind="inc" path="" system="true"/>
includes.append(path.attributes["include"].value)
else:
pass
return includes, defines
def cmake_cache_var(var):
cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"))
lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
cache_file.close()
for l in lines:
if l.split(":")[0] == var:
return l.split("=", 1)[-1]
return None
def cmake_compiler_defines():
compiler = cmake_cache_var("CMAKE_C_COMPILER") # could do CXX too
if compiler is None:
print("Couldn't find the compiler, os defines will be omitted...")
return
import tempfile
temp_c = tempfile.mkstemp(suffix=".c")[1]
temp_def = tempfile.mkstemp(suffix=".def")[1]
os.system("%s -dM -E %s > %s" % (compiler, temp_c, temp_def))
temp_def_file = open(temp_def)
lines = [l.strip() for l in temp_def_file if l.strip()]
temp_def_file.close()
os.remove(temp_c)
os.remove(temp_def)
return lines

@ -0,0 +1,69 @@
# -*- rpm-spec -*-
%global __python %{__python3}
BuildRoot: @CPACK_RPM_DIRECTORY@/@CPACK_PACKAGE_FILE_NAME@@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH@
Summary: @CPACK_RPM_PACKAGE_SUMMARY@
Name: @CPACK_RPM_PACKAGE_NAME@
Version: @CPACK_RPM_PACKAGE_VERSION@
Release: @CPACK_RPM_PACKAGE_RELEASE@%{?dist}
License: @CPACK_RPM_PACKAGE_LICENSE@
Group: @CPACK_RPM_PACKAGE_GROUP@
Vendor: @CPACK_RPM_PACKAGE_VENDOR@
%define _rpmdir @CPACK_RPM_DIRECTORY@
%define _rpmfilename @CPACK_RPM_FILE_NAME@
%define _unpackaged_files_terminate_build 0
%define _topdir @CPACK_RPM_DIRECTORY@
%description
Blender is an integrated 3d suite for modelling, animation, rendering,
post-production, interactive creation and playback (games). Blender has its
own particular user interface, which is implemented entirely in OpenGL and
designed with speed in mind. Python bindings are available for scripting;
import/export features for popular file formats like 3D Studio and Wavefront
Obj are implemented as scripts by the community. Stills, animations, models
for games or other third party engines and interactive content in the form of
a standalone binary and/or a web plug-in are common products of Blender use.
# This is a shortcutted spec file generated by CMake RPM generator
# we skip _install step because CPack does that for us.
# We do only save CPack installed tree in _prepr
# and then restore it in build.
%prep
mv ${RPM_BUILD_ROOT} "@CPACK_TOPLEVEL_DIRECTORY@/tmpBBroot"
%install
if [ -e ${RPM_BUILD_ROOT} ];
then
rm -rf ${RPM_BUILD_ROOT}
fi
mv "@CPACK_TOPLEVEL_DIRECTORY@/tmpBBroot" ${RPM_BUILD_ROOT}
%clean
rm -rf ${RPM_BUILD_ROOT}
%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%{_bindir}/update-desktop-database %{_datadir}/applications || :
%postun
%{_bindir}/update-desktop-database %{_datadir}/applications
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi || :
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}/@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/doc/blender
%{_mandir}/man1/blender.*
%changelog
@CPACK_RPM_SPEC_CHANGELOG@

@ -178,6 +178,14 @@ BF_EXPAT = '/usr'
BF_EXPAT_LIB = 'expat'
BF_EXPAT_LIBPATH = '/usr/lib'
WITH_BF_JEMALLOC = False
WITH_BF_STATICJEMALLOC = False
BF_JEMALLOC = '/usr'
BF_JEMALLOC_INC = '${BF_JEMALLOC}/include'
BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
BF_JEMALLOC_LIB = 'jemalloc'
BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
WITH_BF_OPENMP = True
#Ray trace optimization

@ -149,12 +149,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
WITH_BF_LCMS = False
BF_LCMS = LIBDIR + '/lcms'
BF_LCMS_INC = '${BF_LCMS}/include'
BF_LCMS_LIB = 'lcms'
BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']

@ -151,12 +151,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa UTF'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
WITH_BF_LCMS = False
BF_LCMS = LIBDIR + '/lcms'
BF_LCMS_INC = '${BF_LCMS}/include'
BF_LCMS_LIB = 'lcms'
BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']

@ -148,8 +148,6 @@ def setup_staticlibs(lenv):
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_STATICTIFF']:
@ -203,6 +201,11 @@ def setup_staticlibs(lenv):
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
libincs.append('/usr/lib')
if lenv['WITH_BF_JEMALLOC']:
libincs += Split(lenv['BF_JEMALLOC_LIBPATH'])
if lenv['WITH_BF_STATICJEMALLOC']:
statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC'])
return statlibs, libincs
def setup_syslibs(lenv):
@ -253,8 +256,6 @@ def setup_syslibs(lenv):
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'])
@ -263,6 +264,9 @@ def setup_syslibs(lenv):
if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB'])
if lenv['WITH_BF_JEMALLOC']:
if not lenv['WITH_BF_STATICJEMALLOC']:
syslibs += Split(lenv['BF_JEMALLOC_LIB'])
syslibs += lenv['LLIBS']

@ -125,7 +125,6 @@ def validate_arguments(args, bc):
'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',
@ -134,7 +133,8 @@ def validate_arguments(args, bc):
'WITH_BF_RAYOPTIMIZATION',
'BF_RAYOPTIMIZATION_SSE_FLAGS',
'BF_NO_ELBEEM',
'WITH_BF_CXX_GUARDEDALLOC'
'WITH_BF_CXX_GUARDEDALLOC',
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC'
]
# Have options here that scons expects to be lists
@ -333,12 +333,6 @@ def read_opts(env, cfg, args):
('BF_TIFF_LIBPATH', 'TIFF library path', ''),
('BF_TIFF_LIB_STATIC', 'TIFF static library', ''),
(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)),
(BoolVariable('WITH_BF_STATICZLIB', 'Staticly link to ZLib', False)),
('BF_ZLIB', 'ZLib base path', ''),
@ -429,6 +423,14 @@ def read_opts(env, cfg, args):
('BF_EXPAT_LIB', 'Expat library', ''),
('BF_EXPAT_LIBPATH', 'Expat library path', ''),
(BoolVariable('WITH_BF_JEMALLOC', 'Use jemalloc if true', False)),
(BoolVariable('WITH_BF_STATICJEMALLOC', 'Staticly link to jemalloc', False)),
('BF_JEMALLOC', 'jemalloc base path', ''),
('BF_JEMALLOC_INC', 'jemalloc include path', ''),
('BF_JEMALLOC_LIB', 'jemalloc library', ''),
('BF_JEMALLOC_LIBPATH', 'jemalloc library path', ''),
('BF_JEMALLOC_LIB_STATIC', 'jemalloc static library', ''),
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),

@ -145,10 +145,6 @@
* merged in docs.
*/
/** \defgroup blo readblenfile
* \ingroup blender data
*/
/** \defgroup quicktime quicktime
* \ingroup blender
@ -342,17 +338,5 @@
/* ================================ */
/** \defgroup kernel kernel */
/** \defgroup genmess gen_messaging
* \ingroup kernel
*/
/** \defgroup gensys gen_system
* \ingroup kernel
*/
/* ================================ */
/** \defgroup undoc Undocumented
* \brief Modules and libraries that are still undocumented, or lacking proper integration into the doxygen system, are marked in this group. */

@ -810,7 +810,9 @@ def pyrna2sphinx(BASEPATH):
# operators
def write_ops():
API_BASEURL = "https://svn.blender.org/svnroot/bf-blender/trunk/blender/release/scripts"
API_BASEURL = "http://svn.blender.org/svnroot/bf-blender/trunk/blender/release/scripts"
API_BASEURL_ADDON = "http://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts"
API_BASEURL_ADDON_CONTRIB = "http://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts"
op_modules = {}
for op in ops.values():
@ -849,7 +851,14 @@ def pyrna2sphinx(BASEPATH):
location = op.get_location()
if location != (None, None):
fw(" :file: `%s <%s/%s>`_:%d\n\n" % (location[0], API_BASEURL, location[0], location[1]))
if location[0].startswith("addons_contrib" + os.sep):
url_base = API_BASEURL_ADDON_CONTRIB
elif location[0].startswith("addons" + os.sep):
url_base = API_BASEURL_ADDON
else:
url_base = API_BASEURL
fw(" :file: `%s <%s/%s>`_:%d\n\n" % (location[0], url_base, location[0], location[1]))
file.close()

@ -26,11 +26,13 @@
set(INC
.
../guardedalloc
)
set(SRC
intern/CTR_List.cpp
CTR_HashedPtr.h
CTR_List.h
CTR_Map.h
CTR_TaggedIndex.h

@ -28,24 +28,30 @@
*
*/
/** \file kernel/gen_system/GEN_HashedPtr.h
* \ingroup gensys
/** \file container/CTR_HashedPtr.h
* \ingroup ctr
*/
#ifndef __GEN_HASHEDPTR
#define __GEN_HASHEDPTR
#ifndef CTR_HASHEDPTR_H
#define CTR_HASHEDPTR_H
unsigned int GEN_Hash(void * inDWord);
#include <stdlib.h>
class GEN_HashedPtr
inline unsigned int CTR_Hash(void *inDWord)
{
size_t key = (size_t)inDWord;
return (unsigned int)(key ^ (key>>4));
}
class CTR_HashedPtr
{
void* m_valptr;
public:
GEN_HashedPtr(void* val) : m_valptr(val) {};
unsigned int hash() const { return GEN_Hash(m_valptr);};
inline friend bool operator ==(const GEN_HashedPtr & rhs, const GEN_HashedPtr & lhs) { return rhs.m_valptr == lhs.m_valptr;};
CTR_HashedPtr(void* val) : m_valptr(val) {};
unsigned int hash() const { return CTR_Hash(m_valptr);};
inline friend bool operator ==(const CTR_HashedPtr & rhs, const CTR_HashedPtr & lhs) { return rhs.m_valptr == lhs.m_valptr;};
void *getValue() const { return m_valptr; }
};
#endif //__GEN_HASHEDPTR
#endif //CTR_HASHEDPTR_H

@ -55,6 +55,19 @@ public:
m_buckets[i] = 0;
}
}
CTR_Map(const CTR_Map& map)
{
m_num_buckets = map.m_num_buckets;
m_buckets = new Entry *[m_num_buckets];
for (int i = 0; i < m_num_buckets; ++i) {
m_buckets[i] = 0;
for(Entry *entry = map.m_buckets[i]; entry; entry=entry->m_next)
insert(entry->m_key, entry->m_value);
}
}
int size() {
int count=0;
@ -87,6 +100,24 @@ public:
}
return 0;
}
Key* getKey(int index) {
int count=0;
for (int i=0;i<m_num_buckets;i++)
{
Entry* bucket = m_buckets[i];
while(bucket)
{
if (count==index)
{
return &bucket->m_key;
}
bucket = bucket->m_next;
count++;
}
}
return 0;
}
void clear() {
for (int i = 0; i < m_num_buckets; ++i) {

@ -2,6 +2,6 @@
Import ('env')
sources = env.Glob('intern/*.cpp')
incs = '.'
incs = '. #intern/guardedalloc'
env.BlenderLib ('bf_intern_ctr', sources, Split(incs) , [], libtype='intern', priority = 10 )

@ -20,7 +20,7 @@
import os
import bpy
import io_utils
from bpy_extras.io_utils import ExportHelper
import xml.etree.ElementTree as etree
import xml.dom.minidom as dom
@ -40,7 +40,7 @@ def write(node, fname):
f = open(fname, "w")
f.write(s)
class ExportCyclesXML(bpy.types.Operator, io_utils.ExportHelper):
class ExportCyclesXML(bpy.types.Operator, ExportHelper):
''''''
bl_idname = "export_mesh.cycles_xml"
bl_label = "Export Cycles XML"

@ -29,7 +29,7 @@ set(INC
../string
../../source/blender/imbuf
../../source/blender/makesdna
${GLEW_INCLUDE_PATH}
${GLEW_INCLUDE_PATH}
)
set(SRC

@ -42,7 +42,7 @@
#include <iostream>
#ifdef FREE_WINDOWS
# define _WIN32_WINNT 0x0500 /* GetConsoleWindow() for MinGW */
# define WINVER 0x0501 /* GetConsoleWindow() for MinGW */
#endif
#include "GHOST_SystemWin32.h"
@ -304,7 +304,6 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
// Process all the events waiting for us
while (::PeekMessage(&msg, 0, 0, 0, PM_REMOVE) != 0) {
::TranslateMessage(&msg);
::DispatchMessage(&msg);
anyProcessed = true;
}
@ -819,6 +818,11 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
// Keyboard events, processed
////////////////////////////////////////////////////////////////////////
case WM_INPUT:
// check WM_INPUT from input sink when ghost window is not in the foreground
if (wParam == RIM_INPUTSINK) {
if (GetFocus() != hwnd) // WM_INPUT message not for this window
return 0;
} //else wPAram == RIM_INPUT
event = processKeyEvent(window, wParam, lParam);
if (!event) {
GHOST_PRINT("GHOST_SystemWin32::wndProc: key event ")
@ -1174,25 +1178,29 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(bool selection) const
char *temp_buff;
if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
size_t len = 0;
HANDLE hData = GetClipboardData( CF_TEXT );
if (hData == NULL) {
CloseClipboard();
return NULL;
}
buffer = (char*)GlobalLock( hData );
if (!buffer) {
CloseClipboard();
return NULL;
}
temp_buff = (char*) malloc(strlen(buffer)+1);
strcpy(temp_buff, buffer);
len = strlen(buffer);
temp_buff = (char*) malloc(len+1);
strncpy(temp_buff, buffer, len);
temp_buff[len] = '\0';
/* Buffer mustn't be accessed after CloseClipboard
it would like accessing free-d memory */
GlobalUnlock( hData );
CloseClipboard();
temp_buff[strlen(buffer)] = '\0';
if (buffer) {
return (GHOST_TUns8*)temp_buff;
} else {
return NULL;
}
return (GHOST_TUns8*)temp_buff;
} else {
return NULL;
}

@ -52,6 +52,9 @@
#ifndef RID_INPUT
#define RID_INPUT 0x10000003
#endif
#ifndef RIM_INPUTSINK
#define RIM_INPUTSINK 0x1
#endif
#ifndef RI_KEY_BREAK
#define RI_KEY_BREAK 0x1
#endif
@ -127,8 +130,6 @@ DECLARE_HANDLE(HRAWINPUT);
#ifdef FREE_WINDOWS
#define NEED_RAW_PROC
typedef BOOL (WINAPI * LPFNDLLRRID)(RAWINPUTDEVICE*,UINT, UINT);
#define RegisterRawInputDevices(pRawInputDevices, uiNumDevices, cbSize) ((pRegisterRawInputDevices)?pRegisterRawInputDevices(pRawInputDevices, uiNumDevices, cbSize):0)
typedef UINT (WINAPI * LPFNDLLGRID)(HRAWINPUT, UINT, LPVOID, PUINT, UINT);
#define GetRawInputData(hRawInput, uiCommand, pData, pcbSize, cbSizeHeader) ((pGetRawInputData)?pGetRawInputData(hRawInput, uiCommand, pData, pcbSize, cbSizeHeader):(UINT)-1)

@ -700,19 +700,24 @@ GHOST_SystemX11::processEvent(XEvent *xe)
case EnterNotify:
case LeaveNotify:
{
// XCrossingEvents pointer leave enter window.
// also do cursor move here, MotionNotify only
// happens when motion starts & ends inside window
/* XCrossingEvents pointer leave enter window.
also do cursor move here, MotionNotify only
happens when motion starts & ends inside window.
we only do moves when the crossing mode is 'normal'
(really crossing between windows) since some windowmanagers
also send grab/ungrab crossings for mousewheel events.
*/
XCrossingEvent &xce = xe->xcrossing;
g_event = new
GHOST_EventCursor(
getMilliSeconds(),
GHOST_kEventCursorMove,
window,
xce.x_root,
xce.y_root
);
if( xce.mode == NotifyNormal ) {
g_event = new
GHOST_EventCursor(
getMilliSeconds(),
GHOST_kEventCursorMove,
window,
xce.x_root,
xce.y_root
);
}
break;
}
case MapNotify:

@ -307,6 +307,15 @@ GHOST_WindowWin32::GHOST_WindowWin32(
}
}
if (parentwindowhwnd != 0) {
RAWINPUTDEVICE device = {0};
device.usUsagePage = 0x01; /* usUsagePage & usUsage for keyboard*/
device.usUsage = 0x06; /* http://msdn.microsoft.com/en-us/windows/hardware/gg487473.aspx */
device.dwFlags |= RIDEV_INPUTSINK; // makes WM_INPUT is visible for ghost when has parent window
device.hwndTarget = m_hWnd;
RegisterRawInputDevices(&device, 1, sizeof(device));
}
m_wintab = ::LoadLibrary("Wintab32.dll");
if (m_wintab) {
GHOST_WIN32_WTInfo fpWTInfo = ( GHOST_WIN32_WTInfo ) ::GetProcAddress( m_wintab, "WTInfoA" );

@ -370,7 +370,7 @@ MT_Vector3 IK_QSphericalSegment::Axis(int dof) const
void IK_QSphericalSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
if (lmin >= lmax)
if (lmin > lmax)
return;
if (axis == 1) {
@ -613,7 +613,7 @@ void IK_QRevoluteSegment::UpdateAngleApply()
void IK_QRevoluteSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
if (lmin >= lmax || m_axis != axis)
if (lmin > lmax || m_axis != axis)
return;
// clamp and convert to axis angle parameters
@ -752,7 +752,7 @@ void IK_QSwingSegment::UpdateAngleApply()
void IK_QSwingSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
if (lmin >= lmax)
if (lmin > lmax)
return;
// clamp and convert to axis angle parameters
@ -898,7 +898,7 @@ void IK_QElbowSegment::UpdateAngleApply()
void IK_QElbowSegment::SetLimit(int axis, MT_Scalar lmin, MT_Scalar lmax)
{
if (lmin >= lmax)
if (lmin > lmax)
return;
// clamp and convert to axis angle parameters

@ -1,22 +1,22 @@
# common stuff
LDFLAGS_COMMON = -lfftw3 #-lglut -lglu32 -lopengl32 -lz -lpng
CFLAGS_COMMON = -c -Wall -I./ #-I/cygdrive/c/lib/glvu/include -D_WIN32
CC = g++
CFLAGS = ${CFLAGS_COMMON} -O3 -Wno-unused
LDFLAGS = ${LDFLAGS_COMMON}
EXECUTABLE = noiseFFT
SOURCES = noiseFFT.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
# common stuff
LDFLAGS_COMMON = -lfftw3 #-lglut -lglu32 -lopengl32 -lz -lpng
CFLAGS_COMMON = -c -Wall -I./ #-I/cygdrive/c/lib/glvu/include -D_WIN32
CC = g++
CFLAGS = ${CFLAGS_COMMON} -O3 -Wno-unused
LDFLAGS = ${LDFLAGS_COMMON}
EXECUTABLE = noiseFFT
SOURCES = noiseFFT.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)

@ -1,23 +1,23 @@
CC = g++
LDFLAGS = -lz -lpng
CFLAGS = -O3 -Wno-unused -c -Wall -I./ -D_WIN32
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
CC = g++
LDFLAGS = -lz -lpng
CFLAGS = -O3 -Wno-unused -c -Wall -I./ -D_WIN32
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)

@ -1,23 +1,23 @@
CC = g++
LDFLAGS = -lz -lpng -fopenmp -lgomp
CFLAGS = -c -Wall -I./ -fopenmp -DPARALLEL=1 -O3 -Wno-unused
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
CC = g++
LDFLAGS = -lz -lpng -fopenmp -lgomp
CFLAGS = -c -Wall -I./ -fopenmp -DPARALLEL=1 -O3 -Wno-unused
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)

@ -1,35 +1,35 @@
CC = g++
# uncomment the other two OPENMP_... lines, if your gcc supports OpenMP
#OPENMP_FLAGS = -fopenmp -DPARALLEL=1 -I/opt/gcc-4.3/usr/local/include
#OPENMPLD_FLAGS = -fopenmp -lgomp -I/opt/gcc-4.3/usr/local/lib
OPENMP_FLAGS =
OPENMPLD_FLAGS =
# assumes MacPorts libpng installation
PNG_INCLUDE = -I/opt/local/include
PNG_LIBS = -I/opt/local/lib
LDFLAGS = $(PNG_LIBS)-lz -lpng $(OPENMPLD_FLAGS)
CFLAGS = -c -Wall -I./ $(PNG_INCLUDE) $(OPENMP_FLAGS) -O3 -Wno-unused
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)
CC = g++
# uncomment the other two OPENMP_... lines, if your gcc supports OpenMP
#OPENMP_FLAGS = -fopenmp -DPARALLEL=1 -I/opt/gcc-4.3/usr/local/include
#OPENMPLD_FLAGS = -fopenmp -lgomp -I/opt/gcc-4.3/usr/local/lib
OPENMP_FLAGS =
OPENMPLD_FLAGS =
# assumes MacPorts libpng installation
PNG_INCLUDE = -I/opt/local/include
PNG_LIBS = -I/opt/local/lib
LDFLAGS = $(PNG_LIBS)-lz -lpng $(OPENMPLD_FLAGS)
CFLAGS = -c -Wall -I./ $(PNG_INCLUDE) $(OPENMP_FLAGS) -O3 -Wno-unused
EXECUTABLE = FLUID_3D
SOURCES = main.cpp FLUID_3D.cpp FLUID_3D_SOLVERS.cpp FLUID_3D_STATIC.cpp SPHERE.cpp WTURBULENCE.cpp
OBJECTS = $(SOURCES:.cpp=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
SPHERE.o: SPHERE.h
FLUID_3D.o: FLUID_3D.h FLUID_3D.cpp
FLUID_3D_SOLVERS.o: FLUID_3D.h FLUID_3D_SOLVERS.cpp
main.o: FLUID_3D.h FLUID_3D.cpp FLUID_3D_SOLVERS.cpp
clean:
rm -f *.o $(EXECUTABLE_LOADER) $(EXECUTABLE)

@ -1,18 +1,18 @@
# This is a Blender Environment Variable config file.
#
# Comment lines start with "#", other lines will be split at the "="
# and the part before will be used as env var name and the part after
# as env var value. The value can make reference to previous or
# prelaunch variables with "%%" and the content will be replaced.
# Once set, values of variables will not be overwritten.
#
# BLENDER_SHARE should be COMMON_APPDATA\\Blender Foundation\\Blender for typical installs.
# BLENDER_VERSION will be set by the program before processing this file.
BLENDER_USER_BASE=%USERPROFILE%\\Blender Foundation\\Blender\\%BLENDER_VERSION%
BLENDER_SYSTEM_BASE=%BLENDER_SHARE%\\%BLENDER_VERSION%
BLENDER_USER_DATAFILES=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\datafiles
BLENDER_SYSTEM_DATAFILES=%BLENDER_SHARE%\\%BLENDER_VERSION%\\datafiles
BLENDER_USER_PY=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\py
BLENDER_SYSTEM_PY=%BLENDER_SHARE%\\%BLENDER_VERSION%\\py
BLENDER_USER_PLUGINS=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\plugins
BLENDER_SYSTEM_PLUGINS=%BLENDER_SHARE%\\%BLENDER_VERSION%\\plugins
# This is a Blender Environment Variable config file.
#
# Comment lines start with "#", other lines will be split at the "="
# and the part before will be used as env var name and the part after
# as env var value. The value can make reference to previous or
# prelaunch variables with "%%" and the content will be replaced.
# Once set, values of variables will not be overwritten.
#
# BLENDER_SHARE should be COMMON_APPDATA\\Blender Foundation\\Blender for typical installs.
# BLENDER_VERSION will be set by the program before processing this file.
BLENDER_USER_BASE=%USERPROFILE%\\Blender Foundation\\Blender\\%BLENDER_VERSION%
BLENDER_SYSTEM_BASE=%BLENDER_SHARE%\\%BLENDER_VERSION%
BLENDER_USER_DATAFILES=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\datafiles
BLENDER_SYSTEM_DATAFILES=%BLENDER_SHARE%\\%BLENDER_VERSION%\\datafiles
BLENDER_USER_PY=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\py
BLENDER_SYSTEM_PY=%BLENDER_SHARE%\\%BLENDER_VERSION%\\py
BLENDER_USER_PLUGINS=%USERPROFILE%\\Blender Foundation\\%BLENDER_VERSION%\\plugins
BLENDER_SYSTEM_PLUGINS=%BLENDER_SHARE%\\%BLENDER_VERSION%\\plugins

@ -144,6 +144,9 @@ def resolve_ncase(path):
dirpath = os.path.dirname(dirpath)
if not os.path.exists(dirpath):
if dirpath == path:
return path, False
dirpath, found = _ncase_path_found(dirpath)
if not found:

@ -35,6 +35,7 @@ import addon_utils as _addon_utils
_script_module_dirs = "startup", "modules"
def _test_import(module_name, loaded_modules):
use_time = _bpy.app.debug

@ -0,0 +1,31 @@
# ##### 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>
"""
Utility modules assosiated with the bpy module.
"""
__all__ = (
"object_utils",
"io_utils",
"image_utils",
"mesh_utils",
"view3d_utils",
)

@ -67,6 +67,86 @@ class ImportHelper:
return {'RUNNING_MODAL'}
# Axis conversion function, not pretty LUT
# use lookup tabes to convert between any axis
_axis_convert_matrix = (
((-1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, 1.0)),
((-1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, -1.0, 0.0)),
((-1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, 1.0, 0.0)),
((-1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, -1.0)),
((0.0, -1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, -1.0), (1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, 1.0), (-1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
((0.0, 0.0, -1.0), (-1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, -1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
((0.0, 0.0, 1.0), (-1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, -1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, 1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
((0.0, 1.0, 0.0), (0.0, 0.0, -1.0), (-1.0, 0.0, 0.0)),
((0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 0.0, 0.0)),
((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
((1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, -1.0)),
((1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)),
((1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, -1.0, 0.0)),
)
# store args as a single int
# (X Y Z -X -Y -Z) --> (0, 1, 2, 3, 4, 5)
# each value is ((src_forward, src_up), (dst_forward, dst_up))
# where all 4 values are or'd into a single value...
# (i1<<0 | i1<<3 | i1<<6 | i1<<9)
_axis_convert_lut = (
{0x5c, 0x9a, 0x119, 0x15d, 0x20b, 0x2a2, 0x2c8, 0x365, 0x413, 0x46c, 0x4d0, 0x529, 0x644, 0x682, 0x701, 0x745, 0x823, 0x88a, 0x8e0, 0x94d, 0xa2b, 0xa54, 0xae8, 0xb11},
{0x9c, 0xac, 0x159, 0x169, 0x22b, 0x2e8, 0x40b, 0x465, 0x4c8, 0x522, 0x684, 0x694, 0x741, 0x751, 0x813, 0x8d0, 0xa23, 0xa4d, 0xae0, 0xb0a},
{0x99, 0xa9, 0x15c, 0x16c, 0x213, 0x2d0, 0x423, 0x44a, 0x4e0, 0x50d, 0x681, 0x691, 0x744, 0x754, 0x82b, 0x8e8, 0xa0b, 0xa62, 0xac8, 0xb25},
{0x59, 0x85, 0x11c, 0x142, 0x223, 0x28d, 0x2e0, 0x34a, 0x42b, 0x469, 0x4e8, 0x52c, 0x641, 0x69d, 0x704, 0x75a, 0x80b, 0x8a5, 0x8c8, 0x962, 0xa13, 0xa51, 0xad0, 0xb14},
{0xa5, 0x162, 0x21c, 0x285, 0x2d9, 0x342, 0x463, 0x46b, 0x520, 0x528, 0x68d, 0x74a, 0x804, 0x89d, 0x8c1, 0x95a, 0xa4b, 0xa53, 0xb08, 0xb10},
{0x4b, 0x53, 0x108, 0x110, 0x29c, 0x2ac, 0x359, 0x369, 0x41a, 0x422, 0x4dd, 0x4e5, 0x663, 0x66b, 0x720, 0x728, 0x884, 0x894, 0x941, 0x951, 0xa02, 0xa0a, 0xac5, 0xacd},
{0x63, 0x6b, 0x120, 0x128, 0x299, 0x2a9, 0x35c, 0x36c, 0x405, 0x40d, 0x4c2, 0x4ca, 0x64b, 0x653, 0x708, 0x710, 0x881, 0x891, 0x944, 0x954, 0xa1d, 0xa25, 0xada, 0xae2},
{0x8a, 0x14d, 0x219, 0x29a, 0x2dc, 0x35d, 0x44b, 0x453, 0x508, 0x510, 0x6a2, 0x765, 0x801, 0x882, 0x8c4, 0x945, 0xa63, 0xa6b, 0xb20, 0xb28},
{0x5a, 0x62, 0x8b, 0x11d, 0x125, 0x148, 0x22c, 0x28b, 0x293, 0x2e9, 0x348, 0x350, 0x41c, 0x42c, 0x45a, 0x4d9, 0x4e9, 0x51d, 0x642, 0x64a, 0x6a3, 0x705, 0x70d, 0x760, 0x814, 0x8a3, 0x8ab, 0x8d1, 0x960, 0x968, 0xa04, 0xa14, 0xa42, 0xac1, 0xad1, 0xb05},
{0x54, 0xab, 0x111, 0x168, 0x21d, 0x225, 0x2da, 0x2e2, 0x45c, 0x519, 0x66c, 0x693, 0x729, 0x750, 0x805, 0x80d, 0x8c2, 0x8ca, 0xa44, 0xb01},
{0x51, 0x93, 0x114, 0x150, 0x202, 0x20a, 0x2c5, 0x2cd, 0x459, 0x51c, 0x669, 0x6ab, 0x72c, 0x768, 0x81a, 0x822, 0x8dd, 0x8e5, 0xa41, 0xb04},
{0x45, 0x4d, 0xa3, 0x102, 0x10a, 0x160, 0x229, 0x2a3, 0x2ab, 0x2ec, 0x360, 0x368, 0x419, 0x429, 0x445, 0x4dc, 0x4ec, 0x502, 0x65d, 0x665, 0x68b, 0x71a, 0x722, 0x748, 0x811, 0x88b, 0x893, 0x8d4, 0x948, 0x950, 0xa01, 0xa11, 0xa5d, 0xac4, 0xad4, 0xb1a},
{0x5d, 0x65, 0xa0, 0x11a, 0x122, 0x163, 0x214, 0x2a0, 0x2a8, 0x2d1, 0x363, 0x36b, 0x404, 0x414, 0x45d, 0x4c1, 0x4d1, 0x51a, 0x645, 0x64d, 0x688, 0x702, 0x70a, 0x74b, 0x82c, 0x888, 0x890, 0x8e9, 0x94b, 0x953, 0xa1c, 0xa2c, 0xa45, 0xad9, 0xae9, 0xb02},
{0x6c, 0x90, 0x129, 0x153, 0x21a, 0x222, 0x2dd, 0x2e5, 0x444, 0x501, 0x654, 0x6a8, 0x711, 0x76b, 0x802, 0x80a, 0x8c5, 0x8cd, 0xa5c, 0xb19},
{0x69, 0xa8, 0x12c, 0x16b, 0x205, 0x20d, 0x2c2, 0x2ca, 0x441, 0x504, 0x651, 0x690, 0x714, 0x753, 0x81d, 0x825, 0x8da, 0x8e2, 0xa59, 0xb1c},
{0x42, 0x4a, 0x88, 0x105, 0x10d, 0x14b, 0x211, 0x288, 0x290, 0x2d4, 0x34b, 0x353, 0x401, 0x411, 0x442, 0x4c4, 0x4d4, 0x505, 0x65a, 0x662, 0x6a0, 0x71d, 0x725, 0x763, 0x829, 0x8a0, 0x8a8, 0x8ec, 0x963, 0x96b, 0xa19, 0xa29, 0xa5a, 0xadc, 0xaec, 0xb1d},
{0xa2, 0x165, 0x204, 0x282, 0x2c1, 0x345, 0x448, 0x450, 0x50b, 0x513, 0x68a, 0x74d, 0x81c, 0x89a, 0x8d9, 0x95d, 0xa60, 0xa68, 0xb23, 0xb2b},
{0x60, 0x68, 0x123, 0x12b, 0x284, 0x294, 0x341, 0x351, 0x41d, 0x425, 0x4da, 0x4e2, 0x648, 0x650, 0x70b, 0x713, 0x89c, 0x8ac, 0x959, 0x969, 0xa05, 0xa0d, 0xac2, 0xaca},
{0x48, 0x50, 0x10b, 0x113, 0x281, 0x291, 0x344, 0x354, 0x402, 0x40a, 0x4c5, 0x4cd, 0x660, 0x668, 0x723, 0x72b, 0x899, 0x8a9, 0x95c, 0x96c, 0xa1a, 0xa22, 0xadd, 0xae5},
{0x8d, 0x14a, 0x201, 0x29d, 0x2c4, 0x35a, 0x460, 0x468, 0x523, 0x52b, 0x6a5, 0x762, 0x819, 0x885, 0x8dc, 0x942, 0xa48, 0xa50, 0xb0b, 0xb13},
{0x44, 0x9d, 0x101, 0x15a, 0x220, 0x2a5, 0x2e3, 0x362, 0x428, 0x454, 0x4eb, 0x511, 0x65c, 0x685, 0x719, 0x742, 0x808, 0x88d, 0x8cb, 0x94a, 0xa10, 0xa6c, 0xad3, 0xb29},
{0x84, 0x94, 0x141, 0x151, 0x210, 0x2d3, 0x420, 0x462, 0x4e3, 0x525, 0x69c, 0x6ac, 0x759, 0x769, 0x828, 0x8eb, 0xa08, 0xa4a, 0xacb, 0xb0d},
{0x81, 0x91, 0x144, 0x154, 0x228, 0x2eb, 0x408, 0x44d, 0x4cb, 0x50a, 0x699, 0x6a9, 0x75c, 0x76c, 0x810, 0x8d3, 0xa20, 0xa65, 0xae3, 0xb22},
)
_axis_convert_num = {'X': 0, 'Y': 1, 'Z': 2, '-X': 3, '-Y': 4, '-Z': 5}
def axis_conversion(from_forward='Y', from_up='Z', to_forward='Y', to_up='Z'):
"""
Each argument us an axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z']
where the first 2 are a source and the second 2 are the target.
"""
from mathutils import Matrix
from functools import reduce
if from_forward == to_forward and from_up == to_up:
return Matrix().to_3x3()
value = reduce(int.__or__, (_axis_convert_num[a] << (i * 3) for i, a in enumerate((from_forward, from_up, to_forward, to_up))))
for i, axis_lut in enumerate(_axis_convert_lut):
if value in axis_lut:
return Matrix(_axis_convert_matrix[i])
assert("internal error")
# limited replacement for BPyImage.comprehensiveImageLoad
def load_image(imagepath, dirname):
import os
@ -198,7 +278,7 @@ def path_reference(filepath, base_src, base_dst, mode='AUTO', copy_subdir="", co
def path_reference_copy(copy_set, report=print):
"""
Execute copying files of path_reference
:arg copy_set: set of (from, to) pairs to copy.
:type copy_set: set
:arg report: function used for reporting warnings, takes a string argument.

@ -0,0 +1,93 @@
# ##### 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>
def region_2d_to_vector_3d(region, rv3d, coord):
"""
Return a direction vector from the viewport at the spesific 2d region
coordinate.
:arg region: region of the 3D viewport, typically bpy.context.region.
:type region: :class:`Region`
:arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
:type rv3d: :class:`RegionView3D`
:arg coord: 2d coordinates relative to the region;
(event.mouse_region_x, event.mouse_region_y) for example.
:type coord: 2d vector
:return: normalized 3d vector.
:rtype: :class:`Vector`
"""
from mathutils import Vector
dx = (2.0 * coord[0] / region.width) - 1.0
dy = (2.0 * coord[1] / region.height) - 1.0
viewvec = rv3d.view_matrix.inverted()[2].to_3d().normalized()
perspinv_x, perspinv_y = rv3d.perspective_matrix.inverted().to_3x3()[0:2]
return ((perspinv_x * dx + perspinv_y * dy) - viewvec).normalized()
def region_2d_to_location_3d(region, rv3d, coord, depth_location):
"""
Return a 3d location from the region relative 2d coords, aligned with
*depth_location*.
:arg region: region of the 3D viewport, typically bpy.context.region.
:type region: :class:`Region`
:arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
:type rv3d: :class:`RegionView3D`
:arg coord: 2d coordinates relative to the region;
(event.mouse_region_x, event.mouse_region_y) for example.
:type coord: 2d vector
:arg depth_location: the returned vectors depth is aligned with this since
there is no defined depth with a 2d region input.
:type depth_location: 3d vector
:return: normalized 3d vector.
:rtype: :class:`Vector`
"""
from mathutils.geometry import intersect_point_line
origin_start = rv3d.view_matrix.inverted()[3].to_3d()
origin_end = origin_start + region_2d_to_vector_3d(region, rv3d, coord)
return intersect_point_line(depth_location, origin_start, origin_end)[0]
def location_3d_to_region_2d(region, rv3d, coord):
"""
Return the *region* relative 2d location of a 3d position.
:arg region: region of the 3D viewport, typically bpy.context.region.
:type region: :class:`Region`
:arg rv3d: 3D region data, typically bpy.context.space_data.region_3d.
:type rv3d: :class:`RegionView3D`
:arg coord: 3d worldspace location.
:type coord: 3d vector
:return: 2d location
:rtype: :class:`Vector`
"""
prj = Vector((coord[0], coord[1], coord[2], 1.0)) * rv3d.perspective_matrix
if prj.w > 0.0:
width_half = region.width / 2.0
height_half = region.height / 2.0
return Vector((width_half + width_half * (prj.x / prj.w),
height_half + height_half * (prj.y / prj.w),
))
else:
return None

@ -132,7 +132,7 @@ class AddTorus(bpy.types.Operator):
mesh.faces.foreach_set("vertices_raw", faces)
mesh.update()
import add_object_utils
add_object_utils.object_data_add(context, mesh, operator=self)
from bpy_extras import object_utils
object_utils.object_data_add(context, mesh, operator=self)
return {'FINISHED'}

@ -102,7 +102,8 @@ def register():
('Render', "Render", ""),
('Rigging', "Rigging", ""),
('Text Editor', "Text Editor", ""),
('System', "System", "")
('System', "System", ""),
('Other', "Other", ""),
],
name="Category",
description="Filter add-ons by category",

@ -127,6 +127,7 @@ class DATA_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
col.prop(cam, "show_mist", text="Mist")
col.prop(cam, "show_title_safe", text="Title Safe")
col.prop(cam, "show_name", text="Name")
col.prop_menu_enum(cam, "show_guide")
col = split.column()
col.prop(cam, "draw_size", text="Size")

@ -39,6 +39,17 @@ class DATA_PT_empty(DataButtonsPanel, bpy.types.Panel):
ob = context.object
layout.prop(ob, "empty_draw_type", text="Display")
if ob.empty_draw_type == 'IMAGE':
# layout.template_image(ob, "data", None)
layout.template_ID(ob, "data", open="image.open", unlink="image.unlink")
row = layout.row(align = True)
row.prop(ob, "color", text="Transparency", index=3, slider=True)
row = layout.row(align = True)
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
layout.prop(ob, "empty_draw_size", text="Size")
if __name__ == "__main__": # only for live edit.

@ -46,6 +46,8 @@ class MESH_MT_shape_key_specials(bpy.types.Menu):
layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal
layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal
layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
op = layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix")
op.from_mix = True
class MeshButtonsPanel():
@ -193,7 +195,8 @@ class DATA_PT_shape_keys(MeshButtonsPanel, bpy.types.Panel):
col = row.column()
sub = col.column(align=True)
sub.operator("object.shape_key_add", icon='ZOOMIN', text="")
op = sub.operator("object.shape_key_add", icon='ZOOMIN', text="")
op.from_mix = False
sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="")
sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="")

@ -219,7 +219,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.label(text="Texture Coordinates:")
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coordinate_object", text="Object")
layout.prop(md, "texture_coords_object", text="Object")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
@ -673,9 +673,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coordinate_object", text="Object")
layout.prop(md, "texture_coords_object", text="Object")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_object(md, "uv_layer", ob.data, "uv_textures")
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
def WAVE(self, layout, ob, md):
split = layout.split()

@ -436,7 +436,8 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
def poll(cls, context):
rd = context.scene.render
sima = context.space_data
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
# display even when not in game mode because these settings effect the 3d view
return (sima and sima.image) # and (rd.engine == 'BLENDER_GAME')
def draw(self, context):
layout = self.layout

@ -213,6 +213,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu):
layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
class SEQUENCER_MT_strip(bpy.types.Menu):
@ -391,7 +392,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel):
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'PLUGIN',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
'MULTICAM'}
'MULTICAM', 'ADJUSTMENT'}
def draw(self, context):
layout = self.layout
@ -530,7 +531,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, bpy.types.Panel):
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'PLUGIN',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
'MULTICAM', 'SPEED'}
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
def draw(self, context):
layout = self.layout
@ -680,7 +681,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel):
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'PLUGIN',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
'MULTICAM', 'SPEED'}
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
def draw(self, context):
layout = self.layout

@ -129,6 +129,7 @@ class TEXT_PT_find(bpy.types.Panel):
layout.operator("text.mark_all")
# settings
layout.prop(st, "use_match_case")
row = layout.row()
row.prop(st, "use_find_wrap", text="Wrap")
row.prop(st, "use_find_all", text="All")

@ -2024,6 +2024,9 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel):
elif not view.lock_object:
col.prop(view, "lock_cursor", text="Lock to Cursor")
col = layout.column()
col.prop(view, "lock_camera")
col = layout.column(align=True)
col.label(text="Clip:")
col.prop(view, "clip_start", text="Start")

@ -12,7 +12,7 @@ def write_some_data(context, filepath, use_some_setting):
# ExportHelper is a helper class, defines filename and
# invoke() function which calls the file selector.
from io_utils import ExportHelper
from bpy_extras.io_utils import ExportHelper
from bpy.props import StringProperty, BoolProperty, EnumProperty

@ -80,8 +80,8 @@ class AddBox(bpy.types.Operator):
mesh.update()
# add the mesh as an object into the scene with this utility module
import add_object_utils
add_object_utils.object_data_add(context, mesh, operator=self)
from bpy_extras import object_utils
object_utils.object_data_add(context, mesh, operator=self)
return {'FINISHED'}

@ -1,261 +1,261 @@
;
; $Id$
;
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
;
SetCompressor /SOLID lzma
Name "Blender [VERSION]"
RequestExecutionLevel admin
!include "MUI.nsh"
!include "WinVer.nsh"
!include "FileFunc.nsh"
!include "WordFunc.nsh"
!include "nsDialogs.nsh"
!include "x64.nsh"
!define MUI_ABORTWARNING
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Blender. It is recommended that you close all other applications before starting Setup."
!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "[RELDIR]\00.header.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
Page custom DataLocation DataLocationOnLeave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro Locate
!insertmacro VersionCompare
Icon "[RELDIR]\00.installer.ico"
UninstallIcon "[RELDIR]\00.installer.ico"
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_InstallFiles ${LANG_ENGLISH} "Copy all required files to the application folder."
LangString DESC_StartMenu ${LANG_ENGLISH} "Add shortcut items to the Start Menu. (Recommended)"
LangString DESC_DesktopShortcut ${LANG_ENGLISH} "Add a shortcut to Blender on your desktop."
LangString DESC_BlendRegister ${LANG_ENGLISH} "Blender can register itself with .blend files to allow double-clicking from Windows Explorer, etc."
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Specify User Data Location"
;--------------------------------
;Data
Caption "Blender [VERSION] Installer"
OutFile "[DISTDIR]\..\blender-[VERSION]-windows[BITNESS].exe"
InstallDir $INSTDIR ; $INSTDIR is set inside .onInit
BrandingText "Blender Foundation | http://www.blender.org"
ComponentText "This will install Blender [VERSION] on your computer."
DirText "Use the field below to specify the folder where you want Blender to be copied to. To specify a different folder, type a new name or use the Browse button to select an existing folder."
SilentUnInstall normal
Var BLENDERHOME
Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
; Custom controls
Var HWND
Var HWND_APPDATA
Var HWND_INSTDIR
Var HWND_HOMEDIR
Function .onInit
ClearErrors
StrCpy $SHORTVERSION "[SHORTVERSION]"
${If} ${RunningX64}
${If} "[BITNESS]" == "32"
${OrIf} "[BITNESS]" == "-mingw"
StrCpy $INSTDIR "$PROGRAMFILES32\Blender Foundation\Blender" ; Can't use InstallDir inside Section
${ElseIf} "[BITNESS]" == "64"
StrCpy $INSTDIR "$PROGRAMFILES64\Blender Foundation\Blender"
${EndIf}
${Else}
StrCpy $INSTDIR "$PROGRAMFILES\Blender Foundation\Blender"
${EndIf}
FunctionEnd
Function un.onInit
FunctionEnd
Function DataLocation
nsDialogs::Create /NOUNLOAD 1018
Pop $HWND
${If} $HWND == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 24u "Please specify where you wish to install Blender's user data files. Be aware that if you choose to use your Application Data directory, your preferences and scripts will only be accessible by the current user account."
${NSD_CreateRadioButton} 0 50 100% 12u "Use Application Data directory (recommended)"
Pop $HWND_APPDATA
${NSD_CreateRadioButton} 0 80 100% 12u "Use installation directory"
Pop $HWND_INSTDIR
${NSD_CreateRadioButton} 0 110 100% 12u "I have defined a %HOME% variable, please install files there"
Pop $HWND_HOMEDIR
${If} ${AtMostWinME}
GetDlgItem $0 $HWND $HWND_APPDATA
EnableWindow $0 0
SendMessage $HWND_INSTDIR ${BM_SETCHECK} 1 0
${Else}
SendMessage $HWND_APPDATA ${BM_SETCHECK} 1 0
${EndIf}
nsDialogs::Show
FunctionEnd
Function DataLocationOnLeave
${NSD_GetState} $HWND_APPDATA $R0
${If} $R0 == "1"
SetShellVarContext current
StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
SetShellVarContext all
${Else}
${NSD_GetState} $HWND_INSTDIR $R0
${If} $R0 == "1"
StrCpy $BLENDERHOME $INSTDIR
${Else}
${NSD_GetState} $HWND_HOMEDIR $R0
${If} $R0 == "1"
ReadEnvStr $BLENDERHOME "HOME"
${EndIf}
${EndIf}
${EndIf}
FunctionEnd
Section "Blender [VERSION] (required)" InstallFiles
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; The contents of Blender installation root dir
[ROOTDIRCONTS]
; All datafiles (python, scripts, config)
[DODATAFILES]
SetOutPath $INSTDIR
${If} ${RunningX64}
SetRegView 64
${EndIf}
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir" "$BLENDERHOME"
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "Publisher" "Blender Foundation"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "URLInfoAbout" "http://www.blender.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayVersion" "[VERSION]"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayIcon" "$INSTDIR\blender.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoRepair " 1
WriteUninstaller "uninstall.exe"
SectionEnd
Section "Add Start Menu Shortcuts" StartMenu
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\"
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Blender.lnk" "$INSTDIR\Blender.exe" "" "$INSTDIR\blender.exe" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\readme.html" "" "" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Copyright.lnk" "$INSTDIR\Copyright.txt" "" "$INSTDIR\copyright.txt" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\GPL-license.lnk" "$INSTDIR\GPL-license.txt" "" "$INSTDIR\GPL-license.txt" 0
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
SectionEnd
Section "Add Desktop Shortcut" DesktopShortcut
CreateShortCut "$DESKTOP\Blender.lnk" "$INSTDIR\blender.exe" "" "$INSTDIR\blender.exe" 0
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
SectionEnd
Section "Open .blend files with Blender" BlendRegister
ExecWait '"$INSTDIR\blender.exe" -r'
SectionEnd
UninstallText "This will uninstall Blender [VERSION], and all installed files. Before continuing make sure you have created backup of all the files you may want to keep: startup.blend, bookmarks.txt, recent-files.txt. Hit 'Uninstall' to continue."
Section "Uninstall"
; Remove registry keys
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir"
ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
DeleteRegKey HKCR ".blend"
DeleteRegKey HKCR "blendfile"
DeleteRegKey HKCR "CLSID\{D45F043D-F17F-4e8a-8435-70971D9FA46D}"
SetShellVarContext all
; Remove files
[DELROOTDIRCONTS]
Delete "$INSTDIR\uninstall.exe"
MessageBox MB_YESNO "Recursively erase contents of $BLENDERHOME\$SHORTVERSION\scripts? NOTE: This includes all installed scripts and *any* file and directory you have manually created, installed later or copied. This also including .blend files." IDNO NextNoScriptRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\scripts"
NextNoScriptRemove:
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\config? NOTE: This includes your startup.blend, bookmarks and any other file and directory you may have created in that directory" IDNO NextNoConfigRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\config"
NextNoConfigRemove:
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\plugins? NOTE: This includes files and subdirectories in this directory" IDNO NextNoPluginRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\plugins"
NextNoPluginRemove:
; Try to remove dirs, but leave them if they contain anything
RMDir "$BLENDERHOME\$SHORTVERSION\plugins"
RMDir "$BLENDERHOME\$SHORTVERSION\config"
RMDir "$BLENDERHOME\$SHORTVERSION\scripts"
RMDir "$BLENDERHOME\$SHORTVERSION"
RMDir "$BLENDERHOME"
; Remove shortcuts
Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
Delete "$DESKTOP\Blender.lnk"
; Remove all link related directories and files
RMDir /r "$SMPROGRAMS\Blender Foundation"
; Clear out installation dir
RMDir /r "$INSTDIR"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; Refresh icons
SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${InstallFiles} $(DESC_InstallFiles)
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(DESC_StartMenu)
!insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortcut} $(DESC_DesktopShortcut)
!insertmacro MUI_DESCRIPTION_TEXT ${BlendRegister} $(DESC_BlendRegister)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;
; $Id$
;
; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
;
SetCompressor /SOLID lzma
Name "Blender [VERSION]"
RequestExecutionLevel admin
!include "MUI.nsh"
!include "WinVer.nsh"
!include "FileFunc.nsh"
!include "WordFunc.nsh"
!include "nsDialogs.nsh"
!include "x64.nsh"
!define MUI_ABORTWARNING
!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Blender. It is recommended that you close all other applications before starting Setup."
!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "[RELDIR]\00.header.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
Page custom DataLocation DataLocationOnLeave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro Locate
!insertmacro VersionCompare
Icon "[RELDIR]\00.installer.ico"
UninstallIcon "[RELDIR]\00.installer.ico"
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_InstallFiles ${LANG_ENGLISH} "Copy all required files to the application folder."
LangString DESC_StartMenu ${LANG_ENGLISH} "Add shortcut items to the Start Menu. (Recommended)"
LangString DESC_DesktopShortcut ${LANG_ENGLISH} "Add a shortcut to Blender on your desktop."
LangString DESC_BlendRegister ${LANG_ENGLISH} "Blender can register itself with .blend files to allow double-clicking from Windows Explorer, etc."
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Specify User Data Location"
;--------------------------------
;Data
Caption "Blender [VERSION] Installer"
OutFile "[DISTDIR]\..\blender-[VERSION]-windows[BITNESS].exe"
InstallDir $INSTDIR ; $INSTDIR is set inside .onInit
BrandingText "Blender Foundation | http://www.blender.org"
ComponentText "This will install Blender [VERSION] on your computer."
DirText "Use the field below to specify the folder where you want Blender to be copied to. To specify a different folder, type a new name or use the Browse button to select an existing folder."
SilentUnInstall normal
Var BLENDERHOME
Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
; Custom controls
Var HWND
Var HWND_APPDATA
Var HWND_INSTDIR
Var HWND_HOMEDIR
Function .onInit
ClearErrors
StrCpy $SHORTVERSION "[SHORTVERSION]"
${If} ${RunningX64}
${If} "[BITNESS]" == "32"
${OrIf} "[BITNESS]" == "-mingw"
StrCpy $INSTDIR "$PROGRAMFILES32\Blender Foundation\Blender" ; Can't use InstallDir inside Section
${ElseIf} "[BITNESS]" == "64"
StrCpy $INSTDIR "$PROGRAMFILES64\Blender Foundation\Blender"
${EndIf}
${Else}
StrCpy $INSTDIR "$PROGRAMFILES\Blender Foundation\Blender"
${EndIf}
FunctionEnd
Function un.onInit
FunctionEnd
Function DataLocation
nsDialogs::Create /NOUNLOAD 1018
Pop $HWND
${If} $HWND == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 24u "Please specify where you wish to install Blender's user data files. Be aware that if you choose to use your Application Data directory, your preferences and scripts will only be accessible by the current user account."
${NSD_CreateRadioButton} 0 50 100% 12u "Use Application Data directory (recommended)"
Pop $HWND_APPDATA
${NSD_CreateRadioButton} 0 80 100% 12u "Use installation directory"
Pop $HWND_INSTDIR
${NSD_CreateRadioButton} 0 110 100% 12u "I have defined a %HOME% variable, please install files there"
Pop $HWND_HOMEDIR
${If} ${AtMostWinME}
GetDlgItem $0 $HWND $HWND_APPDATA
EnableWindow $0 0
SendMessage $HWND_INSTDIR ${BM_SETCHECK} 1 0
${Else}
SendMessage $HWND_APPDATA ${BM_SETCHECK} 1 0
${EndIf}
nsDialogs::Show
FunctionEnd
Function DataLocationOnLeave
${NSD_GetState} $HWND_APPDATA $R0
${If} $R0 == "1"
SetShellVarContext current
StrCpy $BLENDERHOME "$APPDATA\Blender Foundation\Blender"
SetShellVarContext all
${Else}
${NSD_GetState} $HWND_INSTDIR $R0
${If} $R0 == "1"
StrCpy $BLENDERHOME $INSTDIR
${Else}
${NSD_GetState} $HWND_HOMEDIR $R0
${If} $R0 == "1"
ReadEnvStr $BLENDERHOME "HOME"
${EndIf}
${EndIf}
${EndIf}
FunctionEnd
Section "Blender [VERSION] (required)" InstallFiles
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; The contents of Blender installation root dir
[ROOTDIRCONTS]
; All datafiles (python, scripts, config)
[DODATAFILES]
SetOutPath $INSTDIR
${If} ${RunningX64}
SetRegView 64
${EndIf}
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir" "$BLENDERHOME"
WriteRegStr HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" "[SHORTVERSION]"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayName" "Blender"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "Publisher" "Blender Foundation"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "URLInfoAbout" "http://www.blender.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayVersion" "[VERSION]"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "DisplayIcon" "$INSTDIR\blender.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" "NoRepair " 1
WriteUninstaller "uninstall.exe"
SectionEnd
Section "Add Start Menu Shortcuts" StartMenu
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\"
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Blender.lnk" "$INSTDIR\Blender.exe" "" "$INSTDIR\blender.exe" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\readme.html" "" "" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Copyright.lnk" "$INSTDIR\Copyright.txt" "" "$INSTDIR\copyright.txt" 0
CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\GPL-license.lnk" "$INSTDIR\GPL-license.txt" "" "$INSTDIR\GPL-license.txt" 0
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
SectionEnd
Section "Add Desktop Shortcut" DesktopShortcut
CreateShortCut "$DESKTOP\Blender.lnk" "$INSTDIR\blender.exe" "" "$INSTDIR\blender.exe" 0
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; refresh icons
SectionEnd
Section "Open .blend files with Blender" BlendRegister
ExecWait '"$INSTDIR\blender.exe" -r'
SectionEnd
UninstallText "This will uninstall Blender [VERSION], and all installed files. Before continuing make sure you have created backup of all the files you may want to keep: startup.blend, bookmarks.txt, recent-files.txt. Hit 'Uninstall' to continue."
Section "Uninstall"
; Remove registry keys
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegStr $BLENDERHOME HKLM "SOFTWARE\BlenderFoundation" "ConfigData_Dir"
ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Blender"
DeleteRegKey HKLM "SOFTWARE\BlenderFoundation"
DeleteRegKey HKCR ".blend"
DeleteRegKey HKCR "blendfile"
DeleteRegKey HKCR "CLSID\{D45F043D-F17F-4e8a-8435-70971D9FA46D}"
SetShellVarContext all
; Remove files
[DELROOTDIRCONTS]
Delete "$INSTDIR\uninstall.exe"
MessageBox MB_YESNO "Recursively erase contents of $BLENDERHOME\$SHORTVERSION\scripts? NOTE: This includes all installed scripts and *any* file and directory you have manually created, installed later or copied. This also including .blend files." IDNO NextNoScriptRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\scripts"
NextNoScriptRemove:
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\config? NOTE: This includes your startup.blend, bookmarks and any other file and directory you may have created in that directory" IDNO NextNoConfigRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\config"
NextNoConfigRemove:
MessageBox MB_YESNO "Recursively erase contents from $BLENDERHOME\$SHORTVERSION\plugins? NOTE: This includes files and subdirectories in this directory" IDNO NextNoPluginRemove
RMDir /r "$BLENDERHOME\$SHORTVERSION\plugins"
NextNoPluginRemove:
; Try to remove dirs, but leave them if they contain anything
RMDir "$BLENDERHOME\$SHORTVERSION\plugins"
RMDir "$BLENDERHOME\$SHORTVERSION\config"
RMDir "$BLENDERHOME\$SHORTVERSION\scripts"
RMDir "$BLENDERHOME\$SHORTVERSION"
RMDir "$BLENDERHOME"
; Remove shortcuts
Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*"
Delete "$DESKTOP\Blender.lnk"
; Remove all link related directories and files
RMDir /r "$SMPROGRAMS\Blender Foundation"
; Clear out installation dir
RMDir /r "$INSTDIR"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' ; Refresh icons
SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${InstallFiles} $(DESC_InstallFiles)
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} $(DESC_StartMenu)
!insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortcut} $(DESC_DesktopShortcut)
!insertmacro MUI_DESCRIPTION_TEXT ${BlendRegister} $(DESC_BlendRegister)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

@ -27,7 +27,6 @@
add_subdirectory(blender)
if(WITH_GAMEENGINE)
add_subdirectory(kernel)
add_subdirectory(gameengine)
endif()

@ -4,7 +4,7 @@ Import ('env')
SConscript(['blender/SConscript', 'creator/SConscript'])
if env['WITH_BF_GAMEENGINE']:
SConscript (['kernel/SConscript', 'gameengine/SConscript'])
SConscript (['gameengine/SConscript'])
if env['WITH_BF_PLAYER']:
SConscript (['blenderplayer/bad_level_call_stubs/SConscript'])

@ -91,7 +91,6 @@ add_subdirectory(blenlib)
add_subdirectory(render)
add_subdirectory(blenfont)
add_subdirectory(blenloader)
add_subdirectory(readblenfile)
add_subdirectory(blenpluginapi)
add_subdirectory(ikplugin)
add_subdirectory(gpu)
@ -123,6 +122,5 @@ if(WITH_PYTHON)
endif()
if(WITH_OPENCOLLADA)
add_subdirectory(collada)
add_subdirectory(collada)
endif()

@ -12,7 +12,6 @@ SConscript(['avi/SConscript',
'imbuf/SConscript',
'makesdna/SConscript',
'makesrna/SConscript',
'readblenfile/SConscript',
'render/SConscript',
'nodes/SConscript',
'modifiers/SConscript',

@ -29,7 +29,7 @@ set(INC
../editors/include
../blenkernel
../../../intern/guardedalloc
${GLEW_INCLUDE_PATH}
${GLEW_INCLUDE_PATH}
${FREETYPE_INCLUDE_DIRS}
)

@ -51,6 +51,7 @@
#include "BLF_api.h"
#include "blf_internal_types.h"
#include "blf_internal.h"
static ListBase global_font_dir= { NULL, NULL };
@ -150,6 +151,7 @@ char *blf_dir_search(const char *file)
return(s);
}
#if 0 // UNUSED
int blf_dir_split(const char *str, char *file, int *size)
{
int i, len;
@ -173,6 +175,7 @@ int blf_dir_split(const char *str, char *file, int *size)
}
return(0);
}
#endif
/* Some font have additional file with metrics information,
* in general, the extension of the file is: .afm or .pfm

@ -44,7 +44,7 @@ int blf_utf8_next(unsigned char *buf, int *iindex);
char *blf_dir_search(const char *file);
char *blf_dir_metrics_search(const char *filename);
int blf_dir_split(const char *str, char *file, int *size);
// int blf_dir_split(const char *str, char *file, int *size); // UNUSED
int blf_font_init(void);
void blf_font_exit(void);

@ -53,7 +53,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR b
/* alpha/beta/rc/release, docs use this */
#define BLENDER_VERSION_CYCLE release
#define BLENDER_VERSION_CYCLE beta
struct ListBase;
struct MemFile;

@ -90,8 +90,7 @@ void brush_painter_free(BrushPainter *painter);
unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
/* radial control */
void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br, float size_weight);
int brush_radial_control_exec(struct wmOperator *op, struct Brush *br, float size_weight);
struct ImBuf *brush_gen_radial_control_imbuf(struct Brush *br);
/* unified strength and size */

@ -78,7 +78,6 @@ void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
void curvemapping_initialize(struct CurveMapping *cumap);
void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
void colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile);
void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
void scopes_free(struct Scopes *scopes);

@ -1,60 +0,0 @@
/*
* $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) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BKE_EXOTIC_H
#define BKE_EXOTIC_H
/** \file BKE_exotic.h
* \ingroup bke
* \brief dxf/vrml/stl external file io function prototypes.
* \attention is this used still? Candidate for removal?
*/
struct Mesh;
struct Scene;
/**
* Reads all 3D fileformats other than Blender fileformat
* @retval 0 The file could not be read.
* @retval 1 The file was read succesfully.
* @attention Used in filesel.c
*/
int BKE_read_exotic(struct Scene *scene, const char *name);
/* return codes */
#define BKE_READ_EXOTIC_FAIL_PATH -3 /* file format is not supported */
#define BKE_READ_EXOTIC_FAIL_FORMAT -2 /* file format is not supported */
#define BKE_READ_EXOTIC_FAIL_OPEN -1 /* Can't open the file */
#define BKE_READ_EXOTIC_OK_BLEND 0 /* .blend file */
#define BKE_READ_EXOTIC_OK_OTHER 1 /* other supported formats */
void write_dxf(struct Scene *scene, char *str);
void write_stl(struct Scene *scene, char *str);
#endif

@ -268,6 +268,10 @@ void seq_translate(struct Scene *scene, struct Sequence *seq, int delta);
void seq_sound_init(struct Scene *scene, struct Sequence *seq);
struct Sequence *seq_foreground_frame_get(struct Scene *scene, int frame);
struct ListBase *seq_seqbase(struct ListBase *seqbase, struct Sequence *seq);
struct Sequence *seq_metastrip(
ListBase * seqbase /* = ed->seqbase */,
struct Sequence * meta /* = NULL */, struct Sequence *seq);
void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs);
void seq_dupe_animdata(struct Scene *scene, char *name_from, char *name_to);
int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene);

@ -73,8 +73,8 @@ typedef struct SK_Overdraw
typedef struct SK_DrawData
{
short mval[2];
short previous_mval[2];
int mval[2];
int previous_mval[2];
SK_PType type;
} SK_DrawData;
@ -152,7 +152,7 @@ void sk_endContinuousStroke(SK_Stroke *stk);
void sk_updateNextPoint(SK_Sketch *sketch, SK_Stroke *stk);
void sk_initDrawData(SK_DrawData *dd, const short mval[2]);
void sk_initDrawData(SK_DrawData *dd, const int mval[2]);
void sk_deleteSelectedStrokes(SK_Sketch *sketch);
void sk_selectAllSketch(SK_Sketch *sketch, int mode);

@ -58,7 +58,7 @@ void write_text(struct Text *text, const char *str);
char* txt_to_buf (struct Text *text);
void txt_clean_text (struct Text *text);
void txt_order_cursors (struct Text *text);
int txt_find_string (struct Text *text, char *findstr, int wrap);
int txt_find_string (struct Text *text, char *findstr, int wrap, int match_case);
int txt_has_sel (struct Text *text);
int txt_get_span (struct TextLine *from, struct TextLine *to);
void txt_move_up (struct Text *text, short sel);

@ -53,7 +53,7 @@ set(INC
../../../intern/opennl/extern
../../../intern/smoke/extern
../../../intern/mikktspace
../../../source/blender/windowmanager # XXX - BAD LEVEL CALL WM_api.h
../../../source/blender/windowmanager # XXX - BAD LEVEL CALL WM_api.h
${GLEW_INCLUDE_PATH}
${ZLIB_INCLUDE_DIRS}
)
@ -91,7 +91,6 @@ set(SRC
intern/depsgraph.c
intern/displist.c
intern/effect.c
intern/exotic.c
intern/fcurve.c
intern/fluidsim.c
intern/fmodifier.c
@ -176,7 +175,6 @@ set(SRC
BKE_displist.h
BKE_effect.h
BKE_endian.h
BKE_exotic.h
BKE_fcurve.h
BKE_fluidsim.h
BKE_font.h
@ -279,11 +277,6 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()
if(WITH_LCMS)
list(APPEND INC ${LCMS_INCLUDE_DIR})
add_definitions(-DWITH_LCMS)
endif()
if(WITH_PYTHON)
list(APPEND INC ../python ${PYTHON_INCLUDE_DIRS})
add_definitions(-DWITH_PYTHON)
@ -316,7 +309,7 @@ if(WITH_LZMA)
endif()
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
endif()
blender_add_lib(bf_blenkernel "${SRC}" "${INC}")

@ -78,10 +78,6 @@ if env['OURPLATFORM'] == 'darwin':
if env['BF_NO_ELBEEM']:
defs.append('DISABLE_ELBEEM')
if env['WITH_BF_LCMS']:
defs.append('WITH_LCMS')
incs += ' ' + env['BF_LCMS_INC']
if env['WITH_BF_LZO']:
incs += ' #/extern/lzo/minilzo'
defs.append('WITH_LZO')

@ -831,7 +831,10 @@ void pose_remove_group (Object *ob)
/* now, remove it from the pose */
BLI_freelinkN(&pose->agroups, grp);
pose->active_group= 0;
pose->active_group--;
if(pose->active_group < 0 || pose->agroups.first == NULL) {
pose->active_group= 0;
}
}
}

@ -191,7 +191,7 @@ static void clean_paths(Main *main)
/* note, this is called on Undo so any slow conversion functions here
* should be avoided or check (mode!='u') */
static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filename)
static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath)
{
bScreen *curscreen= NULL;
Scene *curscene= NULL;
@ -295,18 +295,18 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filename
if(recover && bfd->filename[0] && G.relbase_valid) {
/* in case of autosave or quit.blend, use original filename instead
* use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */
filename= bfd->filename;
filepath= bfd->filename;
}
#if 0
else if (!G.relbase_valid) {
/* otherwise, use an empty string as filename, rather than <memory2> */
filename="";
filepath="";
}
#endif
/* these are the same at times, should never copy to the same location */
if(G.main->name != filename)
BLI_strncpy(G.main->name, filename, FILE_MAX);
if(G.main->name != filepath)
BLI_strncpy(G.main->name, filepath, FILE_MAX);
/* baseflags, groups, make depsgraph, etc */
set_scene_bg(G.main, CTX_data_scene(C));
@ -353,15 +353,15 @@ void BKE_userdef_free(void)
BLI_freelistN(&U.addons);
}
int BKE_read_file(bContext *C, const char *dir, ReportList *reports)
int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
{
BlendFileData *bfd;
int retval= BKE_READ_FILE_OK;
if(strstr(dir, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref loading */
printf("read blend: %s\n", dir);
if(strstr(filepath, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref loading */
printf("read blend: %s\n", filepath);
bfd= BLO_read_from_file(dir, reports);
bfd= BLO_read_from_file(filepath, reports);
if (bfd) {
if(bfd->user) retval= BKE_READ_FILE_OK_USERPREFS;
@ -372,10 +372,10 @@ int BKE_read_file(bContext *C, const char *dir, ReportList *reports)
retval= BKE_READ_FILE_FAIL;
}
else
setup_app_data(C, bfd, dir); // frees BFD
setup_app_data(C, bfd, filepath); // frees BFD
}
else
BKE_reports_prependf(reports, "Loading %s failed: ", dir);
BKE_reports_prependf(reports, "Loading %s failed: ", filepath);
return (bfd?retval:BKE_READ_FILE_FAIL);
}
@ -521,19 +521,19 @@ void BKE_write_undo(bContext *C, const char *name)
/* disk save version */
if(UNDO_DISK) {
static int counter= 0;
char tstr[FILE_MAXDIR+FILE_MAXFILE];
char filepath[FILE_MAXDIR+FILE_MAXFILE];
char numstr[32];
/* calculate current filename */
/* calculate current filepath */
counter++;
counter= counter % U.undosteps;
BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
BLI_make_file_string("/", tstr, btempdir, numstr);
BLI_make_file_string("/", filepath, btempdir, numstr);
success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL, NULL);
success= BLO_write_file(CTX_data_main(C), filepath, G.fileflags, NULL, NULL);
BLI_strncpy(curundo->str, tstr, sizeof(curundo->str));
BLI_strncpy(curundo->str, filepath, sizeof(curundo->str));
}
else {
MemFile *prevfile=NULL;

@ -426,13 +426,6 @@ void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
curvemapping_changed(b->curve, 0);
}
static MTex *brush_active_texture(Brush *brush)
{
if(brush)
return &brush->mtex;
return NULL;
}
int brush_texture_set_nr(Brush *brush, int nr)
{
ID *idtest, *id=NULL;
@ -1185,7 +1178,7 @@ unsigned int *brush_gen_texture_cache(Brush *br, int half_side)
}
/**** Radial Control ****/
static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
{
ImBuf *im = MEM_callocN(sizeof(ImBuf), "radial control texture");
unsigned int *texcache;
@ -1219,50 +1212,6 @@ static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
return im;
}
void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
{
int mode = RNA_enum_get(op->ptr, "mode");
float original_value= 0;
if(mode == WM_RADIALCONTROL_SIZE)
original_value = brush_size(br) * size_weight;
else if(mode == WM_RADIALCONTROL_STRENGTH)
original_value = brush_alpha(br);
else if(mode == WM_RADIALCONTROL_ANGLE) {
MTex *mtex = brush_active_texture(br);
if(mtex)
original_value = mtex->rot;
}
RNA_float_set(op->ptr, "initial_value", original_value);
op->customdata = brush_gen_radial_control_imbuf(br);
}
int brush_radial_control_exec(wmOperator *op, Brush *br, float size_weight)
{
int mode = RNA_enum_get(op->ptr, "mode");
float new_value = RNA_float_get(op->ptr, "new_value");
const float conv = 0.017453293;
if(mode == WM_RADIALCONTROL_SIZE)
if (brush_use_locked_size(br)) {
float initial_value = RNA_float_get(op->ptr, "initial_value");
const float unprojected_radius = brush_unprojected_radius(br);
brush_set_unprojected_radius(br, unprojected_radius * new_value/initial_value * size_weight);
}
else
brush_set_size(br, new_value * size_weight);
else if(mode == WM_RADIALCONTROL_STRENGTH)
brush_set_alpha(br, new_value);
else if(mode == WM_RADIALCONTROL_ANGLE) {
MTex *mtex = brush_active_texture(br);
if(mtex)
mtex->rot = new_value * conv;
}
return OPERATOR_FINISHED;
}
/* Unified Size and Strength */
static void set_unified_settings(Brush *brush, short flag, int value)

@ -37,10 +37,6 @@
#include <stdlib.h>
#include <float.h>
#ifdef WITH_LCMS
#include <lcms.h>
#endif
#include "MEM_guardedalloc.h"
#include "DNA_color_types.h"
@ -789,60 +785,6 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const
}
#ifdef WITH_LCMS
/* basic error handler, if we dont do this blender will exit */
static int ErrorReportingFunction(int ErrorCode, const char *ErrorText)
{
fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode);
return 1;
}
#endif
void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
{
#ifdef WITH_LCMS
if (ibuf->crect == NULL)
{
cmsHPROFILE proofingProfile;
/* TODO, move to initialization area of code */
//cmsSetLogErrorHandler(ErrorReportingFunction);
cmsSetErrorHandler(ErrorReportingFunction);
/* will return NULL if the file isn't fount */
proofingProfile = cmsOpenProfileFromFile(profile, "r");
cmsErrorAction(LCMS_ERROR_SHOW);
if(proofingProfile) {
cmsHPROFILE imageProfile;
cmsHTRANSFORM hTransform;
ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
imageProfile = cmsCreate_sRGBProfile();
hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8,
proofingProfile,
INTENT_ABSOLUTE_COLORIMETRIC,
INTENT_ABSOLUTE_COLORIMETRIC,
cmsFLAGS_SOFTPROOFING);
cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
cmsDeleteTransform(hTransform);
cmsCloseProfile(imageProfile);
cmsCloseProfile(proofingProfile);
}
}
#else
/* unused */
(void)ibuf;
(void)profile;
#endif
}
/* only used for image editor curves */
void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
{

@ -72,6 +72,8 @@
#include "ED_curve.h" /* for BKE_curve_nurbs */
extern Material defmaterial; /* material.c */
static void boundbox_displist(Object *ob);
void free_disp_elem(DispList *dl)
@ -552,7 +554,6 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
}
for (i=0; i<totface; i++) {
extern Material defmaterial; /* material.c */
MFace *mf= &mface[i];
Material *ma= give_current_material(ob, mf->mat_nr+1);
int j, vidx[4], nverts= mf->v4?4:3;
@ -664,8 +665,6 @@ void shadeDispList(Scene *scene, Base *base)
dl= ob->disp.first;
while(dl) {
extern Material defmaterial; /* material.c */
dlob= MEM_callocN(sizeof(DispList), "displistshade");
BLI_addtail(&ob->disp, dlob);
dlob->type= DL_VERTCOL;
@ -734,8 +733,6 @@ void shadeDispList(Scene *scene, Base *base)
if(dl->type==DL_INDEX4) {
if(dl->nors) {
extern Material defmaterial; /* material.c */
if(dl->col1) MEM_freeN(dl->col1);
col1= dl->col1= MEM_mallocN(sizeof(int)*dl->nr, "col1");
@ -984,16 +981,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
dl= dl->next;
}
if(totvert && BLI_edgefill(0)) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
/* count faces */
tot= 0;
efa= fillfacebase.first;
while(efa) {
tot++;
efa= efa->next;
}
if(totvert && (tot= BLI_edgefill(0))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) {
if(tot) {
dlnew= MEM_callocN(sizeof(DispList), "filldisplist");
dlnew->type= DL_INDEX3;
@ -1973,8 +1961,9 @@ static void boundbox_displist(Object *ob)
}
if(!doit) {
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
/* there's no geometry in displist, use zero-sized boundbox */
zero_v3(min);
zero_v3(max);
}
}

File diff suppressed because it is too large Load Diff

@ -125,7 +125,7 @@ struct PreviewImage* BKE_previewimg_create(void)
prv_img = MEM_callocN(sizeof(PreviewImage), "img_prv");
for (i=0; i<PREVIEW_MIPMAPS; ++i) {
for (i=0; i<NUM_ICON_SIZES; ++i) {
prv_img->changed[i] = 1;
prv_img->changed_timestamp[i] = 0;
}
@ -137,7 +137,7 @@ void BKE_previewimg_free(PreviewImage **prv)
if(prv && (*prv)) {
int i;
for (i=0; i<PREVIEW_MIPMAPS;++i) {
for (i=0; i<NUM_ICON_SIZES;++i) {
if ((*prv)->rect[i]) {
MEM_freeN((*prv)->rect[i]);
(*prv)->rect[i] = NULL;
@ -155,7 +155,7 @@ struct PreviewImage* BKE_previewimg_copy(PreviewImage *prv)
if (prv) {
prv_img = MEM_dupallocN(prv);
for (i=0; i < PREVIEW_MIPMAPS; ++i) {
for (i=0; i < NUM_ICON_SIZES; ++i) {
if (prv->rect[i]) {
prv_img->rect[i] = MEM_dupallocN(prv->rect[i]);
} else {
@ -237,7 +237,7 @@ void BKE_icon_changed(int id)
/* all previews changed */
if (prv) {
int i;
for (i=0; i<PREVIEW_MIPMAPS; ++i) {
for (i=0; i<NUM_ICON_SIZES; ++i) {
prv->changed[i] = 1;
prv->changed_timestamp[i]++;
}

@ -1703,21 +1703,20 @@ void object_rot_to_mat3(Object *ob, float mat[][3])
{
float rmat[3][3], dmat[3][3];
/* initialise the delta-rotation matrix, which will get (pre)multiplied
/* 'dmat' is the delta-rotation matrix, which will get (pre)multiplied
* with the rotation matrix to yield the appropriate rotation
*/
unit_m3(dmat);
/* rotations may either be quats, eulers (with various rotation orders), or axis-angle */
if (ob->rotmode > 0) {
/* euler rotations (will cause gimble lock, but this can be alleviated a bit with rotation orders) */
eulO_to_mat3( rmat,ob->rot, ob->rotmode);
eulO_to_mat3( dmat,ob->drot, ob->rotmode);
eulO_to_mat3(rmat, ob->rot, ob->rotmode);
eulO_to_mat3(dmat, ob->drot, ob->rotmode);
}
else if (ob->rotmode == ROT_MODE_AXISANGLE) {
/* axis-angle - not really that great for 3D-changing orientations */
axis_angle_to_mat3( rmat,ob->rotAxis, ob->rotAngle);
axis_angle_to_mat3( dmat,ob->drotAxis, ob->drotAngle);
axis_angle_to_mat3(rmat, ob->rotAxis, ob->rotAngle);
axis_angle_to_mat3(dmat, ob->drotAxis, ob->drotAngle);
}
else {
/* quats are normalised before use to eliminate scaling issues */
@ -1752,9 +1751,22 @@ void object_mat3_to_rot(Object *ob, float mat[][3], short use_compat)
ob->rotAngle -= ob->drotAngle;
break;
default: /* euler */
if(use_compat) mat3_to_compatible_eulO(ob->rot, ob->rot, ob->rotmode, mat);
else mat3_to_eulO(ob->rot, ob->rotmode, mat);
sub_v3_v3(ob->rot, ob->drot);
{
float quat[4];
float dquat[4];
float tmat[3][3];
/* without drot we could apply 'mat' directly */
mat3_to_quat(quat, mat);
eulO_to_quat(dquat, ob->drot, ob->rotmode);
invert_qt(dquat);
mul_qt_qtqt(quat, dquat, quat);
quat_to_mat3(tmat, quat);
/* end drot correction */
if(use_compat) mat3_to_compatible_eulO(ob->rot, ob->rot, ob->rotmode, tmat);
else mat3_to_eulO(ob->rot, ob->rotmode, tmat);
}
}
}
@ -1946,9 +1958,10 @@ static void give_parvert(Object *par, int nr, float *vec)
if(dm) {
MVert *mvert= dm->getVertArray(dm);
int *index = (int *)dm->getVertDataArray(dm, CD_ORIGINDEX);
int i, count = 0, vindex, numVerts = dm->getNumVerts(dm);
int i, vindex, numVerts = dm->getNumVerts(dm);
/* get the average of all verts with (original index == nr) */
count= 0;
for(i = 0; i < numVerts; i++) {
vindex= (index)? index[i]: i;

@ -1250,7 +1250,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
double step, pos;
step= (totpart < 2) ? 0.5 : 1.0/(double)totpart;
pos= 1e-16; /* tiny offset to avoid zero weight face */
pos= 1e-6; /* tiny offset to avoid zero weight face */
i= 0;
for(p=0; p<totpart; p++, pos+=step) {
@ -2553,7 +2553,7 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
/* damp affects final velocity */
if(part->dampfac != 0.f)
mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp);
mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime);
//VECCOPY(pa->state.ave, states->ave);

@ -37,7 +37,7 @@
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "PIL_dynlib.h"
#include "BLI_dynlib.h"
#include "BLI_math.h" /* windows needs for M_PI */
#include "BLI_utildefines.h"
@ -138,18 +138,18 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
pis->instance_private_data = NULL;
/* clear the error list */
PIL_dynlib_get_error_as_string(NULL);
BLI_dynlib_get_error_as_string(NULL);
/* if(pis->handle) PIL_dynlib_close(pis->handle); */
/* if(pis->handle) BLI_dynlib_close(pis->handle); */
/* pis->handle= 0; */
/* open the needed object */
pis->handle= PIL_dynlib_open(pis->name);
pis->handle= BLI_dynlib_open(pis->name);
if(test_dlerr(pis->name, pis->name)) return;
if (pis->handle != NULL) {
/* find the address of the version function */
version= (int (*)(void))PIL_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
version= (int (*)(void))BLI_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
if (test_dlerr(pis->name, "plugin_seq_getversion")) return;
if (version != NULL) {
@ -158,7 +158,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
int (*info_func)(PluginInfo *);
PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
info_func= (int (*)(PluginInfo *))PIL_dynlib_find_symbol(pis->handle, "plugin_getinfo");
info_func= (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pis->handle, "plugin_getinfo");
if(info_func == NULL) error("No info func");
else {
@ -176,21 +176,21 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
}
MEM_freeN(info);
cp= PIL_dynlib_find_symbol(pis->handle, "seqname");
cp= BLI_dynlib_find_symbol(pis->handle, "seqname");
if(cp) strncpy(cp, seqname, 21);
} else {
printf ("Plugin returned unrecognized version number\n");
return;
}
}
alloc_private = (void* (*)(void))PIL_dynlib_find_symbol(
alloc_private = (void* (*)(void))BLI_dynlib_find_symbol(
pis->handle, "plugin_seq_alloc_private_data");
if (alloc_private) {
pis->instance_private_data = alloc_private();
}
pis->current_private_data = (void**)
PIL_dynlib_find_symbol(
BLI_dynlib_find_symbol(
pis->handle, "plugin_private_data");
}
}
@ -229,12 +229,12 @@ static void free_plugin_seq(PluginSeq *pis)
{
if(pis==NULL) return;
/* no PIL_dynlib_close: same plugin can be opened multiple times with 1 handle */
/* no BLI_dynlib_close: same plugin can be opened multiple times with 1 handle */
if (pis->instance_private_data) {
void (*free_private)(void *);
free_private = (void (*)(void *))PIL_dynlib_find_symbol(
free_private = (void (*)(void *))BLI_dynlib_find_symbol(
pis->handle, "plugin_seq_free_private_data");
if (free_private) {
free_private(pis->instance_private_data);
@ -301,7 +301,7 @@ static struct ImBuf * do_plugin_effect(
if(seq->plugin->cfra)
*(seq->plugin->cfra)= cfra;
cp = PIL_dynlib_find_symbol(
cp = BLI_dynlib_find_symbol(
seq->plugin->handle, "seqname");
if(cp) strncpy(cp, seq->name+2, 22);
@ -2858,6 +2858,83 @@ static struct ImBuf * do_multicam(
return out;
}
/* **********************************************************************
ADJUSTMENT
********************************************************************** */
/* no effect inputs for adjustment, we use give_ibuf_seq */
static int num_inputs_adjustment(void)
{
return 0;
}
static int early_out_adjustment(struct Sequence *UNUSED(seq), float UNUSED(facf0), float UNUSED(facf1))
{
return -1;
}
static struct ImBuf * do_adjustment_impl(SeqRenderData context, Sequence * seq,
float cfra)
{
Editing * ed;
ListBase * seqbasep;
struct ImBuf * i = 0;
ed = context.scene->ed;
seqbasep = seq_seqbase(&ed->seqbase, seq);
if (seq->machine > 0) {
i = give_ibuf_seqbase(context, cfra,
seq->machine - 1, seqbasep);
}
/* found nothing? so let's work the way up the metastrip stack, so
that it is possible to group a bunch of adjustment strips into
a metastrip and have that work on everything below the metastrip
*/
if (!i) {
Sequence * meta;
meta = seq_metastrip(&ed->seqbase, NULL, seq);
if (meta) {
i = do_adjustment_impl(context, meta, cfra);
}
}
return i;
}
static struct ImBuf * do_adjustment(
SeqRenderData context, Sequence *seq, float cfra,
float UNUSED(facf0), float UNUSED(facf1),
struct ImBuf *UNUSED(ibuf1), struct ImBuf *UNUSED(ibuf2),
struct ImBuf *UNUSED(ibuf3))
{
struct ImBuf * i = 0;
struct ImBuf * out;
Editing * ed;
ed = context.scene->ed;
if (!ed) {
return NULL;
}
i = do_adjustment_impl(context, seq, cfra);
if (input_have_to_preprocess(context, seq, cfra)) {
out = IMB_dupImBuf(i);
IMB_freeImBuf(i);
} else {
out = i;
}
return out;
}
/* **********************************************************************
SPEED
********************************************************************** */
@ -3256,6 +3333,11 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
rval.early_out = early_out_multicam;
rval.execute = do_multicam;
break;
case SEQ_ADJUSTMENT:
rval.num_inputs = num_inputs_adjustment;
rval.early_out = early_out_adjustment;
rval.execute = do_adjustment;
break;
}
return rval;

@ -79,9 +79,15 @@
#define snprintf _snprintf
#endif
/* **** XXX ******** */
//static void waitcursor(int val) {}
//static int blender_test_break() {return 0;}
static ImBuf* seq_render_strip_stack(
SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
static ImBuf * seq_render_strip(
SeqRenderData context, Sequence * seq, float cfra);
static void seq_free_animdata(Scene *scene, Sequence *seq);
/* **** XXX ******** */
#define SELECT 1
@ -177,8 +183,6 @@ void seq_free_strip(Strip *strip)
MEM_freeN(strip);
}
static void seq_free_animdata(Scene *scene, Sequence *seq);
void seq_free_sequence(Scene *scene, Sequence *seq)
{
if(seq->strip) seq_free_strip(seq->strip);
@ -191,6 +195,10 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
sh.free(seq);
}
if(seq->sound) {
((ID *)seq->sound)->us--;
}
/* clipboard has no scene and will never have a sound handle or be active */
if(scene) {
Editing *ed = scene->ed;
@ -446,51 +454,6 @@ void seq_end(SeqIterator *iter)
* in metastrips!)
**********************************************************************
*/
#if 0 /* UNUSED */
static void do_seq_count(ListBase *seqbase, int *totseq)
{
Sequence *seq;
seq= seqbase->first;
while(seq) {
(*totseq)++;
if(seq->seqbase.first) do_seq_count(&seq->seqbase, totseq);
seq= seq->next;
}
}
static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth)
{
Sequence *seq;
seq= seqbase->first;
while(seq) {
seq->depth= depth;
if(seq->seqbase.first) do_build_seqar(&seq->seqbase, seqar, depth+1);
**seqar= seq;
(*seqar)++;
seq= seq->next;
}
}
static void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
{
Sequence **tseqar;
*totseq= 0;
do_seq_count(seqbase, totseq);
if(*totseq==0) {
*seqar= NULL;
return;
}
*seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar");
tseqar= *seqar;
do_build_seqar(seqbase, seqar, 0);
*seqar= tseqar;
}
#endif /* UNUSED */
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
int (*test_func)(Sequence * seq))
@ -916,6 +879,7 @@ static const char *give_seqname_by_type(int type)
case SEQ_TRANSFORM: return "Transform";
case SEQ_COLOR: return "Color";
case SEQ_MULTICAM: return "Multicam";
case SEQ_ADJUSTMENT: return "Adjustment";
case SEQ_SPEED: return "Speed";
default:
return NULL;
@ -1013,16 +977,22 @@ static float give_stripelem_index(Sequence *seq, float cfra)
int sta = seq->start;
int end = seq->start+seq->len-1;
if(seq->len == 0) return -1;
if (seq->type & SEQ_EFFECT) {
end = seq->enddisp;
}
if(end < sta) {
return -1;
}
if(seq->flag&SEQ_REVERSE_FRAMES) {
/*reverse frame in this sequence */
if(cfra <= sta) nr= seq->len-1;
if(cfra <= sta) nr= end - sta;
else if(cfra >= end) nr= 0;
else nr= end - cfra;
} else {
if(cfra <= sta) nr= 0;
else if(cfra >= end) nr= seq->len-1;
else if(cfra >= end) nr= end - sta;
else nr= cfra - sta;
}
@ -1039,7 +1009,11 @@ StripElem *give_stripelem(Sequence *seq, int cfra)
{
StripElem *se= seq->strip->stripdata;
if(seq->type != SEQ_MOVIE) { /* movie use the first */
if(seq->type == SEQ_IMAGE) { /* only
IMAGE strips use the whole array,
MOVIE strips use only
the first element, all other strips
don't use this... */
int nr = (int) give_stripelem_index(seq, cfra);
if (nr == -1 || se == NULL) return NULL;
@ -1093,15 +1067,12 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se
}
if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
if (b > 0) {
if (seq_arr[b] == NULL) {
return 0;
}
} else {
for (b = MAXSEQ; b > 0; b--) {
if (video_seq_is_rendered(seq_arr[b])) {
break;
}
if (b == 0) {
b = MAXSEQ;
}
for (; b > 0; b--) {
if (video_seq_is_rendered(seq_arr[b])) {
break;
}
}
}
@ -2071,8 +2042,9 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr
break;
}
case SEQ_EFFECT:
{
ibuf = seq_render_effect_strip_impl(context, seq, cfra);
{
ibuf = seq_render_effect_strip_impl(
context, seq, seq->start + nr);
break;
}
case SEQ_IMAGE:
@ -2855,7 +2827,10 @@ void seq_tx_set_final_right(Sequence *seq, int val)
since they work a bit differently to normal image seq's (during transform) */
int seq_single_check(Sequence *seq)
{
return (seq->len==1 && ELEM3(seq->type, SEQ_IMAGE, SEQ_COLOR, SEQ_MULTICAM));
return (seq->len==1 && (
seq->type == SEQ_IMAGE
|| ((seq->type & SEQ_EFFECT) &&
get_sequence_effect_num_inputs(seq->type) == 0)));
}
/* check if the selected seq's reference unselected seq's */
@ -3214,6 +3189,24 @@ ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq)
return NULL;
}
Sequence *seq_metastrip(ListBase * seqbase, Sequence * meta, Sequence *seq)
{
Sequence * iseq;
for(iseq = seqbase->first; iseq; iseq = iseq->next) {
Sequence * rval;
if (seq == iseq) {
return meta;
} else if(iseq->seqbase.first &&
(rval = seq_metastrip(&iseq->seqbase, iseq, seq))) {
return rval;
}
}
return NULL;
}
int seq_swap(Sequence *seq_a, Sequence *seq_b)
{
char name[sizeof(seq_a->name)];
@ -3523,7 +3516,8 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
strip->len = seq->len = ceil(info.length * FPS);
strip->us= 1;
strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
/* we only need 1 element to store the filename */
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
BLI_split_dirfile(seq_load->path, strip->dir, se->name);
@ -3572,7 +3566,8 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
strip->len = seq->len = IMB_anim_get_duration( an );
strip->us= 1;
strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem");
/* we only need 1 element for MOVIE strips */
strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem");
BLI_split_dirfile(seq_load->path, strip->dir, se->name);

@ -543,7 +543,7 @@ int sk_stroke_filtermval(SK_DrawData *dd)
return retval;
}
void sk_initDrawData(SK_DrawData *dd, const short mval[2])
void sk_initDrawData(SK_DrawData *dd, const int mval[2])
{
dd->mval[0] = mval[0];
dd->mval[1] = mval[1];

@ -1232,7 +1232,7 @@ char *txt_to_buf (Text *text)
return buf;
}
int txt_find_string(Text *text, char *findstr, int wrap)
int txt_find_string(Text *text, char *findstr, int wrap, int match_case)
{
TextLine *tl, *startl;
char *s= NULL;
@ -1246,7 +1246,8 @@ int txt_find_string(Text *text, char *findstr, int wrap)
oldsl= txt_get_span(text->lines.first, text->sell);
tl= startl= text->sell;
s= strstr(&tl->line[text->selc], findstr);
if(match_case) s= strstr(&tl->line[text->selc], findstr);
else s= BLI_strcasestr(&tl->line[text->selc], findstr);
while (!s) {
tl= tl->next;
if (!tl) {
@ -1256,7 +1257,8 @@ int txt_find_string(Text *text, char *findstr, int wrap)
break;
}
s= strstr(tl->line, findstr);
if(match_case) s= strstr(tl->line, findstr);
else s= BLI_strcasestr(tl->line, findstr);
if (tl==startl)
break;
}

@ -41,9 +41,8 @@
#include "MEM_guardedalloc.h"
#include "PIL_dynlib.h"
#include "BLI_blenlib.h"
#include "BLI_dynlib.h"
#include "BLI_math.h"
#include "BLI_kdopbvh.h"
#include "BLI_utildefines.h"
@ -82,7 +81,7 @@ int test_dlerr(const char *name, const char *symbol)
{
char *err;
err= PIL_dynlib_get_error_as_string(NULL);
err= BLI_dynlib_get_error_as_string(NULL);
if(err) {
printf("var1: %s, var2: %s, var3: %s\n", name, symbol, err);
return 1;
@ -108,19 +107,19 @@ void open_plugin_tex(PluginTex *pit)
pit->instance_init= NULL;
/* clear the error list */
PIL_dynlib_get_error_as_string(NULL);
BLI_dynlib_get_error_as_string(NULL);
/* no PIL_dynlib_close! multiple opened plugins... */
/* if(pit->handle) PIL_dynlib_close(pit->handle); */
/* no BLI_dynlib_close! multiple opened plugins... */
/* if(pit->handle) BLI_dynlib_close(pit->handle); */
/* pit->handle= 0; */
/* open the needed object */
pit->handle= PIL_dynlib_open(pit->name);
pit->handle= BLI_dynlib_open(pit->name);
if(test_dlerr(pit->name, pit->name)) return;
if (pit->handle != NULL) {
/* find the address of the version function */
version= (int (*)(void)) PIL_dynlib_find_symbol(pit->handle, "plugin_tex_getversion");
version= (int (*)(void)) BLI_dynlib_find_symbol(pit->handle, "plugin_tex_getversion");
if (test_dlerr(pit->name, "plugin_tex_getversion")) return;
if (version != NULL) {
@ -129,7 +128,7 @@ void open_plugin_tex(PluginTex *pit)
int (*info_func)(PluginInfo *);
PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
info_func= (int (*)(PluginInfo *))PIL_dynlib_find_symbol(pit->handle, "plugin_getinfo");
info_func= (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pit->handle, "plugin_getinfo");
if (!test_dlerr(pit->name, "plugin_getinfo")) {
info->instance_init = NULL;
@ -200,7 +199,7 @@ void free_plugin_tex(PluginTex *pit)
{
if(pit==NULL) return;
/* no PIL_dynlib_close: same plugin can be opened multiple times, 1 handle */
/* no BLI_dynlib_close: same plugin can be opened multiple times, 1 handle */
MEM_freeN(pit);
}

@ -27,31 +27,19 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenlib/PIL_dynlib.h
/** \file blender/blenlib/BLI_dynlib.h
* \ingroup bli
*/
#ifndef __PIL_DYNLIB_H__
#define __PIL_DYNLIB_H__
#ifndef __BLI_DYNLIB_H__
#define __BLI_DYNLIB_H__
typedef struct PILdynlib PILdynlib;
typedef struct DynamicLibrary DynamicLibrary;
PILdynlib*
PIL_dynlib_open(
char *name);
DynamicLibrary *BLI_dynlib_open(char *name);
void *BLI_dynlib_find_symbol(DynamicLibrary* lib, const char *symname);
char *BLI_dynlib_get_error_as_string(DynamicLibrary* lib);
void BLI_dynlib_close(DynamicLibrary* lib);
void*
PIL_dynlib_find_symbol(
PILdynlib* lib,
const char *symname);
char*
PIL_dynlib_get_error_as_string(
PILdynlib* lib);
void
PIL_dynlib_close(
PILdynlib* lib);
#endif /* __PIL_DYNLIB_H__ */
#endif /* __BLI_DYNLIB_H__ */

@ -77,7 +77,7 @@ void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3],
#define ISECT_LINE_LINE_CROSS 2
int isect_line_line_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]);
int isect_line_line_v2_short(const short a1[2], const short a2[2], const short b1[2], const short b2[2]);
int isect_line_line_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]);
int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[2], const float v4[2], float vi[2]);
/* Returns the number of point of interests

@ -53,7 +53,7 @@ extern "C" {
/* scanfill.c: used in displist only... */
struct EditVert *BLI_addfillvert(float *vec);
struct EditEdge *BLI_addfilledge(struct EditVert *v1, struct EditVert *v2);
int BLI_edgefill(int mat_nr);
int BLI_edgefill(short mat_nr);
void BLI_end_edgefill(void);
/* These callbacks are needed to make the lib finction properly */

@ -88,6 +88,7 @@ set(SRC
BLI_bpath.h
BLI_cpu.h
BLI_dlrbTree.h
BLI_dynlib.h
BLI_dynstr.h
BLI_edgehash.h
BLI_editVert.h
@ -127,7 +128,6 @@ set(SRC
BLI_vfontdata.h
BLI_voxel.h
BLI_winstuff.h
PIL_dynlib.h
PIL_time.h
intern/BLI_callbacks.h
intern/dynamiclist.h

@ -699,7 +699,12 @@ void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
/* be sure there is low chance of the path being too short */
char filepath_relative[(FILE_MAXDIR * 2) + FILE_MAXFILE];
if(basedir[0] == '\0') {
printf("makeFilesRelative: basedir='', this is a bug\n");
return;
}
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);
@ -750,7 +755,12 @@ void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
/* be sure there is low chance of the path being too short */
char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE];
if(basedir[0] == '\0') {
printf("makeFilesAbsolute: basedir='', this is a bug\n");
return;
}
BLI_bpathIterator_init(&bpi, bmain, basedir, 0);
while (!BLI_bpathIterator_isDone(bpi)) {
BLI_bpathIterator_getPath(bpi, filepath);

@ -31,110 +31,101 @@
* \ingroup bli
*/
#include <stdlib.h>
#include "../PIL_dynlib.h"
#if !defined(CHAR_MAX)
#define CHAR_MAX 255
#endif
/*
* XXX, should use mallocN so we can see
* handle's not being released. fixme zr
*/
#ifdef WIN32
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#include "MEM_guardedalloc.h"
struct PILdynlib {
#include "BLI_dynlib.h"
struct DynamicLibrary {
void *handle;
};
PILdynlib *PIL_dynlib_open(char *name) {
#ifdef WIN32
#include <windows.h>
DynamicLibrary *BLI_dynlib_open(char *name)
{
DynamicLibrary *lib;
void *handle= LoadLibrary(name);
if (handle) {
PILdynlib *lib= malloc(sizeof(*lib));
lib->handle= handle;
return lib;
} else {
if(!handle)
return NULL;
}
lib= MEM_callocN(sizeof(*lib), "Dynamic Library");
lib->handle= handle;
return lib;
}
void *PIL_dynlib_find_symbol(PILdynlib* lib, const char *symname) {
void *BLI_dynlib_find_symbol(DynamicLibrary *lib, const char *symname)
{
return GetProcAddress(lib->handle, symname);
}
char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib)
{
int err;
/* if lib is NULL reset the last error code */
err= GetLastError();
if (!lib) SetLastError(ERROR_SUCCESS);
if(!lib)
SetLastError(ERROR_SUCCESS);
if (err) {
if(err) {
static char buf[1024];
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf,
sizeof(buf),
NULL))
if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, sizeof(buf), NULL))
return buf;
}
return NULL;
}
void PIL_dynlib_close(PILdynlib *lib) {
void BLI_dynlib_close(DynamicLibrary *lib)
{
FreeLibrary(lib->handle);
free(lib);
MEM_freeN(lib);
}
#else /* Unix */
#else /* Unix */
#include <dlfcn.h>
struct PILdynlib {
void *handle;
};
PILdynlib *PIL_dynlib_open(char *name) {
DynamicLibrary *BLI_dynlib_open(char *name)
{
DynamicLibrary *lib;
void *handle= dlopen(name, RTLD_LAZY);
if (handle) {
PILdynlib *lib= malloc(sizeof(*lib));
lib->handle= handle;
return lib;
} else {
if(!handle)
return NULL;
}
lib= MEM_callocN(sizeof(*lib), "Dynamic Library");
lib->handle= handle;
return lib;
}
void *PIL_dynlib_find_symbol(PILdynlib* lib, const char *symname) {
void *BLI_dynlib_find_symbol(DynamicLibrary *lib, const char *symname)
{
return dlsym(lib->handle, symname);
}
char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib)
{
(void)lib; /* unused */
return dlerror();
}
void PIL_dynlib_close(PILdynlib *lib) {
void BLI_dynlib_close(DynamicLibrary *lib)
{
dlclose(lib->handle);
free(lib);
MEM_freeN(lib);
}
#endif

@ -239,7 +239,7 @@ float dist_to_line_segment_v3(const float v1[3], const float v2[3], const float
/******************************* Intersection ********************************/
/* intersect Line-Line, shorts */
int isect_line_line_v2_short(const short v1[2], const short v2[2], const short v3[2], const short v4[2])
int isect_line_line_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2])
{
float div, labda, mu;
@ -529,8 +529,9 @@ int isect_ray_tri_v3(const float p1[3], const float d[3], const float v0[3], con
int isect_ray_plane_v3(float p1[3], float d[3], float v0[3], float v1[3], float v2[3], float *lambda, int clip)
{
float p[3], s[3], e1[3], e2[3], q[3];
float a, f, u, v;
float a, f;
/* float u, v; */ /*UNUSED*/
sub_v3_v3v3(e1, v1, v0);
sub_v3_v3v3(e2, v2, v0);
@ -543,11 +544,11 @@ int isect_ray_plane_v3(float p1[3], float d[3], float v0[3], float v1[3], float
sub_v3_v3v3(s, p1, v0);
u = f * dot_v3v3(s, p);
/* u = f * dot_v3v3(s, p); */ /*UNUSED*/
cross_v3_v3v3(q, s, e1);
v = f * dot_v3v3(d, q);
/* v = f * dot_v3v3(d, q); */ /*UNUSED*/
*lambda = f * dot_v3v3(e2, q);
if (clip && (*lambda < 0.0f)) return 0;
@ -1789,7 +1790,7 @@ void orthographic_m4(float matrix[][4], const float left, const float right, con
matrix[3][2] = -(farClip + nearClip)/Zdelta;
}
void perspective_m4(float mat[][4],float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
void perspective_m4(float mat[4][4], const float left, const float right, const float bottom, const float top, const float nearClip, const float farClip)
{
float Xdelta, Ydelta, Zdelta;

@ -1692,6 +1692,10 @@ void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name)
#ifdef _WIN32
if(GetModuleFileName(0, fullname, maxlen)) {
GetShortPathName(fullname, fullname, maxlen);
if(!BLI_exists(fullname)) {
printf("path can't be found: \"%.*s\"\n", maxlen, fullname);
MessageBox(NULL, "path constains invalid characters or is too long (see console)", "Error", MB_OK);
}
return;
}
#endif

@ -58,6 +58,8 @@ typedef unsigned long long r_uint64;
#define LOWSEED 0x330E
extern unsigned char hash[]; // noise.c
/***/
struct RNG {
@ -83,8 +85,6 @@ void rng_seed(RNG *rng, unsigned int seed) {
}
void rng_srandom(RNG *rng, unsigned int seed) {
extern unsigned char hash[]; // noise.c
rng_seed(rng, seed + hash[seed & 255]);
seed= rng_getInt(rng);
rng_seed(rng, seed + hash[seed & 255]);
@ -180,8 +180,6 @@ static RNG rng_tab[BLENDER_MAX_THREADS];
void BLI_thread_srandom(int thread, unsigned int seed)
{
extern unsigned char hash[]; // noise.c
if(thread >= BLENDER_MAX_THREADS)
thread= 0;

@ -85,7 +85,6 @@ typedef struct PolyFill {
typedef struct ScFillVert {
EditVert *v1;
EditEdge *first,*last;
short f,f1;
} ScFillVert;
@ -95,9 +94,9 @@ typedef struct ScFillVert {
static ScFillVert *scdata;
ListBase fillvertbase = {0,0};
ListBase filledgebase = {0,0};
ListBase fillfacebase = {0,0};
ListBase fillvertbase = {NULL, NULL};
ListBase filledgebase = {NULL, NULL};
ListBase fillfacebase = {NULL, NULL};
static short cox, coy;
@ -219,7 +218,7 @@ EditEdge *BLI_addfilledge(EditVert *v1, EditVert *v2)
return newed;
}
static void addfillface(EditVert *v1, EditVert *v2, EditVert *v3, int mat_nr)
static void addfillface(EditVert *v1, EditVert *v2, EditVert *v3, short mat_nr)
{
/* does not make edges */
EditFace *evl;
@ -495,7 +494,7 @@ static void splitlist(ListBase *tempve, ListBase *temped, short nr)
}
static void scanfill(PolyFill *pf, int mat_nr)
static int scanfill(PolyFill *pf, short mat_nr)
{
ScFillVert *sc = NULL, *sc1;
EditVert *eve,*v1,*v2,*v3;
@ -748,11 +747,13 @@ static void scanfill(PolyFill *pf, int mat_nr)
}
MEM_freeN(scdata);
return totface;
}
int BLI_edgefill(int mat_nr)
int BLI_edgefill(short mat_nr)
{
/*
- fill works with its own lists, so create that first (no faces!)
@ -760,6 +761,7 @@ int BLI_edgefill(int mat_nr)
- struct elements xs en ys are not used here: don't hide stuff in it
- edge flag ->f becomes 2 when it's a new edge
- mode: & 1 is check for crossings, then create edges (TO DO )
- returns number of triangle faces added.
*/
ListBase tempve, temped;
EditVert *eve;
@ -767,6 +769,7 @@ int BLI_edgefill(int mat_nr)
PolyFill *pflist,*pf;
float *minp, *maxp, *v1, *v2, norm[3], len;
short a,c,poly=0,ok=0,toggle=0;
int totfaces= 0; /* total faces added */
/* reset variables */
eve= fillvertbase.first;
@ -1030,7 +1033,7 @@ int BLI_edgefill(int mat_nr)
for(a=0;a<poly;a++) {
if(pf->edges>1) {
splitlist(&tempve,&temped,pf->nr);
scanfill(pf, mat_nr);
totfaces += scanfill(pf, mat_nr);
}
pf++;
}
@ -1040,6 +1043,6 @@ int BLI_edgefill(int mat_nr)
/* FREE */
MEM_freeN(pflist);
return 1;
return totfaces;
}

@ -79,12 +79,12 @@ typedef struct BlendFileData {
* returns NULL and sets a report in the list if
* it cannot open the file.
*
* @param file The path of the file to open.
* @param filepath The path of the file to open.
* @param reports If the return value is NULL, errors
* indicating the cause of the failure.
* @return The data of the file.
*/
BlendFileData* BLO_read_from_file(const char *file, struct ReportList *reports);
BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *reports);
/**
* Open a blender file from memory. The function
@ -209,7 +209,7 @@ int BLO_has_bfile_extension(char *str);
*/
int BLO_is_a_library(const char *path, char *dir, char *group);
struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, char *dir);
struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, const char *filepath);
/**
* Link/Append a named datablock from an external blend file.
@ -217,12 +217,12 @@ struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh
* @param C The context, when NULL instancing object in the scene isnt done.
* @param mainl The main database to link from (not the active one).
* @param bh The blender file handle.
* @param name The name of the datablock (without the 2 char ID prefix)
* @param idname The name of the datablock (without the 2 char ID prefix)
* @param idcode The kind of datablock to link.
* @param flag Options for linking, used for instancing.
* @return Boolean, 0 when the datablock could not be found.
*/
int BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *name, int idcode, short flag);
int BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, int idcode, short flag);
void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag);
/* deprecated */

@ -25,22 +25,29 @@
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
* A message and error sink for c and c++
*
*/
/** \file kernel/gen_messaging/intern/messaging.c
* \ingroup genmess
#ifndef BLO_RUNTIME_H
#define BLO_RUNTIME_H
/** \file BLO_runtime.h
* \ingroup blenloader
*/
#ifdef __cplusplus
extern "C" {
#endif
struct BlendFileData;
struct ReportList;
#include "GEN_messaging.h"
int BLO_is_a_runtime(char *file);
struct BlendFileData *BLO_read_runtime(char *file, struct ReportList *reports);
FILE* GEN_errorstream = NULL;
FILE* GEN_userstream = NULL;
void GEN_init_messaging_system(void)
{
GEN_errorstream = stderr;
GEN_userstream = stdout;
#ifdef __cplusplus
}
#endif
#endif /* BLO_RUNTIME_H */

@ -39,7 +39,7 @@ struct MemFile;
struct Main;
struct ReportList;
extern int BLO_write_file(struct Main *mainvar, char *dir, int write_flags, struct ReportList *reports, int *thumb);
extern int BLO_write_file(struct Main *mainvar, const char *filepath, int write_flags, struct ReportList *reports, int *thumb);
extern int BLO_write_file_mem(struct Main *mainvar, struct MemFile *compare, struct MemFile *current, int write_flags);
extern int BLO_write_runtime(struct Main *mainvar, const char *file, char *exename, struct ReportList *reports);

@ -29,7 +29,6 @@ set(INC
../blenlib
../blenkernel
../makesdna
../readblenfile
../makesrna
../render/extern/include
../../../intern/guardedalloc
@ -39,10 +38,12 @@ set(INC
set(SRC
intern/readblenentry.c
intern/readfile.c
intern/runtime.c
intern/undofile.c
intern/writefile.c
BLO_readfile.h
BLO_runtime.h
BLO_soundfile.h
BLO_sys_types.h
BLO_undofile.h

Some files were not shown because too many files have changed in this diff Show More