forked from bartvdbraak/blender
Merged changes in the trunk up to revision 29409.
This commit is contained in:
commit
df0b629e24
@ -1,178 +1,183 @@
|
||||
MACRO(BLENDERLIB_NOLIST
|
||||
name
|
||||
sources
|
||||
includes)
|
||||
name
|
||||
sources
|
||||
includes)
|
||||
|
||||
# Gather all headers
|
||||
FILE(GLOB_RECURSE INC_ALL *.h)
|
||||
|
||||
INCLUDE_DIRECTORIES(${includes})
|
||||
ADD_LIBRARY(${name} ${INC_ALL} ${sources})
|
||||
# Gather all headers
|
||||
FILE(GLOB_RECURSE INC_ALL *.h)
|
||||
|
||||
INCLUDE_DIRECTORIES(${includes})
|
||||
ADD_LIBRARY(${name} ${INC_ALL} ${sources})
|
||||
|
||||
# Group by location on disk
|
||||
SOURCE_GROUP(Files FILES CMakeLists.txt)
|
||||
SET(ALL_FILES ${sources} ${INC_ALL})
|
||||
FOREACH(SRC ${ALL_FILES})
|
||||
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}")
|
||||
STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
|
||||
STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}")
|
||||
IF(REL_DIR)
|
||||
SOURCE_GROUP(${REL_DIR} FILES ${SRC})
|
||||
ELSE(REL_DIR)
|
||||
SOURCE_GROUP(Files FILES ${SRC})
|
||||
ENDIF(REL_DIR)
|
||||
ENDFOREACH(SRC)
|
||||
# Group by location on disk
|
||||
SOURCE_GROUP(Files FILES CMakeLists.txt)
|
||||
SET(ALL_FILES ${sources} ${INC_ALL})
|
||||
FOREACH(SRC ${ALL_FILES})
|
||||
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}")
|
||||
STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}")
|
||||
STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}")
|
||||
IF(REL_DIR)
|
||||
SOURCE_GROUP(${REL_DIR} FILES ${SRC})
|
||||
ELSE(REL_DIR)
|
||||
SOURCE_GROUP(Files FILES ${SRC})
|
||||
ENDIF(REL_DIR)
|
||||
ENDFOREACH(SRC)
|
||||
|
||||
MESSAGE(STATUS "Configuring library ${name}")
|
||||
MESSAGE(STATUS "Configuring library ${name}")
|
||||
ENDMACRO(BLENDERLIB_NOLIST)
|
||||
|
||||
MACRO(BLENDERLIB
|
||||
name
|
||||
sources
|
||||
includes)
|
||||
name
|
||||
sources
|
||||
includes)
|
||||
|
||||
BLENDERLIB_NOLIST(${name} "${sources}" "${includes}")
|
||||
BLENDERLIB_NOLIST(${name} "${sources}" "${includes}")
|
||||
|
||||
# Add to blender's list of libraries
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "${name};")
|
||||
# Add to blender's list of libraries
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "${name};")
|
||||
ENDMACRO(BLENDERLIB)
|
||||
|
||||
MACRO(SETUP_LIBDIRS)
|
||||
# see "cmake --help-policy CMP0003"
|
||||
if(COMMAND cmake_policy)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
LINK_DIRECTORIES(${PYTHON_LIBPATH})
|
||||
ENDIF(WITH_PYTHON)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
LINK_DIRECTORIES(${ICONV_LIBPATH})
|
||||
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
IF(WITH_SDL)
|
||||
LINK_DIRECTORIES(${SDL_LIBPATH})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WITH_FFMPEG)
|
||||
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
|
||||
ENDIF(WITH_FFMPEG)
|
||||
IF(WITH_OPENEXR)
|
||||
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
|
||||
ENDIF(WITH_OPENEXR)
|
||||
IF(WITH_TIFF)
|
||||
LINK_DIRECTORIES(${TIFF_LIBPATH})
|
||||
ENDIF(WITH_TIFF)
|
||||
IF(WITH_QUICKTIME)
|
||||
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
IF(WITH_OPENAL)
|
||||
LINK_DIRECTORIES(${OPENAL_LIBPATH})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_JACK)
|
||||
LINK_DIRECTORIES(${JACK_LIBPATH})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_SNDFILE)
|
||||
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
|
||||
ENDIF(WITH_SNDFILE)
|
||||
IF(WITH_FFTW3)
|
||||
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
||||
ENDIF(WITH_FFTW3)
|
||||
IF(WITH_OPENCOLLADA)
|
||||
LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
|
||||
LINK_DIRECTORIES(${PCRE_LIBPATH})
|
||||
LINK_DIRECTORIES(${EXPAT_LIBPATH})
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
# see "cmake --help-policy CMP0003"
|
||||
if(COMMAND cmake_policy)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH})
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
LINK_DIRECTORIES(${PYTHON_LIBPATH})
|
||||
ENDIF(WITH_PYTHON)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
LINK_DIRECTORIES(${ICONV_LIBPATH})
|
||||
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
IF(WITH_SDL)
|
||||
LINK_DIRECTORIES(${SDL_LIBPATH})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WITH_FFMPEG)
|
||||
LINK_DIRECTORIES(${FFMPEG_LIBPATH})
|
||||
ENDIF(WITH_FFMPEG)
|
||||
IF(WITH_OPENEXR)
|
||||
LINK_DIRECTORIES(${OPENEXR_LIBPATH})
|
||||
ENDIF(WITH_OPENEXR)
|
||||
IF(WITH_TIFF)
|
||||
LINK_DIRECTORIES(${TIFF_LIBPATH})
|
||||
ENDIF(WITH_TIFF)
|
||||
IF(WITH_LCMS)
|
||||
LINK_DIRECTORIES(${LCMS_LIBPATH})
|
||||
ENDIF(WITH_LCMS)
|
||||
IF(WITH_QUICKTIME)
|
||||
LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
IF(WITH_OPENAL)
|
||||
LINK_DIRECTORIES(${OPENAL_LIBPATH})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_JACK)
|
||||
LINK_DIRECTORIES(${JACK_LIBPATH})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_SNDFILE)
|
||||
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
|
||||
ENDIF(WITH_SNDFILE)
|
||||
IF(WITH_FFTW3)
|
||||
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
||||
ENDIF(WITH_FFTW3)
|
||||
IF(WITH_OPENCOLLADA)
|
||||
LINK_DIRECTORIES(${OPENCOLLADA_LIBPATH})
|
||||
LINK_DIRECTORIES(${PCRE_LIBPATH})
|
||||
LINK_DIRECTORIES(${EXPAT_LIBPATH})
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
|
||||
IF(WIN32)
|
||||
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
|
||||
ENDIF(WIN32)
|
||||
IF(WIN32)
|
||||
LINK_DIRECTORIES(${PTHREADS_LIBPATH})
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_LIBDIRS)
|
||||
|
||||
MACRO(SETUP_LIBLINKS
|
||||
target)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
|
||||
target)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS})
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
IF(WITH_PYTHON)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LINKFLAGS})
|
||||
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
IF(WITH_PYTHON)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LINKFLAGS})
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
|
||||
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_FFTW3)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
|
||||
ENDIF(WITH_FFTW3)
|
||||
IF(WITH_JACK)
|
||||
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_SNDFILE)
|
||||
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
|
||||
ENDIF(WITH_SNDFILE)
|
||||
IF(WITH_SDL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WITH_QUICKTIME)
|
||||
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
IF(WITH_TIFF)
|
||||
TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
|
||||
ENDIF(WITH_TIFF)
|
||||
IF(WITH_OPENEXR)
|
||||
IF(WIN32)
|
||||
FOREACH(loop_var ${OPENEXR_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
||||
ENDFOREACH(loop_var)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
IF(WITH_FFMPEG)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
|
||||
ENDIF(WITH_FFMPEG)
|
||||
IF(WITH_OPENCOLLADA)
|
||||
IF(WIN32)
|
||||
FOREACH(loop_var ${OPENCOLLADA_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
||||
ENDFOREACH(loop_var)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
|
||||
IF(EXPAT_LIB)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
|
||||
ENDIF(EXPAT_LIB)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
||||
ENDIF(WIN32)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENGL_glu_LIBRARY} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB})
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})
|
||||
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${ICONV_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY})
|
||||
ENDIF(WITH_OPENAL)
|
||||
IF(WITH_FFTW3)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB})
|
||||
ENDIF(WITH_FFTW3)
|
||||
IF(WITH_JACK)
|
||||
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
||||
ENDIF(WITH_JACK)
|
||||
IF(WITH_SNDFILE)
|
||||
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
|
||||
ENDIF(WITH_SNDFILE)
|
||||
IF(WITH_SDL)
|
||||
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
||||
ENDIF(WITH_SDL)
|
||||
IF(WITH_QUICKTIME)
|
||||
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
IF(WITH_TIFF)
|
||||
TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
|
||||
ENDIF(WITH_TIFF)
|
||||
IF(WITH_OPENEXR)
|
||||
IF(WIN32)
|
||||
FOREACH(loop_var ${OPENEXR_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
||||
ENDFOREACH(loop_var)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
IF(WITH_LCMS)
|
||||
TARGET_LINK_LIBRARIES(${target} ${LCMS_LIBRARY})
|
||||
ENDIF(WITH_LCMS)
|
||||
IF(WITH_FFMPEG)
|
||||
TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
|
||||
ENDIF(WITH_FFMPEG)
|
||||
IF(WITH_OPENCOLLADA)
|
||||
IF(WIN32)
|
||||
FOREACH(loop_var ${OPENCOLLADA_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
|
||||
ENDFOREACH(loop_var)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
|
||||
IF(EXPAT_LIB)
|
||||
TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
|
||||
TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
|
||||
ENDIF(EXPAT_LIB)
|
||||
ELSE(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
|
||||
TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
IF(WIN32)
|
||||
TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})
|
||||
ENDIF(WIN32)
|
||||
ENDMACRO(SETUP_LIBLINKS)
|
||||
|
||||
|
253
CMakeLists.txt
253
CMakeLists.txt
@ -43,6 +43,10 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
||||
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
# quiet output for Makefiles, 'make -s' helps too
|
||||
# SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
||||
|
||||
PROJECT(Blender)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -57,54 +61,76 @@ SET(BLENDER_VERSION 2.5)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default config options
|
||||
OPTION(WITH_PLAYER "Build Player" OFF)
|
||||
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
|
||||
# Blender internal features
|
||||
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
|
||||
OPTION(WITH_LCMS "Enable color correction with lcms" OFF)
|
||||
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
|
||||
OPTION(WITH_BUILDINFO "Include extra build details" ON)
|
||||
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
|
||||
OPTION(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
|
||||
OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||
OPTION(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||
OPTION(WITH_PLAYER "Build Player" OFF)
|
||||
# (unix defaults to OpenMP On)
|
||||
IF(UNIX AND NOT APPLE)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
ELSE()
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
ENDIF()
|
||||
|
||||
# Image format support
|
||||
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
|
||||
OPTION(WITH_TIFF "Enable LibTIFF Support" ON)
|
||||
OPTION(WITH_DDS "Enable DDS Support" ON)
|
||||
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
|
||||
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
|
||||
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
|
||||
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||
OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
|
||||
OPTION(WITH_LZO "Enable fast LZO compression, used for pointcache" ON)
|
||||
OPTION(WITH_LZMA "Enable best LZMA compression, used for pointcache" ON)
|
||||
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
|
||||
OPTION(WITH_BUILDINFO "Include extra build details" ON)
|
||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
|
||||
|
||||
# Audio format support
|
||||
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
|
||||
OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
|
||||
IF(APPLE OR WIN32)
|
||||
OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF)
|
||||
ENDIF(APPLE OR WIN32)
|
||||
|
||||
# Unix defaults to OpenMP On
|
||||
# Disable opencollada on non-apple unix because opencollada has no package for debian
|
||||
# 3D format support
|
||||
# disable opencollada on non-apple unix because opencollada has no package for debian
|
||||
IF(UNIX AND NOT APPLE)
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" ON)
|
||||
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
|
||||
ELSE()
|
||||
OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF)
|
||||
OPTION(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org/)" OFF)
|
||||
ENDIF()
|
||||
|
||||
# Sound output
|
||||
OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON)
|
||||
OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
|
||||
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||
|
||||
# Compression
|
||||
OPTION(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
|
||||
OPTION(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
|
||||
|
||||
# Misc
|
||||
OPTION(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" OFF)
|
||||
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation tracking" OFF)
|
||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||
|
||||
IF (APPLE)
|
||||
OPTION(WITH_COCOA "Use Cocoa framework instead of deprecated Carbon" ON)
|
||||
OPTION(USE_QTKIT "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
|
||||
OPTION(WITH_LIBS10.5 "Use 10.5 libs (needed for 64bit builds)" OFF)
|
||||
ENDIF (APPLE)
|
||||
ENDIF(APPLE)
|
||||
|
||||
IF(NOT WITH_BULLET AND WITH_GAMEENGINE)
|
||||
MESSAGE("WARNING: WITH_GAMEENGINE needs WITH_BULLET")
|
||||
ENDIF(NOT WITH_BULLET AND WITH_GAMEENGINE)
|
||||
|
||||
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
|
||||
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||
|
||||
# disabled for now, not supported
|
||||
# OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||
|
||||
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
|
||||
# On Unix:
|
||||
# cmake -D PYTHON_LIB=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INC=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
|
||||
@ -122,7 +148,6 @@ INCLUDE(CMake/macros.cmake)
|
||||
|
||||
IF(UNIX AND NOT APPLE)
|
||||
|
||||
|
||||
IF(WITH_OPENAL)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
IF(NOT OPENAL_FOUND)
|
||||
@ -144,20 +169,23 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||
ENDIF(WITH_SNDFILE)
|
||||
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
FIND_LIBRARY(ICONV_LIBRARY
|
||||
NAMES iconv
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
FIND_LIBRARY(INTL_LIBRARY
|
||||
NAMES intl
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(ICONV_LIBRARY
|
||||
NAMES iconv
|
||||
PATHS
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
IF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
|
||||
ENDIF(INTL_LIBRARY AND ICONV_LIBRARY)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
FIND_PACKAGE(Freetype)
|
||||
# UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use
|
||||
@ -179,7 +207,6 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
|
||||
IF(WITH_SDL)
|
||||
FIND_PACKAGE(SDL)
|
||||
# UNSET(SDLMAIN_LIBRARY CACHE)
|
||||
@ -203,25 +230,6 @@ IF(UNIX AND NOT APPLE)
|
||||
SET(OPENEXR_LIB Half IlmImf Iex Imath)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 /usr)
|
||||
SET(FFTW3_INC ${FFTW3}/include)
|
||||
SET(FFTW3_LIB fftw3)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(LIBSAMPLERATE /usr)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
IF(WITH_TIFF)
|
||||
FIND_PACKAGE(TIFF)
|
||||
IF(NOT TIFF_FOUND)
|
||||
@ -235,6 +243,32 @@ IF(UNIX AND NOT APPLE)
|
||||
|
||||
FIND_PACKAGE(ZLIB REQUIRED)
|
||||
|
||||
IF(WITH_LCMS)
|
||||
SET(LCMS /usr CACHE FILEPATH "LCMS directory")
|
||||
SET(LCMS_INCLUDE_DIR ${LCMS}/include)
|
||||
SET(LCMS_LIBRARY lcms)
|
||||
SET(LCMS_LIBPATH ${LCMS}/lib)
|
||||
ENDIF(WITH_LCMS)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory")
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 /usr)
|
||||
SET(FFTW3_INC ${FFTW3}/include)
|
||||
SET(FFTW3_LIB fftw3)
|
||||
SET(FFTW3_LIBPATH ${FFTW3}/lib)
|
||||
ENDIF(WITH_FFTW3)
|
||||
|
||||
SET(LIBSAMPLERATE /usr)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
SET(LIBSAMPLERATE_LIB samplerate)
|
||||
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
|
||||
|
||||
IF (WITH_OPENCOLLADA)
|
||||
SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
|
||||
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
@ -295,10 +329,12 @@ IF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
|
||||
SET(ICONV ${LIBDIR}/iconv)
|
||||
SET(ICONV_INC ${ICONV}/include)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(ICONV ${LIBDIR}/iconv)
|
||||
SET(ICONV_INC ${ICONV}/include)
|
||||
SET(ICONV_LIB iconv)
|
||||
SET(ICONV_LIBPATH ${ICONV}/lib)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
@ -376,14 +412,16 @@ IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ")
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettext)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gettext)
|
||||
ELSE(CMAKE_CL_64)
|
||||
SET(GETTEXT_LIB gnu_gettext)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(CMAKE_CL_64)
|
||||
SET(PNG_LIBRARIES libpng)
|
||||
@ -422,13 +460,15 @@ IF(WIN32)
|
||||
SET(OPENCOLLADA ${LIBDIR}/opencollada)
|
||||
SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
|
||||
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
|
||||
SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa)
|
||||
SET(OPENCOLLADA_LIB OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa)
|
||||
#pcre is bundled with openCollada
|
||||
#SET(PCRE ${LIBDIR}/pcre)
|
||||
#SET(PCRE_LIBPATH ${PCRE}/lib)
|
||||
SET(PCRE_LIB pcre)
|
||||
ENDIF(WITH_OPENCOLLADA)
|
||||
|
||||
# TODO: IF(WITH_LCMS)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc)
|
||||
@ -496,10 +536,12 @@ IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gcc/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
SET(GETTEXT_LIB intl)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(GETTEXT ${LIBDIR}/gcc/gettext)
|
||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
SET(GETTEXT_LIB intl)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
SET(JPEG_LIBRARY jpeg)
|
||||
SET(PNG_LIBRARIES png)
|
||||
@ -632,10 +674,12 @@ IF(APPLE)
|
||||
SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python")
|
||||
ENDIF(PYTHON_VERSION MATCHES 3.1)
|
||||
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC "${GETTEXT}/include")
|
||||
SET(GETTEXT_LIB intl iconv)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
IF(WITH_INTERNATIONAL)
|
||||
SET(GETTEXT ${LIBDIR}/gettext)
|
||||
SET(GETTEXT_INC "${GETTEXT}/include")
|
||||
SET(GETTEXT_LIB intl iconv)
|
||||
SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_FFTW3)
|
||||
SET(FFTW3 ${LIBDIR}/fftw3)
|
||||
@ -656,15 +700,21 @@ IF(APPLE)
|
||||
SET(FREETYPE_LIBPATH ${FREETYPE}/lib)
|
||||
SET(FREETYPE_LIBRARY freetype)
|
||||
|
||||
SET(OPENEXR ${LIBDIR}/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
IF(WITH_OPENEXR)
|
||||
SET(OPENEXR ${LIBDIR}/openexr)
|
||||
SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include)
|
||||
SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread)
|
||||
SET(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
# TODO: IF(WITH_LCMS)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(FFMPEG ${LIBDIR}/ffmpeg)
|
||||
SET(FFMPEG_INC ${FFMPEG}/include)
|
||||
SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg)
|
||||
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
SET(LIBSAMPLERATE ${LIBDIR}/samplerate)
|
||||
SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
|
||||
@ -712,10 +762,12 @@ IF(APPLE)
|
||||
SET(EXPAT_LIB)
|
||||
ENDIF (WITH_OPENCOLLADA)
|
||||
|
||||
SET(SDL ${LIBDIR}/sdl)
|
||||
SET(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
SET(SDL_LIBRARY SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
IF(WITH_SDL)
|
||||
SET(SDL ${LIBDIR}/sdl)
|
||||
SET(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
SET(SDL_LIBRARY SDL)
|
||||
SET(SDL_LIBPATH ${SDL}/lib)
|
||||
ENDIF(WITH_SDL)
|
||||
|
||||
SET(PNG "${LIBDIR}/png")
|
||||
SET(PNG_INC "${PNG}/include")
|
||||
@ -725,10 +777,12 @@ IF(APPLE)
|
||||
SET(JPEG_INC "${JPEG}/include")
|
||||
SET(JPEG_LIBPATH ${JPEG}/lib)
|
||||
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
|
||||
SET(TIFF_LIBRARY tiff)
|
||||
SET(TIFF_LIBPATH ${TIFF}/lib)
|
||||
IF(WITH_TIFF)
|
||||
SET(TIFF ${LIBDIR}/tiff)
|
||||
SET(TIFF_INCLUDE_DIR ${TIFF}/include)
|
||||
SET(TIFF_LIBRARY tiff)
|
||||
SET(TIFF_LIBPATH ${TIFF}/lib)
|
||||
ENDIF(WITH_TIFF)
|
||||
|
||||
SET(EXETYPE MACOSX_BUNDLE)
|
||||
|
||||
@ -776,10 +830,11 @@ ENDIF(WITH_BUILDINFO)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Common.
|
||||
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_LIb extern_libopenjpeg)
|
||||
IF(WITH_OPENJPEG)
|
||||
set(OPENJPEG ${CMAKE_SOURCE_DIR}/extern/libopenjpeg)
|
||||
set(OPENJPEG_INC ${OPENJPEG})
|
||||
set(OPENJPEG_LIb extern_libopenjpeg)
|
||||
ENDIF(WITH_OPENJPEG)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Blender WebPlugin
|
||||
|
@ -201,6 +201,7 @@ if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
|
||||
|
||||
SetOption('num_jobs', int(env['BF_NUMJOBS']))
|
||||
print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
|
||||
print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
|
||||
|
||||
# BLENDERPATH is a unix only option to enable typical style paths this is
|
||||
# spesifically a data-dir, which is used a lot but cant replace BF_INSTALLDIR
|
||||
@ -268,6 +269,7 @@ if 'blenderlite' in B.targets:
|
||||
target_env_defs['WITH_BF_GAMEENGINE'] = False
|
||||
target_env_defs['WITH_BF_OPENAL'] = False
|
||||
target_env_defs['WITH_BF_OPENEXR'] = False
|
||||
target_env_defs['WITH_BF_OPENMP'] = False
|
||||
target_env_defs['WITH_BF_ICONV'] = False
|
||||
target_env_defs['WITH_BF_INTERNATIONAL'] = False
|
||||
target_env_defs['WITH_BF_OPENJPEG'] = False
|
||||
|
@ -83,22 +83,11 @@ BF_FTGL_LIB = 'extern_ftgl'
|
||||
|
||||
WITH_BF_GAMEENGINE='false'
|
||||
|
||||
WITH_BF_ODE = 'false'
|
||||
BF_ODE = LIBDIR + '/ode'
|
||||
BF_ODE_INC = BF_ODE + '/include'
|
||||
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
|
||||
|
||||
WITH_BF_BULLET = 'true'
|
||||
BF_BULLET = '#extern/bullet2/src'
|
||||
BF_BULLET_INC = '${BF_BULLET}'
|
||||
BF_BULLET_LIB = 'extern_bullet'
|
||||
|
||||
BF_SOLID = '#extern/solid'
|
||||
BF_SOLID_INC = '${BF_SOLID}'
|
||||
BF_SOLID_LIB = 'extern_solid'
|
||||
|
||||
WITH_BF_YAFRAY = 'true'
|
||||
|
||||
#WITH_BF_NSPR = 'true'
|
||||
#BF_NSPR = $(LIBDIR)/nspr
|
||||
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
|
||||
|
@ -65,7 +65,7 @@ WITH_BF_DDS = True
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
BF_JPEG_LIB = 'libjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
@ -83,7 +83,7 @@ BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
#BF_ZLIB_LIB = 'z'
|
||||
BF_ZLIB_LIB = 'libz'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
@ -151,11 +151,9 @@ BF_OPENGL = 'C:\\MingW'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
|
||||
BF_OPENGL_LIB = 'opengl32 glu32'
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
|
||||
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
|
||||
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
|
||||
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
WITH_BF_OPENMP = False
|
||||
BF_OPENMP = LIBDIR + '/gcc/gomp'
|
||||
BF_OPENMP_INC = '${BF_OPENMP}/include'
|
||||
BF_OPENMP_LIBPATH = '${BF_OPENMP}/lib'
|
||||
|
@ -64,7 +64,7 @@ WITH_BF_DDS = True
|
||||
WITH_BF_JPEG = True
|
||||
BF_JPEG = LIBDIR + '/jpeg'
|
||||
BF_JPEG_INC = '${BF_JPEG}/include'
|
||||
BF_JPEG_LIB = 'jpeg'
|
||||
BF_JPEG_LIB = 'liblibjpeg'
|
||||
BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
|
||||
|
||||
WITH_BF_PNG = True
|
||||
@ -82,6 +82,7 @@ BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
|
||||
WITH_BF_ZLIB = True
|
||||
BF_ZLIB = LIBDIR + '/zlib'
|
||||
BF_ZLIB_INC = '${BF_ZLIB}/include'
|
||||
BF_ZLIB_LIB = 'libz'
|
||||
BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
|
||||
|
||||
WITH_BF_INTERNATIONAL = True
|
||||
|
@ -139,14 +139,14 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_COLLADA = False
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
|
@ -152,14 +152,14 @@ BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
|
||||
WITH_BF_REDCODE = False
|
||||
BF_REDCODE_INC = '#extern'
|
||||
|
||||
WITH_BF_COLLADA = False
|
||||
WITH_BF_COLLADA = True
|
||||
BF_COLLADA = '#source/blender/collada'
|
||||
BF_COLLADA_INC = '${BF_COLLADA}'
|
||||
BF_COLLADA_LIB = 'bf_collada'
|
||||
|
||||
BF_OPENCOLLADA = LIBDIR + '/opencollada'
|
||||
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml2 pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
|
232
doc/blender.1
Normal file
232
doc/blender.1
Normal file
@ -0,0 +1,232 @@
|
||||
.TH "BLENDER" "1" "June 06, 2010" "Blender 2\&.5\&.2"
|
||||
.SH NAME
|
||||
blender \- a 3D modelling and rendering package
|
||||
.SH SYNOPSIS
|
||||
.B blender [args ...] [file] [args ...]
|
||||
|
||||
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.B blender
|
||||
is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
|
||||
|
||||
Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
|
||||
|
||||
http://www.blender.org
|
||||
.SH OPTIONS
|
||||
.SS "Render options:"
|
||||
|
||||
.TP
|
||||
.B \-b, \-\-background <file>
|
||||
Load <file> in background (often used for UI-less rendering)
|
||||
|
||||
.TP
|
||||
.B \-a, \-\-render-anim
|
||||
Render frames from start to end (inclusive)
|
||||
|
||||
.TP
|
||||
.B \-S, \-\-scene <name>
|
||||
Set the active scene <name> for rendering
|
||||
|
||||
.TP
|
||||
.B \-f, \-\-render-frame <frame>
|
||||
Render frame <frame> and save it
|
||||
|
||||
.TP
|
||||
.B \-s, \-\-frame-start <frame>
|
||||
Set start to frame <frame> (use before the \-a argument)
|
||||
|
||||
.TP
|
||||
.B \-e, \-\-frame-end <frame>
|
||||
Set end to frame <frame> (use before the \-a argument)
|
||||
|
||||
.TP
|
||||
.B \-j, \-\-frame-jump <frames>
|
||||
Set number of frames to step forward after each rendered frame
|
||||
|
||||
.TP
|
||||
.B \-o, --render-output <path>
|
||||
Set the render path and file name.
|
||||
.IP
|
||||
Use // at the start of the path to render relative to the blend file.
|
||||
.IP
|
||||
The # characters are replaced by the frame number, and used to define zero padding.
|
||||
.IP
|
||||
ani_##_test.png becomes ani_01_test.png
|
||||
test-######.png becomes test-000001.png
|
||||
When the filename does not contain #, The suffix #### is added to the filename
|
||||
.IP
|
||||
The frame number will be added at the end of the filename.
|
||||
eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a
|
||||
//render_ becomes //render_####, writing frames as //render_0001.png//
|
||||
|
||||
.HP
|
||||
.B \-E, \-\-engine <engine>
|
||||
Specify the render engine
|
||||
use \fI\-E help\fR to list available engines
|
||||
|
||||
.SS "Format options:"
|
||||
|
||||
.TP
|
||||
.B \-F, \-\-render-format <format>
|
||||
Set the render format, valid options are...
|
||||
.IP
|
||||
TGA IRIS JPEG MOVIE IRIZ RAWTGA
|
||||
AVIRAW AVIJPEG PNG BMP FRAMESERVER
|
||||
.IP
|
||||
(formats that can be compiled into blender, not available on all systems)
|
||||
.IP
|
||||
HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS
|
||||
|
||||
.TP
|
||||
.B \-x, \-\-use-extension <bool>
|
||||
Set option to add the file extension to the end of the file
|
||||
|
||||
.TP
|
||||
.B \-t, \-\-threads <threads>
|
||||
Use amount of <threads> for rendering in background
|
||||
[1-BLENDER_MAX_THREADS], 0 for systems processor count.
|
||||
|
||||
.SS "Animation options:"
|
||||
|
||||
.TP
|
||||
.B \-a <options> <file(s)>
|
||||
Playback <file(s)>, only operates this way when not running in background.
|
||||
.IP
|
||||
\-p <sx> <sy> \-\- Open with lower left corner at <sx>, <sy>
|
||||
.br
|
||||
\-m \-\- Read from disk (Don't buffer)
|
||||
.br
|
||||
\-f <fps> <fps-base> \-\- Specify FPS to start with
|
||||
.br
|
||||
\-j <frame> \-\- Set frame step to <frame>
|
||||
|
||||
.SS "Window options:"
|
||||
|
||||
.TP
|
||||
.B \-w, \-\-window-border
|
||||
Force opening with borders (default)
|
||||
|
||||
.TP
|
||||
.B \-W, \-\-window-borderless
|
||||
Force opening with without borders
|
||||
|
||||
.TP
|
||||
.B \-p, --window-geometry <sx> <sy> <w> <h>
|
||||
Open with lower left corner at <sx>, <sy> and width and height <w>, <h>
|
||||
|
||||
.SS "Game Engine specific options:"
|
||||
.TP
|
||||
.B \-g fixedtime
|
||||
Run on 50 hertz without dropping frames
|
||||
.TP
|
||||
.B \-g vertexarrays
|
||||
Use Vertex Arrays for rendering (usually faster)
|
||||
.TP
|
||||
.B \-g nomipmap
|
||||
No Texture Mipmapping
|
||||
.TP
|
||||
.B \-g linearmipmap
|
||||
Linear Texture Mipmapping instead of Nearest (default)
|
||||
.SS "Misc options:"
|
||||
.TP
|
||||
.B \-d, \-\-debug
|
||||
Turn debugging on
|
||||
.IP
|
||||
Prints every operator call and their arguments
|
||||
.br
|
||||
Disables mouse grab (to interact with a debugger in some cases)
|
||||
.br
|
||||
Keeps python sys.stdin rather then setting it to None
|
||||
|
||||
.TP
|
||||
.B \--debug-fpe
|
||||
Enable floating point exceptions
|
||||
|
||||
.TP
|
||||
.B \-noaudio
|
||||
Disable audio on systems that support audio
|
||||
|
||||
.TP
|
||||
.B \-nojoystick
|
||||
Disable joystick support
|
||||
|
||||
.TP
|
||||
.B \-noglsl
|
||||
Disable GLSL shading
|
||||
|
||||
.TP
|
||||
.B \-y, \-\-enable-autoexec
|
||||
Enable automatic python script execution (default)
|
||||
|
||||
.TP
|
||||
.B \-Y, \-\-disable-autoexec
|
||||
Disable automatic python script execution (pydrivers, pyconstraints, pynodes)
|
||||
|
||||
.TP
|
||||
.B \-P <filename>
|
||||
Run the given Python script (filename or Blender Text)
|
||||
|
||||
.TP
|
||||
.B \-\-python-console
|
||||
Run blender with an interactive console
|
||||
|
||||
.TP
|
||||
.B \-v, \-\-version
|
||||
Print Blender version and exit
|
||||
|
||||
.TP
|
||||
.B \-\-
|
||||
Ends option processing, following arguments passed unchanged. Access via python's sys.argv
|
||||
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
Show a summary of options.
|
||||
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
|
||||
.PP
|
||||
\fIHOME\fR
|
||||
.RS 4
|
||||
Store files such as .blender/ .B.blend .Bfs .Blog here.
|
||||
.RE
|
||||
|
||||
.PP
|
||||
\fIBLENDERPATH\fR
|
||||
.RS 4
|
||||
System directory to use for data files and scripts.
|
||||
For this build of blender the default BLENDERPATH is...
|
||||
"/usr/share/blender"
|
||||
setting the $BLENDERPATH will override this
|
||||
.RE
|
||||
|
||||
.PP
|
||||
\fITMP\fR or \fITMPDIR\fR
|
||||
.RS 4
|
||||
Store temporary files here.
|
||||
.RE
|
||||
|
||||
.PP
|
||||
\fISDL_AUDIODRIVER\fR
|
||||
.RS 4
|
||||
LibSDL audio driver - alsa, esd, alsa, dma.
|
||||
.RE
|
||||
|
||||
.PP
|
||||
\fIPYTHONHOME\fR
|
||||
.RS 4
|
||||
Path to the python directory, eg. /usr/lib/python.
|
||||
.RE
|
||||
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.B yafaray(1)
|
||||
|
||||
.br
|
||||
.SH AUTHORS
|
||||
This manpage was written for a Debian GNU/Linux system by Daniel Mester
|
||||
<mester@uni-bremen.de> and updated by Cyril Brulebois
|
||||
<cyril.brulebois@enst-bretagne.fr> and Dan Eicher <dan@trollwerks.org>.
|
||||
|
||||
|
@ -202,8 +202,8 @@ protected:
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
public:
|
||||
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
|
||||
void operator delete( void *mem ) { MEM_freeN(mem); }
|
||||
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
|
||||
void operator delete(void *mem) { MEM_freeN(mem); }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -762,12 +762,22 @@ class PovrayRender(bpy.types.RenderEngine):
|
||||
|
||||
if 1:
|
||||
# TODO, when povray isnt found this gives a cryptic error, would be nice to be able to detect if it exists
|
||||
self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||
try:
|
||||
self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||
except OSError:
|
||||
# TODO, report api
|
||||
print("POVRAY: could not execute povray, possibly povray isn't installed: '%s'" % pov_binary)
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
print ("***-DONE-***")
|
||||
return False
|
||||
|
||||
else:
|
||||
# This works too but means we have to wait until its done
|
||||
os.system('%s %s' % (pov_binary, self._temp_file_ini))
|
||||
|
||||
print ("***-DONE-***")
|
||||
return True
|
||||
|
||||
def _cleanup(self):
|
||||
for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out):
|
||||
@ -783,7 +793,10 @@ class PovrayRender(bpy.types.RenderEngine):
|
||||
self.update_stats("", "POVRAY: Exporting data from Blender")
|
||||
self._export(scene)
|
||||
self.update_stats("", "POVRAY: Parsing File")
|
||||
self._render()
|
||||
|
||||
if not self._render():
|
||||
self.update_stats("", "POVRAY: Not found")
|
||||
return
|
||||
|
||||
r = scene.render
|
||||
|
||||
|
@ -2011,9 +2011,8 @@ def write(filename, batch_objects = None, \
|
||||
|
||||
if ob_arms_orig_rest:
|
||||
for ob_base in bpy.data.objects:
|
||||
#if ob_base.type == 'Armature':
|
||||
ob_base.make_display_list(scene)
|
||||
# ob_base.makeDisplayList()
|
||||
if ob_base.type == 'ARMATURE':
|
||||
ob_base.update(scene)
|
||||
|
||||
# This causes the makeDisplayList command to effect the mesh
|
||||
scene.set_frame(scene.frame_current)
|
||||
@ -2187,9 +2186,7 @@ def write(filename, batch_objects = None, \
|
||||
if ob_arms_orig_rest:
|
||||
for ob_base in bpy.data.objects:
|
||||
if ob_base.type == 'ARMATURE':
|
||||
# if ob_base.type == 'Armature':
|
||||
ob_base.make_display_list(scene)
|
||||
# ob_base.makeDisplayList()
|
||||
ob_base.update(scene)
|
||||
# This causes the makeDisplayList command to effect the mesh
|
||||
scene.set_frame(scene.frame_current)
|
||||
# Blender.Set('curframe', Blender.Get('curframe'))
|
||||
|
@ -21,6 +21,7 @@
|
||||
import bpy
|
||||
import mathutils
|
||||
|
||||
|
||||
def add_object_align_init(context, operator):
|
||||
|
||||
if operator and operator.properties.is_property_set("location") and operator.properties.is_property_set("rotation"):
|
||||
|
@ -144,7 +144,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
|
||||
_loaded.append(mod)
|
||||
|
||||
if reload_scripts:
|
||||
|
||||
|
||||
# TODO, this is broken but should work, needs looking into
|
||||
'''
|
||||
# reload modules that may not be directly included
|
||||
@ -369,7 +369,7 @@ def smpte_from_seconds(time, fps=None):
|
||||
time = time % 60.0
|
||||
|
||||
seconds = int(time)
|
||||
frames= int(round(math.floor(((time - seconds) * fps))))
|
||||
frames = int(round(math.floor(((time - seconds) * fps))))
|
||||
|
||||
return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames)
|
||||
|
||||
|
@ -29,15 +29,52 @@ class Context(StructRNA):
|
||||
__slots__ = ()
|
||||
|
||||
def copy(self):
|
||||
from types import BuiltinMethodType
|
||||
new_context = {}
|
||||
generic_keys = StructRNA.__dict__.keys()
|
||||
for item in dir(self):
|
||||
if item not in generic_keys:
|
||||
new_context[item] = getattr(self, item)
|
||||
generic_attrs = list(StructRNA.__dict__.keys()) + ["bl_rna", "rna_type", "copy"]
|
||||
for attr in dir(self):
|
||||
if not (attr.startswith("_") or attr in generic_attrs):
|
||||
value = getattr(self, attr)
|
||||
if type(value) != BuiltinMethodType:
|
||||
new_context[attr] = value
|
||||
|
||||
return new_context
|
||||
|
||||
|
||||
class Library(bpy_types.ID):
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def users_id(self):
|
||||
"""ID datablocks which use this library"""
|
||||
import bpy
|
||||
|
||||
# See: readblenentry.c, IDTYPE_FLAGS_ISLINKABLE, we could make this an attribute in rna.
|
||||
attr_links = "actions", "armatures", "brushes", "cameras", \
|
||||
"curves", "gpencil", "groups", "images", \
|
||||
"lamps", "lattices", "materials", "metaballs", \
|
||||
"meshes", "node_groups", "objects", "scenes", \
|
||||
"sounds", "textures", "texts", "fonts", "worlds"
|
||||
|
||||
return tuple(id_block for attr in attr_links for id_block in getattr(bpy.data, attr) if id_block.library == self)
|
||||
|
||||
|
||||
class Texture(bpy_types.ID):
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def users_material(self):
|
||||
"""Materials that use this texture"""
|
||||
import bpy
|
||||
return tuple(mat for mat in bpy.data.materials if self in [slot.texture for slot in mat.texture_slots if slot])
|
||||
|
||||
@property
|
||||
def users_object_modifier(self):
|
||||
"""Object modifiers that use this texture"""
|
||||
import bpy
|
||||
return tuple(obj for obj in bpy.data.objects if self in [mod.texture for mod in obj.modifiers if mod.type == 'DISPLACE'])
|
||||
|
||||
|
||||
class Group(bpy_types.ID):
|
||||
__slots__ = ()
|
||||
|
||||
@ -399,7 +436,7 @@ class Mesh(bpy_types.ID):
|
||||
closed loops have matching start and end values.
|
||||
"""
|
||||
line_polys = []
|
||||
|
||||
|
||||
# Get edges not used by a face
|
||||
if edges is None:
|
||||
edges = self.edges
|
||||
@ -407,10 +444,10 @@ class Mesh(bpy_types.ID):
|
||||
if not hasattr(edges, "pop"):
|
||||
edges = edges[:]
|
||||
|
||||
edge_dict= dict((ed.key, ed) for ed in self.edges if ed.selected)
|
||||
|
||||
edge_dict = dict((ed.key, ed) for ed in self.edges if ed.selected)
|
||||
|
||||
while edges:
|
||||
current_edge= edges.pop()
|
||||
current_edge = edges.pop()
|
||||
vert_end, vert_start = current_edge.verts[:]
|
||||
line_poly = [vert_start, vert_end]
|
||||
|
||||
@ -428,7 +465,7 @@ class Mesh(bpy_types.ID):
|
||||
vert_end = line_poly[-1]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
# break
|
||||
elif v2 == vert_end:
|
||||
line_poly.append(v1)
|
||||
vert_end = line_poly[-1]
|
||||
@ -440,7 +477,7 @@ class Mesh(bpy_types.ID):
|
||||
vert_start = line_poly[0]
|
||||
ok = 1
|
||||
del edges[i]
|
||||
#break
|
||||
# break
|
||||
elif v2 == vert_start:
|
||||
line_poly.insert(0, v1)
|
||||
vert_start = line_poly[0]
|
||||
@ -452,7 +489,6 @@ class Mesh(bpy_types.ID):
|
||||
return line_polys
|
||||
|
||||
|
||||
|
||||
class MeshEdge(StructRNA):
|
||||
__slots__ = ()
|
||||
|
||||
|
@ -33,7 +33,7 @@ def get_console(console_id):
|
||||
'''
|
||||
helper function for console operators
|
||||
currently each text datablock gets its own
|
||||
console - bpython_code.InteractiveConsole()
|
||||
console - code.InteractiveConsole()
|
||||
...which is stored in this function.
|
||||
|
||||
console_id can be any hashable type
|
||||
@ -44,21 +44,24 @@ def get_console(console_id):
|
||||
|
||||
if consoles is None:
|
||||
consoles = get_console.consoles = {}
|
||||
else:
|
||||
# check if clearning the namespace is needed to avoid a memory leak.
|
||||
# the window manager is normally loaded with new blend files
|
||||
# so this is a reasonable way to deal with namespace clearing.
|
||||
# bpy.data hashing is reset by undo so cant be used.
|
||||
hash_prev = getattr(get_console, "consoles_namespace_hash", 0)
|
||||
hash_next = hash(bpy.context.manager)
|
||||
|
||||
# clear all dead consoles, use text names as IDs
|
||||
# TODO, find a way to clear IDs
|
||||
'''
|
||||
for console_id in list(consoles.keys()):
|
||||
if console_id not in bpy.data.texts:
|
||||
del consoles[id]
|
||||
'''
|
||||
if hash_prev != hash_next:
|
||||
get_console.consoles_namespace_hash = hash_next
|
||||
consoles.clear()
|
||||
|
||||
console_data = consoles.get(console_id)
|
||||
|
||||
if console_data:
|
||||
console, stdout, stderr = console_data
|
||||
|
||||
# XXX, bug in python 3.1.2 ?
|
||||
# XXX, bug in python 3.1.2 ? (worked in 3.1.1)
|
||||
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
|
||||
import io
|
||||
stdout = io.StringIO()
|
||||
@ -121,7 +124,7 @@ def execute(context):
|
||||
# unlikely, but this can happen with unicode errors for example.
|
||||
import traceback
|
||||
stderr.write(traceback.format_exc())
|
||||
|
||||
|
||||
|
||||
stdout.seek(0)
|
||||
stderr.seek(0)
|
||||
@ -180,7 +183,7 @@ def autocomplete(context):
|
||||
# note: unlikely stdin would be used for autocomp. but its possible.
|
||||
stdin_backup = sys.stdin
|
||||
sys.stdin = None
|
||||
|
||||
|
||||
scrollback = ""
|
||||
scrollback_error = ""
|
||||
|
||||
|
@ -515,9 +515,9 @@ class IsolateTypeRender(bpy.types.Operator):
|
||||
|
||||
def execute(self, context):
|
||||
act_type = context.object.type
|
||||
|
||||
|
||||
for obj in context.visible_objects:
|
||||
|
||||
|
||||
if obj.selected:
|
||||
obj.restrict_render = False
|
||||
else:
|
||||
|
@ -138,6 +138,7 @@ def register():
|
||||
register(SequencerCutMulticam)
|
||||
register(SequencerDeinterlaceSelectedMovies)
|
||||
|
||||
|
||||
def unregister():
|
||||
unregister = bpy.types.unregister
|
||||
|
||||
@ -145,7 +146,6 @@ def unregister():
|
||||
unregister(SequencerCutMulticam)
|
||||
unregister(SequencerDeinterlaceSelectedMovies)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
register()
|
||||
|
@ -178,7 +178,7 @@ class ExportUVLayout(bpy.types.Operator):
|
||||
fw('stroke\n')
|
||||
fw('} def\n')
|
||||
fw('newpath\n')
|
||||
|
||||
|
||||
firstline = True
|
||||
for i, uvs in self._face_uv_iter(context):
|
||||
for j, uv in enumerate(uvs):
|
||||
|
@ -16,7 +16,7 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8-80 compliant>
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
|
||||
|
@ -452,12 +452,12 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
||||
col = layout.column()
|
||||
row = col.row()
|
||||
if md.external:
|
||||
row.operator("object.multires_pack_external", text="Pack External")
|
||||
row.operator("object.multires_external_pack", text="Pack External")
|
||||
row.label()
|
||||
row = col.row()
|
||||
row.prop(md, "filepath", text="")
|
||||
else:
|
||||
row.operator("object.multires_save_external", text="Save External...")
|
||||
row.operator("object.multires_external_save", text="Save External...")
|
||||
row.label()
|
||||
|
||||
def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui):
|
||||
|
@ -30,11 +30,12 @@ class PhysicsButtonsPanel(bpy.types.Panel):
|
||||
def poll(self, context):
|
||||
ob = context.active_object
|
||||
rd = context.scene.render
|
||||
return ob and ob.game and (rd.engine == 'BLENDER_GAME')
|
||||
return ob and ob.game and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
bl_label = "Physics"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -163,11 +164,12 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
|
||||
|
||||
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
|
||||
bl_label = "Collision Bounds"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def poll(self, context):
|
||||
game = context.object.game
|
||||
rd = context.scene.render
|
||||
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
|
||||
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
def draw_header(self, context):
|
||||
game = context.active_object.game
|
||||
@ -203,11 +205,12 @@ class RenderButtonsPanel(bpy.types.Panel):
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render
|
||||
return (rd.engine == 'BLENDER_GAME')
|
||||
return (rd.engine in self.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class RENDER_PT_game(RenderButtonsPanel):
|
||||
bl_label = "Game"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -219,6 +222,7 @@ class RENDER_PT_game(RenderButtonsPanel):
|
||||
|
||||
class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
bl_label = "Standalone Player"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -256,6 +260,7 @@ class RENDER_PT_game_player(RenderButtonsPanel):
|
||||
|
||||
class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
bl_label = "Stereo"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -315,6 +320,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
|
||||
|
||||
class RENDER_PT_game_shading(RenderButtonsPanel):
|
||||
bl_label = "Shading"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -343,6 +349,7 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
|
||||
|
||||
class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
bl_label = "Performance"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -368,6 +375,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
|
||||
|
||||
class RENDER_PT_game_sound(RenderButtonsPanel):
|
||||
bl_label = "Sound"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -390,12 +398,13 @@ class WorldButtonsPanel(bpy.types.Panel):
|
||||
|
||||
def poll(self, context):
|
||||
scene = context.scene
|
||||
return (scene.render.engine == 'BLENDER_GAME') and (scene.world is not None)
|
||||
return (scene.render.engine in self.COMPAT_ENGINES) and (scene.world is not None)
|
||||
|
||||
|
||||
class WORLD_PT_game_context_world(WorldButtonsPanel):
|
||||
bl_label = ""
|
||||
bl_show_header = False
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def poll(self, context):
|
||||
rd = context.scene.render
|
||||
@ -424,6 +433,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel):
|
||||
|
||||
class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
bl_label = "World"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -443,11 +453,12 @@ class WORLD_PT_game_world(WorldButtonsPanel):
|
||||
|
||||
class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
bl_label = "Mist"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw_header(self, context):
|
||||
world = context.world
|
||||
|
||||
self.layout.prop(world.mist, "enabled", text="")
|
||||
self.layout.prop(world.mist, "use_mist", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -455,7 +466,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
world = context.world
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout.active = world.mist.enabled
|
||||
layout.active = world.mist.use_mist
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
@ -468,6 +479,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
|
||||
|
||||
class WORLD_PT_game_physics(WorldButtonsPanel):
|
||||
bl_label = "Physics"
|
||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -739,7 +739,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
else:
|
||||
col = layout.column()
|
||||
col.prop(con, "use_relative_position")
|
||||
if con.use_relative_position:
|
||||
if con.use_relative_position:
|
||||
col.prop(con, "offset", text="Relative Pivot Point")
|
||||
else:
|
||||
col.prop(con, "offset", text="Absolute Pivot Point")
|
||||
@ -747,6 +747,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
||||
col = layout.column()
|
||||
col.prop(con, "enabled_rotation_range", text="Pivot When")
|
||||
|
||||
|
||||
class OBJECT_PT_constraints(ConstraintButtonsPanel):
|
||||
bl_label = "Object Constraints"
|
||||
bl_context = "constraint"
|
||||
|
@ -70,8 +70,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
||||
else:
|
||||
layout.prop(md, "smoke_type", text="")
|
||||
|
||||
if md.smoke_type == 'TYPE_DOMAIN':
|
||||
|
||||
if md.smoke_type == 'DOMAIN':
|
||||
domain = md.domain_settings
|
||||
|
||||
split = layout.split()
|
||||
@ -93,8 +92,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
||||
sub.prop(domain, "dissolve_speed", text="Time")
|
||||
sub.prop(domain, "dissolve_smoke_log", text="Slow")
|
||||
|
||||
elif md.smoke_type == 'TYPE_FLOW':
|
||||
|
||||
elif md.smoke_type == 'FLOW':
|
||||
flow = md.flow_settings
|
||||
|
||||
split = layout.split()
|
||||
@ -114,7 +112,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
||||
col.prop(flow, "temperature")
|
||||
col.prop(flow, "density")
|
||||
|
||||
#elif md.smoke_type == 'TYPE_COLL':
|
||||
#elif md.smoke_type == 'COLLISION':
|
||||
# layout.separator()
|
||||
|
||||
|
||||
@ -124,7 +122,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
return md and (md.smoke_type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -153,19 +151,17 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
return md and (md.smoke_type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
domain = context.smoke.domain_settings
|
||||
|
||||
layout.label(text="Compression:")
|
||||
layout.prop(domain, "smoke_cache_comp", expand=True)
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_low
|
||||
|
||||
layout.label(text="Compression:")
|
||||
layout.prop(md, "smoke_cache_comp", expand=True)
|
||||
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
|
||||
|
||||
|
||||
@ -175,12 +171,12 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN')
|
||||
return md and (md.smoke_type == 'DOMAIN')
|
||||
|
||||
def draw_header(self, context):
|
||||
high = context.smoke.domain_settings
|
||||
md = context.smoke.domain_settings
|
||||
|
||||
self.layout.prop(high, "highres", text="")
|
||||
self.layout.prop(md, "highres", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -188,6 +184,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
||||
md = context.smoke.domain_settings
|
||||
wide_ui = context.region.width > narrowui
|
||||
|
||||
layout.active = md.highres
|
||||
|
||||
split = layout.split()
|
||||
|
||||
col = split.column()
|
||||
@ -208,20 +206,17 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
|
||||
|
||||
def poll(self, context):
|
||||
md = context.smoke
|
||||
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
|
||||
return md and (md.smoke_type == 'DOMAIN') and md.domain_settings.highres
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
domain = context.smoke.domain_settings
|
||||
|
||||
layout.label(text="Compression:")
|
||||
layout.prop(domain, "smoke_cache_high_comp", expand=True)
|
||||
|
||||
|
||||
md = context.smoke.domain_settings
|
||||
cache = md.point_cache_high
|
||||
|
||||
layout.label(text="Compression:")
|
||||
layout.prop(md, "smoke_cache_high_comp", expand=True)
|
||||
|
||||
point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
|
||||
|
||||
|
||||
@ -231,7 +226,7 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
|
||||
|
||||
def poll(self, context):
|
||||
smoke = context.smoke
|
||||
return (smoke and smoke.smoke_type == 'TYPE_DOMAIN')
|
||||
return (smoke and smoke.smoke_type == 'DOMAIN')
|
||||
|
||||
def draw(self, context):
|
||||
domain = context.smoke.domain_settings
|
||||
|
@ -349,7 +349,7 @@ class RENDER_PT_output(RenderButtonsPanel):
|
||||
if rd.file_format in ('AVI_JPEG', 'JPEG'):
|
||||
split = layout.split()
|
||||
split.prop(rd, "file_quality", slider=True)
|
||||
|
||||
|
||||
elif rd.file_format == 'MULTILAYER':
|
||||
split = layout.split()
|
||||
|
||||
|
@ -66,7 +66,7 @@ class INFO_HT_header(bpy.types.Header):
|
||||
layout.template_running_jobs()
|
||||
|
||||
layout.template_reports_banner()
|
||||
|
||||
|
||||
layout.label(text=scene.statistics())
|
||||
|
||||
# XXX: this should be right-aligned to the RHS of the region
|
||||
@ -198,6 +198,7 @@ class INFO_MT_mesh_add(bpy.types.Menu):
|
||||
layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
|
||||
layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
|
||||
|
||||
|
||||
class INFO_MT_curve_add(bpy.types.Menu):
|
||||
bl_idname = "INFO_MT_curve_add"
|
||||
bl_label = "Curve"
|
||||
@ -211,6 +212,7 @@ class INFO_MT_curve_add(bpy.types.Menu):
|
||||
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
|
||||
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
||||
|
||||
|
||||
class INFO_MT_armature_add(bpy.types.Menu):
|
||||
bl_idname = "INFO_MT_armature_add"
|
||||
bl_label = "Armature"
|
||||
|
@ -46,6 +46,7 @@ class LOGIC_PT_properties(bpy.types.Panel):
|
||||
row.prop(prop, "debug", text="", toggle=True, icon='INFO')
|
||||
row.operator("object.game_property_remove", text="", icon='X').index = i
|
||||
|
||||
|
||||
class LOGIC_MT_logicbricks_add(bpy.types.Menu):
|
||||
bl_label = "Add"
|
||||
|
||||
|
@ -139,8 +139,10 @@ class NODE_MT_node(bpy.types.Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("node.hide")
|
||||
layout.operator("node.mute")
|
||||
layout.operator("node.hide_toggle")
|
||||
layout.operator("node.mute_toggle")
|
||||
layout.operator("node.preview_toggle")
|
||||
layout.operator("node.hide_socket_toggle")
|
||||
|
||||
# XXX
|
||||
# layout.operator("node.rename")
|
||||
|
@ -457,7 +457,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel):
|
||||
row = layout.row(align=True)
|
||||
sub = row.row()
|
||||
sub.scale_x = 2.0
|
||||
|
||||
|
||||
if not context.screen.animation_playing:
|
||||
sub.operator("screen.animation_play", text="", icon='PLAY')
|
||||
else:
|
||||
|
@ -54,6 +54,9 @@ class TEXT_HT_header(bpy.types.Header):
|
||||
if text:
|
||||
row = layout.row()
|
||||
row.operator("text.run_script")
|
||||
|
||||
row = layout.row()
|
||||
row.active = text.name.endswith(".py")
|
||||
row.prop(text, "use_module")
|
||||
|
||||
row = layout.row()
|
||||
@ -63,10 +66,7 @@ class TEXT_HT_header(bpy.types.Header):
|
||||
else:
|
||||
row.label(text="File: %s" % text.filepath)
|
||||
else:
|
||||
if text.library:
|
||||
row.label(text="Text: External")
|
||||
else:
|
||||
row.label(text="Text: Internal")
|
||||
row.label(text="Text: External" if text.library else "Text: Internal")
|
||||
|
||||
|
||||
class TEXT_PT_properties(bpy.types.Panel):
|
||||
|
@ -165,11 +165,11 @@ class USERPREF_PT_interface(bpy.types.Panel):
|
||||
sub.enabled = view.show_mini_axis
|
||||
sub.prop(view, "mini_axis_size", text="Size")
|
||||
sub.prop(view, "mini_axis_brightness", text="Brightness")
|
||||
|
||||
|
||||
col.separator()
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
|
||||
col.label(text="Properties Window:")
|
||||
col.prop(view, "properties_width_check")
|
||||
|
||||
@ -561,7 +561,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
||||
ui = theme.user_interface.wcol_scroll
|
||||
col.label(text="Scroll Bar:")
|
||||
ui_items_general(col, ui)
|
||||
|
||||
|
||||
ui = theme.user_interface.wcol_progress
|
||||
col.label(text="Progress Bar:")
|
||||
ui_items_general(col, ui)
|
||||
@ -1234,7 +1234,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
|
||||
split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
|
||||
if info["tracker_url"]:
|
||||
split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
|
||||
|
||||
|
||||
if info["wiki_url"] and info["tracker_url"]:
|
||||
split.separator()
|
||||
else:
|
||||
|
@ -38,7 +38,7 @@ class VIEW3D_HT_header(bpy.types.Header):
|
||||
# Menus
|
||||
if context.area.show_menus:
|
||||
sub = row.row(align=True)
|
||||
|
||||
|
||||
sub.menu("VIEW3D_MT_view")
|
||||
|
||||
# Select Menu
|
||||
@ -855,8 +855,8 @@ class VIEW3D_MT_object_game_properties(bpy.types.Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.game_property_copy", text="Replace").operation="REPLACE"
|
||||
layout.operator("object.game_property_copy", text="Merge").operation="MERGE"
|
||||
layout.operator("object.game_property_copy", text="Replace").operation = 'REPLACE'
|
||||
layout.operator("object.game_property_copy", text="Merge").operation = 'MERGE'
|
||||
layout.operator_menu_enum("object.game_property_copy", "property", text="Copy...")
|
||||
layout.separator()
|
||||
layout.operator("object.game_property_clear")
|
||||
@ -1879,6 +1879,7 @@ class VIEW3D_PT_view3d_properties(bpy.types.Panel):
|
||||
scene = context.scene
|
||||
|
||||
col = layout.column()
|
||||
col.active = view.region_3d.view_perspective != 'CAMERA'
|
||||
col.prop(view, "lens")
|
||||
col.label(text="Lock to Object:")
|
||||
col.prop(view, "lock_object", text="")
|
||||
|
@ -47,15 +47,19 @@ void multires_force_external_reload(struct Object *ob);
|
||||
struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
|
||||
int local_mmd, struct DerivedMesh*, struct Object *, int, int);
|
||||
|
||||
struct MultiresModifierData *find_multires_modifier(struct Object *ob);
|
||||
struct DerivedMesh *get_multires_dm(struct Object *ob);
|
||||
struct MultiresModifierData *find_multires_modifier(struct Scene *scene, struct Object *ob);
|
||||
struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd,
|
||||
struct Object *ob);
|
||||
void multiresModifier_join(struct Object *);
|
||||
void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
|
||||
void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
|
||||
int updateblock, int simple);
|
||||
int multiresModifier_reshape(struct Object *dst, struct Object *src);
|
||||
int multiresModifier_reshapeFromDM(struct Object *ob, struct DerivedMesh *srcdm);
|
||||
int multiresModifier_reshapeFromDeformMod(struct Object *ob, struct ModifierData *md);
|
||||
int multiresModifier_reshape(struct Scene *scene, struct MultiresModifierData *mmd,
|
||||
struct Object *dst, struct Object *src);
|
||||
int multiresModifier_reshapeFromDM(struct Scene *scene, struct MultiresModifierData *mmd,
|
||||
struct Object *ob, struct DerivedMesh *srcdm);
|
||||
int multiresModifier_reshapeFromDeformMod(struct Scene *scene, struct MultiresModifierData *mmd,
|
||||
struct Object *ob, struct ModifierData *md);
|
||||
|
||||
void multires_stitch_grids(struct Object *);
|
||||
|
||||
|
@ -72,6 +72,11 @@ IF(WITH_FFMPEG)
|
||||
ADD_DEFINITIONS(-DWITH_FFMPEG)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_LCMS)
|
||||
SET(INC ${INC} ${LCMS_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DWITH_LCMS)
|
||||
ENDIF(WITH_LCMS)
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
SET(INC ${INC} ../python ${PYTHON_INC})
|
||||
ELSE(WITH_PYTHON)
|
||||
|
@ -1077,6 +1077,21 @@ static int emDM_getNumFaces(DerivedMesh *dm)
|
||||
return BLI_countlist(&emdm->em->faces);
|
||||
}
|
||||
|
||||
static void emDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
|
||||
{
|
||||
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
|
||||
EditVert *eve;
|
||||
int i;
|
||||
|
||||
for (i=0,eve= emdm->em->verts.first; eve; i++,eve=eve->next) {
|
||||
if (emdm->vertexCos) {
|
||||
copy_v3_v3(cos_r[i], emdm->vertexCos[i]);
|
||||
} else {
|
||||
copy_v3_v3(cos_r[i], eve->co);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r)
|
||||
{
|
||||
EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first;
|
||||
@ -1309,6 +1324,8 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
|
||||
emdm->dm.getNumEdges = emDM_getNumEdges;
|
||||
emdm->dm.getNumFaces = emDM_getNumFaces;
|
||||
|
||||
emdm->dm.getVertCos = emDM_getVertCos;
|
||||
|
||||
emdm->dm.getVert = emDM_getVert;
|
||||
emdm->dm.getEdge = emDM_getEdge;
|
||||
emdm->dm.getFace = emDM_getFace;
|
||||
|
@ -200,7 +200,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
|
||||
return NULL;
|
||||
if(ob->sculpt->pbvh) {
|
||||
cddm->pbvh= ob->sculpt->pbvh;
|
||||
cddm->pbvh_draw = (cddm->mvert == me->mvert);
|
||||
cddm->pbvh_draw = (cddm->mvert == me->mvert) || ob->sculpt->kb;
|
||||
}
|
||||
|
||||
/* always build pbvh from original mesh, and only use it for drawing if
|
||||
@ -208,7 +208,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
|
||||
that this is actually for, to support a pbvh on a modified mesh */
|
||||
if(!cddm->pbvh && ob->type == OB_MESH) {
|
||||
cddm->pbvh = BLI_pbvh_new();
|
||||
cddm->pbvh_draw = (cddm->mvert == me->mvert);
|
||||
cddm->pbvh_draw = (cddm->mvert == me->mvert) || ob->sculpt->kb;
|
||||
BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
|
||||
me->totface, me->totvert);
|
||||
}
|
||||
@ -853,47 +853,41 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
|
||||
}
|
||||
}
|
||||
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
|
||||
int state = 1;
|
||||
int prevstate = 1;
|
||||
int prevstart = 0;
|
||||
GPU_vertex_setup(dm);
|
||||
GPU_normal_setup(dm);
|
||||
if( useColors && mc )
|
||||
GPU_color_setup(dm);
|
||||
if( !GPU_buffer_legacy(dm) ) {
|
||||
int tottri = dm->drawObject->nelements/3;
|
||||
glShadeModel(GL_SMOOTH);
|
||||
for( i = 0; i < dm->drawObject->nelements/3; i++ ) {
|
||||
|
||||
for( i = 0; i < tottri; i++ ) {
|
||||
int actualFace = dm->drawObject->faceRemap[i];
|
||||
int drawSmooth = (mf[actualFace].flag & ME_SMOOTH);
|
||||
int dontdraw = 0;
|
||||
int draw = 1;
|
||||
|
||||
if(index) {
|
||||
orig = index[actualFace];
|
||||
if(setDrawOptions && orig == ORIGINDEX_NONE)
|
||||
dontdraw = 1;
|
||||
draw = 0;
|
||||
}
|
||||
else
|
||||
orig = actualFace;
|
||||
if( dontdraw ) {
|
||||
state = 0;
|
||||
|
||||
if(setDrawOptions && !setDrawOptions(userData, orig, &drawSmooth))
|
||||
draw = 0;
|
||||
|
||||
/* Goal is to draw as long of a contiguous triangle
|
||||
array as possible, so draw when we hit either an
|
||||
invisible triangle or at the end of the array */
|
||||
if(!draw || i == tottri - 1) {
|
||||
if(prevstart != i)
|
||||
/* Add one to the length (via `draw')
|
||||
if we're drawing at the end of the array */
|
||||
glDrawArrays(GL_TRIANGLES,prevstart*3, (i-prevstart+draw)*3);
|
||||
prevstart = i + 1;
|
||||
}
|
||||
else {
|
||||
if(!setDrawOptions || setDrawOptions(userData, orig, &drawSmooth)) {
|
||||
state = 1;
|
||||
}
|
||||
else {
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
if( prevstate != state && prevstate == 1 ) {
|
||||
if( i-prevstart > 0 ) {
|
||||
glDrawArrays(GL_TRIANGLES,prevstart*3,(i-prevstart)*3);
|
||||
}
|
||||
prevstart = i;
|
||||
}
|
||||
prevstate = state;
|
||||
}
|
||||
if(state==1) {
|
||||
glDrawArrays(GL_TRIANGLES,prevstart*3,dm->drawObject->nelements-prevstart*3);
|
||||
}
|
||||
glShadeModel(GL_FLAT);
|
||||
}
|
||||
|
@ -440,10 +440,8 @@ Image *BKE_add_image_imbuf(ImBuf *ibuf)
|
||||
{
|
||||
/* on save, type is changed to FILE in editsima.c */
|
||||
Image *ima;
|
||||
char filename[sizeof(ibuf->name)];
|
||||
|
||||
BLI_split_dirfile(ibuf->name, NULL, filename);
|
||||
ima= image_alloc(filename, IMA_SRC_FILE, IMA_TYPE_IMAGE);
|
||||
ima= image_alloc(BLI_path_basename(ibuf->name), IMA_SRC_FILE, IMA_TYPE_IMAGE);
|
||||
|
||||
if (ima) {
|
||||
BLI_strncpy(ima->name, ibuf->name, FILE_MAX);
|
||||
|
@ -60,35 +60,33 @@ static const int multires_side_tot[] = {0, 2, 3, 5, 9, 17, 33, 65, 129,
|
||||
static void multires_mvert_to_ss(DerivedMesh *dm, MVert *mvert);
|
||||
static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int add, DMGridData **oldGridData, int totlvl);
|
||||
|
||||
DerivedMesh *get_multires_dm(Object *ob)
|
||||
DerivedMesh *get_multires_dm(Scene *scene, MultiresModifierData *mmd, Object *ob)
|
||||
{
|
||||
Mesh *me= ob->data;
|
||||
ModifierData *md= (ModifierData *)find_multires_modifier(ob);
|
||||
ModifierData *md= (ModifierData *)mmd;
|
||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||
DerivedMesh *tdm = CDDM_from_mesh(me, ob);
|
||||
DerivedMesh *tdm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
|
||||
DerivedMesh *dm;
|
||||
|
||||
CDDM_calc_normals(tdm);
|
||||
dm = mti->applyModifier(md, ob, tdm, 0, 1);
|
||||
|
||||
if(tdm != dm) tdm->release(tdm);
|
||||
if (dm == tdm) {
|
||||
dm = CDDM_copy(tdm);
|
||||
}
|
||||
|
||||
return dm;
|
||||
}
|
||||
|
||||
MultiresModifierData *find_multires_modifier(Object *ob)
|
||||
MultiresModifierData *find_multires_modifier(Scene *scene, Object *ob)
|
||||
{
|
||||
ModifierData *md;
|
||||
MultiresModifierData *mmd = NULL;
|
||||
|
||||
for(md = ob->modifiers.first; md; md = md->next) {
|
||||
if(md->type == eModifierType_Multires) {
|
||||
mmd = (MultiresModifierData*)md;
|
||||
break;
|
||||
if (modifier_isEnabled(scene, md, eModifierMode_Realtime))
|
||||
return (MultiresModifierData*)md;
|
||||
}
|
||||
}
|
||||
|
||||
return mmd;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int multires_get_level(Object *ob, MultiresModifierData *mmd, int render)
|
||||
@ -215,9 +213,10 @@ void multiresModifier_join(Object *ob)
|
||||
}
|
||||
#endif
|
||||
|
||||
int multiresModifier_reshapeFromDM(Object *ob, DerivedMesh *srcdm)
|
||||
int multiresModifier_reshapeFromDM(Scene *scene, MultiresModifierData *mmd,
|
||||
Object *ob, DerivedMesh *srcdm)
|
||||
{
|
||||
DerivedMesh *mrdm = get_multires_dm (ob);
|
||||
DerivedMesh *mrdm = get_multires_dm (scene, mmd, ob);
|
||||
|
||||
if(mrdm && srcdm && mrdm->getNumVerts(mrdm) == srcdm->getNumVerts(srcdm)) {
|
||||
multires_mvert_to_ss(mrdm, srcdm->getVertArray(srcdm));
|
||||
@ -236,13 +235,14 @@ int multiresModifier_reshapeFromDM(Object *ob, DerivedMesh *srcdm)
|
||||
}
|
||||
|
||||
/* Returns 1 on success, 0 if the src's totvert doesn't match */
|
||||
int multiresModifier_reshape(Object *dst, Object *src)
|
||||
int multiresModifier_reshape(Scene *scene, MultiresModifierData *mmd, Object *dst, Object *src)
|
||||
{
|
||||
DerivedMesh *srcdm = src->derivedFinal;
|
||||
return multiresModifier_reshapeFromDM(dst, srcdm);
|
||||
DerivedMesh *srcdm = mesh_get_derived_final(scene, src, CD_MASK_BAREMESH);
|
||||
return multiresModifier_reshapeFromDM(scene, mmd, dst, srcdm);
|
||||
}
|
||||
|
||||
int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
|
||||
int multiresModifier_reshapeFromDeformMod(Scene *scene, MultiresModifierData *mmd,
|
||||
Object *ob, ModifierData *md)
|
||||
{
|
||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||
DerivedMesh *dm, *ndm;
|
||||
@ -250,7 +250,7 @@ int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
|
||||
float (*deformedVerts)[3];
|
||||
|
||||
/* Create DerivedMesh for deformation modifier */
|
||||
dm = get_multires_dm(ob);
|
||||
dm = get_multires_dm(scene, mmd, ob);
|
||||
numVerts= dm->getNumVerts(dm);
|
||||
deformedVerts= MEM_callocN(sizeof(float)*numVerts*3, "multiresReshape_deformVerts");
|
||||
|
||||
@ -264,7 +264,7 @@ int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
|
||||
dm->release(dm);
|
||||
|
||||
/* Reshaping */
|
||||
result= multiresModifier_reshapeFromDM(ob, ndm);
|
||||
result= multiresModifier_reshapeFromDM(scene, mmd, ob, ndm);
|
||||
|
||||
/* Cleanup */
|
||||
ndm->release(ndm);
|
||||
@ -1286,6 +1286,7 @@ void multires_load_old(Object *ob, Mesh *me)
|
||||
ModifierData *md;
|
||||
MultiresModifierData *mmd;
|
||||
DerivedMesh *dm, *orig;
|
||||
CustomDataLayer *l;
|
||||
int i;
|
||||
|
||||
/* Load original level into the mesh */
|
||||
@ -1331,6 +1332,14 @@ void multires_load_old(Object *ob, Mesh *me)
|
||||
dm->release(dm);
|
||||
orig->release(orig);
|
||||
|
||||
/* Copy the first-level data to the mesh */
|
||||
for(i = 0, l = me->mr->vdata.layers; i < me->mr->vdata.totlayer; ++i, ++l)
|
||||
CustomData_add_layer(&me->vdata, l->type, CD_REFERENCE, l->data, me->totvert);
|
||||
for(i = 0, l = me->mr->fdata.layers; i < me->mr->fdata.totlayer; ++i, ++l)
|
||||
CustomData_add_layer(&me->fdata, l->type, CD_REFERENCE, l->data, me->totface);
|
||||
memset(&me->mr->vdata, 0, sizeof(CustomData));
|
||||
memset(&me->mr->fdata, 0, sizeof(CustomData));
|
||||
|
||||
/* Remove the old multires */
|
||||
multires_free(me->mr);
|
||||
me->mr= NULL;
|
||||
|
@ -320,6 +320,7 @@ static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Objec
|
||||
ob->recalc |= OB_RECALC;
|
||||
}
|
||||
}
|
||||
|
||||
void unlink_object(Scene *scene, Object *ob)
|
||||
{
|
||||
Object *obt;
|
||||
@ -334,6 +335,8 @@ void unlink_object(Scene *scene, Object *ob)
|
||||
bConstraint *con;
|
||||
//bActionStrip *strip; // XXX animsys
|
||||
ModifierData *md;
|
||||
ARegion *ar;
|
||||
RegionView3D *rv3d;
|
||||
int a;
|
||||
|
||||
unlink_controllers(&ob->controllers);
|
||||
@ -606,17 +609,27 @@ void unlink_object(Scene *scene, Object *ob)
|
||||
while(sa) {
|
||||
SpaceLink *sl;
|
||||
|
||||
if (sa->spacetype == SPACE_VIEW3D) {
|
||||
for (ar= sa->regionbase.first; ar; ar= ar->next) {
|
||||
if (ar->regiontype==RGN_TYPE_WINDOW) {
|
||||
rv3d= (RegionView3D *)ar->regiondata;
|
||||
if (rv3d->persp == RV3D_CAMOB)
|
||||
rv3d->persp= RV3D_PERSP;
|
||||
if (rv3d->localvd && rv3d->localvd->persp == RV3D_CAMOB)
|
||||
rv3d->localvd->persp= RV3D_PERSP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
||||
if(sl->spacetype==SPACE_VIEW3D) {
|
||||
View3D *v3d= (View3D*) sl;
|
||||
|
||||
if(v3d->camera==ob) {
|
||||
v3d->camera= NULL;
|
||||
// XXX if(v3d->persp==V3D_CAMOB) v3d->persp= V3D_PERSP;
|
||||
}
|
||||
if(v3d->localvd && v3d->localvd->camera==ob ) {
|
||||
v3d->localvd->camera= NULL;
|
||||
// XXX if(v3d->localvd->persp==V3D_CAMOB) v3d->localvd->persp= V3D_PERSP;
|
||||
}
|
||||
}
|
||||
else if(sl->spacetype==SPACE_OUTLINER) {
|
||||
@ -679,8 +692,8 @@ void *add_camera(char *name)
|
||||
cam->clipend= 100.0f;
|
||||
cam->drawsize= 0.5f;
|
||||
cam->ortho_scale= 6.0;
|
||||
cam->flag |= CAM_SHOWTITLESAFE;
|
||||
cam->passepartalpha = 0.2f;
|
||||
cam->flag |= CAM_SHOWPASSEPARTOUT;
|
||||
cam->passepartalpha = 0.5f;
|
||||
|
||||
return cam;
|
||||
}
|
||||
@ -1026,6 +1039,8 @@ Object *add_only_object(int type, char *name)
|
||||
ob->anisotropicFriction[2] = 1.0f;
|
||||
ob->gameflag= OB_PROP|OB_COLLISION;
|
||||
ob->margin = 0.0;
|
||||
ob->init_state=1;
|
||||
ob->state=1;
|
||||
/* ob->pad3 == Contact Processing Threshold */
|
||||
ob->m_contactProcessingThreshold = 1.;
|
||||
|
||||
@ -1265,6 +1280,7 @@ Object *copy_object(Object *ob)
|
||||
|
||||
for (md=ob->modifiers.first; md; md=md->next) {
|
||||
ModifierData *nmd = modifier_new(md->type);
|
||||
BLI_strncpy(nmd->name, md->name, sizeof(nmd->name));
|
||||
modifier_copyData(md, nmd);
|
||||
BLI_addtail(&obn->modifiers, nmd);
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ Scene *add_scene(char *name)
|
||||
int a;
|
||||
|
||||
sce= alloc_libblock(&G.main->scene, ID_SCE, name);
|
||||
sce->lay= 1;
|
||||
sce->lay= sce->layact= 1;
|
||||
|
||||
sce->r.mode= R_GAMMA|R_OSA|R_SHADOW|R_SSS|R_ENVMAP|R_RAYTRACE;
|
||||
sce->r.cfra= 1;
|
||||
|
@ -566,7 +566,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
|
||||
}
|
||||
}
|
||||
|
||||
/* note: caller should run calc_sequence(scene, seq) */
|
||||
/* note: caller should run calc_sequence(scene, seq) after */
|
||||
void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
|
||||
{
|
||||
char str[FILE_MAXDIR+FILE_MAXFILE];
|
||||
|
@ -355,11 +355,16 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, struct S
|
||||
|
||||
if(calc->vert)
|
||||
{
|
||||
VECCOPY(tmp_co, calc->vert[i].co);
|
||||
if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL)
|
||||
/* calc->vert contains verts from derivedMesh */
|
||||
/* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
|
||||
/* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
|
||||
if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
|
||||
VECCOPY(tmp_co, calc->vert[i].co);
|
||||
normal_short_to_float_v3(tmp_no, calc->vert[i].no);
|
||||
else
|
||||
} else {
|
||||
VECCOPY(tmp_co, co);
|
||||
VECCOPY(tmp_no, proj_axis);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2328,6 +2328,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
int gridInternalEdges;
|
||||
MEdge *medge = NULL;
|
||||
MFace *mface = NULL;
|
||||
int *orig_indices;
|
||||
FaceVertWeight *qweight, *tweight;
|
||||
|
||||
DM_from_template(&ccgdm->dm, dm, DM_TYPE_CCGDM,
|
||||
@ -2437,6 +2438,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
|
||||
faceFlags = ccgdm->faceFlags = MEM_callocN(sizeof(char)*2*totface, "faceFlags");
|
||||
|
||||
orig_indices = (int*)ccgdm->dm.getFaceDataArray(&ccgdm->dm, CD_ORIGINDEX);
|
||||
for(index = 0; index < totface; ++index) {
|
||||
CCGFace *f = ccgdm->faceMap[index].face;
|
||||
int numVerts = ccgSubSurf_getFaceNumVerts(f);
|
||||
@ -2450,6 +2452,9 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
ccgdm->faceMap[index].startEdge = edgeNum;
|
||||
ccgdm->faceMap[index].startFace = faceNum;
|
||||
|
||||
if(orig_indices)
|
||||
orig_indices[faceNum] = origIndex;
|
||||
|
||||
/* set the face base vert */
|
||||
*((int*)ccgSubSurf_getFaceUserData(ss, f)) = vertNum;
|
||||
|
||||
|
@ -232,7 +232,6 @@ int reopen_text(Text *text)
|
||||
int i, llen, len, res;
|
||||
unsigned char *buffer;
|
||||
TextLine *tmp;
|
||||
char sfile[FILE_MAXFILE];
|
||||
char str[FILE_MAXDIR+FILE_MAXFILE];
|
||||
struct stat st;
|
||||
|
||||
@ -240,7 +239,6 @@ int reopen_text(Text *text)
|
||||
|
||||
BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE);
|
||||
BLI_path_abs(str, G.sce);
|
||||
BLI_split_dirfile(str, NULL, sfile);
|
||||
|
||||
fp= fopen(str, "r");
|
||||
if(fp==NULL) return 0;
|
||||
@ -331,19 +329,17 @@ Text *add_text(char *file, const char *relpath)
|
||||
unsigned char *buffer;
|
||||
TextLine *tmp;
|
||||
Text *ta;
|
||||
char sfile[FILE_MAXFILE];
|
||||
char str[FILE_MAXDIR+FILE_MAXFILE];
|
||||
struct stat st;
|
||||
|
||||
BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE);
|
||||
if (relpath) /* can be NULL (bg mode) */
|
||||
BLI_path_abs(str, relpath);
|
||||
BLI_split_dirfile(str, NULL, sfile);
|
||||
|
||||
fp= fopen(str, "r");
|
||||
if(fp==NULL) return NULL;
|
||||
|
||||
ta= alloc_libblock(&G.main->text, ID_TXT, sfile);
|
||||
ta= alloc_libblock(&G.main->text, ID_TXT, BLI_path_basename(str));
|
||||
ta->id.us= 1;
|
||||
|
||||
ta->lines.first= ta->lines.last= NULL;
|
||||
|
@ -54,7 +54,6 @@ char *BLI_last_slash(const char *string);
|
||||
int BLI_add_slash(char *string);
|
||||
void BLI_del_slash(char *string);
|
||||
char *first_slash(char *string);
|
||||
const char *BLI_short_filename(const char *string);
|
||||
|
||||
/* only for the sane unix world: direct calls to system functions :( */
|
||||
#ifndef WIN32
|
||||
|
@ -53,6 +53,7 @@ void BLI_make_exist(char *dir);
|
||||
void BLI_make_existing_file(char *name);
|
||||
void BLI_split_dirfile(const char *string, char *dir, char *file);
|
||||
void BLI_join_dirfile(char *string, const char *dir, const char *file);
|
||||
char *BLI_path_basename(char *path);
|
||||
int BKE_rebase_path(char *abs, int abs_size, char *rel, int rel_size, const char *base_dir, const char *src_dir, const char *dest_dir);
|
||||
void BLI_getlastdir(const char* dir, char *last, int maxlen);
|
||||
int BLI_testextensie(const char *str, const char *ext);
|
||||
|
@ -661,7 +661,7 @@ void findMissingFiles(char *basepath, char *str) {
|
||||
char filepath[FILE_MAX], *libpath;
|
||||
int filesize, recur_depth;
|
||||
|
||||
char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX];
|
||||
char dirname[FILE_MAX], filename_new[FILE_MAX];
|
||||
|
||||
//XXX waitcursor( 1 );
|
||||
|
||||
@ -686,9 +686,8 @@ void findMissingFiles(char *basepath, char *str) {
|
||||
/* can the dir be opened? */
|
||||
filesize = -1;
|
||||
recur_depth = 0;
|
||||
BLI_split_dirfile(filepath, NULL, filename); /* the file to find */
|
||||
|
||||
findFileRecursive(filename_new, dirname, filename, &filesize, &recur_depth);
|
||||
findFileRecursive(filename_new, dirname, BLI_path_basename(filepath), &filesize, &recur_depth);
|
||||
if (filesize == -1) { /* could not open dir */
|
||||
printf("Could not open dir \"%s\"\n", dirname);
|
||||
return;
|
||||
|
@ -80,31 +80,6 @@ char *BLI_last_slash(const char *string) {
|
||||
else return lfslash;
|
||||
}
|
||||
|
||||
static const char *last_slash_len(const char *string, int len) {
|
||||
int a;
|
||||
|
||||
for(a=len-1; a>=0; a--)
|
||||
if(string[a] == '/' || string[a] == '\\')
|
||||
return &string[a];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *BLI_short_filename(const char *string) {
|
||||
const char *ls, *lls;
|
||||
|
||||
ls= last_slash_len(string, strlen(string));
|
||||
if(!ls)
|
||||
return string;
|
||||
|
||||
lls= last_slash_len(string, ls-string);
|
||||
|
||||
if(lls)
|
||||
return lls+1;
|
||||
else
|
||||
return ls+1;
|
||||
}
|
||||
|
||||
/* adds a slash if there isnt one there alredy */
|
||||
int BLI_add_slash(char *string) {
|
||||
int len = strlen(string);
|
||||
|
@ -1172,6 +1172,12 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file)
|
||||
}
|
||||
}
|
||||
|
||||
/* like pythons os.path.basename( ) */
|
||||
char *BLI_path_basename(char *path)
|
||||
{
|
||||
char *filename= BLI_last_slash(path);
|
||||
return filename ? filename + 1 : path;
|
||||
}
|
||||
|
||||
/*
|
||||
Produce image export path.
|
||||
|
@ -3074,6 +3074,7 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase
|
||||
for(; pt; pt=pt->next)
|
||||
pt->ob=newlibadr(fd, id->lib, pt->ob);
|
||||
|
||||
psys->parent= newlibadr_us(fd, id->lib, psys->parent);
|
||||
psys->target_ob = newlibadr(fd, id->lib, psys->target_ob);
|
||||
|
||||
if(psys->clmd) {
|
||||
@ -3143,7 +3144,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles)
|
||||
psys->childcachebufs.first = psys->childcachebufs.last = NULL;
|
||||
psys->frand = NULL;
|
||||
psys->pdd = NULL;
|
||||
|
||||
|
||||
direct_link_pointcache_list(fd, &psys->ptcaches, &psys->pointcache);
|
||||
|
||||
if(psys->clmd) {
|
||||
@ -10857,6 +10858,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
/* put 2.50 compatibility code here until next subversion bump */
|
||||
{
|
||||
Object *ob;
|
||||
Scene *scene;
|
||||
bScreen *sc;
|
||||
|
||||
for (sc= main->screen.first; sc; sc= sc->id.next) {
|
||||
@ -10913,6 +10915,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* initialise scene active layer */
|
||||
for (scene= main->scene.first; scene; scene=scene->id.next) {
|
||||
int i;
|
||||
for(i=0; i<20; i++) {
|
||||
if(scene->lay & (1<<i)) {
|
||||
scene->layact= 1<<i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Jan Diederich, Tod Liverseed.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
@ -638,8 +661,8 @@ public:
|
||||
source.setAccessorCount(totuv);
|
||||
source.setAccessorStride(2);
|
||||
COLLADASW::SourceBase::ParameterNameList ¶m = source.getParameterNameList();
|
||||
param.push_back("X");
|
||||
param.push_back("Y");
|
||||
param.push_back("S");
|
||||
param.push_back("T");
|
||||
|
||||
source.prepareToAppendValues();
|
||||
|
||||
@ -908,7 +931,7 @@ public:
|
||||
Object *ob_arm = get_assigned_armature(ob);
|
||||
bArmature *arm = (bArmature*)ob_arm->data;
|
||||
|
||||
const std::string& controller_id = get_controller_id(ob_arm);
|
||||
const std::string& controller_id = get_controller_id(ob_arm, ob);
|
||||
|
||||
COLLADASW::InstanceController ins(mSW);
|
||||
ins.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, controller_id));
|
||||
@ -1051,9 +1074,9 @@ private:
|
||||
TransformWriter::add_node_transform(node, mat, NULL);
|
||||
}
|
||||
|
||||
std::string get_controller_id(Object *ob_arm)
|
||||
std::string get_controller_id(Object *ob_arm, Object *ob)
|
||||
{
|
||||
return translate_id(id_name(ob_arm)) + SKIN_CONTROLLER_ID_SUFFIX;
|
||||
return translate_id(id_name(ob_arm)) + "_" + translate_id(id_name(ob)) + SKIN_CONTROLLER_ID_SUFFIX;
|
||||
}
|
||||
|
||||
// ob should be of type OB_MESH
|
||||
@ -1087,7 +1110,7 @@ private:
|
||||
if (!me->dvert) return;
|
||||
|
||||
std::string controller_name = id_name(ob_arm);
|
||||
std::string controller_id = get_controller_id(ob_arm);
|
||||
std::string controller_id = get_controller_id(ob_arm, ob);
|
||||
|
||||
openSkin(controller_id, controller_name,
|
||||
COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob)));
|
||||
@ -1555,18 +1578,27 @@ public:
|
||||
else {
|
||||
ep.setIndexOfRefraction(1.0f);
|
||||
}
|
||||
|
||||
COLLADASW::ColorOrTexture cot;
|
||||
|
||||
// transparency
|
||||
ep.setTransparency(ma->alpha);
|
||||
// emission
|
||||
COLLADASW::ColorOrTexture cot = getcol(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
ep.setEmission(cot);
|
||||
// Tod: because we are in A_ONE mode transparency is calculated like this:
|
||||
ep.setTransparency(1.0f);
|
||||
cot = getcol(0.0f, 0.0f, 0.0f, ma->alpha);
|
||||
ep.setTransparent(cot);
|
||||
|
||||
// emission
|
||||
cot=getcol(ma->emit, ma->emit, ma->emit, 1.0f);
|
||||
ep.setEmission(cot);
|
||||
|
||||
// diffuse
|
||||
cot = getcol(ma->r, ma->g, ma->b, 1.0f);
|
||||
ep.setDiffuse(cot);
|
||||
|
||||
// ambient
|
||||
cot = getcol(ma->ambr, ma->ambg, ma->ambb, 1.0f);
|
||||
ep.setAmbient(cot);
|
||||
|
||||
// reflective, reflectivity
|
||||
if (ma->mode & MA_RAYMIRROR) {
|
||||
cot = getcol(ma->mirr, ma->mirg, ma->mirb, 1.0f);
|
||||
@ -1574,15 +1606,16 @@ public:
|
||||
ep.setReflectivity(ma->ray_mirror);
|
||||
}
|
||||
else {
|
||||
cot = getcol(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
|
||||
ep.setReflective(cot);
|
||||
ep.setReflectivity(0.0f);
|
||||
ep.setReflectivity(ma->spec);
|
||||
}
|
||||
|
||||
// specular
|
||||
if (ep.getShaderType() != COLLADASW::EffectProfile::LAMBERT) {
|
||||
cot = getcol(ma->specr, ma->specg, ma->specb, 1.0f);
|
||||
ep.setSpecular(cot);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX make this more readable if possible
|
||||
|
||||
@ -1686,12 +1719,28 @@ public:
|
||||
// most widespread de-facto standard.
|
||||
texture.setProfileName("FCOLLADA");
|
||||
texture.setChildElementName("bump");
|
||||
#ifdef WIN32 // currently, Windows builds are using revision 746 of OpenCollada while Linux and Mac are using an older revision 721
|
||||
ep.addExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
||||
#else
|
||||
ep.setExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// performs the actual writing
|
||||
ep.addProfileElements();
|
||||
bool twoSided = false;
|
||||
if (ob->type == OB_MESH && ob->data) {
|
||||
Mesh *me = (Mesh*)ob->data;
|
||||
if (me->flag & ME_TWOSIDED)
|
||||
twoSided = true;
|
||||
}
|
||||
if (twoSided)
|
||||
ep.addExtraTechniqueParameter("GOOGLEEARTH", "double_sided", 1);
|
||||
ep.addExtraTechniques(mSW);
|
||||
|
||||
ep.closeProfile();
|
||||
if (twoSided)
|
||||
mSW->appendTextBlock("<extra><technique profile=\"MAX3D\"><double_sided>1</double_sided></technique></extra>");
|
||||
closeEffect();
|
||||
}
|
||||
|
||||
@ -2433,6 +2482,9 @@ protected:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// keep the keys in ascending order
|
||||
std::sort(fra.begin(), fra.end());
|
||||
}
|
||||
|
||||
void find_rotation_frames(Object *ob, std::vector<float> &fra, const char *prefix, int rotmode)
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
struct Scene;
|
||||
|
||||
class DocumentExporter
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
// TODO:
|
||||
// * name imported objects
|
||||
// * import object rotation as euler
|
||||
@ -396,8 +419,6 @@ private:
|
||||
std::vector<COLLADAFW::Node*> root_joints;
|
||||
std::map<COLLADAFW::UniqueId, Object*> joint_parent_map;
|
||||
|
||||
std::vector<Object*> armature_objects;
|
||||
|
||||
MeshImporterBase *mesh_importer;
|
||||
AnimationImporterBase *anim_importer;
|
||||
|
||||
@ -506,13 +527,11 @@ private:
|
||||
joint_data.push_back(jd);
|
||||
}
|
||||
|
||||
// called from write_controller
|
||||
Object *create_armature(const COLLADAFW::SkinController* co, Scene *scene)
|
||||
void set_controller(const COLLADAFW::SkinController* co)
|
||||
{
|
||||
ob_arm = add_object(scene, OB_ARMATURE);
|
||||
|
||||
controller_uid = co->getUniqueId();
|
||||
|
||||
// fill in joint UIDs
|
||||
const COLLADAFW::UniqueIdArray& joint_uids = co->getJoints();
|
||||
for (unsigned int i = 0; i < joint_uids.getCount(); i++) {
|
||||
joint_data[i].joint_uid = joint_uids[i];
|
||||
@ -524,7 +543,21 @@ private:
|
||||
// now we'll be able to get inv bind matrix from joint id
|
||||
// joint_id_to_joint_index_map[joint_ids[i]] = i;
|
||||
}
|
||||
}
|
||||
|
||||
// called from write_controller
|
||||
Object *create_armature(Scene *scene)
|
||||
{
|
||||
ob_arm = add_object(scene, OB_ARMATURE);
|
||||
return ob_arm;
|
||||
}
|
||||
|
||||
Object* set_armature(Object *ob_arm)
|
||||
{
|
||||
if (this->ob_arm)
|
||||
return this->ob_arm;
|
||||
|
||||
this->ob_arm = ob_arm;
|
||||
return ob_arm;
|
||||
}
|
||||
|
||||
@ -552,10 +585,12 @@ private:
|
||||
return controller_uid;
|
||||
}
|
||||
|
||||
// check if this skin controller references a joint or any descendant of it
|
||||
//
|
||||
// some nodes may not be referenced by SkinController,
|
||||
// in this case to determine if the node belongs to this armature,
|
||||
// we need to search down the tree
|
||||
bool uses_joint(COLLADAFW::Node *node)
|
||||
bool uses_joint_or_descendant(COLLADAFW::Node *node)
|
||||
{
|
||||
const COLLADAFW::UniqueId& uid = node->getUniqueId();
|
||||
std::vector<JointData>::iterator it;
|
||||
@ -566,7 +601,7 @@ private:
|
||||
|
||||
COLLADAFW::NodePointerArray& children = node->getChildNodes();
|
||||
for (unsigned int i = 0; i < children.getCount(); i++) {
|
||||
if (this->uses_joint(children[i]))
|
||||
if (uses_joint_or_descendant(children[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -658,6 +693,38 @@ private:
|
||||
return parent;
|
||||
}
|
||||
|
||||
void find_root_joints(const std::vector<COLLADAFW::Node*> &root_joints,
|
||||
std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& joint_by_uid,
|
||||
std::vector<COLLADAFW::Node*>& result)
|
||||
{
|
||||
std::vector<COLLADAFW::Node*>::const_iterator it;
|
||||
for (it = root_joints.begin(); it != root_joints.end(); it++) {
|
||||
COLLADAFW::Node *root = *it;
|
||||
std::vector<JointData>::iterator ji;
|
||||
for (ji = joint_data.begin(); ji != joint_data.end(); ji++) {
|
||||
COLLADAFW::Node *joint = joint_by_uid[(*ji).joint_uid];
|
||||
if (find_node_in_tree(joint, root)) {
|
||||
if (std::find(result.begin(), result.end(), root) == result.end())
|
||||
result.push_back(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool find_node_in_tree(COLLADAFW::Node *node, COLLADAFW::Node *tree_root)
|
||||
{
|
||||
if (node == tree_root)
|
||||
return true;
|
||||
|
||||
COLLADAFW::NodePointerArray& children = tree_root->getChildNodes();
|
||||
for (unsigned int i = 0; i < children.getCount(); i++) {
|
||||
if (find_node_in_tree(node, children[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
std::map<COLLADAFW::UniqueId, SkinInfo> skin_by_data_uid; // data UID = skin controller data UID
|
||||
@ -841,7 +908,7 @@ private:
|
||||
for (sit = skin_by_data_uid.begin(); sit != skin_by_data_uid.end(); sit++) {
|
||||
SkinInfo& skin = sit->second;
|
||||
|
||||
if (skin.uses_joint(joint)) {
|
||||
if (skin.uses_joint_or_descendant(joint)) {
|
||||
bPoseChannel *pchan = skin.get_pose_channel_from_node(joint);
|
||||
|
||||
if (pchan) {
|
||||
@ -909,7 +976,70 @@ private:
|
||||
// - exit edit mode
|
||||
// - set a sphere shape to leaf bones
|
||||
|
||||
Object *ob_arm = skin.get_armature();
|
||||
Object *ob_arm = NULL;
|
||||
|
||||
/*
|
||||
* find if there's another skin sharing at least one bone with this skin
|
||||
* if so, use that skin's armature
|
||||
*/
|
||||
|
||||
/*
|
||||
Pseudocode:
|
||||
|
||||
find_node_in_tree(node, root_joint)
|
||||
|
||||
skin::find_root_joints(root_joints):
|
||||
std::vector root_joints;
|
||||
for each root in root_joints:
|
||||
for each joint in joints:
|
||||
if find_node_in_tree(joint, root):
|
||||
if (std::find(root_joints.begin(), root_joints.end(), root) == root_joints.end())
|
||||
root_joints.push_back(root);
|
||||
|
||||
for (each skin B with armature) {
|
||||
find all root joints for skin B
|
||||
|
||||
for each joint X in skin A:
|
||||
for each root joint R in skin B:
|
||||
if (find_node_in_tree(X, R)) {
|
||||
shared = 1;
|
||||
goto endloop;
|
||||
}
|
||||
}
|
||||
|
||||
endloop:
|
||||
*/
|
||||
|
||||
SkinInfo *a = &skin;
|
||||
Object *shared = NULL;
|
||||
std::vector<COLLADAFW::Node*> skin_root_joints;
|
||||
|
||||
std::map<COLLADAFW::UniqueId, SkinInfo>::iterator it;
|
||||
for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) {
|
||||
SkinInfo *b = &it->second;
|
||||
if (b == a || b->get_armature() == NULL)
|
||||
continue;
|
||||
|
||||
skin_root_joints.clear();
|
||||
|
||||
b->find_root_joints(root_joints, joint_by_uid, skin_root_joints);
|
||||
|
||||
std::vector<COLLADAFW::Node*>::iterator ri;
|
||||
for (ri = skin_root_joints.begin(); ri != skin_root_joints.end(); ri++) {
|
||||
if (a->uses_joint_or_descendant(*ri)) {
|
||||
shared = b->get_armature();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (shared != NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
if (shared)
|
||||
ob_arm = skin.set_armature(shared);
|
||||
else
|
||||
ob_arm = skin.create_armature(scene);
|
||||
|
||||
// enter armature edit mode
|
||||
ED_armature_to_edit(ob_arm);
|
||||
@ -921,15 +1051,23 @@ private:
|
||||
// min_angle = 360.0f; // minimum angle between bone head-tail and a row of bone matrix
|
||||
|
||||
// create bones
|
||||
/*
|
||||
TODO:
|
||||
check if bones have already been created for a given joint
|
||||
*/
|
||||
|
||||
std::vector<COLLADAFW::Node*>::iterator ri;
|
||||
for (ri = root_joints.begin(); ri != root_joints.end(); ri++) {
|
||||
// for shared armature check if bone tree is already created
|
||||
if (shared && std::find(skin_root_joints.begin(), skin_root_joints.end(), *ri) != skin_root_joints.end())
|
||||
continue;
|
||||
|
||||
std::vector<COLLADAFW::Node*>::iterator it;
|
||||
for (it = root_joints.begin(); it != root_joints.end(); it++) {
|
||||
// since root_joints may contain joints for multiple controllers, we need to filter
|
||||
if (skin.uses_joint(*it)) {
|
||||
create_bone(skin, *it, NULL, (*it)->getChildNodes().getCount(), NULL, (bArmature*)ob_arm->data);
|
||||
if (skin.uses_joint_or_descendant(*ri)) {
|
||||
create_bone(skin, *ri, NULL, (*ri)->getChildNodes().getCount(), NULL, (bArmature*)ob_arm->data);
|
||||
|
||||
if (joint_parent_map.find((*it)->getUniqueId()) != joint_parent_map.end() && !skin.get_parent())
|
||||
skin.set_parent(joint_parent_map[(*it)->getUniqueId()]);
|
||||
if (joint_parent_map.find((*ri)->getUniqueId()) != joint_parent_map.end() && !skin.get_parent())
|
||||
skin.set_parent(joint_parent_map[(*ri)->getUniqueId()]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1071,10 +1209,8 @@ public:
|
||||
const COLLADAFW::UniqueId& skin_id = controller->getUniqueId();
|
||||
|
||||
if (controller->getControllerType() == COLLADAFW::Controller::CONTROLLER_TYPE_SKIN) {
|
||||
|
||||
COLLADAFW::SkinController *co = (COLLADAFW::SkinController*)controller;
|
||||
|
||||
// to find geom id by controller id
|
||||
// to be able to find geom id by controller id
|
||||
geom_uid_by_controller_uid[skin_id] = co->getSource();
|
||||
|
||||
const COLLADAFW::UniqueId& data_uid = co->getSkinControllerData();
|
||||
@ -1083,9 +1219,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
Object *ob_arm = skin_by_data_uid[data_uid].create_armature(co, scene);
|
||||
|
||||
armature_objects.push_back(ob_arm);
|
||||
skin_by_data_uid[data_uid].set_controller(co);
|
||||
}
|
||||
// morph controller
|
||||
else {
|
||||
@ -1110,7 +1244,7 @@ public:
|
||||
for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) {
|
||||
SkinInfo& skin = it->second;
|
||||
|
||||
if (skin.uses_joint(node))
|
||||
if (skin.uses_joint_or_descendant(node))
|
||||
return skin.get_armature();
|
||||
}
|
||||
|
||||
@ -1122,19 +1256,6 @@ public:
|
||||
BLI_snprintf(joint_path, count, "pose.bones[\"%s\"]", get_joint_name(node));
|
||||
}
|
||||
|
||||
#if 0
|
||||
void fix_animation()
|
||||
{
|
||||
/* Change Euler rotation to Quaternion for bone animation */
|
||||
std::vector<Object*>::iterator it;
|
||||
for (it = armature_objects.begin(); it != armature_objects.end(); it++) {
|
||||
Object *ob = *it;
|
||||
if (!ob || !ob->adt || !ob->adt->action) continue;
|
||||
anim_importer->change_eul_to_quat(ob, ob->adt->action);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// gives a world-space mat
|
||||
bool get_joint_bind_mat(float m[][4], COLLADAFW::Node *joint)
|
||||
{
|
||||
@ -1207,7 +1328,7 @@ private:
|
||||
}
|
||||
#endif
|
||||
|
||||
void getUV(int uv_set_index, int uv_index[2], float *uv)
|
||||
void getUV(int uv_index[2], float *uv)
|
||||
{
|
||||
switch(mVData->getType()) {
|
||||
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
|
||||
@ -1258,7 +1379,7 @@ private:
|
||||
}
|
||||
#endif
|
||||
|
||||
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs, int uv_set_index,
|
||||
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
|
||||
COLLADAFW::IndexList& index_list, unsigned int *tris_indices)
|
||||
{
|
||||
int uv_indices[4][2];
|
||||
@ -1273,12 +1394,12 @@ private:
|
||||
uv_indices[i][1] = uv_index * 2 + 1;
|
||||
}
|
||||
|
||||
uvs.getUV(uv_set_index, uv_indices[0], mtface->uv[0]);
|
||||
uvs.getUV(uv_set_index, uv_indices[1], mtface->uv[1]);
|
||||
uvs.getUV(uv_set_index, uv_indices[2], mtface->uv[2]);
|
||||
uvs.getUV(uv_indices[0], mtface->uv[0]);
|
||||
uvs.getUV(uv_indices[1], mtface->uv[1]);
|
||||
uvs.getUV(uv_indices[2], mtface->uv[2]);
|
||||
}
|
||||
|
||||
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs, int uv_set_index,
|
||||
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
|
||||
COLLADAFW::IndexList& index_list, int index, bool quad)
|
||||
{
|
||||
int uv_indices[4][2];
|
||||
@ -1293,11 +1414,11 @@ private:
|
||||
uv_indices[i][1] = uv_index * 2 + 1;
|
||||
}
|
||||
|
||||
uvs.getUV(uv_set_index, uv_indices[0], mtface->uv[0]);
|
||||
uvs.getUV(uv_set_index, uv_indices[1], mtface->uv[1]);
|
||||
uvs.getUV(uv_set_index, uv_indices[2], mtface->uv[2]);
|
||||
uvs.getUV(uv_indices[0], mtface->uv[0]);
|
||||
uvs.getUV(uv_indices[1], mtface->uv[1]);
|
||||
uvs.getUV(uv_indices[2], mtface->uv[2]);
|
||||
|
||||
if (quad) uvs.getUV(uv_set_index, uv_indices[3], mtface->uv[3]);
|
||||
if (quad) uvs.getUV(uv_indices[3], mtface->uv[3]);
|
||||
|
||||
#ifdef COLLADA_DEBUG
|
||||
/*if (quad) {
|
||||
@ -1497,13 +1618,13 @@ private:
|
||||
// allocate UV layers
|
||||
unsigned int totuvset = mesh->getUVCoords().getInputInfosArray().getCount();
|
||||
|
||||
for (i = 0; i < totuvset; i++) {
|
||||
if (mesh->getUVCoords().getLength(i) == 0) {
|
||||
totuvset = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// for (i = 0; i < totuvset; i++) {
|
||||
// if (mesh->getUVCoords().getLength(i) == 0) {
|
||||
// totuvset = 0;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
for (i = 0; i < totuvset; i++) {
|
||||
CustomData_add_layer(&me->fdata, CD_MTFACE, CD_CALLOC, NULL, me->totface);
|
||||
//this->set_layername_map[i] = CustomData_get_layer_name(&me->fdata, CD_MTFACE, i);
|
||||
@ -1560,6 +1681,7 @@ private:
|
||||
set_face_indices(mface, indices, false);
|
||||
indices += 3;
|
||||
|
||||
#if 0
|
||||
for (k = 0; k < totuvset; k++) {
|
||||
if (!index_list_array.empty() && index_list_array[k]) {
|
||||
// get mtface by face index and uv set index
|
||||
@ -1567,6 +1689,15 @@ private:
|
||||
set_face_uv(&mtface[face_index], uvs, k, *index_list_array[k], index, false);
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (k = 0; k < index_list_array.getCount(); k++) {
|
||||
int uvset_index = index_list_array[k]->getSetIndex();
|
||||
|
||||
// get mtface by face index and uv set index
|
||||
MTFace *mtface = (MTFace*)CustomData_get_layer_n(&me->fdata, CD_MTFACE, uvset_index);
|
||||
set_face_uv(&mtface[face_index], uvs, *index_list_array[k], index, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
test_index_face(mface, &me->fdata, face_index, 3);
|
||||
|
||||
@ -1598,6 +1729,7 @@ private:
|
||||
// set mtface for each uv set
|
||||
// it is assumed that all primitives have equal number of UV sets
|
||||
|
||||
#if 0
|
||||
for (k = 0; k < totuvset; k++) {
|
||||
if (!index_list_array.empty() && index_list_array[k]) {
|
||||
// get mtface by face index and uv set index
|
||||
@ -1605,6 +1737,15 @@ private:
|
||||
set_face_uv(&mtface[face_index], uvs, k, *index_list_array[k], index, mface->v4 != 0);
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (k = 0; k < index_list_array.getCount(); k++) {
|
||||
int uvset_index = index_list_array[k]->getSetIndex();
|
||||
|
||||
// get mtface by face index and uv set index
|
||||
MTFace *mtface = (MTFace*)CustomData_get_layer_n(&me->fdata, CD_MTFACE, uvset_index);
|
||||
set_face_uv(&mtface[face_index], uvs, *index_list_array[k], index, mface->v4 != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
test_index_face(mface, &me->fdata, face_index, vcount);
|
||||
|
||||
@ -1640,6 +1781,7 @@ private:
|
||||
|
||||
set_face_indices(mface, tri_indices, false);
|
||||
|
||||
#if 0
|
||||
for (unsigned int l = 0; l < totuvset; l++) {
|
||||
if (!index_list_array.empty() && index_list_array[l]) {
|
||||
// get mtface by face index and uv set index
|
||||
@ -1647,6 +1789,16 @@ private:
|
||||
set_face_uv(&mtface[face_index], uvs, l, *index_list_array[l], uv_indices);
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (unsigned int l = 0; l < index_list_array.getCount(); l++) {
|
||||
int uvset_index = index_list_array[l]->getSetIndex();
|
||||
|
||||
// get mtface by face index and uv set index
|
||||
MTFace *mtface = (MTFace*)CustomData_get_layer_n(&me->fdata, CD_MTFACE, uvset_index);
|
||||
set_face_uv(&mtface[face_index], uvs, *index_list_array[l], uv_indices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
test_index_face(mface, &me->fdata, face_index, 3);
|
||||
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
struct Main;
|
||||
struct bContext;
|
||||
|
||||
|
@ -1,4 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
# $Id$
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Arystanbek Dyussenov, Nathan Letwory.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
Import ('env')
|
||||
|
||||
sources = env.Glob('*.cpp')
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_scene.h"
|
||||
#include "BKE_context.h"
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef BLENDER_COLLADA_H
|
||||
#define BLENDER_COLLADA_H
|
||||
|
||||
|
@ -1,3 +1,26 @@
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef BLENDER_COLLADA_H
|
||||
#define BLENDER_COLLADA_H
|
||||
|
||||
|
@ -15,88 +15,43 @@
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC */*.c)
|
||||
|
||||
SET(INC ../windowmanager
|
||||
../editors/include ../editors/interface
|
||||
../../../intern/guardedalloc ../../../intern/memutil
|
||||
../blenlib ../makesdna ../makesrna ../blenkernel
|
||||
../include ../imbuf ../render/extern/include
|
||||
../../../intern/bsp/extern
|
||||
../../../intern/decimation/extern ../blenloader ../python
|
||||
../../kernel/gen_system ../readstreamglue
|
||||
../../../intern/elbeem/extern
|
||||
../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../../../intern/smoke/extern
|
||||
../../../intern/audaspace/intern
|
||||
../nodes
|
||||
../gpu
|
||||
../freestyle
|
||||
../blenfont
|
||||
../ikplugin
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||
|
||||
IF(WITH_GAMEENGINE)
|
||||
ADD_DEFINITIONS(-DGAMEBLENDER)
|
||||
ENDIF(WITH_GAMEENGINE)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
ADD_DEFINITIONS(-DINTERNATIONAL)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_OPENEXR)
|
||||
ADD_DEFINITIONS(-DWITH_OPENEXR)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
IF(WITH_TIFF)
|
||||
ADD_DEFINITIONS(-DWITH_TIFF)
|
||||
ENDIF(WITH_TIFF)
|
||||
|
||||
IF(WITH_OPENJPEG)
|
||||
ADD_DEFINITIONS(-DWITH_OPENJPEG)
|
||||
ENDIF(WITH_OPENJPEG)
|
||||
|
||||
IF(WITH_QUICKTIME)
|
||||
SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
|
||||
ADD_DEFINITIONS(-DWITH_QUICKTIME)
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(INC ${INC} ${FFMPEG_INC})
|
||||
ADD_DEFINITIONS(-DWITH_FFMPEG)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_OPENMP)
|
||||
ADD_DEFINITIONS(-DPARALLEL=1)
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
IF(NOT WITH_ELBEEM)
|
||||
ADD_DEFINITIONS(-DDISABLE_ELBEEM)
|
||||
ENDIF(NOT WITH_ELBEEM)
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
SET(INC ${INC} ${PYTHON_INC})
|
||||
ELSE(WITH_PYTHON)
|
||||
ADD_DEFINITIONS(-DDISABLE_PYTHON)
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_BUILDINFO)
|
||||
ADD_DEFINITIONS(-DNAN_BUILDINFO)
|
||||
ENDIF(WITH_BUILDINFO)
|
||||
|
||||
BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
|
||||
|
||||
ADD_SUBDIRECTORY(animation)
|
||||
ADD_SUBDIRECTORY(armature)
|
||||
ADD_SUBDIRECTORY(curve)
|
||||
ADD_SUBDIRECTORY(datafiles)
|
||||
ADD_SUBDIRECTORY(gpencil)
|
||||
ADD_SUBDIRECTORY(interface)
|
||||
ADD_SUBDIRECTORY(mesh)
|
||||
ADD_SUBDIRECTORY(metaball)
|
||||
ADD_SUBDIRECTORY(object)
|
||||
ADD_SUBDIRECTORY(physics)
|
||||
ADD_SUBDIRECTORY(render)
|
||||
ADD_SUBDIRECTORY(screen)
|
||||
ADD_SUBDIRECTORY(sculpt_paint)
|
||||
ADD_SUBDIRECTORY(sound)
|
||||
ADD_SUBDIRECTORY(space_action)
|
||||
ADD_SUBDIRECTORY(space_api)
|
||||
ADD_SUBDIRECTORY(space_buttons)
|
||||
ADD_SUBDIRECTORY(space_console)
|
||||
ADD_SUBDIRECTORY(space_file)
|
||||
ADD_SUBDIRECTORY(space_graph)
|
||||
ADD_SUBDIRECTORY(space_image)
|
||||
ADD_SUBDIRECTORY(space_info)
|
||||
ADD_SUBDIRECTORY(space_logic)
|
||||
ADD_SUBDIRECTORY(space_nla)
|
||||
ADD_SUBDIRECTORY(space_node)
|
||||
ADD_SUBDIRECTORY(space_outliner)
|
||||
ADD_SUBDIRECTORY(space_script)
|
||||
ADD_SUBDIRECTORY(space_sequencer)
|
||||
ADD_SUBDIRECTORY(space_sound)
|
||||
ADD_SUBDIRECTORY(space_text)
|
||||
ADD_SUBDIRECTORY(space_time)
|
||||
ADD_SUBDIRECTORY(space_userpref)
|
||||
ADD_SUBDIRECTORY(space_view3d)
|
||||
ADD_SUBDIRECTORY(transform)
|
||||
ADD_SUBDIRECTORY(util)
|
||||
ADD_SUBDIRECTORY(uvedit)
|
||||
|
34
source/blender/editors/animation/CMakeLists.txt
Normal file
34
source/blender/editors/animation/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
BLENDERLIB(bf_editor_animation "${SRC}" "${INC}")
|
@ -1104,6 +1104,8 @@ static int insert_key_exec (bContext *C, wmOperator *op)
|
||||
|
||||
void ANIM_OT_keyframe_insert (wmOperatorType *ot)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Insert Keyframe";
|
||||
ot->idname= "ANIM_OT_keyframe_insert";
|
||||
@ -1119,11 +1121,13 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot)
|
||||
/* keyingset to use
|
||||
* - here the type is int not enum, since many of the indicies here are determined dynamically
|
||||
*/
|
||||
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
|
||||
prop= RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
/* confirm whether a keyframe was added by showing a popup
|
||||
* - by default, this is enabled, since this operator is assumed to be called independently
|
||||
*/
|
||||
RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
|
||||
prop= RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
/* Insert Key Operator (With Menu) ------------------------ */
|
||||
@ -1152,6 +1156,8 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Insert Keyframe Menu";
|
||||
ot->idname= "ANIM_OT_keyframe_insert_menu";
|
||||
@ -1167,17 +1173,20 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
|
||||
/* keyingset to use
|
||||
* - here the type is int not enum, since many of the indicies here are determined dynamically
|
||||
*/
|
||||
RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
|
||||
prop= RNA_def_int(ot->srna, "type", 0, INT_MIN, INT_MAX, "Keying Set Number", "Index (determined internally) of the Keying Set to use", 0, 1);
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
/* confirm whether a keyframe was added by showing a popup
|
||||
* - by default, this is disabled so that if a menu is shown, this doesn't come up too
|
||||
*/
|
||||
// XXX should this just be always on?
|
||||
RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
|
||||
prop= RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
/* whether the menu should always be shown
|
||||
* - by default, the menu should only be shown when there is no active Keying Set (2.5 behaviour),
|
||||
* although in some cases it might be useful to always shown (pre 2.5 behaviour)
|
||||
*/
|
||||
RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", "");
|
||||
prop= RNA_def_boolean(ot->srna, "always_prompt", 0, "Always Show Menu", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
/* Delete Key Operator ------------------------ */
|
||||
|
40
source/blender/editors/armature/CMakeLists.txt
Normal file
40
source/blender/editors/armature/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../render/extern/include
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/opennl/extern
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_armature "${SRC}" "${INC}")
|
34
source/blender/editors/curve/CMakeLists.txt
Normal file
34
source/blender/editors/curve/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
BLENDERLIB(bf_editor_curve "${SRC}" "${INC}")
|
@ -5283,7 +5283,7 @@ static int curve_prim_add(bContext *C, wmOperator *op, int type){
|
||||
}
|
||||
else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
||||
ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
|
||||
|
||||
nu= add_nurbs_primitive(C, mat, type, newob);
|
||||
editnurb= curve_get_editcurve(obedit);
|
||||
|
@ -417,7 +417,7 @@ void FONT_OT_file_paste(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE);
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, 0);
|
||||
}
|
||||
|
||||
/******************* paste buffer operator ********************/
|
||||
@ -1639,7 +1639,7 @@ void FONT_OT_open(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE);
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, 0);
|
||||
}
|
||||
|
||||
/******************* delete operator *********************/
|
||||
|
File diff suppressed because it is too large
Load Diff
26
source/blender/editors/datafiles/CMakeLists.txt
Normal file
26
source/blender/editors/datafiles/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public LicenseS
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC "")
|
||||
|
||||
BLENDERLIB(bf_editor_datafiles "${SRC}" "${INC}")
|
35
source/blender/editors/gpencil/CMakeLists.txt
Normal file
35
source/blender/editors/gpencil/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../imbuf
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
BLENDERLIB(bf_editor_gpencil "${SRC}" "${INC}")
|
@ -1515,6 +1515,8 @@ static EnumPropertyItem prop_gpencil_drawmodes[] = {
|
||||
|
||||
void GPENCIL_OT_draw (wmOperatorType *ot)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Grease Pencil Draw";
|
||||
ot->idname= "GPENCIL_OT_draw";
|
||||
@ -1531,6 +1533,8 @@ void GPENCIL_OT_draw (wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
|
||||
|
||||
/* settings for drawing */
|
||||
RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
|
||||
prop= RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
|
||||
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void ED_object_enter_editmode(struct bContext *C, int flag);
|
||||
void ED_object_location_from_view(struct bContext *C, float *loc);
|
||||
void ED_object_rotation_from_view(struct bContext *C, float *rot);
|
||||
void ED_object_base_init_transform(struct bContext *C, struct Base *base, float *loc, float *rot);
|
||||
float ED_object_new_primitive_matrix(struct bContext *C, float *loc, float *rot, float primmat[][4]);
|
||||
float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, float *loc, float *rot, float primmat[][4]);
|
||||
|
||||
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
|
||||
int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
|
||||
|
@ -153,7 +153,7 @@ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
|
||||
|
||||
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
|
||||
|
||||
int ED_view3d_scene_layer_set(int lay, const int *values);
|
||||
int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
|
||||
|
||||
int ED_view3d_context_activate(struct bContext *C);
|
||||
void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar,
|
||||
|
46
source/blender/editors/interface/CMakeLists.txt
Normal file
46
source/blender/editors/interface/CMakeLists.txt
Normal file
@ -0,0 +1,46 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenfont
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../gpu
|
||||
../../imbuf
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../python
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
ADD_DEFINITIONS(-DINTERNATIONAL)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(NOT WITH_PYTHON)
|
||||
ADD_DEFINITIONS(-DDISABLE_PYTHON)
|
||||
ENDIF(NOT WITH_PYTHON)
|
||||
|
||||
BLENDERLIB(bf_editor_interface "${SRC}" "${INC}")
|
@ -656,6 +656,10 @@ static int find_highest_panel(const void *a1, const void *a2)
|
||||
{
|
||||
const PanelSort *ps1=a1, *ps2=a2;
|
||||
|
||||
/* stick uppermost header-less panels to the top of the region -
|
||||
* prevent them from being sorted */
|
||||
if (ps1->pa->sortorder < ps2->pa->sortorder && ps1->pa->type->flag & PNL_NO_HEADER) return -1;
|
||||
|
||||
if(ps1->pa->ofsy+ps1->pa->sizey < ps2->pa->ofsy+ps2->pa->sizey) return 1;
|
||||
else if(ps1->pa->ofsy+ps1->pa->sizey > ps2->pa->ofsy+ps2->pa->sizey) return -1;
|
||||
else if(ps1->pa->sortorder > ps2->pa->sortorder) return 1;
|
||||
@ -1055,7 +1059,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
|
||||
inside= 1;
|
||||
|
||||
if(inside && event->val==KM_PRESS) {
|
||||
if(event->type == AKEY) {
|
||||
if(event->type == AKEY && !ELEM3(1, event->ctrl, event->oskey, event->shift)) {
|
||||
|
||||
if(pa->flag & PNL_CLOSEDY) {
|
||||
if((block->maxy <= my) && (block->maxy+PNL_HEADER >= my))
|
||||
|
@ -283,10 +283,10 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
|
||||
float maxxi= maxx - 1.0f;
|
||||
float minyi= miny + 1.0f;
|
||||
float maxyi= maxy - 1.0f;
|
||||
float facxi= 1.0f/(maxxi-minxi); /* for uv */
|
||||
float facyi= 1.0f/(maxyi-minyi);
|
||||
float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */
|
||||
float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f;
|
||||
int a, tot= 0, minsize;
|
||||
|
||||
|
||||
minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin);
|
||||
|
||||
if(2.0f*rad > minsize)
|
||||
|
@ -151,7 +151,8 @@ static void view_pan_apply(bContext *C, wmOperator *op)
|
||||
WM_event_add_mousemove(C);
|
||||
|
||||
/* exceptions */
|
||||
if(vpd->sa->spacetype==SPACE_OUTLINER) {
|
||||
if (vpd->sa->spacetype==SPACE_OUTLINER) {
|
||||
/* don't rebuild full tree, since we're just changing our view */
|
||||
SpaceOops *soops= vpd->sa->spacedata.first;
|
||||
soops->storeflag |= SO_TREESTORE_REDRAW;
|
||||
}
|
||||
@ -292,7 +293,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot)
|
||||
ot->modal= view_pan_modal;
|
||||
ot->cancel= view_pan_cancel;
|
||||
|
||||
/* operator is repeatable */
|
||||
/* operator is modal */
|
||||
ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
@ -339,9 +340,6 @@ void VIEW2D_OT_scroll_right(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->exec= view_scrollright_exec;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
|
||||
@ -386,9 +384,6 @@ void VIEW2D_OT_scroll_left(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->exec= view_scrollleft_exec;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
|
||||
@ -432,9 +427,6 @@ void VIEW2D_OT_scroll_down(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->exec= view_scrolldown_exec;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
|
||||
@ -479,9 +471,6 @@ void VIEW2D_OT_scroll_up(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->exec= view_scrollup_exec;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
|
||||
@ -569,11 +558,12 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
|
||||
float dx, dy, facx, facy;
|
||||
|
||||
/* calculate amount to move view by, ensuring symmetry so the
|
||||
* old zoom level is restored after zooming back the same amount */
|
||||
* old zoom level is restored after zooming back the same amount
|
||||
*/
|
||||
facx= RNA_float_get(op->ptr, "zoomfacx");
|
||||
facy= RNA_float_get(op->ptr, "zoomfacy");
|
||||
|
||||
if(facx >= 0.0f) {
|
||||
if (facx >= 0.0f) {
|
||||
dx= (v2d->cur.xmax - v2d->cur.xmin) * facx;
|
||||
dy= (v2d->cur.ymax - v2d->cur.ymin) * facy;
|
||||
}
|
||||
@ -588,16 +578,17 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
|
||||
v2d->cur.xmax -= 2*dx;
|
||||
}
|
||||
else if (v2d->keepofs & V2D_KEEPOFS_X) {
|
||||
if(v2d->align & V2D_ALIGN_NO_POS_X)
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_X)
|
||||
v2d->cur.xmin += 2*dx;
|
||||
else
|
||||
v2d->cur.xmax -= 2*dx;
|
||||
}
|
||||
else {
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax-v2d->cur.xmin);
|
||||
float mval_faci = 1.0 - mval_fac;
|
||||
float ofs= (mval_fac * dx) - (mval_faci * dx);
|
||||
|
||||
v2d->cur.xmin += ofs + dx;
|
||||
v2d->cur.xmax += ofs - dx;
|
||||
}
|
||||
@ -612,19 +603,21 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
|
||||
v2d->cur.ymax -= 2*dy;
|
||||
}
|
||||
else if (v2d->keepofs & V2D_KEEPOFS_Y) {
|
||||
if(v2d->align & V2D_ALIGN_NO_POS_Y)
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_Y)
|
||||
v2d->cur.ymin += 2*dy;
|
||||
else
|
||||
v2d->cur.ymax -= 2*dy;
|
||||
}
|
||||
else {
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax-v2d->cur.ymin);
|
||||
float mval_faci = 1.0 - mval_fac;
|
||||
float ofs= (mval_fac * dy) - (mval_faci * dy);
|
||||
|
||||
v2d->cur.ymin += ofs + dy;
|
||||
v2d->cur.ymax += ofs - dy;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
v2d->cur.ymin += dy;
|
||||
v2d->cur.ymax -= dy;
|
||||
}
|
||||
@ -679,9 +672,13 @@ static int view_zoomin_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
vzd= op->customdata;
|
||||
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin, &vzd->mx_2d, &vzd->my_2d);
|
||||
|
||||
/* store initial mouse position (in view space) */
|
||||
UI_view2d_region_to_view(&ar->v2d,
|
||||
event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
|
||||
&vzd->mx_2d, &vzd->my_2d);
|
||||
}
|
||||
|
||||
return view_zoomin_exec(C, op);
|
||||
@ -699,9 +696,6 @@ void VIEW2D_OT_zoom_in(wmOperatorType *ot)
|
||||
ot->exec= view_zoomin_exec;
|
||||
ot->poll= view_zoom_poll;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX);
|
||||
@ -737,7 +731,11 @@ static int view_zoomout_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin, &vzd->mx_2d, &vzd->my_2d);
|
||||
|
||||
/* store initial mouse position (in view space) */
|
||||
UI_view2d_region_to_view(&ar->v2d,
|
||||
event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
|
||||
&vzd->mx_2d, &vzd->my_2d);
|
||||
}
|
||||
|
||||
return view_zoomout_exec(C, op);
|
||||
@ -755,9 +753,6 @@ void VIEW2D_OT_zoom_out(wmOperatorType *ot)
|
||||
ot->exec= view_zoomout_exec;
|
||||
ot->poll= view_zoom_poll;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_float(ot->srna, "zoomfacx", 0, -FLT_MAX, FLT_MAX, "Zoom Factor X", "", -FLT_MAX, FLT_MAX);
|
||||
RNA_def_float(ot->srna, "zoomfacy", 0, -FLT_MAX, FLT_MAX, "Zoom Factor Y", "", -FLT_MAX, FLT_MAX);
|
||||
@ -789,10 +784,11 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
|
||||
v2d->cur.xmax -= 2*dx;
|
||||
}
|
||||
else {
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
float mval_fac = (vzd->mx_2d - v2d->cur.xmin) / (v2d->cur.xmax-v2d->cur.xmin);
|
||||
float mval_faci = 1.0 - mval_fac;
|
||||
float ofs= (mval_fac * dx) - (mval_faci * dx);
|
||||
|
||||
v2d->cur.xmin += ofs + dx;
|
||||
v2d->cur.xmax += ofs - dx;
|
||||
}
|
||||
@ -807,10 +803,11 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
|
||||
v2d->cur.ymax -= 2*dy;
|
||||
}
|
||||
else {
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
float mval_fac = (vzd->my_2d - v2d->cur.ymin) / (v2d->cur.ymax-v2d->cur.ymin);
|
||||
float mval_faci = 1.0 - mval_fac;
|
||||
float ofs= (mval_fac * dy) - (mval_faci * dy);
|
||||
|
||||
v2d->cur.ymin += ofs + dy;
|
||||
v2d->cur.ymax += ofs - dy;
|
||||
}
|
||||
@ -871,7 +868,8 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
vzd->lasty= event->prevy;
|
||||
|
||||
/* As we have only 1D information (magnify value), feed both axes
|
||||
with magnify information that is stored in x axis */
|
||||
* with magnify information that is stored in x axis
|
||||
*/
|
||||
fac= 0.01f * (event->x - event->prevx);
|
||||
dx= fac * (v2d->cur.xmax - v2d->cur.xmin) / 10.0f;
|
||||
dy= fac * (v2d->cur.ymax - v2d->cur.ymin) / 10.0f;
|
||||
@ -890,9 +888,13 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
RNA_float_set(op->ptr, "deltax", 0);
|
||||
RNA_float_set(op->ptr, "deltay", 0);
|
||||
|
||||
if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
if (U.uiflag & USER_ZOOM_TO_MOUSEPOS) {
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin, &vzd->mx_2d, &vzd->my_2d);
|
||||
|
||||
/* store initial mouse position (in view space) */
|
||||
UI_view2d_region_to_view(&ar->v2d,
|
||||
event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
|
||||
&vzd->mx_2d, &vzd->my_2d);
|
||||
}
|
||||
|
||||
if (v2d->keepofs & V2D_LOCKOFS_X)
|
||||
@ -1014,7 +1016,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot)
|
||||
ot->poll= view_zoom_poll;
|
||||
|
||||
/* operator is repeatable */
|
||||
// ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING;
|
||||
// ot->flag= OPTYPE_BLOCKING;
|
||||
|
||||
/* rna - must keep these in sync with the other operators */
|
||||
RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX);
|
||||
@ -1202,6 +1204,7 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_
|
||||
}
|
||||
|
||||
/* check if mouse is in or past either handle */
|
||||
// TODO: check if these extents are still valid or not
|
||||
in_max= ( (mouse >= (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse <= (sh_max + V2D_SCROLLER_HANDLE_SIZE)) );
|
||||
in_min= ( (mouse <= (sh_min + V2D_SCROLLER_HANDLE_SIZE)) && (mouse >= (sh_min - V2D_SCROLLER_HANDLE_SIZE)) );
|
||||
in_bar= ( (mouse < (sh_max - V2D_SCROLLER_HANDLE_SIZE)) && (mouse > (sh_min + V2D_SCROLLER_HANDLE_SIZE)) );
|
||||
@ -1400,8 +1403,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
case LEFTMOUSE:
|
||||
if (event->val==KM_RELEASE) {
|
||||
|
||||
/* click was in empty space outside scroll bar */
|
||||
/* single-click was in empty space outside bubble, so scroll by 1 'page' */
|
||||
if (ELEM(vsm->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) {
|
||||
if (vsm->zone == SCROLLHANDLE_MIN_OUTSIDE)
|
||||
vsm->delta = -vsm->scrollbarwidth * 0.8;
|
||||
@ -1532,7 +1534,7 @@ static int reset_exec(bContext *C, wmOperator *op)
|
||||
v2d->cur.ymax= v2d->cur.ymin + winy;
|
||||
|
||||
/* align */
|
||||
if(v2d->align) {
|
||||
if (v2d->align) {
|
||||
/* posx and negx flags are mutually exclusive, so watch out */
|
||||
if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
|
||||
v2d->cur.xmax= 0.0f;
|
||||
@ -1575,9 +1577,6 @@ void VIEW2D_OT_reset(wmOperatorType *ot)
|
||||
/* api callbacks */
|
||||
ot->exec= reset_exec;
|
||||
ot->poll= view2d_poll;
|
||||
|
||||
/* flags */
|
||||
// ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* ********************************************************* */
|
||||
|
40
source/blender/editors/mesh/CMakeLists.txt
Normal file
40
source/blender/editors/mesh/CMakeLists.txt
Normal file
@ -0,0 +1,40 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../imbuf
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../render/extern/include
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_mesh "${SRC}" "${INC}")
|
@ -60,9 +60,6 @@
|
||||
#include "BKE_texture.h"
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
#include "LBM_fluidsim.h"
|
||||
|
||||
|
||||
#include "ED_mesh.h"
|
||||
#include "ED_object.h"
|
||||
#include "ED_retopo.h"
|
||||
|
@ -1269,6 +1269,7 @@ static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmod
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
int newob = 0;
|
||||
float mat[4][4];
|
||||
int scale;
|
||||
|
||||
if(obedit==NULL || obedit->type!=OB_MESH) {
|
||||
obedit= ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
|
||||
@ -1279,8 +1280,10 @@ static void make_prim_ext(bContext *C, float *loc, float *rot, int enter_editmod
|
||||
}
|
||||
else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
||||
dia *= ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
depth *= ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
scale= ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
|
||||
|
||||
dia *= scale;
|
||||
depth *= scale;
|
||||
|
||||
make_prim(obedit, type, mat, tot, seg, subdiv, dia, depth, ext, fill);
|
||||
|
||||
|
35
source/blender/editors/metaball/CMakeLists.txt
Normal file
35
source/blender/editors/metaball/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../render/extern/include
|
||||
../../windowmanager
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
BLENDERLIB(bf_editor_metaball "${SRC}" "${INC}")
|
47
source/blender/editors/object/CMakeLists.txt
Normal file
47
source/blender/editors/object/CMakeLists.txt
Normal file
@ -0,0 +1,47 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../gpu
|
||||
../../ikplugin
|
||||
../../imbuf
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../python
|
||||
../../windowmanager
|
||||
../../render/extern/include
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
IF(NOT WITH_PYTHON)
|
||||
ADD_DEFINITIONS(-DDISABLE_PYTHON)
|
||||
ENDIF(NOT WITH_PYTHON)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_object "${SRC}" "${INC}")
|
@ -137,9 +137,8 @@ void ED_object_base_init_transform(bContext *C, Base *base, float *loc, float *r
|
||||
|
||||
/* uses context to figure out transform for primitive */
|
||||
/* returns standard diameter */
|
||||
float ED_object_new_primitive_matrix(bContext *C, float *loc, float *rot, float primmat[][4])
|
||||
float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, float *rot, float primmat[][4])
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
View3D *v3d =CTX_wm_view3d(C);
|
||||
float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3];
|
||||
|
||||
@ -155,8 +154,8 @@ float ED_object_new_primitive_matrix(bContext *C, float *loc, float *rot, float
|
||||
copy_m4_m3(primmat, imat);
|
||||
|
||||
/* center */
|
||||
VECCOPY(primmat[3], loc);
|
||||
VECSUB(primmat[3], primmat[3], obedit->obmat[3]);
|
||||
copy_v3_v3(primmat[3], loc);
|
||||
sub_v3_v3v3(primmat[3], primmat[3], obedit->obmat[3]);
|
||||
invert_m3_m3(imat, mat);
|
||||
mul_m3_v3(imat, primmat[3]);
|
||||
|
||||
@ -212,12 +211,13 @@ static void object_add_generic_invoke_options(bContext *C, wmOperator *op)
|
||||
for(a=0; a<32; a++)
|
||||
values[a]= (layer & (1<<a));
|
||||
} else {
|
||||
layer = v3d->layact;
|
||||
layer = (v3d->scenelock)?scene->layact:v3d->layact;
|
||||
|
||||
for(a=0; a<32; a++)
|
||||
values[a]= (layer & (1<<a));
|
||||
}
|
||||
} else {
|
||||
layer = scene->lay;
|
||||
layer = scene->layact;
|
||||
for(a=0; a<32; a++)
|
||||
values[a]= (layer & (1<<a));
|
||||
}
|
||||
@ -365,7 +365,7 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
|
||||
|
||||
((Curve*)ob->data)->flag |= CU_PATH|CU_3D;
|
||||
ED_object_enter_editmode(C, 0);
|
||||
ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
ED_object_new_primitive_matrix(C, ob, loc, rot, mat);
|
||||
BLI_addtail(curve_get_editcurve(ob), add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_PATH, 1));
|
||||
|
||||
if(!enter_editmode)
|
||||
@ -497,7 +497,7 @@ static int object_add_surface_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
||||
ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
|
||||
|
||||
nu= add_nurbs_primitive(C, mat, RNA_enum_get(op->ptr, "type"), newob);
|
||||
editnurb= curve_get_editcurve(obedit);
|
||||
@ -562,7 +562,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
|
||||
|
||||
ED_object_new_primitive_matrix(C, loc, rot, mat);
|
||||
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
|
||||
|
||||
elem= (MetaElem*)add_metaball_primitive(C, mat, RNA_enum_get(op->ptr, "type"), newob);
|
||||
mball= (MetaBall*)obedit->data;
|
||||
@ -833,14 +833,13 @@ static int object_delete_exec(bContext *C, wmOperator *op)
|
||||
CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
|
||||
|
||||
if(base->object->type==OB_LAMP) islamp= 1;
|
||||
|
||||
/* remove from current scene only */
|
||||
ED_base_object_free_and_unlink(scene, base);
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
if(islamp) reshadeall_displist(scene); /* only frees displist */
|
||||
|
||||
|
||||
DAG_scene_sort(scene);
|
||||
DAG_ids_flush_update(0);
|
||||
|
||||
@ -1054,7 +1053,7 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
|
||||
|
||||
static EnumPropertyItem convert_target_items[]= {
|
||||
{OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve from Mesh/Text", ""},
|
||||
{OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh from Curve/Meta/Surf/Mesh", ""},
|
||||
{OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh from Curve/Meta/Surf/Text", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
||||
static void curvetomesh(Scene *scene, Object *ob)
|
||||
@ -1674,6 +1673,8 @@ static int duplicate_exec(bContext *C, wmOperator *op)
|
||||
|
||||
void OBJECT_OT_duplicate(wmOperatorType *ot)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Duplicate";
|
||||
ot->description = "Duplicate selected objects";
|
||||
@ -1688,7 +1689,8 @@ void OBJECT_OT_duplicate(wmOperatorType *ot)
|
||||
|
||||
/* to give to transform */
|
||||
RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data.");
|
||||
RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
|
||||
prop= RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
/* **************** add named object, for dragdrop ************* */
|
||||
|
@ -199,9 +199,9 @@ char *buildmenu_pyconstraints (Text *con_text, int *pyconindex)
|
||||
/* this callback gets called when the 'refresh' button of a pyconstraint gets pressed */
|
||||
void update_pyconstraint_cb (void *arg1, void *arg2)
|
||||
{
|
||||
#ifndef DISABLE_PYTHON
|
||||
Object *owner= (Object *)arg1;
|
||||
bConstraint *con= (bConstraint *)arg2;
|
||||
#ifndef DISABLE_PYTHON
|
||||
if (owner && con)
|
||||
BPY_pyconstraint_update(owner, con);
|
||||
#endif
|
||||
@ -1286,9 +1286,9 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
|
||||
|
||||
case CONSTRAINT_TYPE_PYTHON: // FIXME: this code is not really valid anymore
|
||||
{
|
||||
#ifndef DISABLE_PYTHON
|
||||
char *menustr;
|
||||
int scriptint= 0;
|
||||
#ifndef DISABLE_PYTHON
|
||||
/* popup a list of usable scripts */
|
||||
menustr = buildmenu_pyconstraints(NULL, &scriptint);
|
||||
// XXX scriptint = pupmenu(menustr);
|
||||
|
@ -2306,9 +2306,6 @@ void OBJECT_OT_game_property_copy(wmOperatorType *ot)
|
||||
|
||||
static int game_property_clear_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob=ED_object_active_context(C);
|
||||
bProperty *prop;
|
||||
|
||||
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
|
||||
free_properties(&ob_iter->prop);
|
||||
}
|
||||
|
@ -157,8 +157,8 @@ void OBJECT_OT_modifier_copy(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_reshape(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_save_external(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_pack_external(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_external_save(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_external_pack(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_explode_refresh(struct wmOperatorType *ot);
|
||||
|
||||
|
@ -399,7 +399,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
|
||||
if (ob->type==OB_MESH) {
|
||||
DerivedMesh *dm;
|
||||
Mesh *me = ob->data;
|
||||
MultiresModifierData *mmd= find_multires_modifier(ob);
|
||||
MultiresModifierData *mmd= find_multires_modifier(scene, ob);
|
||||
|
||||
if( me->key) {
|
||||
BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys");
|
||||
@ -413,7 +413,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
|
||||
multires_force_update(ob);
|
||||
|
||||
if (mmd && mti->type==eModifierTypeType_OnlyDeform) {
|
||||
multiresModifier_reshapeFromDeformMod (ob, md);
|
||||
multiresModifier_reshapeFromDeformMod (scene, mmd, ob, md);
|
||||
} else {
|
||||
dm = mesh_create_derived_for_modifier(scene, ob, md);
|
||||
if (!dm) {
|
||||
@ -954,6 +954,7 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
|
||||
static int multires_reshape_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob= ED_object_active_context(C), *secondob= NULL;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(C, op, ob, eModifierType_Multires);
|
||||
|
||||
if (!mmd)
|
||||
@ -971,15 +972,15 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
|
||||
BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if(!multiresModifier_reshape(ob, secondob)) {
|
||||
|
||||
if(!multiresModifier_reshape(scene, mmd, ob, secondob)) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
@ -1008,11 +1009,12 @@ void OBJECT_OT_multires_reshape(wmOperatorType *ot)
|
||||
|
||||
/****************** multires save external operator *********************/
|
||||
|
||||
static int multires_save_external_exec(bContext *C, wmOperator *op)
|
||||
static int multires_external_save_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
Mesh *me= (ob)? ob->data: op->customdata;
|
||||
char path[FILE_MAX];
|
||||
int relative= RNA_boolean_get(op->ptr, "relative_path");
|
||||
|
||||
if(!me)
|
||||
return OPERATOR_CANCELLED;
|
||||
@ -1022,7 +1024,8 @@ static int multires_save_external_exec(bContext *C, wmOperator *op)
|
||||
|
||||
RNA_string_get(op->ptr, "path", path);
|
||||
|
||||
/* BLI_path_rel(path, G.sce); */ /* TODO, relative path operator option */
|
||||
if(relative)
|
||||
BLI_path_rel(path, G.sce);
|
||||
|
||||
CustomData_external_add(&me->fdata, &me->id, CD_MDISPS, me->totface, path);
|
||||
CustomData_external_write(&me->fdata, &me->id, CD_MASK_MESH, me->totface, 0);
|
||||
@ -1030,7 +1033,7 @@ static int multires_save_external_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
MultiresModifierData *mmd;
|
||||
@ -1048,8 +1051,11 @@ static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *e
|
||||
if(CustomData_external_test(&me->fdata, CD_MDISPS))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if(!RNA_property_is_set(op->ptr, "relative_path"))
|
||||
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
|
||||
|
||||
if(RNA_property_is_set(op->ptr, "path"))
|
||||
return multires_save_external_exec(C, op);
|
||||
return multires_external_save_exec(C, op);
|
||||
|
||||
op->customdata= me;
|
||||
|
||||
@ -1061,27 +1067,27 @@ static int multires_save_external_invoke(bContext *C, wmOperator *op, wmEvent *e
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
|
||||
void OBJECT_OT_multires_save_external(wmOperatorType *ot)
|
||||
void OBJECT_OT_multires_external_save(wmOperatorType *ot)
|
||||
{
|
||||
ot->name= "Multires Save External";
|
||||
ot->description= "Save displacements to an external file";
|
||||
ot->idname= "OBJECT_OT_multires_save_external";
|
||||
ot->idname= "OBJECT_OT_multires_external_save";
|
||||
|
||||
// XXX modifier no longer in context after file browser .. ot->poll= multires_poll;
|
||||
ot->exec= multires_save_external_exec;
|
||||
ot->invoke= multires_save_external_invoke;
|
||||
ot->exec= multires_external_save_exec;
|
||||
ot->invoke= multires_external_save_invoke;
|
||||
ot->poll= multires_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE);
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH);
|
||||
edit_modifier_properties(ot);
|
||||
}
|
||||
|
||||
/****************** multires pack operator *********************/
|
||||
|
||||
static int multires_pack_external_exec(bContext *C, wmOperator *op)
|
||||
static int multires_external_pack_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
Mesh *me= ob->data;
|
||||
@ -1095,14 +1101,14 @@ static int multires_pack_external_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void OBJECT_OT_multires_pack_external(wmOperatorType *ot)
|
||||
void OBJECT_OT_multires_external_pack(wmOperatorType *ot)
|
||||
{
|
||||
ot->name= "Multires Pack External";
|
||||
ot->description= "Pack displacements from an external file";
|
||||
ot->idname= "OBJECT_OT_multires_pack_external";
|
||||
ot->idname= "OBJECT_OT_multires_external_pack";
|
||||
|
||||
ot->poll= multires_poll;
|
||||
ot->exec= multires_pack_external_exec;
|
||||
ot->exec= multires_external_pack_exec;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
@ -138,8 +138,8 @@ void ED_operatortypes_object(void)
|
||||
WM_operatortype_append(OBJECT_OT_multires_subdivide);
|
||||
WM_operatortype_append(OBJECT_OT_multires_reshape);
|
||||
WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete);
|
||||
WM_operatortype_append(OBJECT_OT_multires_save_external);
|
||||
WM_operatortype_append(OBJECT_OT_multires_pack_external);
|
||||
WM_operatortype_append(OBJECT_OT_multires_external_save);
|
||||
WM_operatortype_append(OBJECT_OT_multires_external_pack);
|
||||
WM_operatortype_append(OBJECT_OT_meshdeform_bind);
|
||||
WM_operatortype_append(OBJECT_OT_explode_refresh);
|
||||
|
||||
|
@ -1188,6 +1188,29 @@ enum {
|
||||
MAKE_LINKS_MODIFIERS
|
||||
};
|
||||
|
||||
/* Return 1 if make link data is allow, zero otherwise */
|
||||
static int allow_make_links_data(int ev, Object *ob, Object *obt)
|
||||
{
|
||||
if (ev == MAKE_LINKS_OBDATA) {
|
||||
if (ob->type == OB_MESH && obt->type == OB_MESH)
|
||||
return(1);
|
||||
}
|
||||
else if (ev == MAKE_LINKS_MATERIALS) {
|
||||
if ((ob->type == OB_MESH || ob->type == OB_CURVE || ob->type == OB_FONT || ob->type == OB_SURF || ob->type == OB_MBALL) &&
|
||||
(obt->type == OB_MESH || obt->type == OB_CURVE || obt->type == OB_FONT || obt->type == OB_SURF || obt->type == OB_MBALL))
|
||||
return(1);
|
||||
}
|
||||
else if (ev == MAKE_LINKS_ANIMDATA)
|
||||
return(1);
|
||||
else if (ev == MAKE_LINKS_DUPLIGROUP)
|
||||
return(1);
|
||||
else if (ev == MAKE_LINKS_MODIFIERS) {
|
||||
if (ob->type != OB_EMPTY && obt->type != OB_EMPTY)
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int make_links_data_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
int event = RNA_int_get(op->ptr, "type");
|
||||
@ -1199,43 +1222,45 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
|
||||
|
||||
CTX_DATA_BEGIN(C, Object*, obt, selected_editable_objects) {
|
||||
if(ob != obt) {
|
||||
switch(event) {
|
||||
case MAKE_LINKS_OBDATA: /* obdata */
|
||||
id= obt->data;
|
||||
id->us--;
|
||||
if (allow_make_links_data(event, ob, obt)) {
|
||||
switch(event) {
|
||||
case MAKE_LINKS_OBDATA: /* obdata */
|
||||
id= obt->data;
|
||||
id->us--;
|
||||
|
||||
id= ob->data;
|
||||
id_us_plus(id);
|
||||
obt->data= id;
|
||||
id= ob->data;
|
||||
id_us_plus(id);
|
||||
obt->data= id;
|
||||
|
||||
/* if amount of material indices changed: */
|
||||
test_object_materials(obt->data);
|
||||
/* if amount of material indices changed: */
|
||||
test_object_materials(obt->data);
|
||||
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
break;
|
||||
case MAKE_LINKS_MATERIALS:
|
||||
/* new approach, using functions from kernel */
|
||||
for(a=0; a<ob->totcol; a++) {
|
||||
Material *ma= give_current_material(ob, a+1);
|
||||
assign_material(obt, ma, a+1); /* also works with ma==NULL */
|
||||
obt->recalc |= OB_RECALC_DATA;
|
||||
break;
|
||||
case MAKE_LINKS_MATERIALS:
|
||||
/* new approach, using functions from kernel */
|
||||
for(a=0; a<ob->totcol; a++) {
|
||||
Material *ma= give_current_material(ob, a+1);
|
||||
assign_material(obt, ma, a+1); /* also works with ma==NULL */
|
||||
}
|
||||
break;
|
||||
case MAKE_LINKS_ANIMDATA:
|
||||
BKE_copy_animdata_id((ID *)obt, (ID *)ob);
|
||||
BKE_copy_animdata_id((ID *)obt->data, (ID *)ob->data);
|
||||
break;
|
||||
case MAKE_LINKS_DUPLIGROUP:
|
||||
if(ob->dup_group) ob->dup_group->id.us--;
|
||||
obt->dup_group= ob->dup_group;
|
||||
if(obt->dup_group) {
|
||||
id_us_plus((ID *)obt->dup_group);
|
||||
obt->transflag |= OB_DUPLIGROUP;
|
||||
}
|
||||
break;
|
||||
case MAKE_LINKS_MODIFIERS:
|
||||
object_link_modifiers(obt, ob);
|
||||
obt->recalc |= OB_RECALC;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MAKE_LINKS_ANIMDATA:
|
||||
BKE_copy_animdata_id((ID *)obt, (ID *)ob);
|
||||
BKE_copy_animdata_id((ID *)obt->data, (ID *)ob->data);
|
||||
break;
|
||||
case MAKE_LINKS_DUPLIGROUP:
|
||||
if(ob->dup_group) ob->dup_group->id.us--;
|
||||
obt->dup_group= ob->dup_group;
|
||||
if(obt->dup_group) {
|
||||
id_us_plus((ID *)obt->dup_group);
|
||||
obt->transflag |= OB_DUPLIGROUP;
|
||||
}
|
||||
break;
|
||||
case MAKE_LINKS_MODIFIERS:
|
||||
object_link_modifiers(obt, ob);
|
||||
obt->recalc |= OB_RECALC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -432,6 +432,10 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
|
||||
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if(!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
|
||||
BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing.");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if(cu->key) {
|
||||
BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing.");
|
||||
return OPERATOR_CANCELLED;
|
||||
@ -498,7 +502,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
|
||||
cu= ob->data;
|
||||
|
||||
scale = mat3_to_scale(rsmat);
|
||||
|
||||
|
||||
for(nu=cu->nurb.first; nu; nu=nu->next) {
|
||||
if(nu->type == CU_BEZIER) {
|
||||
a= nu->pntsu;
|
||||
|
@ -129,17 +129,8 @@ int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot)
|
||||
case ID_ME:
|
||||
{
|
||||
Mesh *me = (Mesh *)id;
|
||||
*dvert_tot= me->totvert;
|
||||
|
||||
if (!me->edit_mesh) {
|
||||
int i;
|
||||
|
||||
*dvert_arr= MEM_mallocN(sizeof(void*)*me->totvert, "vgroup parray from me");
|
||||
|
||||
for (i=0; i<me->totvert; i++) {
|
||||
(*dvert_arr)[i] = me->dvert + i;
|
||||
}
|
||||
} else {
|
||||
if(me->edit_mesh) {
|
||||
EditMesh *em = me->edit_mesh;
|
||||
EditVert *eve;
|
||||
int i;
|
||||
@ -161,8 +152,20 @@ int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot)
|
||||
(*dvert_arr)[i] = CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if(me->dvert) {
|
||||
int i;
|
||||
|
||||
*dvert_tot= me->totvert;
|
||||
*dvert_arr= MEM_mallocN(sizeof(void*)*me->totvert, "vgroup parray from me");
|
||||
|
||||
for (i=0; i<me->totvert; i++) {
|
||||
(*dvert_arr)[i] = me->dvert + i;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
case ID_LT:
|
||||
{
|
||||
|
47
source/blender/editors/physics/CMakeLists.txt
Normal file
47
source/blender/editors/physics/CMakeLists.txt
Normal file
@ -0,0 +1,47 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../include
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../../../intern/elbeem/extern
|
||||
../../../../intern/guardedalloc
|
||||
)
|
||||
|
||||
IF(NOT WITH_ELBEEM)
|
||||
ADD_DEFINITIONS(-DDISABLE_ELBEEM)
|
||||
ENDIF(NOT WITH_ELBEEM)
|
||||
|
||||
IF(WITH_OPENMP)
|
||||
ADD_DEFINITIONS(-DPARALLEL=1)
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_physics "${SRC}" "${INC}")
|
@ -770,10 +770,10 @@ static void fluidbake_endjob(void *customdata)
|
||||
int runSimulationCallback(void *data, int status, int frame) {
|
||||
FluidBakeJob *fb = (FluidBakeJob *)data;
|
||||
elbeemSimulationSettings *settings = fb->settings;
|
||||
//printf("elbeem blender cb s%d, f%d, domainid:%d \n", status,frame, settings->domainId ); // DEBUG
|
||||
|
||||
if (status == FLUIDSIM_CBSTATUS_NEWFRAME) {
|
||||
fluidbake_updatejob(fb, frame / (float)settings->noOfFrames);
|
||||
//printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d \n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
|
||||
}
|
||||
|
||||
if (fluidbake_breakjob(fb)) {
|
||||
@ -794,8 +794,10 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects,
|
||||
MEM_freeN(fobjects);
|
||||
fobjects = NULL;
|
||||
|
||||
MEM_freeN(fsset);
|
||||
fsset = NULL;
|
||||
if (fsset) {
|
||||
MEM_freeN(fsset);
|
||||
fsset = NULL;
|
||||
}
|
||||
|
||||
if (fb) {
|
||||
MEM_freeN(fb);
|
||||
@ -835,7 +837,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
|
||||
FluidBakeJob *fb;
|
||||
elbeemSimulationSettings *fsset= MEM_callocN(sizeof(elbeemSimulationSettings), "Fluid sim settings");
|
||||
|
||||
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Fluid Sim", WM_JOB_PROGRESS);
|
||||
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Fluid Simulation", WM_JOB_PROGRESS);
|
||||
fb= MEM_callocN(sizeof(FluidBakeJob), "fluid bake job");
|
||||
|
||||
if(getenv(strEnvName)) {
|
||||
@ -854,10 +856,10 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
|
||||
}
|
||||
|
||||
/* check scene for sane object/modifier settings */
|
||||
if (!fluid_validate_scene(reports, scene, fsDomain))
|
||||
if (!fluid_validate_scene(reports, scene, fsDomain)) {
|
||||
fluidbake_free_data(channels, fobjects, fsset, fb);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/* these both have to be valid, otherwise we wouldnt be here */
|
||||
fluidmd = (FluidsimModifierData *)modifiers_findByType(fsDomain, eModifierType_Fluidsim);
|
||||
@ -1041,7 +1043,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
|
||||
WM_jobs_start(CTX_wm_manager(C), steve);
|
||||
|
||||
/* ******** free stored animation data ******** */
|
||||
fluidbake_free_data(channels, fobjects, fsset, NULL);
|
||||
fluidbake_free_data(channels, fobjects, NULL, NULL);
|
||||
|
||||
// elbeemFree();
|
||||
return 1;
|
||||
|
55
source/blender/editors/render/CMakeLists.txt
Normal file
55
source/blender/editors/render/CMakeLists.txt
Normal file
@ -0,0 +1,55 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../../blenfont
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../blenloader
|
||||
../../gpu
|
||||
../../imbuf
|
||||
../include
|
||||
../../../../intern/guardedalloc
|
||||
../../../../extern/glew/include
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../python
|
||||
../../render/extern/include
|
||||
../../windowmanager
|
||||
../../freestyle
|
||||
)
|
||||
|
||||
IF(WITH_QUICKTIME)
|
||||
SET(INC ${INC} ../../quicktime ${QUICKTIME_INC})
|
||||
ADD_DEFINITIONS(-DWITH_QUICKTIME)
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
|
||||
IF(WITH_OPENMP)
|
||||
ADD_DEFINITIONS(-DPARALLEL=1)
|
||||
ENDIF(WITH_OPENMP)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_render "${SRC}" "${INC}")
|
@ -1035,9 +1035,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
|
||||
|
||||
/* properties */
|
||||
//RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as.");
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE);
|
||||
|
||||
RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Save image with relative path to current .blend file");
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, FILE_RELPATH);
|
||||
}
|
||||
|
||||
static int envmap_clear_exec(bContext *C, wmOperator *op)
|
||||
|
@ -1,13 +1,10 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version. The Blender
|
||||
# Foundation also sells licenses for use in proprietary software under
|
||||
# the Blender License. See http://www.blender.org/BL/ for information
|
||||
# about this.
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -18,61 +15,26 @@
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC */*.c)
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC ../../windowmanager
|
||||
../../editors/include
|
||||
../../../../intern/guardedalloc ../../../../intern/memutil
|
||||
../../blenlib ../../makesdna ../../makesrna ../../blenkernel
|
||||
../../include ../../imbuf
|
||||
../../render/extern/include ../../../../intern/bsp/extern
|
||||
../../../intern/decimation/extern ../../blenloader
|
||||
../../../kernel/gen_system ../../readstreamglue
|
||||
../../../../intern/elbeem/extern
|
||||
../../../../intern/ghost ../../../../intern/opennl/extern
|
||||
../../nodes
|
||||
SET(INC
|
||||
../../blenfont
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../../imbuf
|
||||
../include
|
||||
../../../../intern/guardedalloc
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
)
|
||||
|
||||
IF(WITH_INTERNATIONAL)
|
||||
ADD_DEFINITIONS(-DINTERNATIONAL)
|
||||
ENDIF(WITH_INTERNATIONAL)
|
||||
|
||||
IF(WITH_OPENEXR)
|
||||
ADD_DEFINITIONS(-DWITH_OPENEXR)
|
||||
ENDIF(WITH_OPENEXR)
|
||||
|
||||
IF(WITH_QUICKTIME)
|
||||
SET(INC ${INC} ../../quicktime ${QUICKTIME_INC})
|
||||
ADD_DEFINITIONS(-DWITH_QUICKTIME)
|
||||
ENDIF(WITH_QUICKTIME)
|
||||
|
||||
IF(WITH_FFMPEG)
|
||||
SET(INC ${INC} ${FFMPEG_INC})
|
||||
ADD_DEFINITIONS(-DWITH_FFMPEG)
|
||||
ENDIF(WITH_FFMPEG)
|
||||
|
||||
IF(WITH_PYTHON)
|
||||
SET(INC ${INC} ../../python ${PYTHON_INC})
|
||||
ELSE(WITH_PYTHON)
|
||||
ADD_DEFINITIONS(-DDISABLE_PYTHON)
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(WITH_BUILDINFO)
|
||||
ADD_DEFINITIONS(-DNAN_BUILDINFO)
|
||||
ENDIF(WITH_BUILDINFO)
|
||||
|
||||
BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}")
|
||||
|
||||
BLENDERLIB(bf_editor_screen "${SRC}" "${INC}")
|
||||
|
@ -4,17 +4,12 @@ Import ('env')
|
||||
sources = env.Glob('*.c')
|
||||
|
||||
incs = '../include ../../blenlib ../../blenkernel ../../blenfont ../../makesdna ../../imbuf'
|
||||
incs += ' ../../blenloader ../../windowmanager ../../python ../../makesrna ../../gpu'
|
||||
incs += ' ../../blenloader ../../windowmanager ../../makesrna ../../gpu'
|
||||
incs += ' ../../render/extern/include'
|
||||
incs += ' #/intern/guardedalloc #/extern/glew/include'
|
||||
|
||||
defs = ''
|
||||
|
||||
if not env['WITH_BF_PYTHON']:
|
||||
defs += 'DISABLE_PYTHON'
|
||||
if env['WITH_BF_OPENEXR']:
|
||||
defs += ' WITH_OPENEXR'
|
||||
|
||||
if env['OURPLATFORM'] == 'linux2':
|
||||
cflags='-pthread'
|
||||
incs += ' ../../../extern/binreloc/include'
|
||||
@ -22,8 +17,4 @@ if env['OURPLATFORM'] == 'linux2':
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
|
||||
if env['OURPLATFORM'] == 'darwin':
|
||||
if env['WITH_BF_OPENMP']:
|
||||
defs += ' PARALLEL=1'
|
||||
|
||||
env.BlenderLib ( 'bf_editors_screen', sources, Split(incs), Split(defs), libtype=['core'], priority=[105] )
|
||||
|
@ -59,10 +59,6 @@
|
||||
#include "UI_resources.h"
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
#include "BPY_extern.h"
|
||||
#endif
|
||||
|
||||
#include "screen_intern.h"
|
||||
|
||||
/* general area and region code */
|
||||
|
@ -1326,6 +1326,9 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, char edge)
|
||||
* prevents dragging regions into other opposite regions */
|
||||
for (ar=sa->regionbase.first; ar; ar=ar->next)
|
||||
{
|
||||
if (ar == scalear)
|
||||
continue;
|
||||
|
||||
if (scalear->alignment == RGN_ALIGN_TOP && ar->alignment == RGN_ALIGN_BOTTOM)
|
||||
dist -= ar->winy;
|
||||
else if (scalear->alignment == RGN_ALIGN_BOTTOM && ar->alignment == RGN_ALIGN_TOP)
|
||||
@ -1334,8 +1337,15 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, char edge)
|
||||
dist -= ar->winx;
|
||||
else if (scalear->alignment == RGN_ALIGN_RIGHT && ar->alignment == RGN_ALIGN_LEFT)
|
||||
dist -= ar->winx;
|
||||
|
||||
/* case of regions in regions, like operator properties panel */
|
||||
/* these can sit on top of other regions such as headers, so account for this */
|
||||
else if (edge == 'b' && scalear->alignment & RGN_ALIGN_TOP && ar->alignment == RGN_ALIGN_TOP && ar->regiontype == RGN_TYPE_HEADER)
|
||||
dist -= ar->winy;
|
||||
else if (edge == 't' && scalear->alignment & RGN_ALIGN_BOTTOM && ar->alignment == RGN_ALIGN_BOTTOM && ar->regiontype == RGN_TYPE_HEADER)
|
||||
dist -= ar->winy;
|
||||
}
|
||||
|
||||
|
||||
return dist;
|
||||
}
|
||||
|
||||
@ -1561,6 +1571,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
|
||||
ActKeyColumn *ak;
|
||||
float cfra= (scene)? (float)(CFRA) : 0.0f;
|
||||
short next= RNA_boolean_get(op->ptr, "next");
|
||||
short done = 0;
|
||||
|
||||
/* sanity checks */
|
||||
if (scene == NULL)
|
||||
@ -1579,15 +1590,27 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
|
||||
BLI_dlrbTree_linkedlist_sync(&keys);
|
||||
|
||||
/* find matching keyframe in the right direction */
|
||||
if (next)
|
||||
ak= (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfra);
|
||||
else
|
||||
ak= (ActKeyColumn *)BLI_dlrbTree_search_prev(&keys, compare_ak_cfraPtr, &cfra);
|
||||
do {
|
||||
if (next)
|
||||
ak= (ActKeyColumn *)BLI_dlrbTree_search_next(&keys, compare_ak_cfraPtr, &cfra);
|
||||
else
|
||||
ak= (ActKeyColumn *)BLI_dlrbTree_search_prev(&keys, compare_ak_cfraPtr, &cfra);
|
||||
|
||||
if (ak) {
|
||||
if (CFRA != (int)ak->cfra) {
|
||||
/* this changes the frame, so set the frame and we're done */
|
||||
CFRA= (int)ak->cfra;
|
||||
done = 1;
|
||||
}
|
||||
else {
|
||||
/* make this the new starting point for the search */
|
||||
cfra = ak->cfra;
|
||||
}
|
||||
}
|
||||
} while ((ak != NULL) && (done == 0));
|
||||
|
||||
/* set the new frame (if keyframe found) */
|
||||
if (ak)
|
||||
CFRA= (int)ak->cfra;
|
||||
else
|
||||
/* any success? */
|
||||
if (done == 0)
|
||||
BKE_report(op->reports, RPT_INFO, "No more keyframes to jump to in this direction");
|
||||
|
||||
/* free temp stuff */
|
||||
@ -2149,18 +2172,22 @@ static int region_quadview_exec(bContext *C, wmOperator *op)
|
||||
|
||||
rv3d= ar->regiondata;
|
||||
rv3d->viewlock= RV3D_LOCKED; rv3d->view= RV3D_VIEW_FRONT; rv3d->persp= RV3D_ORTHO;
|
||||
if (rv3d->localvd) { rv3d->localvd->view = rv3d->view; rv3d->localvd->persp = rv3d->persp; }
|
||||
|
||||
ar= ar->next;
|
||||
rv3d= ar->regiondata;
|
||||
rv3d->viewlock= RV3D_LOCKED; rv3d->view= RV3D_VIEW_TOP; rv3d->persp= RV3D_ORTHO;
|
||||
if (rv3d->localvd) { rv3d->localvd->view = rv3d->view; rv3d->localvd->persp = rv3d->persp; }
|
||||
|
||||
ar= ar->next;
|
||||
rv3d= ar->regiondata;
|
||||
rv3d->viewlock= RV3D_LOCKED; rv3d->view= RV3D_VIEW_RIGHT; rv3d->persp= RV3D_ORTHO;
|
||||
if (rv3d->localvd) { rv3d->localvd->view = rv3d->view; rv3d->localvd->persp = rv3d->persp; }
|
||||
|
||||
ar= ar->next;
|
||||
rv3d= ar->regiondata;
|
||||
rv3d->view= RV3D_VIEW_CAMERA; rv3d->persp= RV3D_CAMOB;
|
||||
if (rv3d->localvd) {rv3d->localvd->view = rv3d->view; rv3d->localvd->persp = rv3d->persp; }
|
||||
}
|
||||
|
||||
#ifdef WM_FAST_DRAW
|
||||
|
@ -171,7 +171,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
|
||||
|
||||
ot->flag= 0;
|
||||
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE);
|
||||
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, 0);
|
||||
RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
|
||||
}
|
||||
|
||||
|
41
source/blender/editors/sculpt_paint/CMakeLists.txt
Normal file
41
source/blender/editors/sculpt_paint/CMakeLists.txt
Normal file
@ -0,0 +1,41 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../../blenkernel
|
||||
../../imbuf
|
||||
../../gpu
|
||||
../../blenlib
|
||||
../include
|
||||
../../../../intern/guardedalloc
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
../../render/extern/include
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
SET(INC ${INC} ${PTHREADS_INC})
|
||||
ENDIF(WIN32)
|
||||
|
||||
BLENDERLIB(bf_editor_sculpt_paint "${SRC}" "${INC}")
|
35
source/blender/editors/sound/CMakeLists.txt
Normal file
35
source/blender/editors/sound/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
||||
# $Id: CMakeLists.txt 12931 2007-12-17 18:20:48Z theeth $
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# Contributor(s): Jacques Beaurain.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
FILE(GLOB SRC *.c)
|
||||
|
||||
SET(INC
|
||||
../../blenkernel
|
||||
../../blenlib
|
||||
../include
|
||||
../../../../intern/guardedalloc
|
||||
../../../../intern/audaspace/intern
|
||||
../../makesdna
|
||||
../../makesrna
|
||||
../../windowmanager
|
||||
)
|
||||
|
||||
BLENDERLIB(bf_editor_sound "${SRC}" "${INC}")
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user