Merge with trunk r41545
This commit is contained in:
commit
2ed6f077b3
@ -157,6 +157,8 @@ endif()
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
|
||||
option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
|
||||
option(WITH_XDG_USER_DIRS "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
|
||||
mark_as_advanced(WITH_XDG_USER_DIRS)
|
||||
else()
|
||||
# not an option for other OS's
|
||||
set(WITH_BUILTIN_GLEW ON)
|
||||
@ -1255,6 +1257,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# flags to undo strict flags
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_BUT_SET_VARIABLE -Wno-unused-but-set-variable)
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||
|
||||
|
@ -151,6 +151,7 @@ help:
|
||||
@echo ""
|
||||
@echo "Documentation Targets (not assosiated with building blender)"
|
||||
@echo " * doc_py - generate sphinx python api docs"
|
||||
@echo " * doc_doxy - generate doxygen C/C++ docs"
|
||||
@echo " * doc_dna - generate blender file format reference"
|
||||
@echo " * doc_man - generate manpage"
|
||||
@echo ""
|
||||
@ -238,9 +239,13 @@ check_sparse:
|
||||
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
||||
doc_py:
|
||||
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
|
||||
cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out
|
||||
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
|
||||
|
||||
doc_doxy:
|
||||
cd doc/doxygen; doxygen
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
|
||||
|
||||
doc_dna:
|
||||
$(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
|
||||
|
@ -44,8 +44,19 @@ SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for p
|
||||
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
||||
|
||||
|
||||
# if the user passes these defines as args, we dont want to overwrite
|
||||
SET(_IS_INC_DEF OFF)
|
||||
SET(_IS_LIB_DEF OFF)
|
||||
IF(DEFINED PYTHON_INCLUDE_DIR)
|
||||
SET(_IS_INC_DEF ON)
|
||||
ENDIF()
|
||||
IF(DEFINED PYTHON_LIBRARY)
|
||||
SET(_IS_LIB_DEF ON)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# only search for the dirs if we havn't already
|
||||
IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
|
||||
IF((NOT _IS_INC_DEF) OR (NOT _IS_LIB_DEF))
|
||||
|
||||
SET(_python_ABI_FLAGS
|
||||
"m;mu;u; " # release
|
||||
@ -66,30 +77,38 @@ IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
|
||||
#ENDIF()
|
||||
STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
|
||||
|
||||
FIND_PATH(PYTHON_INCLUDE_DIR
|
||||
NAMES
|
||||
Python.h
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
|
||||
)
|
||||
IF(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
FIND_PATH(PYTHON_INCLUDE_DIR
|
||||
NAMES
|
||||
Python.h
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
FIND_LIBRARY(PYTHON_LIBRARY
|
||||
NAMES
|
||||
"python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
IF(NOT DEFINED PYTHON_LIBRARY)
|
||||
FIND_LIBRARY(PYTHON_LIBRARY
|
||||
NAMES
|
||||
"python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
|
||||
HINTS
|
||||
${_python_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
|
||||
break()
|
||||
ELSE()
|
||||
# ensure we dont find values from 2 different ABI versions
|
||||
UNSET(PYTHON_INCLUDE_DIR CACHE)
|
||||
UNSET(PYTHON_LIBRARY CACHE)
|
||||
IF(NOT _IS_INC_DEF)
|
||||
UNSET(PYTHON_INCLUDE_DIR CACHE)
|
||||
ENDIF()
|
||||
IF(NOT _IS_LIB_DEF)
|
||||
UNSET(PYTHON_LIBRARY CACHE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
@ -100,6 +119,9 @@ IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
|
||||
UNSET(_python_SEARCH_DIRS)
|
||||
ENDIF()
|
||||
|
||||
UNSET(_IS_INC_DEF)
|
||||
UNSET(_IS_LIB_DEF)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
@ -29,8 +29,8 @@ IGNORE = (
|
||||
"source/blender/imbuf/intern/imbuf_cocoa.m",
|
||||
"extern/recastnavigation/Recast/Source/RecastLog.cpp",
|
||||
"extern/recastnavigation/Recast/Source/RecastTimer.cpp",
|
||||
"entern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
|
||||
"entern/audaspace/SRC/AUD_SRCResampleReader.cpp",
|
||||
"intern/audaspace/SRC/AUD_SRCResampleFactory.cpp",
|
||||
"intern/audaspace/SRC/AUD_SRCResampleReader.cpp",
|
||||
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h",
|
||||
"extern/bullet2/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h",
|
||||
@ -44,7 +44,7 @@ IGNORE = (
|
||||
"extern/eltopo/common/meshes/ObjLoader.hpp",
|
||||
"extern/eltopo/common/meshes/TriangleIndex.hpp",
|
||||
"extern/eltopo/common/meshes/meshloader.h",
|
||||
"extern/eltopo/eltopo3d/broadphase_blenderbvh.h"
|
||||
"extern/eltopo/eltopo3d/broadphase_blenderbvh.h",
|
||||
"extern/recastnavigation/Recast/Include/RecastLog.h",
|
||||
"extern/recastnavigation/Recast/Include/RecastTimer.h",
|
||||
"intern/audaspace/SRC/AUD_SRCResampleFactory.h",
|
||||
|
@ -40,6 +40,7 @@ from project_info import (SIMPLE_PROJECTFILE,
|
||||
is_py,
|
||||
cmake_advanced_info,
|
||||
cmake_compiler_defines,
|
||||
project_name_get,
|
||||
)
|
||||
|
||||
import os
|
||||
@ -59,7 +60,8 @@ def create_qtc_project_main():
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f) for f in files_rel if is_c_header(f))))))
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f)
|
||||
for f in files_rel if is_c_header(f))))))
|
||||
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
|
||||
f = open(qtc_prj, 'w')
|
||||
@ -73,10 +75,16 @@ def create_qtc_project_main():
|
||||
includes, defines = cmake_advanced_info()
|
||||
|
||||
# for some reason it doesnt give all internal includes
|
||||
includes = list(set(includes) | set(os.path.dirname(f) for f in files_rel if is_c_header(f)))
|
||||
includes = list(set(includes) | set(os.path.dirname(f)
|
||||
for f in files_rel if is_c_header(f)))
|
||||
includes.sort()
|
||||
|
||||
PROJECT_NAME = "Blender"
|
||||
if 0:
|
||||
PROJECT_NAME = "Blender"
|
||||
else:
|
||||
# be tricky, get the project name from SVN if we can!
|
||||
PROJECT_NAME = project_name_get(SOURCE_DIR)
|
||||
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
@ -93,7 +101,7 @@ def create_qtc_project_main():
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
defines_final = [("#define %s %s" % item) for item in defines]
|
||||
if sys.platform != "win32":
|
||||
defines_final += cmake_compiler_defines() # defines from the compiler
|
||||
defines_final += cmake_compiler_defines()
|
||||
f.write("\n".join(defines_final))
|
||||
|
||||
print("Blender project file written to: %s" % qtc_prj)
|
||||
@ -106,7 +114,12 @@ def create_qtc_project_python():
|
||||
files_rel.sort()
|
||||
|
||||
# --- qtcreator specific, simple format
|
||||
PROJECT_NAME = "Blender_Python"
|
||||
if 0:
|
||||
PROJECT_NAME = "Blender_Python"
|
||||
else:
|
||||
# be tricky, get the project name from SVN if we can!
|
||||
PROJECT_NAME = project_name_get(SOURCE_DIR) + "_Python"
|
||||
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
|
||||
f.write("\n".join(files_rel))
|
||||
|
@ -413,8 +413,7 @@ macro(remove_strict_flags)
|
||||
remove_cc_flag("-Werror")
|
||||
|
||||
# negate flags implied by '-Wall'
|
||||
add_cc_flag("-Wno-unused-parameter")
|
||||
add_cc_flag("-Wno-unused-but-set-variable")
|
||||
add_cc_flag("${CC_REMOVE_STRICT_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
|
@ -41,6 +41,7 @@ __all__ = (
|
||||
"is_py",
|
||||
"cmake_advanced_info",
|
||||
"cmake_compiler_defines",
|
||||
"project_name_get"
|
||||
)
|
||||
|
||||
import sys
|
||||
@ -215,3 +216,21 @@ def cmake_compiler_defines():
|
||||
os.remove(temp_c)
|
||||
os.remove(temp_def)
|
||||
return lines
|
||||
|
||||
|
||||
def project_name_get(path, fallback="Blender", prefix="Blender_"):
|
||||
if not os.path.isdir(os.path.join(path, ".svn")):
|
||||
return fallback
|
||||
|
||||
import subprocess
|
||||
info = subprocess.Popen(["svn", "info", path],
|
||||
stdout=subprocess.PIPE).communicate()[0].decode()
|
||||
|
||||
for l in info.split("\n"):
|
||||
l = l.strip()
|
||||
if l.startswith("URL"):
|
||||
# https://svn.blender.org/svnroot/bf-blender/branches/bmesh/blender
|
||||
# --> bmesh
|
||||
if "/branches/" in l:
|
||||
return prefix + l.rsplit("/branches/", 1)[-1].split("/", 1)[0]
|
||||
return fallback
|
||||
|
@ -149,6 +149,20 @@ WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
'''
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_46_1 libboost_filesystem-vc90-mt-s-1_46_1 libboost_regex-vc90-mt-s-1_46_1 libboost_system-vc90-mt-s-1_46_1 libboost_thread-vc90-mt-s-1_46_1'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
'''
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
|
||||
|
@ -153,6 +153,20 @@ WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
'''
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB = 'OpenImageIO'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
WITH_BF_BOOST = True
|
||||
BF_BOOST = LIBDIR + '/boost'
|
||||
BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_45 libboost_filesystem-vc90-mt-s-1_45 libboost_regex-vc90-mt-s-1_45 libboost_system-vc90-mt-s-1_45 libboost_thread-vc90-mt-s-1_45'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
'''
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
|
||||
|
@ -193,6 +193,11 @@ def setup_staticlibs(lenv):
|
||||
if lenv['OURPLATFORM'] == 'linuxcross':
|
||||
libincs += Split(lenv['BF_OPENMP_LIBPATH'])
|
||||
|
||||
if lenv['WITH_BF_OIIO']:
|
||||
libincs += Split(lenv['BF_OIIO_LIBPATH'])
|
||||
if lenv['WITH_BF_BOOST']:
|
||||
libincs += Split(lenv['BF_BOOST_LIBPATH'])
|
||||
|
||||
# setting this last so any overriding of manually libs could be handled
|
||||
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
libincs.append('/usr/lib')
|
||||
@ -275,6 +280,11 @@ def setup_syslibs(lenv):
|
||||
if not lenv['WITH_BF_STATIC3DMOUSE']:
|
||||
syslibs += Split(lenv['BF_3DMOUSE_LIB'])
|
||||
|
||||
if lenv['WITH_BF_OIIO']:
|
||||
syslibs += Split(lenv['BF_OIIO_LIB'])
|
||||
if lenv['WITH_BF_BOOST']:
|
||||
syslibs += Split(lenv['BF_BOOST_LIB'])
|
||||
|
||||
syslibs += lenv['LLIBS']
|
||||
|
||||
return syslibs
|
||||
|
@ -116,7 +116,9 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_INTERNATIONAL',
|
||||
'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'WITH_BF_GETTEXT_STATIC', 'BF_GETTEXT_LIB_STATIC', 'BF_GETTEXT_LIBPATH',
|
||||
'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
|
||||
'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'WITH_BF_ELTOPO', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
|
||||
'WITH_BF_GAMEENGINE',
|
||||
'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
|
||||
'WITH_BF_ELTOPO',
|
||||
'BF_WINTAB', 'BF_WINTAB_INC',
|
||||
'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
|
||||
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
|
||||
@ -133,12 +135,10 @@ def validate_arguments(args, bc):
|
||||
'WITHOUT_BF_INSTALL',
|
||||
'WITHOUT_BF_PYTHON_INSTALL',
|
||||
'WITHOUT_BF_OVERWRITE_INSTALL',
|
||||
'WITH_BF_OPENMP',
|
||||
'BF_OPENMP',
|
||||
'BF_OPENMP_INC',
|
||||
'BF_OPENMP_LIBPATH',
|
||||
'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH',
|
||||
'WITH_GHOST_COCOA',
|
||||
'WITH_GHOST_SDL',
|
||||
'BF_GHOST_DEBUG',
|
||||
'USE_QTKIT',
|
||||
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
|
||||
'BF_X264_CONFIG',
|
||||
@ -147,7 +147,6 @@ def validate_arguments(args, bc):
|
||||
'BF_NUMJOBS',
|
||||
'BF_MSVS',
|
||||
'BF_VERSION',
|
||||
'BF_GHOST_DEBUG',
|
||||
'WITH_BF_RAYOPTIMIZATION',
|
||||
'BF_RAYOPTIMIZATION_SSE_FLAGS',
|
||||
'WITH_BF_FLUID',
|
||||
@ -155,7 +154,10 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_BOOLEAN',
|
||||
'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',
|
||||
'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
|
||||
'BUILDBOT_BRANCH',
|
||||
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
|
||||
'WITH_BF_OIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIBPATH',
|
||||
'WITH_BF_BOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIBPATH'
|
||||
]
|
||||
|
||||
# Have options here that scons expects to be lists
|
||||
@ -239,9 +241,9 @@ def read_opts(env, cfg, args):
|
||||
('LCGDIR', 'location of cvs lib dir'),
|
||||
(BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
|
||||
(BoolVariable('WITH_BF_PYTHON_SAFETY', 'Internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)', False)),
|
||||
('BF_PYTHON', 'base path for python', ''),
|
||||
('BF_PYTHON', 'Base path for python', ''),
|
||||
('BF_PYTHON_VERSION', 'Python version to use', ''),
|
||||
('BF_PYTHON_INC', 'include path for Python headers', ''),
|
||||
('BF_PYTHON_INC', 'Include path for Python headers', ''),
|
||||
('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
|
||||
('BF_PYTHON_LIB', 'Python library', ''),
|
||||
('BF_PYTHON_DLL', 'Python dll - used on Windows only', ''),
|
||||
@ -257,8 +259,8 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
|
||||
('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
|
||||
(BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
|
||||
('BF_OPENAL', 'base path for OpenAL', ''),
|
||||
('BF_OPENAL_INC', 'include path for python headers', ''),
|
||||
('BF_OPENAL', 'Base path for OpenAL', ''),
|
||||
('BF_OPENAL_INC', 'Include path for python headers', ''),
|
||||
('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
|
||||
('BF_OPENAL_LIB_STATIC', 'Path to OpenAL static library', ''),
|
||||
('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
|
||||
@ -532,6 +534,16 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
|
||||
|
||||
('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
|
||||
('BF_OIIO_INC', 'OIIO include path', ''),
|
||||
('BF_OIIO_LIB', 'OIIO library', ''),
|
||||
('BF_OIIO_LIBPATH', 'OIIO library path', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
|
||||
('BF_BOOST_INC', 'Boost include path', ''),
|
||||
('BF_BOOST_LIB', 'Boost library', ''),
|
||||
('BF_BOOST_LIBPATH', 'Boost library path', '')
|
||||
) # end of opts.AddOptions()
|
||||
|
||||
return localopts
|
||||
|
@ -193,7 +193,7 @@ SEPARATE_MEMBER_PAGES = NO
|
||||
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
|
||||
# Doxygen uses this value to replace tabs by spaces in code fragments.
|
||||
|
||||
TAB_SIZE = 8
|
||||
TAB_SIZE = 4
|
||||
|
||||
# This tag can be used to specify a number of aliases that acts
|
||||
# as commands in the documentation. An alias has the form "name=value".
|
||||
|
@ -22,6 +22,10 @@
|
||||
* \ingroup python
|
||||
*/
|
||||
|
||||
/** \defgroup pymathutils Python Mathutils
|
||||
* \ingroup python
|
||||
*/
|
||||
|
||||
/** \defgroup pythonintern Python RNA and Operators
|
||||
* \ingroup python
|
||||
*/
|
||||
|
20
doc/python_api/examples/bpy.app.handlers.1.py
Normal file
20
doc/python_api/examples/bpy.app.handlers.1.py
Normal file
@ -0,0 +1,20 @@
|
||||
"""
|
||||
Persistent Handler Example
|
||||
++++++++++++++++++++++++++
|
||||
|
||||
By default handlers are freed when loading new files, in some cases you may
|
||||
wan't the handler stay running across multiple files (when the handler is
|
||||
part of an addon for example).
|
||||
|
||||
For this the :data:`bpy.app.handlers.persistent` decorator needs to be used.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
from bpy.app.handlers import persistent
|
||||
|
||||
|
||||
@persistent
|
||||
def load_handler(dummy):
|
||||
print("Load Handler:", bpy.data.filepath)
|
||||
|
||||
bpy.app.handlers.load_post.append(load_handler)
|
12
doc/python_api/examples/bpy.app.handlers.py
Normal file
12
doc/python_api/examples/bpy.app.handlers.py
Normal file
@ -0,0 +1,12 @@
|
||||
"""
|
||||
Basic Handler Example
|
||||
+++++++++++++++++++++
|
||||
This script shows the most simple example of adding a handler.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
||||
def my_handler(scene):
|
||||
print("Frame Change", scene.frame_current)
|
||||
|
||||
bpy.app.handlers.frame_change_pre.append(my_handler)
|
@ -50,7 +50,7 @@ For PDF generation
|
||||
|
||||
# Check we're running in blender
|
||||
if __import__("sys").modules.get("bpy") is None:
|
||||
print("\nError, this script must run from inside blender2.5")
|
||||
print("\nError, this script must run from inside blender")
|
||||
print(script_help_msg)
|
||||
|
||||
import sys
|
||||
@ -70,13 +70,14 @@ else:
|
||||
# for testing so doc-builds dont take so long.
|
||||
EXCLUDE_MODULES = (
|
||||
"bpy.context",
|
||||
"bpy.app",
|
||||
#"bpy.app",
|
||||
#"bpy.app.handlers",
|
||||
"bpy.path",
|
||||
"bpy.data",
|
||||
"bpy.props",
|
||||
"bpy.utils",
|
||||
"bpy.context",
|
||||
# "bpy.types", # supports filtering
|
||||
"bpy.types", # supports filtering
|
||||
"bpy.ops", # supports filtering
|
||||
"bpy_extras",
|
||||
"bge",
|
||||
@ -109,8 +110,18 @@ INFO_DOCS = (
|
||||
("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
|
||||
)
|
||||
|
||||
# import rpdb2; rpdb2.start_embedded_debugger('test')
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# configure compile time options
|
||||
|
||||
try:
|
||||
__import__("aud")
|
||||
except ImportError:
|
||||
print("Warning: Built without 'aud' module, docs incomplete...")
|
||||
EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
|
||||
|
||||
|
||||
# import rpdb2; rpdb2.start_embedded_debugger('test')
|
||||
import os
|
||||
import inspect
|
||||
import bpy
|
||||
@ -120,6 +131,7 @@ import rna_info
|
||||
ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
|
||||
MethodDescriptorType = type(dict.get)
|
||||
GetSetDescriptorType = type(int.real)
|
||||
from types import MemberDescriptorType
|
||||
|
||||
EXAMPLE_SET = set()
|
||||
EXAMPLE_SET_USED = set()
|
||||
@ -134,6 +146,10 @@ else:
|
||||
_BPY_PROP_COLLECTION_ID = "collection"
|
||||
|
||||
|
||||
def is_struct_seq(value):
|
||||
return isinstance(value, tuple) and type(tuple) != tuple and hasattr(value, "n_fields")
|
||||
|
||||
|
||||
def undocumented_message(module_name, type_name, identifier):
|
||||
if str(type_name).startswith('<module'):
|
||||
preloadtitle = '%s.%s' % (module_name, identifier)
|
||||
@ -305,6 +321,10 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
|
||||
fw(ident + ".. attribute:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, doc, False)
|
||||
fw("\n")
|
||||
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
|
||||
fw(ident + ".. data:: %s\n\n" % identifier)
|
||||
write_indented_lines(ident + " ", fw, doc, False)
|
||||
fw("\n")
|
||||
elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType):
|
||||
write_indented_lines(ident, fw, doc, False)
|
||||
fw("\n")
|
||||
@ -411,59 +431,90 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
|
||||
if key.startswith("__"):
|
||||
continue
|
||||
# naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
|
||||
if type(descr) == types.GetSetDescriptorType: # 'bpy_app_type' name is only used for examples and messages
|
||||
py_descr2sphinx("", fw, descr, module_name, "bpy_app_type", key)
|
||||
|
||||
# type_name is only used for examples and messages
|
||||
type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1] # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
|
||||
if type(descr) == types.GetSetDescriptorType:
|
||||
py_descr2sphinx("", fw, descr, module_name, type_name, key)
|
||||
attribute_set.add(key)
|
||||
descr_sorted = []
|
||||
for key, descr in sorted(type(module).__dict__.items()):
|
||||
if key.startswith("__"):
|
||||
continue
|
||||
|
||||
if type(descr) == types.MemberDescriptorType:
|
||||
if type(descr) == MemberDescriptorType:
|
||||
if descr.__doc__:
|
||||
fw(".. data:: %s\n\n" % key)
|
||||
write_indented_lines(" ", fw, descr.__doc__, False)
|
||||
fw("\n")
|
||||
attribute_set.add(key)
|
||||
value = getattr(module, key, None)
|
||||
|
||||
del key, descr
|
||||
value_type = type(value)
|
||||
descr_sorted.append((key, descr, value, type(value)))
|
||||
# sort by the valye type
|
||||
descr_sorted.sort(key=lambda descr_data: str(descr_data[3]))
|
||||
for key, descr, value, value_type in descr_sorted:
|
||||
|
||||
# must be documented as a submodule
|
||||
if is_struct_seq(value):
|
||||
continue
|
||||
|
||||
type_name = value_type.__name__
|
||||
py_descr2sphinx("", fw, descr, module_name, type_name, key)
|
||||
|
||||
attribute_set.add(key)
|
||||
|
||||
del key, descr, descr_sorted
|
||||
|
||||
classes = []
|
||||
submodules = []
|
||||
|
||||
# use this list so we can sort by type
|
||||
module_dir_value_type = []
|
||||
|
||||
for attribute in module_dir:
|
||||
if not attribute.startswith("_"):
|
||||
if attribute in attribute_set:
|
||||
continue
|
||||
if attribute.startswith("_"):
|
||||
continue
|
||||
|
||||
if attribute.startswith("n_"): # annoying exception, needed for bpy.app
|
||||
continue
|
||||
if attribute in attribute_set:
|
||||
continue
|
||||
|
||||
value = getattr(module, attribute)
|
||||
if attribute.startswith("n_"): # annoying exception, needed for bpy.app
|
||||
continue
|
||||
|
||||
value_type = type(value)
|
||||
# workaround for bpy.app documenting .index() and .count()
|
||||
if isinstance(module, tuple) and hasattr(tuple, attribute):
|
||||
continue
|
||||
|
||||
if value_type == types.FunctionType:
|
||||
pyfunc2sphinx("", fw, attribute, value, is_class=False)
|
||||
elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof
|
||||
# note: can't get args from these, so dump the string as is
|
||||
# this means any module used like this must have fully formatted docstrings.
|
||||
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
||||
elif value_type == type:
|
||||
classes.append((attribute, value))
|
||||
elif issubclass(value_type, types.ModuleType):
|
||||
submodules.append((attribute, value))
|
||||
elif value_type in (bool, int, float, str, tuple):
|
||||
# constant, not much fun we can do here except to list it.
|
||||
# TODO, figure out some way to document these!
|
||||
fw(".. data:: %s\n\n" % attribute)
|
||||
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
|
||||
fw("\n")
|
||||
else:
|
||||
print("\tnot documenting %s.%s of %r type" % (module_name, attribute, value_type.__name__))
|
||||
continue
|
||||
value = getattr(module, attribute)
|
||||
|
||||
attribute_set.add(attribute)
|
||||
# TODO, more types...
|
||||
module_dir_value_type.append((attribute, value, type(value)))
|
||||
|
||||
# sort by str of each type
|
||||
# this way lists, functions etc are grouped.
|
||||
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
|
||||
|
||||
for attribute, value, value_type in module_dir_value_type:
|
||||
if value_type == types.FunctionType:
|
||||
pyfunc2sphinx("", fw, attribute, value, is_class=False)
|
||||
elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof
|
||||
# note: can't get args from these, so dump the string as is
|
||||
# this means any module used like this must have fully formatted docstrings.
|
||||
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
|
||||
elif value_type == type:
|
||||
classes.append((attribute, value))
|
||||
elif issubclass(value_type, types.ModuleType):
|
||||
submodules.append((attribute, value))
|
||||
elif value_type in (bool, int, float, str, tuple):
|
||||
# constant, not much fun we can do here except to list it.
|
||||
# TODO, figure out some way to document these!
|
||||
#fw(".. data:: %s\n\n" % attribute)
|
||||
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
|
||||
fw("\n")
|
||||
else:
|
||||
print("\tnot documenting %s.%s of %r type" % (module_name, attribute, value_type.__name__))
|
||||
continue
|
||||
|
||||
attribute_set.add(attribute)
|
||||
# TODO, more types...
|
||||
del module_dir_value_type
|
||||
|
||||
# TODO, bpy_extras does this already, mathutils not.
|
||||
"""
|
||||
@ -1103,6 +1154,8 @@ def rna2sphinx(BASEPATH):
|
||||
fw(" bpy.path.rst\n\n")
|
||||
if "bpy.app" not in EXCLUDE_MODULES:
|
||||
fw(" bpy.app.rst\n\n")
|
||||
if "bpy.app.handlers" not in EXCLUDE_MODULES:
|
||||
fw(" bpy.app.handlers.rst\n\n")
|
||||
|
||||
# C modules
|
||||
if "bpy.props" not in EXCLUDE_MODULES:
|
||||
@ -1242,6 +1295,10 @@ def rna2sphinx(BASEPATH):
|
||||
from bpy import app as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
|
||||
|
||||
if "bpy.app.handlers" not in EXCLUDE_MODULES:
|
||||
from bpy.app import handlers as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.app.handlers", module, "Application Handlers")
|
||||
|
||||
if "bpy.props" not in EXCLUDE_MODULES:
|
||||
from bpy import props as module
|
||||
pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
|
||||
|
@ -226,7 +226,7 @@ Factory_lowpass(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "f|f:lowpass", &frequency, &Q))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -267,7 +267,7 @@ Factory_delay(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "f:delay", &delay))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -303,7 +303,7 @@ PyDoc_STRVAR(M_aud_Factory_join_doc,
|
||||
static PyObject *
|
||||
Factory_join(Factory* self, PyObject* object)
|
||||
{
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
|
||||
if(!PyObject_TypeCheck(object, type))
|
||||
{
|
||||
@ -354,7 +354,7 @@ Factory_highpass(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "f|f:highpass", &frequency, &Q))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -395,7 +395,7 @@ Factory_limit(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "ff:limit", &start, &end))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -439,7 +439,7 @@ Factory_pitch(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "f:pitch", &factor))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -481,7 +481,7 @@ Factory_volume(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "f:volume", &volume))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -524,7 +524,7 @@ Factory_fadein(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "ff:fadein", &start, &length))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -568,7 +568,7 @@ Factory_fadeout(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "ff:fadeout", &start, &length))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -610,7 +610,7 @@ Factory_loop(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "i:loop", &loop))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -646,7 +646,7 @@ PyDoc_STRVAR(M_aud_Factory_mix_doc,
|
||||
static PyObject *
|
||||
Factory_mix(Factory* self, PyObject* object)
|
||||
{
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
|
||||
if(!PyObject_TypeCheck(object, type))
|
||||
{
|
||||
@ -686,7 +686,7 @@ PyDoc_STRVAR(M_aud_Factory_pingpong_doc,
|
||||
static PyObject *
|
||||
Factory_pingpong(Factory* self)
|
||||
{
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -725,7 +725,7 @@ PyDoc_STRVAR(M_aud_Factory_reverse_doc,
|
||||
static PyObject *
|
||||
Factory_reverse(Factory* self)
|
||||
{
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -763,7 +763,7 @@ PyDoc_STRVAR(M_aud_Factory_buffer_doc,
|
||||
static PyObject *
|
||||
Factory_buffer(Factory* self)
|
||||
{
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -802,7 +802,7 @@ Factory_square(Factory* self, PyObject* args)
|
||||
if(!PyArg_ParseTuple(args, "|f:square", &threshold))
|
||||
return NULL;
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
@ -905,7 +905,7 @@ Factory_filter(Factory* self, PyObject* args)
|
||||
else
|
||||
a.push_back(1);
|
||||
|
||||
PyTypeObject* type = ((PyObject*)self)->ob_type;
|
||||
PyTypeObject* type = Py_TYPE(self);
|
||||
Factory *parent = (Factory*)type->tp_alloc(type, 0);
|
||||
|
||||
if(parent != NULL)
|
||||
|
@ -454,7 +454,7 @@ extern float* AUD_readSoundBuffer(const char* filename, float low, float high,
|
||||
/**
|
||||
* Pauses a playing sound after a specific amount of time.
|
||||
* \param handle The handle to the sound.
|
||||
* \param time The time in seconds.
|
||||
* \param seconds The time in seconds.
|
||||
* \return The silence handle.
|
||||
*/
|
||||
extern AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds);
|
||||
|
@ -108,6 +108,10 @@ if(WITH_INPUT_NDOF)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_XDG_USER_DIRS)
|
||||
add_definitions(-DWITH_XDG_USER_DIRS)
|
||||
endif()
|
||||
|
||||
if(WITH_HEADLESS OR WITH_GHOST_SDL)
|
||||
if(WITH_HEADLESS)
|
||||
list(APPEND SRC
|
||||
|
@ -52,15 +52,15 @@ struct GHOST_Buttons {
|
||||
|
||||
/**
|
||||
* Returns the state of a single button.
|
||||
* @param mask. Key button to return.
|
||||
* @param mask Key button to return.
|
||||
* @return The state of the button (pressed == true).
|
||||
*/
|
||||
virtual bool get(GHOST_TButtonMask mask) const;
|
||||
|
||||
/**
|
||||
* Updates the state of a single button.
|
||||
* @param mask. Button state to update.
|
||||
* @param down. The new state of the button.
|
||||
* @param mask Button state to update.
|
||||
* @param down The new state of the button.
|
||||
*/
|
||||
virtual void set(GHOST_TButtonMask mask, bool down);
|
||||
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
/**
|
||||
* Returns the number of display settings for this display device.
|
||||
* @param display The index of the display to query with 0 <= display < getNumDisplays().
|
||||
* @param setting The number of settings of the display device with this index.
|
||||
* @param numSettings The number of settings of the display device with this index.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const;
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/** \file ghost/intern/GHOST_EventWheel.h
|
||||
* \ingroup GHOSTeel.h
|
||||
* \ingroup GHOST
|
||||
* Declaration of GHOST_EventWheel class.
|
||||
*/
|
||||
|
||||
|
@ -41,6 +41,11 @@
|
||||
#include <stdio.h> // for fprintf only
|
||||
#include <cstdlib> // for exit
|
||||
|
||||
#ifdef WITH_XDG_USER_DIRS
|
||||
# include <pwd.h> // for get home without use getenv()
|
||||
# include <limits.h> // for PATH_MAX
|
||||
#endif
|
||||
|
||||
#ifdef PREFIX
|
||||
static const char *static_path= PREFIX "/share" ;
|
||||
#else
|
||||
@ -63,7 +68,27 @@ const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
|
||||
{
|
||||
#ifndef WITH_XDG_USER_DIRS
|
||||
return (const GHOST_TUns8 *)getenv("HOME");
|
||||
#else /* WITH_XDG_USER_DIRS */
|
||||
const char *home= getenv("XDG_CONFIG_HOME");
|
||||
|
||||
if (home) {
|
||||
return (const GHOST_TUns8 *)home;
|
||||
}
|
||||
else {
|
||||
static char user_path[PATH_MAX];
|
||||
|
||||
home= getenv("HOME");
|
||||
|
||||
if (home == NULL) {
|
||||
home= getpwuid(getuid())->pw_dir;
|
||||
}
|
||||
|
||||
snprintf(user_path, sizeof(user_path), "%s/.config", home);
|
||||
return (const GHOST_TUns8 *)user_path;
|
||||
}
|
||||
#endif /* WITH_XDG_USER_DIRS */
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
|
||||
|
@ -54,6 +54,8 @@ def main():
|
||||
|
||||
# fake module to allow:
|
||||
# from bpy.types import Panel
|
||||
sys.modules["bpy.app"] = app
|
||||
sys.modules["bpy.app.handlers"] = app.handlers
|
||||
sys.modules["bpy.types"] = types
|
||||
|
||||
#~ if "-d" in sys.argv: # Enable this to measure start up speed
|
||||
|
4
release/scripts/presets/camera/APS-C_DSLR.py
Normal file
4
release/scripts/presets/camera/APS-C_DSLR.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Blender.py
Normal file
4
release/scripts/presets/camera/Blender.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 32
|
||||
bpy.context.object.data.sensor_height = 18
|
||||
bpy.context.object.data.sensor_fit = 'AUTO'
|
4
release/scripts/presets/camera/Canon_1100D.py
Normal file
4
release/scripts/presets/camera/Canon_1100D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.2
|
||||
bpy.context.object.data.sensor_height = 14.7
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_1D.py
Normal file
4
release/scripts/presets/camera/Canon_1D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 27.9
|
||||
bpy.context.object.data.sensor_height = 18.6
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_1DS.py
Normal file
4
release/scripts/presets/camera/Canon_1DS.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 36.0
|
||||
bpy.context.object.data.sensor_height = 24.0
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_500D.py
Normal file
4
release/scripts/presets/camera/Canon_500D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_550D.py
Normal file
4
release/scripts/presets/camera/Canon_550D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_5D.py
Normal file
4
release/scripts/presets/camera/Canon_5D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 36.0
|
||||
bpy.context.object.data.sensor_height = 24.0
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_600D.py
Normal file
4
release/scripts/presets/camera/Canon_600D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_60D.py
Normal file
4
release/scripts/presets/camera/Canon_60D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Canon_7D.py
Normal file
4
release/scripts/presets/camera/Canon_7D.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.3
|
||||
bpy.context.object.data.sensor_height = 14.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D300S.py
Normal file
4
release/scripts/presets/camera/Nikon_D300S.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.6
|
||||
bpy.context.object.data.sensor_height = 15.8
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D3100.py
Normal file
4
release/scripts/presets/camera/Nikon_D3100.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.1
|
||||
bpy.context.object.data.sensor_height = 15.4
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D35.py
Normal file
4
release/scripts/presets/camera/Nikon_D35.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 36.0
|
||||
bpy.context.object.data.sensor_height = 23.9
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D5000.py
Normal file
4
release/scripts/presets/camera/Nikon_D5000.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.6
|
||||
bpy.context.object.data.sensor_height = 15.8
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D5100.py
Normal file
4
release/scripts/presets/camera/Nikon_D5100.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.6
|
||||
bpy.context.object.data.sensor_height = 15.6
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D7000.py
Normal file
4
release/scripts/presets/camera/Nikon_D7000.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.6
|
||||
bpy.context.object.data.sensor_height = 15.6
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Nikon_D90.py
Normal file
4
release/scripts/presets/camera/Nikon_D90.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 23.6
|
||||
bpy.context.object.data.sensor_height = 15.8
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Red_Epic.py
Normal file
4
release/scripts/presets/camera/Red_Epic.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 30.0
|
||||
bpy.context.object.data.sensor_height = 15.0
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Red_One_2K.py
Normal file
4
release/scripts/presets/camera/Red_One_2K.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 11.1
|
||||
bpy.context.object.data.sensor_height = 6.24
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Red_One_3K.py
Normal file
4
release/scripts/presets/camera/Red_One_3K.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 16.65
|
||||
bpy.context.object.data.sensor_height = 9.36
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/Red_One_4K.py
Normal file
4
release/scripts/presets/camera/Red_One_4K.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 22.2
|
||||
bpy.context.object.data.sensor_height = 12.6
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/full_frame_35mm_film.py
Normal file
4
release/scripts/presets/camera/full_frame_35mm_film.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 36
|
||||
bpy.context.object.data.sensor_height = 24
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/micro_four_thirds.py
Normal file
4
release/scripts/presets/camera/micro_four_thirds.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 17.3
|
||||
bpy.context.object.data.sensor_height = 13.0
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/super_16_film.py
Normal file
4
release/scripts/presets/camera/super_16_film.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 12.52
|
||||
bpy.context.object.data.sensor_height = 7.41
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
4
release/scripts/presets/camera/super_35_film.py
Normal file
4
release/scripts/presets/camera/super_35_film.py
Normal file
@ -0,0 +1,4 @@
|
||||
import bpy
|
||||
bpy.context.object.data.sensor_width = 24.89
|
||||
bpy.context.object.data.sensor_height = 18.66
|
||||
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
|
@ -192,6 +192,8 @@ class ProjectEdit(Operator):
|
||||
image_new.file_format = 'PNG'
|
||||
image_new.save()
|
||||
|
||||
filepath_final = bpy.path.abspath(filepath_final)
|
||||
|
||||
try:
|
||||
bpy.ops.image.external_edit(filepath=filepath_final)
|
||||
except RuntimeError as re:
|
||||
|
@ -195,6 +195,25 @@ class AddPresetRender(AddPresetBase, Operator):
|
||||
preset_subdir = "render"
|
||||
|
||||
|
||||
class AddPresetCamera(AddPresetBase, Operator):
|
||||
'''Add a Camera Preset'''
|
||||
bl_idname = "camera.preset_add"
|
||||
bl_label = "Add Camera Preset"
|
||||
preset_menu = "CAMERA_MT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"cam = bpy.context.object.data"
|
||||
]
|
||||
|
||||
preset_values = [
|
||||
"cam.sensor_width",
|
||||
"cam.sensor_height",
|
||||
"cam.sensor_fit"
|
||||
]
|
||||
|
||||
preset_subdir = "camera"
|
||||
|
||||
|
||||
class AddPresetSSS(AddPresetBase, Operator):
|
||||
'''Add a Subsurface Scattering Preset'''
|
||||
bl_idname = "material.sss_preset_add"
|
||||
|
@ -33,6 +33,14 @@ class CameraButtonsPanel():
|
||||
return context.camera and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class CAMERA_MT_presets(bpy.types.Menu):
|
||||
bl_label = "Camera Presets"
|
||||
preset_subdir = "camera"
|
||||
preset_operator = "script.execute_preset"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
draw = bpy.types.Menu.draw_preset
|
||||
|
||||
|
||||
class DATA_PT_context_camera(CameraButtonsPanel, Panel):
|
||||
bl_label = ""
|
||||
bl_options = {'HIDE_HEADER'}
|
||||
@ -54,7 +62,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel):
|
||||
split.separator()
|
||||
|
||||
|
||||
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
class DATA_PT_lens(CameraButtonsPanel, Panel):
|
||||
bl_label = "Lens"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
@ -69,12 +77,12 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
|
||||
col = split.column()
|
||||
if cam.type == 'PERSP':
|
||||
row = col.row()
|
||||
if cam.lens_unit == 'MILLIMETERS':
|
||||
col.prop(cam, "lens")
|
||||
row.prop(cam, "lens")
|
||||
elif cam.lens_unit == 'DEGREES':
|
||||
col.prop(cam, "angle")
|
||||
col = split.column()
|
||||
col.prop(cam, "lens_unit", text="")
|
||||
row.prop(cam, "angle")
|
||||
row.prop(cam, "lens_unit", text="")
|
||||
|
||||
elif cam.type == 'ORTHO':
|
||||
col.prop(cam, "ortho_scale")
|
||||
@ -100,18 +108,54 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
col.prop(cam, "clip_start", text="Start")
|
||||
col.prop(cam, "clip_end", text="End")
|
||||
|
||||
layout.label(text="Depth of Field:")
|
||||
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
bl_label = "Camera"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cam = context.camera
|
||||
|
||||
row = layout.row(align=True)
|
||||
|
||||
row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label)
|
||||
row.operator("camera.preset_add", text="", icon="ZOOMIN")
|
||||
row.operator("camera.preset_add", text="", icon="ZOOMOUT").remove_active = True
|
||||
|
||||
layout.label(text="Sensor:")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column(align=True)
|
||||
if cam.sensor_fit == 'AUTO':
|
||||
col.prop(cam, "sensor_width", text="Size")
|
||||
else:
|
||||
col.prop(cam, "sensor_width", text="Width")
|
||||
col.prop(cam, "sensor_height", text="Height")
|
||||
|
||||
col = split.column(align=True)
|
||||
col.prop(cam, "sensor_fit", text="")
|
||||
|
||||
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
|
||||
bl_label = "Depth of Field"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.label(text="Focus:")
|
||||
|
||||
split = layout.split()
|
||||
split.prop(cam, "dof_object", text="")
|
||||
|
||||
col = split.column()
|
||||
|
||||
if cam.dof_object is not None:
|
||||
col.enabled = False
|
||||
col.active = cam.dof_object is None
|
||||
col.prop(cam, "dof_distance", text="Distance")
|
||||
|
||||
|
||||
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
bl_label = "Display"
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
@ -127,10 +171,12 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
col.prop(cam, "show_limits", text="Limits")
|
||||
col.prop(cam, "show_mist", text="Mist")
|
||||
col.prop(cam, "show_title_safe", text="Title Safe")
|
||||
col.prop(cam, "show_sensor", text="Sensor")
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
col.prop_menu_enum(cam, "show_guide")
|
||||
|
||||
col = split.column()
|
||||
col.prop_menu_enum(cam, "show_guide")
|
||||
col.separator()
|
||||
col.prop(cam, "draw_size", text="Size")
|
||||
col.separator()
|
||||
col.prop(cam, "show_passepartout", text="Passepartout")
|
||||
|
@ -227,7 +227,7 @@ class WORLD_PT_mist(WorldButtonsPanel, Panel):
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.prop(world.mist_settings, "intensity", slider=True)
|
||||
col.prop(world.mist_settings, "intensity")
|
||||
col.prop(world.mist_settings, "start")
|
||||
|
||||
col = split.column()
|
||||
|
@ -213,19 +213,11 @@ class DOPESHEET_MT_marker(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
from .space_time import marker_menu_generic
|
||||
marker_menu_generic(layout)
|
||||
|
||||
st = context.space_data
|
||||
|
||||
#layout.operator_context = 'EXEC_REGION_WIN'
|
||||
|
||||
layout.operator("marker.add", "Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
|
||||
if st.mode in {'ACTION', 'SHAPEKEY'} and st.action:
|
||||
layout.separator()
|
||||
layout.prop(st, "show_pose_markers")
|
||||
|
@ -144,16 +144,8 @@ class GRAPH_MT_marker(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
#layout.operator_context = 'EXEC_REGION_WIN'
|
||||
|
||||
layout.operator("marker.add", "Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
from .space_time import marker_menu_generic
|
||||
marker_menu_generic(layout)
|
||||
|
||||
# TODO: pose markers for action edit mode only?
|
||||
|
||||
|
@ -104,16 +104,8 @@ class NLA_MT_marker(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
#layout.operator_context = 'EXEC_REGION_WIN'
|
||||
|
||||
layout.operator("marker.add", "Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
from .space_time import marker_menu_generic
|
||||
marker_menu_generic(layout)
|
||||
|
||||
|
||||
class NLA_MT_edit(Menu):
|
||||
|
@ -27,6 +27,7 @@ class NODE_HT_header(Header):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
snode = context.space_data
|
||||
snode_id = snode.id
|
||||
id_from = snode.id_from
|
||||
@ -42,11 +43,15 @@ class NODE_HT_header(Header):
|
||||
|
||||
layout.prop(snode, "tree_type", text="", expand=True)
|
||||
|
||||
if snode.tree_type == 'MATERIAL':
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_material", new="material.new")
|
||||
if snode_id:
|
||||
layout.prop(snode_id, "use_nodes")
|
||||
if snode.tree_type == 'SHADER':
|
||||
if scene.render.use_shading_nodes:
|
||||
layout.prop(snode, "shader_type", text="", expand=True)
|
||||
|
||||
if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_material", new="material.new")
|
||||
if snode_id:
|
||||
layout.prop(snode_id, "use_nodes")
|
||||
|
||||
elif snode.tree_type == 'TEXTURE':
|
||||
layout.prop(snode, "texture_type", text="", expand=True)
|
||||
|
@ -158,18 +158,8 @@ class SEQUENCER_MT_marker(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
#layout.operator_context = 'EXEC_REGION_WIN'
|
||||
|
||||
layout.operator("marker.add", "Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
|
||||
#layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
|
||||
from .space_time import marker_menu_generic
|
||||
marker_menu_generic(layout)
|
||||
|
||||
|
||||
class SEQUENCER_MT_change(Menu):
|
||||
|
@ -36,6 +36,7 @@ class TIME_HT_header(Header):
|
||||
|
||||
if context.area.show_menus:
|
||||
row.menu("TIME_MT_view")
|
||||
row.menu("TIME_MT_marker")
|
||||
row.menu("TIME_MT_frame")
|
||||
row.menu("TIME_MT_playback")
|
||||
|
||||
@ -91,6 +92,15 @@ class TIME_HT_header(Header):
|
||||
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
|
||||
|
||||
|
||||
class TIME_MT_marker(bpy.types.Menu):
|
||||
bl_label = "Marker"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
marker_menu_generic(layout)
|
||||
|
||||
|
||||
class TIME_MT_view(Menu):
|
||||
bl_label = "View"
|
||||
|
||||
@ -143,17 +153,6 @@ class TIME_MT_frame(Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("marker.add", text="Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("time.start_frame_set")
|
||||
layout.operator("time.end_frame_set")
|
||||
|
||||
@ -198,5 +197,28 @@ class TIME_MT_autokey(Menu):
|
||||
layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS')
|
||||
layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS')
|
||||
|
||||
|
||||
def marker_menu_generic(layout):
|
||||
|
||||
#layout.operator_context = 'EXEC_REGION_WIN'
|
||||
|
||||
layout.column()
|
||||
layout.operator("marker.add", "Add Marker")
|
||||
layout.operator("marker.duplicate", text="Duplicate Marker")
|
||||
|
||||
if(len(bpy.data.scenes) > 10):
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.operator("marker.make_links_scene", text="Duplicate Marker to Scene...", icon='OUTLINER_OB_EMPTY')
|
||||
else:
|
||||
layout.operator_menu_enum("marker.make_links_scene", "scene", text="Duplicate Marker to Scene...")
|
||||
|
||||
layout.operator("marker.delete", text="Delete Marker")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
bpy.utils.register_module(__name__)
|
||||
|
@ -976,10 +976,8 @@ class VIEW3D_MT_make_links(Menu):
|
||||
if(len(bpy.data.scenes) > 10):
|
||||
layout.operator_context = 'INVOKE_DEFAULT'
|
||||
layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
|
||||
layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY')
|
||||
else:
|
||||
layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
|
||||
layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...")
|
||||
|
||||
layout.operator_enum("object.make_links_data", "type") # inline
|
||||
|
||||
@ -1086,6 +1084,7 @@ class VIEW3D_MT_paint_weight(Menu):
|
||||
|
||||
layout.operator("object.vertex_group_normalize_all", text="Normalize All")
|
||||
layout.operator("object.vertex_group_normalize", text="Normalize")
|
||||
layout.operator("object.vertex_group_mirror", text="Mirror")
|
||||
layout.operator("object.vertex_group_invert", text="Invert")
|
||||
layout.operator("object.vertex_group_clean", text="Clean")
|
||||
layout.operator("object.vertex_group_levels", text="Levels")
|
||||
@ -2142,10 +2141,11 @@ class VIEW3D_PT_view3d_display(Panel):
|
||||
subsub.active = scene.unit_settings.system == 'NONE'
|
||||
subsub.prop(view, "grid_subdivisions", text="Subdivisions")
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Shading:")
|
||||
col.prop(gs, "material_mode", text="")
|
||||
col.prop(view, "show_textured_solid")
|
||||
if not scene.render.use_shading_nodes:
|
||||
col = layout.column()
|
||||
col.label(text="Shading:")
|
||||
col.prop(gs, "material_mode", text="")
|
||||
col.prop(view, "show_textured_solid")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
@ -209,7 +209,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
||||
col.operator("transform.resize", text="Scale")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.operator("transform.transform", text="Tilt").mode = 'TILT'
|
||||
col.operator("transform.tilt", text="Tilt")
|
||||
col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
|
||||
|
||||
col = layout.column(align=True)
|
||||
@ -481,12 +481,9 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
|
||||
col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
|
||||
|
||||
# Particle Mode #
|
||||
|
||||
# XXX This needs a check if psys is editable.
|
||||
if context.particle_edit_object:
|
||||
tool = settings.tool
|
||||
|
||||
# XXX Select Particle System
|
||||
layout.column().prop(settings, "tool", expand=True)
|
||||
|
||||
if tool != 'NONE':
|
||||
@ -825,13 +822,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
|
||||
|
||||
if brush.use_anchor:
|
||||
col.separator()
|
||||
row = col.row()
|
||||
row.prop(brush, "use_edge_to_edge", "Edge To Edge")
|
||||
col.prop(brush, "use_edge_to_edge", "Edge To Edge")
|
||||
|
||||
if brush.use_airbrush:
|
||||
col.separator()
|
||||
row = col.row()
|
||||
row.prop(brush, "rate", text="Rate", slider=True)
|
||||
col.prop(brush, "rate", text="Rate", slider=True)
|
||||
|
||||
if brush.use_space:
|
||||
col.separator()
|
||||
@ -857,8 +852,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
|
||||
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
||||
|
||||
else:
|
||||
row = col.row()
|
||||
row.prop(brush, "use_airbrush")
|
||||
col.prop(brush, "use_airbrush")
|
||||
|
||||
row = col.row()
|
||||
row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
|
||||
@ -867,8 +861,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
|
||||
col.separator()
|
||||
|
||||
if not image_paint:
|
||||
row = col.row()
|
||||
row.prop(brush, "use_smooth_stroke")
|
||||
col.prop(brush, "use_smooth_stroke")
|
||||
|
||||
col = layout.column()
|
||||
col.active = brush.use_smooth_stroke
|
||||
@ -879,9 +872,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
|
||||
|
||||
col = layout.column()
|
||||
col.active = (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'})
|
||||
|
||||
row = col.row()
|
||||
row.prop(brush, "use_space")
|
||||
col.prop(brush, "use_space")
|
||||
|
||||
row = col.row()
|
||||
row.active = brush.use_space
|
||||
@ -1011,14 +1002,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel):
|
||||
else:
|
||||
col.prop(brush, "cursor_color_add", text="Color")
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Icon:")
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(brush, "use_custom_icon")
|
||||
col = layout.column(align=True)
|
||||
col.prop(brush, "use_custom_icon")
|
||||
if brush.use_custom_icon:
|
||||
row = col.row(align=True)
|
||||
row.prop(brush, "icon_filepath", text="")
|
||||
col.prop(brush, "icon_filepath", text="")
|
||||
|
||||
# ********** default tools for weight-paint ****************
|
||||
|
||||
@ -1036,6 +1023,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
|
||||
col.active = ob.vertex_groups.active is not None
|
||||
col.operator("object.vertex_group_normalize_all", text="Normalize All")
|
||||
col.operator("object.vertex_group_normalize", text="Normalize")
|
||||
col.operator("object.vertex_group_mirror", text="Mirror")
|
||||
col.operator("object.vertex_group_invert", text="Invert")
|
||||
col.operator("object.vertex_group_clean", text="Clean")
|
||||
col.operator("object.vertex_group_levels", text="Levels")
|
||||
@ -1132,53 +1120,46 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
|
||||
use_projection = ipaint.use_projection
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
sub.active = use_projection
|
||||
sub.prop(ipaint, "use_occlude")
|
||||
sub.prop(ipaint, "use_backface_culling")
|
||||
col.active = use_projection
|
||||
col.prop(ipaint, "use_occlude")
|
||||
col.prop(ipaint, "use_backface_culling")
|
||||
|
||||
row = layout.row()
|
||||
row.active = (use_projection)
|
||||
row.prop(ipaint, "use_normal_falloff")
|
||||
|
||||
sub = row.row()
|
||||
sub.active = (ipaint.use_normal_falloff)
|
||||
sub.prop(ipaint, "normal_angle", text="")
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
col.active = (use_projection)
|
||||
col.prop(ipaint, "use_normal_falloff")
|
||||
split.active = (use_projection)
|
||||
split.prop(ipaint, "use_stencil_layer", text="Stencil")
|
||||
|
||||
col = split.column()
|
||||
col.active = (ipaint.use_normal_falloff and use_projection)
|
||||
col.prop(ipaint, "normal_angle", text="")
|
||||
row = split.row()
|
||||
row.active = (ipaint.use_stencil_layer)
|
||||
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
|
||||
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
|
||||
|
||||
col = layout.column(align=False)
|
||||
row = col.row()
|
||||
row.active = (use_projection)
|
||||
row.prop(ipaint, "use_stencil_layer", text="Stencil")
|
||||
|
||||
row2 = row.row(align=False)
|
||||
row2.active = (use_projection and ipaint.use_stencil_layer)
|
||||
row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
|
||||
row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
|
||||
|
||||
col = layout.column()
|
||||
sub = col.column()
|
||||
row = sub.row()
|
||||
row = layout.row()
|
||||
row.active = (settings.brush.image_tool == 'CLONE')
|
||||
|
||||
row.prop(ipaint, "use_clone_layer", text="Layer")
|
||||
row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name)
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(ipaint, "seam_bleed")
|
||||
layout.prop(ipaint, "seam_bleed")
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="External Editing:")
|
||||
|
||||
col.label(text="External Editing")
|
||||
row = col.split(align=True, percentage=0.55)
|
||||
row.operator("image.project_edit", text="Quick Edit")
|
||||
row.operator("image.project_apply", text="Apply")
|
||||
row = col.row(align=True)
|
||||
row.prop(ipaint, "screen_grab_size", text="")
|
||||
|
||||
sub = col.column()
|
||||
sub.operator("paint.project_image", text="Apply Camera Image")
|
||||
col.row().prop(ipaint, "screen_grab_size", text="")
|
||||
|
||||
sub.operator("image.save_dirty", text="Save All Edited")
|
||||
col.operator("paint.project_image", text="Apply Camera Image")
|
||||
col.operator("image.save_dirty", text="Save All Edited")
|
||||
|
||||
|
||||
class VIEW3D_PT_imagepaint_options(PaintPanel):
|
||||
|
@ -122,36 +122,37 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
|
||||
/* Note,
|
||||
* blf_font_ensure_ascii_table(font); must be called before this macro */
|
||||
|
||||
#define BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table) \
|
||||
if(((c)= (str)[i]) < 0x80) { \
|
||||
g= (glyph_ascii_table)[c]; \
|
||||
i++; \
|
||||
#define BLF_UTF8_NEXT_FAST(_font, _g, _str, _i, _c, _glyph_ascii_table) \
|
||||
if(((_c)= (_str)[_i]) < 0x80) { \
|
||||
_g= (_glyph_ascii_table)[_c]; \
|
||||
_i++; \
|
||||
} \
|
||||
else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) { \
|
||||
if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) { \
|
||||
g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c); \
|
||||
else if ((_c= BLI_str_utf8_as_unicode_step(_str, &(_i)))!=BLI_UTF8_ERR) { \
|
||||
if ((_g= blf_glyph_search((_font)->glyph_cache, _c)) == NULL) { \
|
||||
_g= blf_glyph_add(_font, \
|
||||
FT_Get_Char_Index((_font)->face, _c), _c); \
|
||||
} \
|
||||
} \
|
||||
|
||||
|
||||
#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
|
||||
const short has_kerning= FT_HAS_KERNING((_font)->face); \
|
||||
const FT_UInt kern_mode= (has_kerning == 0) ? 0 : \
|
||||
const short _has_kerning= FT_HAS_KERNING((_font)->face); \
|
||||
const FT_UInt _kern_mode= (_has_kerning == 0) ? 0 : \
|
||||
(((_font)->flags & BLF_KERNING_DEFAULT) ? \
|
||||
ft_kerning_default : FT_KERNING_UNFITTED) \
|
||||
|
||||
|
||||
#define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x) \
|
||||
#define BLF_KERNING_STEP(_font, _kern_mode, _g_prev, _g, _delta, _pen_x) \
|
||||
{ \
|
||||
if (g_prev) { \
|
||||
delta.x= delta.y= 0; \
|
||||
if (_g_prev) { \
|
||||
_delta.x= _delta.y= 0; \
|
||||
if (FT_Get_Kerning((_font)->face, \
|
||||
(g_prev)->idx, \
|
||||
(g)->idx, \
|
||||
kern_mode, \
|
||||
&(delta)) == 0) \
|
||||
(_g_prev)->idx, \
|
||||
(_g)->idx, \
|
||||
_kern_mode, \
|
||||
&(_delta)) == 0) \
|
||||
{ \
|
||||
pen_x += delta.x >> 6; \
|
||||
_pen_x += delta.x >> 6; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
|
@ -120,7 +120,7 @@ void BLF_lang_set(const char *str)
|
||||
const char *short_locale;
|
||||
int ok= 1;
|
||||
#if defined (_WIN32) && !defined(FREE_WINDOWS)
|
||||
char *long_locale = locales[ 2 * U.language];
|
||||
const char *long_locale = locales[ 2 * U.language];
|
||||
#endif
|
||||
|
||||
if((U.transopts&USER_DOTRANSLATE)==0)
|
||||
|
@ -42,7 +42,7 @@ extern "C" {
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 260
|
||||
#define BLENDER_SUBVERSION 0
|
||||
#define BLENDER_SUBVERSION 1
|
||||
|
||||
#define BLENDER_MINVERSION 250
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
|
@ -203,17 +203,17 @@ int CTX_data_dir(const char *member);
|
||||
/*void CTX_data_pointer_set(bContextDataResult *result, void *data);
|
||||
void CTX_data_list_add(bContextDataResult *result, void *data);*/
|
||||
|
||||
#define CTX_DATA_BEGIN(C, Type, instance, member) \
|
||||
{ \
|
||||
ListBase ctx_data_list; \
|
||||
CollectionPointerLink *ctx_link; \
|
||||
CTX_data_##member(C, &ctx_data_list); \
|
||||
for(ctx_link=ctx_data_list.first; ctx_link; ctx_link=ctx_link->next) { \
|
||||
#define CTX_DATA_BEGIN(C, Type, instance, member) \
|
||||
{ \
|
||||
ListBase ctx_data_list; \
|
||||
CollectionPointerLink *ctx_link; \
|
||||
CTX_data_##member(C, &ctx_data_list); \
|
||||
for(ctx_link=ctx_data_list.first; ctx_link; ctx_link=ctx_link->next) {\
|
||||
Type instance= ctx_link->ptr.data;
|
||||
|
||||
#define CTX_DATA_END \
|
||||
} \
|
||||
BLI_freelistN(&ctx_data_list); \
|
||||
#define CTX_DATA_END \
|
||||
} \
|
||||
BLI_freelistN(&ctx_data_list); \
|
||||
}
|
||||
|
||||
int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*));
|
||||
|
@ -65,6 +65,7 @@ void make_local_curve( struct Curve *cu);
|
||||
struct ListBase *curve_editnurbs(struct Curve *cu);
|
||||
short curve_type( struct Curve *cu);
|
||||
void test_curve_type( struct Object *ob);
|
||||
void update_curve_dimension( struct Curve *cu );
|
||||
void tex_space_curve( struct Curve *cu);
|
||||
int count_curveverts( struct ListBase *nurb);
|
||||
int count_curveverts_without_handles( struct ListBase *nurb);
|
||||
|
@ -45,6 +45,7 @@ struct bDeformGroup *defgroup_duplicate(struct bDeformGroup *ingroup);
|
||||
struct bDeformGroup *defgroup_find_name(struct Object *ob, const char *name);
|
||||
int defgroup_find_index(struct Object *ob, struct bDeformGroup *dg);
|
||||
int *defgroup_flip_map(struct Object *ob, int *flip_map_len, int use_default);
|
||||
int *defgroup_flip_map_single(struct Object *ob, int *flip_map_len, int use_default, int defgroup);
|
||||
int defgroup_flip_index(struct Object *ob, int index, int use_default);
|
||||
int defgroup_name_index(struct Object *ob, const char *name);
|
||||
void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob);
|
||||
@ -57,7 +58,7 @@ float defvert_array_find_weight_safe(const struct MDeformVert *dvert, int index
|
||||
|
||||
void defvert_copy(struct MDeformVert *dvert_r, const struct MDeformVert *dvert);
|
||||
void defvert_sync(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, int use_verify);
|
||||
void defvert_sync_mapped(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, const int *flip_map, const int flip_map_len, int use_verify);
|
||||
void defvert_sync_mapped(struct MDeformVert *dvert_r, const struct MDeformVert *dvert, const int *flip_map, const int flip_map_len, const int use_verify);
|
||||
void defvert_remap (struct MDeformVert *dvert, int *map);
|
||||
void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
|
||||
void defvert_normalize(struct MDeformVert *dvert);
|
||||
|
@ -120,6 +120,12 @@ void DAG_ids_flush_update(struct Main *bmain, int time);
|
||||
void DAG_id_tag_update(struct ID *id, short flag);
|
||||
/* flush all tagged updates */
|
||||
void DAG_ids_flush_tagged(struct Main *bmain);
|
||||
/* check and clear ID recalc flags */
|
||||
void DAG_ids_check_recalc(struct Main *bmain);
|
||||
void DAG_ids_clear_recalc(struct Main *bmain);
|
||||
/* test if any of this id type is tagged for update */
|
||||
void DAG_id_type_tag(struct Main *bmain, short idtype);
|
||||
int DAG_id_type_tagged(struct Main *bmain, short idtype);
|
||||
|
||||
/* (re)-create dependency graph for armature pose */
|
||||
void DAG_pose_sort(struct Object *ob);
|
||||
@ -127,6 +133,9 @@ void DAG_pose_sort(struct Object *ob);
|
||||
/* callback for editors module to do updates */
|
||||
void DAG_editors_update_cb(void (*func)(struct Main *bmain, struct ID *id));
|
||||
|
||||
/* debugging */
|
||||
void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -58,7 +58,7 @@ typedef struct Global {
|
||||
/* flag: if != 0 G.main->name contains valid relative base path */
|
||||
int relbase_valid;
|
||||
|
||||
/* strings of recent opend files */
|
||||
/* strings of recent opened files */
|
||||
struct ListBase recent_files;
|
||||
|
||||
short afbreek, moving, file_loaded;
|
||||
|
@ -49,6 +49,7 @@ void *alloc_libblock(struct ListBase *lb, short type, const char *name);
|
||||
void *copy_libblock(void *rt);
|
||||
void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action);
|
||||
|
||||
void BKE_id_lib_local_paths(struct Main *bmain, struct ID *id);
|
||||
void id_lib_extern(struct ID *id);
|
||||
void BKE_library_filepath_set(struct Library *lib, const char *filepath);
|
||||
void id_us_plus(struct ID *id);
|
||||
|
@ -130,7 +130,7 @@ typedef struct bNodeType {
|
||||
char name[32];
|
||||
float width, minwidth, maxwidth;
|
||||
float height, minheight, maxheight;
|
||||
short nclass, flag;
|
||||
short nclass, flag, compatibility;
|
||||
|
||||
/* templates for static sockets */
|
||||
bNodeSocketTemplate *inputs, *outputs;
|
||||
@ -230,8 +230,13 @@ typedef struct bNodeType {
|
||||
#define NODE_CLASS_PARTICLES 25
|
||||
#define NODE_CLASS_TRANSFORM 30
|
||||
#define NODE_CLASS_COMBINE 31
|
||||
#define NODE_CLASS_SHADER 40
|
||||
#define NODE_CLASS_LAYOUT 100
|
||||
|
||||
/* nodetype->compatibility */
|
||||
#define NODE_OLD_SHADING 1
|
||||
#define NODE_NEW_SHADING 2
|
||||
|
||||
/* enum values for input/output */
|
||||
#define SOCK_IN 1
|
||||
#define SOCK_OUT 2
|
||||
@ -388,6 +393,7 @@ void node_type_exec_new(struct bNodeType *ntype,
|
||||
void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **));
|
||||
void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out));
|
||||
void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out));
|
||||
void node_type_compatibility(struct bNodeType *ntype, short compatibility);
|
||||
|
||||
/* ************** COMMON NODES *************** */
|
||||
|
||||
|
@ -139,9 +139,12 @@ struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob,
|
||||
int object_is_modified(struct Scene *scene, struct Object *ob);
|
||||
|
||||
void object_camera_mode(struct RenderData *rd, struct Object *camera);
|
||||
void object_camera_intrinsics(struct Object *camera, struct Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
|
||||
float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit);
|
||||
void object_camera_matrix(
|
||||
struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second,
|
||||
float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor,
|
||||
float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens,
|
||||
float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
|
||||
float *viewdx, float *viewdy);
|
||||
|
||||
void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
|
||||
|
@ -88,6 +88,8 @@ int scene_check_setscene(struct Main *bmain, struct Scene *sce);
|
||||
float BKE_curframe(struct Scene *scene);
|
||||
|
||||
void scene_update_tagged(struct Main *bmain, struct Scene *sce);
|
||||
void scene_clear_tagged(struct Main *bmain, struct Scene *sce);
|
||||
|
||||
void scene_update_for_newframe(struct Main *bmain, struct Scene *sce, unsigned int lay);
|
||||
|
||||
void scene_add_render_layer(struct Scene *sce);
|
||||
@ -98,6 +100,8 @@ int get_render_child_particle_number(struct RenderData *r, int num);
|
||||
int get_render_shadow_samples(struct RenderData *r, int samples);
|
||||
float get_render_aosss_error(struct RenderData *r, float error);
|
||||
|
||||
int scene_use_new_shading_nodes(struct Scene *scene);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -34,22 +34,23 @@
|
||||
*/
|
||||
|
||||
struct ARegion;
|
||||
struct Header;
|
||||
struct ListBase;
|
||||
struct Menu;
|
||||
struct Panel;
|
||||
struct Scene;
|
||||
struct ScrArea;
|
||||
struct SpaceType;
|
||||
struct View3D;
|
||||
struct bContext;
|
||||
struct bContextDataResult;
|
||||
struct bScreen;
|
||||
struct ListBase;
|
||||
struct Panel;
|
||||
struct Header;
|
||||
struct Menu;
|
||||
struct ScrArea;
|
||||
struct SpaceType;
|
||||
struct Scene;
|
||||
struct uiLayout;
|
||||
struct uiMenuItem;
|
||||
struct wmKeyConfig;
|
||||
struct wmNotifier;
|
||||
struct wmWindow;
|
||||
struct wmWindowManager;
|
||||
struct wmKeyConfig;
|
||||
struct uiLayout;
|
||||
struct uiMenuItem;
|
||||
|
||||
#include "RNA_types.h"
|
||||
|
||||
@ -239,6 +240,7 @@ void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
|
||||
void BKE_screen_area_free(struct ScrArea *sa);
|
||||
|
||||
struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
|
||||
struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min);
|
||||
|
||||
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
|
||||
void BKE_screen_view3d_scene_sync(struct bScreen *sc);
|
||||
|
@ -67,21 +67,21 @@ void seq_next(SeqIterator *iter);
|
||||
void seq_end(SeqIterator *iter);
|
||||
void seq_array(struct Editing *ed, struct Sequence ***seqarray, int *tot, int use_pointer);
|
||||
|
||||
#define SEQP_BEGIN(ed, _seq) \
|
||||
{ \
|
||||
SeqIterator iter;\
|
||||
for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { \
|
||||
#define SEQP_BEGIN(ed, _seq) \
|
||||
{ \
|
||||
SeqIterator iter; \
|
||||
for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { \
|
||||
_seq= iter.seq;
|
||||
|
||||
#define SEQ_BEGIN(ed, _seq) \
|
||||
{ \
|
||||
SeqIterator iter;\
|
||||
for(seq_begin(ed, &iter, 0); iter.valid; seq_next(&iter)) { \
|
||||
#define SEQ_BEGIN(ed, _seq) \
|
||||
{ \
|
||||
SeqIterator iter; \
|
||||
for(seq_begin(ed, &iter, 0); iter.valid; seq_next(&iter)) { \
|
||||
_seq= iter.seq;
|
||||
|
||||
#define SEQ_END \
|
||||
} \
|
||||
seq_end(&iter); \
|
||||
#define SEQ_END \
|
||||
} \
|
||||
seq_end(&iter); \
|
||||
}
|
||||
|
||||
typedef struct SeqRenderData {
|
||||
|
@ -146,13 +146,10 @@ void make_local_action(bAction *act)
|
||||
id_clear_lib_data(bmain, &act->id);
|
||||
}
|
||||
else if (mlac.is_local && mlac.is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, act->id.lib->filepath};
|
||||
|
||||
mlac.actn= copy_action(act);
|
||||
mlac.actn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &mlac.actn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &mlac.actn->id);
|
||||
|
||||
BKE_animdata_main_cb(bmain, make_localact_apply_cb, &mlac);
|
||||
}
|
||||
|
@ -753,6 +753,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
|
||||
extern int enable_cu_speed; /* object.c */
|
||||
Object copyob = {{NULL}};
|
||||
int cfrao = scene->r.cfra;
|
||||
int dupend = ob->dupend;
|
||||
|
||||
/* simple prevention of too deep nested groups */
|
||||
if (level > MAX_DUPLI_RECUR) return;
|
||||
@ -773,7 +774,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
|
||||
/* duplicate over the required range */
|
||||
if (ob->transflag & OB_DUPLINOSPEED) enable_cu_speed= 0;
|
||||
|
||||
for (scene->r.cfra= ob->dupsta; scene->r.cfra<=ob->dupend; scene->r.cfra++) {
|
||||
for (scene->r.cfra= ob->dupsta; scene->r.cfra<=dupend; scene->r.cfra++) {
|
||||
short ok= 1;
|
||||
|
||||
/* - dupoff = how often a frames within the range shouldn't be made into duplis
|
||||
|
@ -43,12 +43,15 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_lamp_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_texture_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
|
||||
#include "BKE_animsys.h"
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_fcurve.h"
|
||||
#include "BKE_nla.h"
|
||||
#include "BKE_global.h"
|
||||
@ -1179,6 +1182,15 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
|
||||
RNA_property_update_cache_add(&new_ptr, prop);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* as long as we don't do property update, we still tag datablock
|
||||
as having been updated. this flag does not cause any updates to
|
||||
be run, it's for e.g. render engines to synchronize data */
|
||||
if(new_ptr.id.data) {
|
||||
ID *id= new_ptr.id.data;
|
||||
id->flag |= LIB_ID_RECALC;
|
||||
DAG_id_type_tag(G.main, GS(id->name));
|
||||
}
|
||||
}
|
||||
|
||||
/* successful */
|
||||
@ -2291,7 +2303,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
|
||||
EVAL_ANIM_NODETREE_IDS(main->tex.first, Tex, ADT_RECALC_ANIM);
|
||||
|
||||
/* lamps */
|
||||
EVAL_ANIM_IDS(main->lamp.first, ADT_RECALC_ANIM);
|
||||
EVAL_ANIM_NODETREE_IDS(main->lamp.first, Lamp, ADT_RECALC_ANIM);
|
||||
|
||||
/* materials */
|
||||
EVAL_ANIM_NODETREE_IDS(main->mat.first, Material, ADT_RECALC_ANIM);
|
||||
@ -2320,7 +2332,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
|
||||
/* particles */
|
||||
EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
|
||||
|
||||
/* lamps */
|
||||
/* speakers */
|
||||
EVAL_ANIM_IDS(main->speaker.first, ADT_RECALC_ANIM);
|
||||
|
||||
/* objects */
|
||||
@ -2331,7 +2343,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
|
||||
EVAL_ANIM_IDS(main->object.first, 0);
|
||||
|
||||
/* worlds */
|
||||
EVAL_ANIM_IDS(main->world.first, ADT_RECALC_ANIM);
|
||||
EVAL_ANIM_NODETREE_IDS(main->world.first, World, ADT_RECALC_ANIM);
|
||||
|
||||
/* scenes */
|
||||
EVAL_ANIM_NODETREE_IDS(main->scene.first, Scene, ADT_RECALC_ANIM);
|
||||
|
@ -157,12 +157,11 @@ void make_local_armature(bArmature *arm)
|
||||
id_clear_lib_data(bmain, &arm->id);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, arm->id.lib->filepath};
|
||||
bArmature *armn= copy_armature(arm);
|
||||
armn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &armn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &armn->id);
|
||||
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(ob->data == arm) {
|
||||
|
@ -172,7 +172,7 @@ static void clean_paths(Main *main)
|
||||
{
|
||||
Scene *scene;
|
||||
|
||||
bpath_traverse_main(main, clean_paths_visit_cb, 0, NULL);
|
||||
bpath_traverse_main(main, clean_paths_visit_cb, BPATH_TRAVERSE_SKIP_MULTIFILE, NULL);
|
||||
|
||||
for(scene= main->scene.first; scene; scene= scene->id.next) {
|
||||
BLI_clean(scene->r.pic);
|
||||
|
@ -224,13 +224,12 @@ void make_local_brush(Brush *brush)
|
||||
}
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, brush->id.lib->filepath};
|
||||
Brush *brushn= copy_brush(brush);
|
||||
brushn->id.us= 1; /* only keep fake user */
|
||||
brushn->id.flag |= LIB_FAKEUSER;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &brushn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &brush->id);
|
||||
|
||||
for(scene= bmain->scene.first; scene; scene=scene->id.next) {
|
||||
if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) {
|
||||
|
@ -447,7 +447,8 @@ static void contarget_get_mesh_mat (Object *ob, const char *substring, float mat
|
||||
}
|
||||
else {
|
||||
/* when not in EditMode, use the 'final' derived mesh, depsgraph
|
||||
* ensures we build with CD_MDEFORMVERT layer */
|
||||
* ensures we build with CD_MDEFORMVERT layer
|
||||
*/
|
||||
dm = (DerivedMesh *)ob->derivedFinal;
|
||||
}
|
||||
|
||||
@ -703,7 +704,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *UNUSED(cob), bC
|
||||
ct->type = CONSTRAINT_OBTYPE_BONE; \
|
||||
ct->rotOrder= (pchan) ? (pchan->rotmode) : EULER_ORDER_DEFAULT; \
|
||||
}\
|
||||
else if (ELEM(ct->tar->type, OB_MESH, OB_LATTICE) && (ct->subtarget[0])) { \
|
||||
else if (OB_TYPE_SUPPORT_VGROUP(ct->tar->type) && (ct->subtarget[0])) { \
|
||||
ct->type = CONSTRAINT_OBTYPE_VERT; \
|
||||
ct->rotOrder = EULER_ORDER_DEFAULT; \
|
||||
} \
|
||||
@ -1256,10 +1257,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
|
||||
float quat[4];
|
||||
if ((data->followflag & FOLLOWPATH_STATIC) == 0) {
|
||||
/* animated position along curve depending on time */
|
||||
if (cob->scene)
|
||||
curvetime= bsystem_time(cob->scene, ct->tar, cu->ctime, 0.0) - data->offset;
|
||||
else
|
||||
curvetime= cu->ctime - data->offset;
|
||||
curvetime= cu->ctime - data->offset;
|
||||
|
||||
/* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated,
|
||||
* but this will only work if it actually is animated...
|
||||
|
@ -273,13 +273,10 @@ void make_local_curve(Curve *cu)
|
||||
extern_local_curve(cu);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, cu->id.lib->filepath};
|
||||
Curve *cun= copy_curve(cu);
|
||||
cun->id.us= 0;
|
||||
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &cun->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &cun->id);
|
||||
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(ob->data==cu) {
|
||||
@ -318,9 +315,34 @@ short curve_type(Curve *cu)
|
||||
return OB_CURVE;
|
||||
}
|
||||
|
||||
void update_curve_dimension(Curve *cu)
|
||||
{
|
||||
ListBase *nurbs= BKE_curve_nurbs(cu);
|
||||
Nurb *nu= nurbs->first;
|
||||
|
||||
if(cu->flag&CU_3D) {
|
||||
for( ; nu; nu= nu->next) {
|
||||
nu->flag &= ~CU_2D;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for( ; nu; nu= nu->next) {
|
||||
nu->flag |= CU_2D;
|
||||
test2DNurb(nu);
|
||||
|
||||
/* since the handles are moved they need to be auto-located again */
|
||||
if(nu->type == CU_BEZIER)
|
||||
calchandlesNurb(nu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void test_curve_type(Object *ob)
|
||||
{
|
||||
ob->type = curve_type(ob->data);
|
||||
ob->type= curve_type(ob->data);
|
||||
|
||||
if(ob->type==OB_CURVE)
|
||||
update_curve_dimension((Curve *)ob->data);
|
||||
}
|
||||
|
||||
void tex_space_curve(Curve *cu)
|
||||
|
@ -257,17 +257,19 @@ int defgroup_find_index (Object *ob, bDeformGroup *dg)
|
||||
/* note, must be freed */
|
||||
int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
|
||||
{
|
||||
bDeformGroup *dg;
|
||||
int totdg= *flip_map_len= BLI_countlist(&ob->defbase);
|
||||
|
||||
if(totdg==0) {
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
bDeformGroup *dg;
|
||||
char name[sizeof(dg->name)];
|
||||
int i, flip_num, *map= MEM_mallocN(totdg * sizeof(int), __func__);
|
||||
|
||||
memset(map, -1, totdg * sizeof(int));
|
||||
for (i=0; i < totdg; i++) {
|
||||
map[i]= -1;
|
||||
}
|
||||
|
||||
for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
|
||||
if(map[i] == -1) { /* may be calculated previously */
|
||||
@ -276,7 +278,7 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
|
||||
if(use_default)
|
||||
map[i]= i;
|
||||
|
||||
flip_side_name(name, dg->name, 0);
|
||||
flip_side_name(name, dg->name, FALSE);
|
||||
if(strcmp(name, dg->name)) {
|
||||
flip_num= defgroup_name_index(ob, name);
|
||||
if(flip_num >= 0) {
|
||||
@ -290,6 +292,40 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, int use_default)
|
||||
}
|
||||
}
|
||||
|
||||
/* note, must be freed */
|
||||
int *defgroup_flip_map_single(Object *ob, int *flip_map_len, int use_default, int defgroup)
|
||||
{
|
||||
int totdg= *flip_map_len= BLI_countlist(&ob->defbase);
|
||||
|
||||
if(totdg==0) {
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
bDeformGroup *dg;
|
||||
char name[sizeof(dg->name)];
|
||||
int i, flip_num, *map= MEM_mallocN(totdg * sizeof(int), __func__);
|
||||
|
||||
for (i=0; i < totdg; i++) {
|
||||
if (use_default) map[i]= i;
|
||||
else map[i]= -1;
|
||||
}
|
||||
|
||||
dg= BLI_findlink(&ob->defbase, defgroup);
|
||||
|
||||
flip_side_name(name, dg->name, FALSE);
|
||||
if(strcmp(name, dg->name)) {
|
||||
flip_num= defgroup_name_index(ob, name);
|
||||
|
||||
if(flip_num >= 0) {
|
||||
map[defgroup]= flip_num;
|
||||
map[flip_num]= defgroup;
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
int defgroup_flip_index(Object *ob, int index, int use_default)
|
||||
{
|
||||
bDeformGroup *dg= BLI_findlink(&ob->defbase, index);
|
||||
|
@ -591,9 +591,9 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
|
||||
|
||||
if(part->ren_as == PART_DRAW_OB && part->dup_ob) {
|
||||
node2 = dag_get_node(dag, part->dup_ob);
|
||||
dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
|
||||
dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Object Visualisation");
|
||||
if(part->dup_ob->type == OB_MBALL)
|
||||
dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Object Visualisation");
|
||||
dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
|
||||
}
|
||||
|
||||
if(part->ren_as == PART_DRAW_GR && part->dup_group) {
|
||||
@ -799,6 +799,7 @@ DagNode * dag_find_node (DagForest *forest,void * fob)
|
||||
}
|
||||
|
||||
static int ugly_hack_sorry= 1; // prevent type check
|
||||
static int dag_print_dependencies= 0; // debugging
|
||||
|
||||
/* no checking of existence, use dag_find_node first or dag_get_node */
|
||||
DagNode * dag_add_node (DagForest *forest, void * fob)
|
||||
@ -926,7 +927,6 @@ static const char *dag_node_name(DagNode *node)
|
||||
return ((bPoseChannel*)(node->ob))->name;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void dag_node_print_dependencies(DagNode *node)
|
||||
{
|
||||
DagAdjList *itA;
|
||||
@ -937,7 +937,6 @@ static void dag_node_print_dependencies(DagNode *node)
|
||||
printf(" %s through %s\n", dag_node_name(itA->node), itA->name);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static int dag_node_print_dependency_recurs(DagNode *node, DagNode *endnode)
|
||||
{
|
||||
@ -998,6 +997,11 @@ static void dag_check_cycle(DagForest *dag)
|
||||
DagNode *node;
|
||||
DagAdjList *itA;
|
||||
|
||||
/* debugging print */
|
||||
if(dag_print_dependencies)
|
||||
for(node = dag->DagNode.first; node; node= node->next)
|
||||
dag_node_print_dependencies(node);
|
||||
|
||||
/* tag nodes unchecked */
|
||||
for(node = dag->DagNode.first; node; node= node->next)
|
||||
node->color= DAG_WHITE;
|
||||
@ -1761,9 +1765,22 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
|
||||
sce->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */
|
||||
}
|
||||
|
||||
static void lib_id_recalc_tag(Main *bmain, ID *id)
|
||||
{
|
||||
id->flag |= LIB_ID_RECALC;
|
||||
bmain->id_tag_update[id->name[0]] = 1;
|
||||
}
|
||||
|
||||
static void lib_id_recalc_data_tag(Main *bmain, ID *id)
|
||||
{
|
||||
id->flag |= LIB_ID_RECALC_DATA;
|
||||
bmain->id_tag_update[id->name[0]] = 1;
|
||||
}
|
||||
|
||||
/* node was checked to have lasttime != curtime and is if type ID_OB */
|
||||
static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
|
||||
{
|
||||
Main *bmain= G.main;
|
||||
DagAdjList *itA;
|
||||
Object *ob, *obc;
|
||||
int oldflag, changed=0;
|
||||
@ -1789,20 +1806,24 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
|
||||
if(itA->type & DAG_RL_OB_OB) {
|
||||
//printf("ob %s changes ob %s\n", ob->id.name, obc->id.name);
|
||||
obc->recalc |= OB_RECALC_OB;
|
||||
lib_id_recalc_tag(bmain, &obc->id);
|
||||
}
|
||||
if(itA->type & DAG_RL_OB_DATA) {
|
||||
//printf("ob %s changes obdata %s\n", ob->id.name, obc->id.name);
|
||||
obc->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obc->id);
|
||||
}
|
||||
}
|
||||
if(ob->recalc & OB_RECALC_DATA) {
|
||||
if(itA->type & DAG_RL_DATA_OB) {
|
||||
//printf("obdata %s changes ob %s\n", ob->id.name, obc->id.name);
|
||||
obc->recalc |= OB_RECALC_OB;
|
||||
lib_id_recalc_tag(bmain, &obc->id);
|
||||
}
|
||||
if(itA->type & DAG_RL_DATA_DATA) {
|
||||
//printf("obdata %s changes obdata %s\n", ob->id.name, obc->id.name);
|
||||
obc->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obc->id);
|
||||
}
|
||||
}
|
||||
if(oldflag!=obc->recalc) changed= 1;
|
||||
@ -1833,6 +1854,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
|
||||
if(itA->type & (DAG_RL_OB_DATA|DAG_RL_DATA_DATA)) {
|
||||
// printf("parent %s changes ob %s\n", ob->id.name, obc->id.name);
|
||||
obc->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obc->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1872,6 +1894,7 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
|
||||
/* node was checked to have lasttime != curtime , and is of type ID_OB */
|
||||
static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int reset)
|
||||
{
|
||||
Main *bmain= G.main;
|
||||
DagAdjList *itA;
|
||||
Object *ob;
|
||||
|
||||
@ -1883,8 +1906,10 @@ static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int
|
||||
ob= (Object*)(itA->node->ob);
|
||||
|
||||
if(reset || (ob->recalc & OB_RECALC_ALL)) {
|
||||
if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH))
|
||||
if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) {
|
||||
ob->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &ob->id);
|
||||
}
|
||||
|
||||
flush_pointcache_reset(scene, itA->node, curtime, 1);
|
||||
}
|
||||
@ -2001,8 +2026,10 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
|
||||
ob= (Object*)(itA->node->ob);
|
||||
|
||||
if(ob->recalc & OB_RECALC_ALL) {
|
||||
if(BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH))
|
||||
if(BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH)) {
|
||||
ob->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &ob->id);
|
||||
}
|
||||
|
||||
flush_pointcache_reset(sce, itA->node, lasttime, 1);
|
||||
}
|
||||
@ -2204,6 +2231,12 @@ static void dag_object_time_update_flags(Object *ob)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ob->recalc & OB_RECALC_OB)
|
||||
lib_id_recalc_tag(G.main, &ob->id);
|
||||
if(ob->recalc & OB_RECALC_DATA)
|
||||
lib_id_recalc_data_tag(G.main, &ob->id);
|
||||
|
||||
}
|
||||
/* flag all objects that need recalc, for changes in time for example */
|
||||
/* do_time: make this optional because undo resets objects to their animated locations without this */
|
||||
@ -2362,6 +2395,9 @@ void DAG_on_visible_update(Main *bmain, const short do_time)
|
||||
DAG_scene_update_flags(bmain, scene, lay, do_time);
|
||||
scene->lay_updated |= lay;
|
||||
}
|
||||
|
||||
/* hack to get objects updating on layer changes */
|
||||
DAG_id_type_tag(bmain, ID_OB);
|
||||
}
|
||||
|
||||
static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUSED(ob), ID **idpoin)
|
||||
@ -2408,6 +2444,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
|
||||
for(obt=bmain->object.first; obt; obt= obt->id.next) {
|
||||
if(!(ob && obt == ob) && obt->data == id) {
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obt->id);
|
||||
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
|
||||
}
|
||||
}
|
||||
@ -2421,8 +2458,10 @@ static void dag_id_flush_update(Scene *sce, ID *id)
|
||||
data.is_dependent= 0;
|
||||
|
||||
modifiers_foreachIDLink(obt, dag_id_flush_update__isDependentTexture, &data);
|
||||
if (data.is_dependent)
|
||||
if (data.is_dependent) {
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obt->id);
|
||||
}
|
||||
|
||||
/* particle settings can use the texture as well */
|
||||
if(obt->particlesystem.first) {
|
||||
@ -2435,6 +2474,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
|
||||
mtex = *mtexp;
|
||||
if(mtex && mtex->tex == (Tex*)id) {
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
lib_id_recalc_data_tag(bmain, &obt->id);
|
||||
|
||||
if(mtex->mapto & PAMAP_INIT)
|
||||
psys->recalc |= PSYS_RECALC_RESET;
|
||||
@ -2455,6 +2495,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
|
||||
Key *key= ob_get_key(obt);
|
||||
if(!(ob && obt == ob) && ((ID *)key == id)) {
|
||||
obt->flag |= (OB_RECALC_OB|OB_RECALC_DATA);
|
||||
lib_id_recalc_tag(bmain, &obt->id);
|
||||
lib_id_recalc_data_tag(bmain, &obt->id);
|
||||
BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH);
|
||||
}
|
||||
}
|
||||
@ -2479,7 +2521,7 @@ void DAG_ids_flush_tagged(Main *bmain)
|
||||
ListBase *lbarray[MAX_LIBARRAY];
|
||||
Scene *sce;
|
||||
unsigned int lay;
|
||||
int a, have_tag = 0;
|
||||
int a, do_flush = 0;
|
||||
|
||||
dag_current_scene_layers(bmain, &sce, &lay);
|
||||
|
||||
@ -2497,25 +2539,66 @@ void DAG_ids_flush_tagged(Main *bmain)
|
||||
looping over all ID's in case there are no tags */
|
||||
if(id && bmain->id_tag_update[id->name[0]]) {
|
||||
for(; id; id=id->next) {
|
||||
if(id->flag & LIB_ID_RECALC) {
|
||||
if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA)) {
|
||||
dag_id_flush_update(sce, id);
|
||||
id->flag &= ~LIB_ID_RECALC;
|
||||
do_flush = 1;
|
||||
}
|
||||
}
|
||||
|
||||
have_tag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(have_tag) {
|
||||
/* clear tags */
|
||||
memset(bmain->id_tag_update, 0, sizeof(bmain->id_tag_update));
|
||||
|
||||
/* flush changes to other objects */
|
||||
/* flush changes to other objects */
|
||||
if(do_flush)
|
||||
DAG_scene_flush_update(bmain, sce, lay, 0);
|
||||
}
|
||||
|
||||
void DAG_ids_check_recalc(Main *bmain)
|
||||
{
|
||||
ListBase *lbarray[MAX_LIBARRAY];
|
||||
int a;
|
||||
|
||||
/* loop over all ID types */
|
||||
a = set_listbasepointers(bmain, lbarray);
|
||||
|
||||
while(a--) {
|
||||
ListBase *lb = lbarray[a];
|
||||
ID *id = lb->first;
|
||||
|
||||
/* we tag based on first ID type character to avoid
|
||||
looping over all ID's in case there are no tags */
|
||||
if(id && bmain->id_tag_update[id->name[0]]) {
|
||||
/* do editors update */
|
||||
dag_editors_update(bmain, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DAG_ids_clear_recalc(Main *bmain)
|
||||
{
|
||||
ListBase *lbarray[MAX_LIBARRAY];
|
||||
int a;
|
||||
|
||||
/* loop over all ID types */
|
||||
a = set_listbasepointers(bmain, lbarray);
|
||||
|
||||
while(a--) {
|
||||
ListBase *lb = lbarray[a];
|
||||
ID *id = lb->first;
|
||||
|
||||
/* we tag based on first ID type character to avoid
|
||||
looping over all ID's in case there are no tags */
|
||||
if(id && bmain->id_tag_update[id->name[0]]) {
|
||||
for(; id; id=id->next)
|
||||
if(id->flag & (LIB_ID_RECALC|LIB_ID_RECALC_DATA))
|
||||
id->flag &= ~(LIB_ID_RECALC|LIB_ID_RECALC_DATA);
|
||||
}
|
||||
}
|
||||
|
||||
memset(bmain->id_tag_update, 0, sizeof(bmain->id_tag_update));
|
||||
}
|
||||
|
||||
void DAG_id_tag_update(ID *id, short flag)
|
||||
{
|
||||
Main *bmain= G.main;
|
||||
@ -2523,8 +2606,14 @@ void DAG_id_tag_update(ID *id, short flag)
|
||||
if(id==NULL) return;
|
||||
|
||||
/* tag ID for update */
|
||||
id->flag |= LIB_ID_RECALC;
|
||||
bmain->id_tag_update[id->name[0]] = 1;
|
||||
if(flag) {
|
||||
if(flag & OB_RECALC_OB)
|
||||
lib_id_recalc_tag(bmain, id);
|
||||
if(flag & (OB_RECALC_DATA|PSYS_RECALC))
|
||||
lib_id_recalc_data_tag(bmain, id);
|
||||
}
|
||||
else
|
||||
lib_id_recalc_tag(bmain, id);
|
||||
|
||||
/* flag is for objects and particle systems */
|
||||
if(flag) {
|
||||
@ -2556,6 +2645,16 @@ void DAG_id_tag_update(ID *id, short flag)
|
||||
}
|
||||
}
|
||||
|
||||
void DAG_id_type_tag(struct Main *bmain, short idtype)
|
||||
{
|
||||
bmain->id_tag_update[((char*)&idtype)[0]] = 1;
|
||||
}
|
||||
|
||||
int DAG_id_type_tagged(Main *bmain, short idtype)
|
||||
{
|
||||
return bmain->id_tag_update[((char*)&idtype)[0]];
|
||||
}
|
||||
|
||||
#if 0 // UNUSED
|
||||
/* recursively descends tree, each node only checked once */
|
||||
/* node is checked to be of type object */
|
||||
@ -2739,5 +2838,22 @@ void DAG_pose_sort(Object *ob)
|
||||
ugly_hack_sorry= 1;
|
||||
}
|
||||
|
||||
/* ************************ DAG DEBUGGING ********************* */
|
||||
|
||||
void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
|
||||
{
|
||||
/* utility for debugging dependencies */
|
||||
dag_print_dependencies= 1;
|
||||
|
||||
if(ob && (ob->mode & OB_MODE_POSE)) {
|
||||
printf("\nDEPENDENCY RELATIONS for %s\n\n", ob->id.name+2);
|
||||
DAG_pose_sort(ob);
|
||||
}
|
||||
else {
|
||||
printf("\nDEPENDENCY RELATIONS for %s\n\n", scene->id.name+2);
|
||||
DAG_scene_sort(bmain, scene);
|
||||
}
|
||||
|
||||
dag_print_dependencies= 0;
|
||||
}
|
||||
|
||||
|
@ -385,13 +385,12 @@ void make_local_image(struct Image *ima)
|
||||
extern_local_image(ima);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, ima->id.lib->filepath};
|
||||
Image *iman= copy_image(ima);
|
||||
|
||||
iman->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &iman->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &iman->id);
|
||||
|
||||
tex= bmain->tex.first;
|
||||
while(tex) {
|
||||
|
@ -704,13 +704,6 @@ static const char *world_adrcodes_to_paths (int adrcode, int *array_index)
|
||||
case WO_MISTHI:
|
||||
return "mist.height";
|
||||
|
||||
/* Star Color is unused -- recommend removal */
|
||||
/* case WO_STAR_R:
|
||||
*array_index= 0; return "stars.color";
|
||||
case WO_STAR_G:
|
||||
*array_index= 1; return "stars.color";
|
||||
case WO_STAR_B:
|
||||
*array_index= 2; return "stars.color"; */
|
||||
case WO_STAR_R:
|
||||
case WO_STAR_G:
|
||||
case WO_STAR_B:
|
||||
|
@ -1381,7 +1381,7 @@ float *do_ob_key(Scene *scene, Object *ob)
|
||||
ob->shapenr= 1;
|
||||
}
|
||||
|
||||
if(ELEM(ob->type, OB_MESH, OB_LATTICE)) {
|
||||
if (OB_TYPE_SUPPORT_VGROUP(ob->type)) {
|
||||
float *weights= get_weights_array(ob, kb->vgroup);
|
||||
|
||||
cp_key(0, tot, tot, out, key, actkb, kb, weights, 0);
|
||||
|
@ -271,12 +271,11 @@ void make_local_lattice(Lattice *lt)
|
||||
id_clear_lib_data(bmain, <->id);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bath_user_data[2]= {bmain->name, lt->id.lib->filepath};
|
||||
Lattice *ltn= copy_lattice(lt);
|
||||
ltn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, <n->id, bpath_relocate_visitor, 0, bath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, <n->id);
|
||||
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(ob->data==lt) {
|
||||
|
@ -127,6 +127,21 @@
|
||||
|
||||
/* ************* general ************************ */
|
||||
|
||||
|
||||
/* this has to be called from each make_local_* func, we could call
|
||||
* from id_make_local() but then the make local functions would not be self
|
||||
* contained.
|
||||
* also note that the id _must_ have a library - campbell */
|
||||
void BKE_id_lib_local_paths(Main *bmain, ID *id)
|
||||
{
|
||||
char *bpath_user_data[2]= {bmain->name, (id)->lib->filepath};
|
||||
|
||||
bpath_traverse_id(bmain, id,
|
||||
bpath_relocate_visitor,
|
||||
BPATH_TRAVERSE_SKIP_MULTIFILE,
|
||||
bpath_user_data);
|
||||
}
|
||||
|
||||
void id_lib_extern(ID *id)
|
||||
{
|
||||
if(id) {
|
||||
@ -1252,8 +1267,8 @@ int new_id(ListBase *lb, ID *id, const char *tname)
|
||||
don't have other library users. */
|
||||
void id_clear_lib_data(Main *bmain, ID *id)
|
||||
{
|
||||
char *bpath_user_data[2]= {bmain->name, id->lib->filepath};
|
||||
bpath_traverse_id(bmain, id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, id);
|
||||
|
||||
id->lib= NULL;
|
||||
id->flag= LIB_LOCAL;
|
||||
new_id(which_libbase(bmain, GS(id->name)), id, NULL);
|
||||
|
@ -364,13 +364,12 @@ void make_local_material(Material *ma)
|
||||
}
|
||||
/* Both user and local, so copy. */
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, ma->id.lib->filepath};
|
||||
Material *man= copy_material(ma);
|
||||
|
||||
man->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &man->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &man->id);
|
||||
|
||||
/* do objects */
|
||||
ob= bmain->object.first;
|
||||
|
@ -174,12 +174,11 @@ void make_local_mball(MetaBall *mb)
|
||||
extern_local_mball(mb);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, mb->id.lib->filepath};
|
||||
MetaBall *mbn= copy_mball(mb);
|
||||
mbn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &mbn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &mbn->id);
|
||||
|
||||
for(ob= G.main->object.first; ob; ob= ob->id.next) {
|
||||
if(ob->data == mb) {
|
||||
|
@ -298,13 +298,12 @@ void make_local_mesh(Mesh *me)
|
||||
expand_local_mesh(me);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, me->id.lib->filepath};
|
||||
Mesh *men= copy_mesh(me);
|
||||
men->id.us= 0;
|
||||
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &men->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &men->id);
|
||||
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(me == ob->data) {
|
||||
|
@ -43,10 +43,11 @@
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "DNA_action_types.h"
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_action_types.h"
|
||||
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_math.h"
|
||||
@ -1320,7 +1321,7 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
|
||||
node->flag |= NODE_ACTIVE_ID;
|
||||
}
|
||||
|
||||
/* use flags are not persistant yet, groups might need different tagging, so we do it each time
|
||||
/* use flags are not persistent yet, groups might need different tagging, so we do it each time
|
||||
when we need to get this info */
|
||||
void ntreeSocketUseFlags(bNodeTree *ntree)
|
||||
{
|
||||
@ -1751,6 +1752,10 @@ void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMate
|
||||
ntype->gpuextfunc = gpuextfunc;
|
||||
}
|
||||
|
||||
void node_type_compatibility(struct bNodeType *ntype, short compatibility)
|
||||
{
|
||||
ntype->compatibility = compatibility;
|
||||
}
|
||||
|
||||
static bNodeType *is_nodetype_registered(ListBase *typelist, int type)
|
||||
{
|
||||
|
@ -86,6 +86,7 @@
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_mball.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
@ -302,8 +303,6 @@ void free_object(Object *ob)
|
||||
ob->matbits= NULL;
|
||||
if(ob->bb) MEM_freeN(ob->bb);
|
||||
ob->bb= NULL;
|
||||
if(ob->path) free_path(ob->path);
|
||||
ob->path= NULL;
|
||||
if(ob->adt) BKE_free_animdata((ID *)ob);
|
||||
if(ob->poselib) ob->poselib->id.us--;
|
||||
if(ob->gpd) ((ID *)ob->gpd)->us--;
|
||||
@ -723,6 +722,8 @@ void *add_camera(const char *name)
|
||||
cam= alloc_libblock(&G.main->camera, ID_CA, name);
|
||||
|
||||
cam->lens= 35.0f;
|
||||
cam->sensor_x= 32.0f;
|
||||
cam->sensor_y= 18.0f;
|
||||
cam->clipsta= 0.1f;
|
||||
cam->clipend= 100.0f;
|
||||
cam->drawsize= 0.5f;
|
||||
@ -772,13 +773,12 @@ void make_local_camera(Camera *cam)
|
||||
id_clear_lib_data(bmain, &cam->id);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, cam->id.lib->filepath};
|
||||
Camera *camn= copy_camera(cam);
|
||||
|
||||
camn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &camn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &camn->id);
|
||||
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
if(ob->data == cam) {
|
||||
@ -879,6 +879,9 @@ Lamp *copy_lamp(Lamp *la)
|
||||
|
||||
lan->curfalloff = curvemapping_copy(la->curfalloff);
|
||||
|
||||
if(la->nodetree)
|
||||
lan->nodetree= ntreeCopyTree(la->nodetree);
|
||||
|
||||
if(la->preview)
|
||||
lan->preview = BKE_previewimg_copy(la->preview);
|
||||
|
||||
@ -904,6 +907,9 @@ Lamp *localize_lamp(Lamp *la)
|
||||
|
||||
lan->curfalloff = curvemapping_copy(la->curfalloff);
|
||||
|
||||
if(la->nodetree)
|
||||
lan->nodetree= ntreeLocalize(la->nodetree);
|
||||
|
||||
lan->preview= NULL;
|
||||
|
||||
return lan;
|
||||
@ -939,13 +945,11 @@ void make_local_lamp(Lamp *la)
|
||||
id_clear_lib_data(bmain, &la->id);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, la->id.lib->filepath};
|
||||
Lamp *lan= copy_lamp(la);
|
||||
lan->id.us= 0;
|
||||
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &lan->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &lan->id);
|
||||
|
||||
ob= bmain->object.first;
|
||||
while(ob) {
|
||||
@ -982,6 +986,12 @@ void free_lamp(Lamp *la)
|
||||
|
||||
curvemapping_free(la->curfalloff);
|
||||
|
||||
/* is no lib link block, but lamp extension */
|
||||
if(la->nodetree) {
|
||||
ntreeFreeTree(la->nodetree);
|
||||
MEM_freeN(la->nodetree);
|
||||
}
|
||||
|
||||
BKE_previewimg_free(&la->preview);
|
||||
BKE_icon_delete(&la->id);
|
||||
la->id.icon_id = 0;
|
||||
@ -1095,7 +1105,6 @@ Object *add_only_object(int type, const char *name)
|
||||
ob->obstacleRad = 1.;
|
||||
|
||||
/* NT fluid sim defaults */
|
||||
ob->fluidsimFlag = 0;
|
||||
ob->fluidsimSettings = NULL;
|
||||
|
||||
ob->pc_ids.first = ob->pc_ids.last = NULL;
|
||||
@ -1365,7 +1374,6 @@ Object *copy_object(Object *ob)
|
||||
}
|
||||
|
||||
if(ob->bb) obn->bb= MEM_dupallocN(ob->bb);
|
||||
obn->path= NULL;
|
||||
obn->flag &= ~OB_FROMGROUP;
|
||||
|
||||
obn->modifiers.first = obn->modifiers.last= NULL;
|
||||
@ -1486,13 +1494,12 @@ void make_local_object(Object *ob)
|
||||
extern_local_object(ob);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, ob->id.lib->filepath};
|
||||
Object *obn= copy_object(ob);
|
||||
|
||||
obn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &obn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &obn->id);
|
||||
|
||||
sce= bmain->scene.first;
|
||||
while(sce) {
|
||||
@ -2945,27 +2952,23 @@ void object_camera_mode(RenderData *rd, Object *camera)
|
||||
}
|
||||
}
|
||||
|
||||
/* 'lens' may be set for envmap only */
|
||||
void object_camera_matrix(
|
||||
RenderData *rd, Object *camera, int winx, int winy, short field_second,
|
||||
float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor,
|
||||
float *viewdx, float *viewdy
|
||||
) {
|
||||
Camera *cam=NULL;
|
||||
float pixsize;
|
||||
float shiftx=0.0, shifty=0.0, winside, viewfac;
|
||||
short is_ortho= FALSE;
|
||||
void object_camera_intrinsics(Object *camera, Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
|
||||
float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit)
|
||||
{
|
||||
Camera *cam= NULL;
|
||||
|
||||
/* question mark */
|
||||
(*ycor)= rd->yasp / rd->xasp;
|
||||
if(rd->mode & R_FIELDS)
|
||||
(*ycor) *= 2.0f;
|
||||
(*shiftx)= 0.0f;
|
||||
(*shifty)= 0.0f;
|
||||
|
||||
(*sensor_x)= DEFAULT_SENSOR_WIDTH;
|
||||
(*sensor_y)= DEFAULT_SENSOR_HEIGHT;
|
||||
(*sensor_fit)= CAMERA_SENSOR_FIT_AUTO;
|
||||
|
||||
if(camera->type==OB_CAMERA) {
|
||||
cam= camera->data;
|
||||
|
||||
if(cam->type == CAM_ORTHO) {
|
||||
is_ortho= TRUE;
|
||||
*is_ortho= TRUE;
|
||||
}
|
||||
|
||||
/* solve this too... all time depending stuff is in convertblender.c?
|
||||
@ -2978,11 +2981,14 @@ void object_camera_matrix(
|
||||
execute_ipo(&cam->id, cam->ipo);
|
||||
}
|
||||
#endif // XXX old animation system
|
||||
shiftx=cam->shiftx;
|
||||
shifty=cam->shifty;
|
||||
(*shiftx)=cam->shiftx;
|
||||
(*shifty)=cam->shifty;
|
||||
(*lens)= cam->lens;
|
||||
(*sensor_x)= cam->sensor_x;
|
||||
(*sensor_y)= cam->sensor_y;
|
||||
(*clipsta)= cam->clipsta;
|
||||
(*clipend)= cam->clipend;
|
||||
(*sensor_fit)= cam->sensor_fit;
|
||||
}
|
||||
else if(camera->type==OB_LAMP) {
|
||||
Lamp *la= camera->data;
|
||||
@ -2996,7 +3002,7 @@ void object_camera_matrix(
|
||||
(*clipend)= la->clipend;
|
||||
}
|
||||
else { /* envmap exception... */;
|
||||
if((*lens)==0.0f)
|
||||
if((*lens)==0.0f) /* is this needed anymore? */
|
||||
(*lens)= 16.0f;
|
||||
|
||||
if((*clipsta)==0.0f || (*clipend)==0.0f) {
|
||||
@ -3005,25 +3011,69 @@ void object_camera_matrix(
|
||||
}
|
||||
}
|
||||
|
||||
(*cam_r)= cam;
|
||||
}
|
||||
|
||||
/* 'lens' may be set for envmap only */
|
||||
void object_camera_matrix(
|
||||
RenderData *rd, Object *camera, int winx, int winy, short field_second,
|
||||
float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens,
|
||||
float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
|
||||
float *viewdx, float *viewdy)
|
||||
{
|
||||
Camera *cam=NULL;
|
||||
float pixsize;
|
||||
float shiftx=0.0, shifty=0.0, winside, viewfac;
|
||||
short is_ortho= FALSE;
|
||||
|
||||
/* question mark */
|
||||
(*ycor)= rd->yasp / rd->xasp;
|
||||
if(rd->mode & R_FIELDS)
|
||||
(*ycor) *= 2.0f;
|
||||
|
||||
object_camera_intrinsics(camera, &cam, &is_ortho, &shiftx, &shifty, clipsta, clipend, lens, sensor_x, sensor_y, sensor_fit);
|
||||
|
||||
/* ortho only with camera available */
|
||||
if(cam && is_ortho) {
|
||||
if(rd->xasp*winx >= rd->yasp*winy) {
|
||||
if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
|
||||
if(rd->xasp*winx >= rd->yasp*winy) viewfac= winx;
|
||||
else viewfac= (*ycor) * winy;
|
||||
}
|
||||
else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
|
||||
viewfac= winx;
|
||||
}
|
||||
else {
|
||||
else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
|
||||
viewfac= (*ycor) * winy;
|
||||
}
|
||||
|
||||
/* ortho_scale == 1.0 means exact 1 to 1 mapping */
|
||||
pixsize= cam->ortho_scale/viewfac;
|
||||
}
|
||||
else {
|
||||
if(rd->xasp*winx >= rd->yasp*winy) viewfac= ((*lens) * winx)/32.0f;
|
||||
else viewfac= (*ycor) * ((*lens) * winy)/32.0f;
|
||||
if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
|
||||
if(rd->xasp*winx >= rd->yasp*winy) viewfac= ((*lens) * winx) / (*sensor_x);
|
||||
else viewfac= (*ycor) * ((*lens) * winy) / (*sensor_x);
|
||||
}
|
||||
else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
|
||||
viewfac= ((*lens) * winx) / (*sensor_x);
|
||||
}
|
||||
else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
|
||||
viewfac= ((*lens) * winy) / (*sensor_y);
|
||||
}
|
||||
|
||||
pixsize= (*clipsta) / viewfac;
|
||||
}
|
||||
|
||||
/* viewplane fully centered, zbuffer fills in jittered between -.5 and +.5 */
|
||||
winside= MAX2(winx, winy);
|
||||
|
||||
if(cam) {
|
||||
if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR)
|
||||
winside= winx;
|
||||
else if(cam->sensor_fit==CAMERA_SENSOR_FIT_VERT)
|
||||
winside= winy;
|
||||
}
|
||||
|
||||
viewplane->xmin= -0.5f*(float)winx + shiftx*winside;
|
||||
viewplane->ymin= -0.5f*(*ycor)*(float)winy + shifty*winside;
|
||||
viewplane->xmax= 0.5f*(float)winx + shiftx*winside;
|
||||
@ -3067,7 +3117,17 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
|
||||
float aspx= (float) scene->r.xsch*scene->r.xasp;
|
||||
float aspy= (float) scene->r.ysch*scene->r.yasp;
|
||||
|
||||
if(aspx < aspy) {
|
||||
if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
|
||||
if(aspx < aspy) {
|
||||
r_asp[0]= aspx / aspy;
|
||||
r_asp[1]= 1.0;
|
||||
}
|
||||
else {
|
||||
r_asp[0]= 1.0;
|
||||
r_asp[1]= aspy / aspx;
|
||||
}
|
||||
}
|
||||
else if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
|
||||
r_asp[0]= aspx / aspy;
|
||||
r_asp[1]= 1.0;
|
||||
}
|
||||
@ -3093,16 +3153,18 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
|
||||
else {
|
||||
/* that way it's always visible - clipsta+0.1 */
|
||||
float fac;
|
||||
float half_sensor= 0.5f*((camera->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (camera->sensor_y) : (camera->sensor_x));
|
||||
|
||||
*r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f);
|
||||
|
||||
if(do_clip) {
|
||||
/* fixed depth, variable size (avoids exceeding clipping range) */
|
||||
depth = -(camera->clipsta + 0.1f);
|
||||
fac = depth / (camera->lens/-16.0f * scale[2]);
|
||||
fac = depth / (camera->lens/(-half_sensor) * scale[2]);
|
||||
}
|
||||
else {
|
||||
/* fixed size, variable depth (stays a reasonable size in the 3D view) */
|
||||
depth= *r_drawsize * camera->lens/-16.0f * scale[2];
|
||||
depth= *r_drawsize * camera->lens/(-half_sensor) * scale[2];
|
||||
fac= *r_drawsize;
|
||||
}
|
||||
|
||||
|
@ -3641,13 +3641,12 @@ void make_local_particlesettings(ParticleSettings *part)
|
||||
expand_local_particlesettings(part);
|
||||
}
|
||||
else if(is_local && is_lib) {
|
||||
char *bpath_user_data[2]= {bmain->name, part->id.lib->filepath};
|
||||
ParticleSettings *partn= psys_copy_settings(part);
|
||||
|
||||
partn->id.us= 0;
|
||||
|
||||
/* Remap paths of new ID using old library as base. */
|
||||
bpath_traverse_id(bmain, &partn->id, bpath_relocate_visitor, 0, bpath_user_data);
|
||||
BKE_id_lib_local_paths(bmain, &partn->id);
|
||||
|
||||
/* do objects */
|
||||
for(ob= bmain->object.first; ob; ob= ob->id.next) {
|
||||
|
@ -72,6 +72,8 @@
|
||||
|
||||
#include "BKE_sound.h"
|
||||
|
||||
#include "RE_engine.h"
|
||||
|
||||
//XXX #include "BIF_previewrender.h"
|
||||
//XXX #include "BIF_editseq.h"
|
||||
|
||||
@ -988,16 +990,22 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
|
||||
/* this is called in main loop, doing tagged updates before redraw */
|
||||
void scene_update_tagged(Main *bmain, Scene *scene)
|
||||
{
|
||||
/* keep this first */
|
||||
BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
|
||||
|
||||
/* flush recalc flags to dependencies */
|
||||
DAG_ids_flush_tagged(bmain);
|
||||
|
||||
scene->physics_settings.quick_cache_step= 0;
|
||||
|
||||
/* update all objects: drivers, matrices, displists, etc. flags set
|
||||
by depgraph or manual, no layer check here, gets correct flushed */
|
||||
by depgraph or manual, no layer check here, gets correct flushed
|
||||
|
||||
in the future this should handle updates for all datablocks, not
|
||||
only objects and scenes. - brecht */
|
||||
scene_update_tagged_recursive(bmain, scene, scene);
|
||||
|
||||
/* recalc scene animation data here (for sequencer) */
|
||||
/* extra call here to recalc scene animation (for sequencer) */
|
||||
{
|
||||
AnimData *adt= BKE_animdata_from_id(&scene->id);
|
||||
float ctime = BKE_curframe(scene);
|
||||
@ -1006,11 +1014,20 @@ void scene_update_tagged(Main *bmain, Scene *scene)
|
||||
BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, 0);
|
||||
}
|
||||
|
||||
/* quick point cache updates */
|
||||
if (scene->physics_settings.quick_cache_step)
|
||||
BKE_ptcache_quick_cache_all(bmain, scene);
|
||||
|
||||
/* in the future this should handle updates for all datablocks, not
|
||||
only objects and scenes. - brecht */
|
||||
/* notify editors about recalc */
|
||||
DAG_ids_check_recalc(bmain);
|
||||
|
||||
/* keep this last */
|
||||
BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
|
||||
}
|
||||
|
||||
void scene_clear_tagged(Main *bmain, Scene *UNUSED(scene))
|
||||
{
|
||||
DAG_ids_clear_recalc(bmain);
|
||||
}
|
||||
|
||||
/* applies changes right away, does all sets too */
|
||||
@ -1020,7 +1037,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
|
||||
Scene *sce_iter;
|
||||
|
||||
/* keep this first */
|
||||
BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_PRE);
|
||||
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE);
|
||||
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
|
||||
|
||||
sound_set_cfra(sce->r.cfra);
|
||||
|
||||
@ -1032,6 +1050,10 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
|
||||
DAG_scene_sort(bmain, sce_iter);
|
||||
}
|
||||
|
||||
/* flush recalc flags to dependencies, if we were only changing a frame
|
||||
this would not be necessary, but if a user or a script has modified
|
||||
some datablock before scene_update_tagged was called, we need the flush */
|
||||
DAG_ids_flush_tagged(bmain);
|
||||
|
||||
/* Following 2 functions are recursive
|
||||
* so dont call within 'scene_update_tagged_recursive' */
|
||||
@ -1050,7 +1072,10 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
|
||||
scene_update_tagged_recursive(bmain, sce, sce);
|
||||
|
||||
/* keep this last */
|
||||
BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_POST);
|
||||
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
|
||||
BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST);
|
||||
|
||||
DAG_ids_clear_recalc(bmain);
|
||||
}
|
||||
|
||||
/* return default layer, also used to patch old files */
|
||||
@ -1127,3 +1152,10 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int scene_use_new_shading_nodes(Scene *scene)
|
||||
{
|
||||
RenderEngineType *type= RE_engines_find(scene->r.engine);
|
||||
return (type->flag & RE_USE_SHADING_NODES);
|
||||
}
|
||||
|
||||
|
@ -351,6 +351,29 @@ ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* note, using this function is generally a last resort, you really want to be
|
||||
* using the context when you can - campbell
|
||||
* -1 for any type */
|
||||
struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min)
|
||||
{
|
||||
ScrArea *sa, *big= NULL;
|
||||
int size, maxsize= 0;
|
||||
|
||||
for(sa= sc->areabase.first; sa; sa= sa->next) {
|
||||
if ((spacetype == -1) || sa->spacetype == spacetype) {
|
||||
if (min <= sa->winx && min <= sa->winy) {
|
||||
size= sa->winx*sa->winy;
|
||||
if (size > maxsize) {
|
||||
maxsize= size;
|
||||
big= sa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return big;
|
||||
}
|
||||
|
||||
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene)
|
||||
{
|
||||
int bit;
|
||||
|
@ -77,6 +77,8 @@
|
||||
|
||||
#include "BKE_smoke.h"
|
||||
|
||||
#ifdef WITH_SMOKE
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
@ -131,12 +133,13 @@ struct SmokeModifierData;
|
||||
|
||||
#define TRI_UVOFFSET (1./4.)
|
||||
|
||||
#ifdef WITH_SMOKE
|
||||
/* forward declerations */
|
||||
static void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
|
||||
static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct);
|
||||
static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs);
|
||||
|
||||
#else /* WITH_SMOKE */
|
||||
|
||||
/* Stubs to use when smoke is disabled */
|
||||
struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype)) { return NULL; }
|
||||
struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(p0)) { return NULL; }
|
||||
@ -146,9 +149,11 @@ void smoke_initWaveletBlenderRNA(struct WTURBULENCE *UNUSED(wt), float *UNUSED(s
|
||||
void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), float *UNUSED(beta), float *UNUSED(dt_factor), float *UNUSED(vorticity), int *UNUSED(border_colli)) {}
|
||||
long long smoke_get_mem_req(int UNUSED(xres), int UNUSED(yres), int UNUSED(zres), int UNUSED(amplify)) { return 0; }
|
||||
void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Object *UNUSED(ob), DerivedMesh *UNUSED(dm)) {}
|
||||
|
||||
#endif /* WITH_SMOKE */
|
||||
|
||||
#ifdef WITH_SMOKE
|
||||
|
||||
static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
|
||||
{
|
||||
if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user