Merged changes in the trunk up to revision 49986.

This commit is contained in:
Tamito Kajiyama 2012-08-18 15:20:35 +00:00
commit 22b30da565
346 changed files with 4092 additions and 76123 deletions

@ -126,6 +126,7 @@ option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid d
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" 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)
@ -976,9 +977,10 @@ elseif(WIN32)
# normally cached but not since we include them with blender
set(PYTHON_VERSION 3.2) # CACHE STRING)
set_lib_path(PYTHON "python")
set(PYTHON_INCLUDE_DIR ${PYTHON}/include/python${PYTHON_VERSION})
set(PYTHON_LIBRARY ${PYTHON}/lib/python32.lib) #CACHE FILEPATH
#Shared includes for both vc2008 and vc2010
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/include/python${PYTHON_VERSION})
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
@ -988,7 +990,7 @@ elseif(WIN32)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
if(MSVC10)
set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
set(BOOST_LIBPATH ${BOOST}/vc2010/lib)
set(BOOST_POSTFIX "vc100-mt-s-1_49.lib")
set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_49.lib")
else()

@ -19,9 +19,9 @@
#
# ##### END GPL LICENSE BLOCK #####
# This Makefile does an out-of-source CMake build in ../build/`OS`_`CPU`
# This Makefile does an out-of-source CMake build in ../build_`OS`_`CPU`
# eg:
# ../build/Linux_i386
# ../build_linux_i386
# This is for users who like to configure & build blender with a single command.
@ -40,7 +40,7 @@ ifndef BUILD_CMAKE_ARGS
endif
ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build_$(OS_NCASE)
endif

@ -450,9 +450,12 @@ if not os.path.isdir ( B.root_build_dir):
###################################
if not os.path.isdir ( B.root_build_dir + 'data_headers'):
os.makedirs ( B.root_build_dir + 'data_headers' )
if not os.path.isdir ( B.root_build_dir + 'data_sources'):
os.makedirs ( B.root_build_dir + 'data_sources' )
# use for includes
env['DATA_HEADERS'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_headers")
def ensure_data(FILE_FROM, FILE_TO, VAR_NAME):
env['DATA_SOURCES'] = os.path.join(os.path.abspath(env['BF_BUILDDIR']), "data_sources")
def data_to_c(FILE_FROM, FILE_TO, VAR_NAME):
if os.sep == "\\":
FILE_FROM = FILE_FROM.replace("/", "\\")
FILE_TO = FILE_TO.replace("/", "\\")
@ -483,9 +486,69 @@ def ensure_data(FILE_FROM, FILE_TO, VAR_NAME):
fpin.close()
fpout.close()
ensure_data("source/blender/compositor/operations/COM_OpenCLKernels.cl",
B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
"clkernelstoh_COM_OpenCLKernels_cl")
def data_to_c_simple(FILE_FROM):
filename_only = os.path.basename(FILE_FROM)
FILE_TO = os.path.join(env['DATA_SOURCES'], filename_only + ".c")
VAR_NAME = "datatoc_" + filename_only.replace(".", "_")
data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
B.root_build_dir + "data_headers/COM_OpenCLKernels.cl.h",
"datatoc_COM_OpenCLKernels_cl")
data_to_c_simple("release/datafiles/startup.blend")
data_to_c_simple("release/datafiles/preview.blend")
# --- glsl ---
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
# --- blender ---
data_to_c_simple("release/datafiles/bfont.pfb")
data_to_c_simple("release/datafiles/bfont.ttf")
data_to_c_simple("release/datafiles/bmonofont.ttf")
data_to_c_simple("release/datafiles/splash.png")
data_to_c_simple("release/datafiles/blender_icons.png")
data_to_c_simple("release/datafiles/prvicons.png")
data_to_c_simple("release/datafiles/brushicons/add.png")
data_to_c_simple("release/datafiles/brushicons/blob.png")
data_to_c_simple("release/datafiles/brushicons/blur.png")
data_to_c_simple("release/datafiles/brushicons/clay.png")
data_to_c_simple("release/datafiles/brushicons/claystrips.png")
data_to_c_simple("release/datafiles/brushicons/clone.png")
data_to_c_simple("release/datafiles/brushicons/crease.png")
data_to_c_simple("release/datafiles/brushicons/darken.png")
data_to_c_simple("release/datafiles/brushicons/draw.png")
data_to_c_simple("release/datafiles/brushicons/fill.png")
data_to_c_simple("release/datafiles/brushicons/flatten.png")
data_to_c_simple("release/datafiles/brushicons/grab.png")
data_to_c_simple("release/datafiles/brushicons/inflate.png")
data_to_c_simple("release/datafiles/brushicons/layer.png")
data_to_c_simple("release/datafiles/brushicons/lighten.png")
data_to_c_simple("release/datafiles/brushicons/mask.png")
data_to_c_simple("release/datafiles/brushicons/mix.png")
data_to_c_simple("release/datafiles/brushicons/multiply.png")
data_to_c_simple("release/datafiles/brushicons/nudge.png")
data_to_c_simple("release/datafiles/brushicons/pinch.png")
data_to_c_simple("release/datafiles/brushicons/scrape.png")
data_to_c_simple("release/datafiles/brushicons/smear.png")
data_to_c_simple("release/datafiles/brushicons/smooth.png")
data_to_c_simple("release/datafiles/brushicons/snake_hook.png")
data_to_c_simple("release/datafiles/brushicons/soften.png")
data_to_c_simple("release/datafiles/brushicons/subtract.png")
data_to_c_simple("release/datafiles/brushicons/texdraw.png")
data_to_c_simple("release/datafiles/brushicons/thumb.png")
data_to_c_simple("release/datafiles/brushicons/twist.png")
data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
##### END DATAFILES ##########

@ -24,7 +24,7 @@
"""
Example linux usage
python .~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
python3 ~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
Windows not supported so far
"""

@ -18,6 +18,7 @@ set(WITH_LIBMV OFF CACHE FORCE BOOL)
set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
set(WITH_COMPOSITOR OFF CACHE FORCE BOOL)
set(WITH_GHOST_XDND OFF CACHE FORCE BOOL)
set(WITH_IK_SOLVER OFF CACHE FORCE BOOL)
set(WITH_IK_ITASC OFF CACHE FORCE BOOL)
set(WITH_IMAGE_CINEON OFF CACHE FORCE BOOL)
set(WITH_IMAGE_DDS OFF CACHE FORCE BOOL)

@ -1,25 +0,0 @@
# cmake script, to be called on its own with 3 defined args
#
# - FILE_FROM
# - FILE_TO
# - VAR_NAME
# not highly optimal, may replace with generated C program like makesdna
file(READ ${FILE_FROM} file_from_string HEX)
string(LENGTH ${file_from_string} _max_index)
math(EXPR size_on_disk ${_max_index}/2)
file(REMOVE ${FILE_TO})
file(APPEND ${FILE_TO} "int ${VAR_NAME}_size = ${size_on_disk};\n")
file(APPEND ${FILE_TO} "char ${VAR_NAME}[] = {")
set(_index 0)
while(NOT _index EQUAL _max_index)
string(SUBSTRING "${file_from_string}" ${_index} 2 _pair)
file(APPEND ${FILE_TO} "0x${_pair},")
math(EXPR _index ${_index}+2)
endwhile()
# null terminator not essential but good if we want plane strings encoded
file(APPEND ${FILE_TO} "0x00};\n")

@ -638,7 +638,7 @@ macro(blender_project_hack_post)
# --------------
# MINGW HACK END
if (_reset_standard_libraries)
# Must come after project(...)
# Must come after projecINCt(...)
#
# MINGW workaround for -ladvapi32 being included which surprisingly causes
# string formatting of floats, eg: printf("%.*f", 3, value). to crash blender
@ -727,29 +727,43 @@ macro(set_lib_path
endmacro()
# not highly optimal, may replace with generated C program like makesdna
function(data_to_c
file_from file_to var_name)
macro(data_to_c
file_from file_to
list_to_add)
file(READ ${file_from} file_from_string HEX)
string(LENGTH ${file_from_string} _max_index)
math(EXPR size_on_disk ${_max_index}/2)
list(APPEND ${list_to_add} ${file_to})
file(REMOVE ${file_to})
get_filename_component(_file_to_path ${file_to} PATH)
file(APPEND ${file_to} "int ${var_name}_size = ${size_on_disk};\n")
file(APPEND ${file_to} "char ${var_name}[] = {")
add_custom_command(
OUTPUT ${file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${file_from} ${file_to}
DEPENDS ${file_from} datatoc)
unset(_file_to_path)
endmacro()
set(_index 0)
while(NOT _index EQUAL _max_index)
string(SUBSTRING "${file_from_string}" ${_index} 2 _pair)
file(APPEND ${file_to} "0x${_pair},")
math(EXPR _index ${_index}+2)
endwhile()
file(APPEND ${file_to} "};\n")
endfunction()
# same as above but generates the var name and output automatic.
macro(data_to_c_simple
file_from
list_to_add)
# eg
# data_to_c("/home/guest/test.txt" "/home/guest/test.txt.h" "this_is_data")
# remove ../'s
get_filename_component(_file_from ${CMAKE_CURRENT_SOURCE_DIR}/${file_from} REALPATH)
get_filename_component(_file_to ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.c REALPATH)
list(APPEND ${list_to_add} ${_file_to})
get_filename_component(_file_to_path ${_file_to} PATH)
add_custom_command(
OUTPUT ${_file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/datatoc ${_file_from} ${_file_to}
DEPENDS ${_file_from} datatoc)
unset(_file_from)
unset(_file_to)
unset(_file_to_path)
endmacro()

@ -105,6 +105,11 @@ BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = '/usr'
BF_LAPACK_LIB = 'lapack3gf blas clapack'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_FREETYPE = '/usr'
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
BF_FREETYPE_LIB = 'freetype'

@ -101,6 +101,11 @@ BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = LIBDIR + '/lapack'
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

@ -97,6 +97,11 @@ BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
WITH_BF_ELTOPO = False
BF_LAPACK = LIBDIR + '/lapack'
BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

@ -159,6 +159,10 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_FFTW3_LIBPATH'])
if lenv['WITH_BF_STATICFFTW3']:
statlibs += Split(lenv['BF_FFTW3_LIB_STATIC'])
if lenv['WITH_BF_ELTOPO']:
libincs += Split(lenv['BF_LAPACK_LIBPATH'])
if lenv['WITH_BF_STATICLAPACK']:
statlibs += Split(lenv['BF_LAPACK_LIB_STATIC'])
if lenv['WITH_BF_FFMPEG'] and lenv['WITH_BF_STATICFFMPEG']:
statlibs += Split(lenv['BF_FFMPEG_LIB_STATIC'])
if lenv['WITH_BF_INTERNATIONAL']:
@ -264,6 +268,8 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_SNDFILE_LIB'])
if lenv['WITH_BF_FFTW3'] and not lenv['WITH_BF_STATICFFTW3']:
syslibs += Split(lenv['BF_FFTW3_LIB'])
if lenv['WITH_BF_ELTOPO']:
syslibs += Split(lenv['BF_LAPACK_LIB'])
if lenv['WITH_BF_SDL']:
syslibs += Split(lenv['BF_SDL_LIB'])
if not lenv['WITH_BF_STATICOPENGL']:

@ -120,7 +120,7 @@ def validate_arguments(args, bc):
'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
'WITH_BF_GAMEENGINE',
'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
'WITH_BF_ELTOPO',
'WITH_BF_ELTOPO', 'BF_LAPACK', 'BF_LAPACK_LIB', 'BF_LAPACK_LIBPATH', 'BF_LAPACK_LIB_STATIC',
'BF_WINTAB', 'BF_WINTAB_INC',
'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
@ -393,7 +393,13 @@ def read_opts(env, cfg, args):
(BoolVariable('WITH_BF_GAMEENGINE', 'Build with gameengine' , False)),
(BoolVariable('WITH_BF_BULLET', 'Use Bullet if true', True)),
(BoolVariable('WITH_BF_ELTOPO', 'Use Eltopo collision library if true', False)),
('BF_LAPACK', 'LAPACK base path', ''),
('BF_LAPACK_LIB', 'LAPACK library', ''),
('BF_LAPACK_LIB_STATIC', 'LAPACK library', ''),
('BF_LAPACK_LIBPATH', 'LAPACK library path', ''),
(BoolVariable('WITH_BF_STATICLAPACK', 'Staticly link to LAPACK', False)),
('BF_BULLET', 'Bullet base dir', ''),
('BF_BULLET_INC', 'Bullet include path', ''),

@ -28,7 +28,6 @@ add_subdirectory(ghost)
add_subdirectory(guardedalloc)
add_subdirectory(moto)
add_subdirectory(memutil)
add_subdirectory(iksolver)
add_subdirectory(opennl)
add_subdirectory(mikktspace)
add_subdirectory(raskter)
@ -58,6 +57,10 @@ if(WITH_MOD_BOOLEAN)
add_subdirectory(bsp)
endif()
if(WITH_IK_SOLVER)
add_subdirectory(iksolver)
endif()
if(WITH_IK_ITASC)
add_subdirectory(itasc)
endif()

@ -38,7 +38,7 @@
inline unsigned int CTR_Hash(void *inDWord)
{
size_t key = (size_t)inDWord;
return (unsigned int)(key ^ (key>>4));
return (unsigned int)(key ^ (key >> 4));
}
class CTR_HashedPtr

@ -26,7 +26,7 @@
*/
/** \ingroup GHOST
*
* \file GHOST_C-api.h
* \file GHOST_C-api.h
* \brief GHOST C-API function and type declarations.
*/
@ -43,7 +43,7 @@ extern "C" {
* Creates a "handle" for a C++ GHOST object.
* A handle is just an opaque pointer to an empty struct.
* In the API the pointer is casted to the actual C++ class.
* \param name Name of the handle to create.
* \param name Name of the handle to create.
*/
GHOST_DECLARE_HANDLE(GHOST_SystemHandle);
@ -56,48 +56,47 @@ GHOST_DECLARE_HANDLE(GHOST_EventConsumerHandle);
/**
* Definition of a callback routine that receives events.
* @param event The event received.
* @param userdata The callback's user data, supplied to GHOST_CreateSystem.
* \param event The event received.
* \param userdata The callback's user data, supplied to GHOST_CreateSystem.
*/
typedef int (*GHOST_EventCallbackProcPtr)(GHOST_EventHandle event, GHOST_TUserDataPtr userdata);
/**
* Creates the one and only system.
* @return a handle to the system.
* \return a handle to the system.
*/
extern GHOST_SystemHandle GHOST_CreateSystem(void);
/**
* Disposes the one and only system.
* @param systemhandle The handle to the system
* @return An indication of success.
* \param systemhandle The handle to the system
* \return An indication of success.
*/
extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
/**
* Creates an event consumer object
* @param eventCallback The event callback routine.
* @param userdata Pointer to user data returned to the callback routine.
* \param eventCallback The event callback routine.
* \param userdata Pointer to user data returned to the callback routine.
*/
extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userdata);
/**
* Disposes an event consumer object
* @param consumerhandle Handle to the event consumer.
* @return An indication of success.
* \param consumerhandle Handle to the event consumer.
* \return An indication of success.
*/
extern GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle);
/**
* Returns the system time.
* Returns the number of milliseconds since the start of the system process.
* Based on ANSI clock() routine.
* @param systemhandle The handle to the system
* @return The number of milliseconds.
* \param systemhandle The handle to the system
* \return The number of milliseconds.
*/
extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
@ -105,12 +104,12 @@ extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
* Installs a timer.
* Note that, on most operating systems, messages need to be processed in order
* for the timer callbacks to be invoked.
* @param systemhandle The handle to the system
* @param delay The time to wait for the first call to the timerProc (in milliseconds)
* @param interval The interval between calls to the timerProc (in milliseconds)
* @param timerProc The callback invoked when the interval expires,
* @param userData Placeholder for user data.
* @return A timer task (0 if timer task installation failed).
* \param systemhandle The handle to the system
* \param delay The time to wait for the first call to the timerProc (in milliseconds)
* \param interval The interval between calls to the timerProc (in milliseconds)
* \param timerProc The callback invoked when the interval expires,
* \param userData Placeholder for user data.
* \return A timer task (0 if timer task installation failed).
*/
extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
GHOST_TUns64 delay,
@ -120,9 +119,9 @@ extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
/**
* Removes a timer.
* @param systemhandle The handle to the system
* @param timerTask Timer task to be removed.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param timerTask Timer task to be removed.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
GHOST_TimerTaskHandle timertaskhandle);
@ -133,17 +132,17 @@ extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
/**
* Returns the number of displays on this system.
* @param systemhandle The handle to the system
* @return The number of displays.
* \param systemhandle The handle to the system
* \return The number of displays.
*/
extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
/**
* Returns the dimensions of the main display on this system.
* @param systemhandle The handle to the system
* @param width A pointer the width gets put in
* @param height A pointer the height gets put in
* @return void.
* \param systemhandle The handle to the system
* \param width A pointer the width gets put in
* \param height A pointer the height gets put in
* \return void.
*/
extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32 *width,
@ -153,17 +152,17 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
* Create a new window.
* The new window is added to the list of windows managed.
* Never explicitly delete the window, use disposeWindow() instead.
* @param systemhandle The handle to the system
* @param title The name of the window (displayed in the title bar of the window if the OS supports it).
* @param left The coordinate of the left edge of the window.
* @param top The coordinate of the top edge of the window.
* @param width The width the window.
* @param height The height the window.
* @param state The state of the window when opened.
* @param type The type of drawing context installed in this window.
* @param stereoVisual Stereo visual for quad buffered stereo.
* @param numOfAASamples Number of samples used for AA (zero if no AA)
* @return A handle to the new window ( == NULL if creation failed).
* \param systemhandle The handle to the system
* \param title The name of the window (displayed in the title bar of the window if the OS supports it).
* \param left The coordinate of the left edge of the window.
* \param top The coordinate of the top edge of the window.
* \param width The width the window.
* \param height The height the window.
* \param state The state of the window when opened.
* \param type The type of drawing context installed in this window.
* \param stereoVisual Stereo visual for quad buffered stereo.
* \param numOfAASamples Number of samples used for AA (zero if no AA)
* \return A handle to the new window ( == NULL if creation failed).
*/
extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
const char *title,
@ -178,43 +177,43 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
/**
* Returns the window user data.
* @param windowhandle The handle to the window
* @return The window user data.
* \param windowhandle The handle to the window
* \return The window user data.
*/
extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle);
/**
* Changes the window user data.
* @param windowhandle The handle to the window
* @param data The window user data.
* \param windowhandle The handle to the window
* \param data The window user data.
*/
extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
GHOST_TUserDataPtr userdata);
/**
* Dispose a window.
* @param systemhandle The handle to the system
* @param window Handle to the window to be disposed.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param windowhandle Handle to the window to be disposed.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle);
/**
* Returns whether a window is valid.
* @param systemhandle The handle to the system
* @param window Handle to the window to be checked.
* @return Indication of validity.
* \param systemhandle The handle to the system
* \param windowhandle Handle to the window to be checked.
* \return Indication of validity.
*/
extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle);
/**
* Begins full screen mode.
* @param systemhandle The handle to the system
* @param setting The new setting of the display.
* @return A handle to the window displayed in full screen.
* This window is invalid after full screen has been ended.
* \param systemhandle The handle to the system
* \param setting The new setting of the display.
* \return A handle to the window displayed in full screen.
* This window is invalid after full screen has been ended.
*/
extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
GHOST_DisplaySetting *setting,
@ -222,15 +221,15 @@ extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
/**
* Ends full screen mode.
* @param systemhandle The handle to the system
* @return Indication of success.
* \param systemhandle The handle to the system
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle);
/**
* Returns current full screen mode status.
* @param systemhandle The handle to the system
* @return The current status.
* \param systemhandle The handle to the system
* \return The current status.
*/
extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
@ -240,34 +239,34 @@ extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
/**
* Retrieves events from the system and stores them in the queue.
* @param systemhandle The handle to the system
* @param waitForEvent Boolean to indicate that ProcessEvents should
* \param systemhandle The handle to the system
* \param waitForEvent Boolean to indicate that ProcessEvents should
* wait (block) until the next event before returning.
* @return Indication of the presence of events.
* \return Indication of the presence of events.
*/
extern int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent);
/**
* Retrieves events from the queue and send them to the event consumers.
* @param systemhandle The handle to the system
* @return Indication of the presence of events.
* \param systemhandle The handle to the system
* \return Indication of the presence of events.
*/
extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
/**
* Adds the given event consumer to our list.
* @param systemhandle The handle to the system
* @param consumerhandle The event consumer to add.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param consumerhandle The event consumer to add.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle);
/**
* Remove the given event consumer to our list.
* @param systemhandle The handle to the system
* @param consumerhandle The event consumer to remove.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param consumerhandle The event consumer to remove.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle);
@ -278,14 +277,14 @@ extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
/**
* Sets the progress bar value displayed in the window/application icon
* @param windowhandle The handle to the window
* @param progress The progress % (0.0 to 1.0)
* \param windowhandle The handle to the window
* \param progress The progress % (0.0 to 1.0)
*/
extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
/**
* Hides the progress bar in the icon
* @param windowhandle The handle to the window
* \param windowhandle The handle to the window
*/
extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
@ -295,28 +294,28 @@ extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
/**
* Returns the current cursor shape.
* @param windowhandle The handle to the window
* @return The current cursor shape.
* \param windowhandle The handle to the window
* \return The current cursor shape.
*/
extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle);
/**
* Set the shape of the cursor.
* @param windowhandle The handle to the window
* @param cursor The new cursor shape type id.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param cursor The new cursor shape type id.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
GHOST_TStandardCursor cursorshape);
/**
* Set the shape of the cursor to a custom cursor.
* @param windowhandle The handle to the window
* @param bitmap The bitmap data for the cursor.
* @param mask The mask data for the cursor.
* @param hotX The X coordinate of the cursor hotspot.
* @param hotY The Y coordinate of the cursor hotspot.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param bitmap The bitmap data for the cursor.
* \param mask The mask data for the cursor.
* \param hotX The X coordinate of the cursor hotspot.
* \param hotY The Y coordinate of the cursor hotspot.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
GHOST_TUns8 bitmap[16][2],
@ -325,15 +324,15 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
int hotY);
/**
* Set the shape of the cursor to a custom cursor of specified size.
* @param windowhandle The handle to the window
* @param bitmap The bitmap data for the cursor.
* @param mask The mask data for the cursor.
* @param sizex The width of the cursor
* @param sizey The height of the cursor
* @param hotX The X coordinate of the cursor hotspot.
* @param hotY The Y coordinate of the cursor hotspot.
* @param fg_color, bg_color Colors of the cursor
* @return Indication of success.
* \param windowhandle The handle to the window
* \param bitmap The bitmap data for the cursor.
* \param mask The mask data for the cursor.
* \param sizex The width of the cursor
* \param sizey The height of the cursor
* \param hotX The X coordinate of the cursor hotspot.
* \param hotY The Y coordinate of the cursor hotspot.
* \param fg_color, bg_color Colors of the cursor
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
GHOST_TUns8 *bitmap,
@ -344,26 +343,26 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhand
/**
* Returns the visibility state of the cursor.
* @param windowhandle The handle to the window
* @return The visibility state of the cursor.
* \param windowhandle The handle to the window
* \return The visibility state of the cursor.
*/
extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
/**
* Shows or hides the cursor.
* @param windowhandle The handle to the window
* @param visible The new visibility state of the cursor.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param visible The new visibility state of the cursor.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
int visible);
/**
* Returns the current location of the cursor (location in screen coordinates)
* @param systemhandle The handle to the system
* @param x The x-coordinate of the cursor.
* @param y The y-coordinate of the cursor.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param x The x-coordinate of the cursor.
* \param y The y-coordinate of the cursor.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
GHOST_TInt32 *x,
@ -372,10 +371,10 @@ extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
/**
* Updates the location of the cursor (location in screen coordinates).
* Not all operating systems allow the cursor to be moved (without the input device being moved).
* @param systemhandle The handle to the system
* @param x The x-coordinate of the cursor.
* @param y The y-coordinate of the cursor.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param x The x-coordinate of the cursor.
* \param y The y-coordinate of the cursor.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
GHOST_TInt32 x,
@ -385,10 +384,10 @@ extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
* Grabs the cursor for a modal operation, to keep receiving
* events when the mouse is outside the window. X11 only, others
* do this automatically.
* @param windowhandle The handle to the window
* @param mode The new grab state of the cursor.
* @param bounds The grab ragion (optional) - left,top,right,bottom
* @return Indication of success.
* \param windowhandle The handle to the window
* \param mode The new grab state of the cursor.
* \param bounds The grab ragion (optional) - left,top,right,bottom
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
GHOST_TGrabCursorMode mode,
@ -400,10 +399,10 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
/**
* Returns the state of a modifier key (ouside the message queue).
* @param systemhandle The handle to the system
* @param mask The modifier key state to retrieve.
* @param isDown Pointer to return modifier state in.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param mask The modifier key state to retrieve.
* \param isDown Pointer to return modifier state in.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
GHOST_TModifierKeyMask mask,
@ -411,10 +410,10 @@ extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
/**
* Returns the state of a mouse button (ouside the message queue).
* @param systemhandle The handle to the system
* @param mask The button state to retrieve.
* @param isDown Pointer to return button state in.
* @return Indication of success.
* \param systemhandle The handle to the system
* \param mask The button state to retrieve.
* \param isDown Pointer to return button state in.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
GHOST_TButtonMask mask,
@ -429,94 +428,93 @@ extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
*/
extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept);
/**
* Returns the event type.
* @param eventhandle The handle to the event
* @return The event type.
* \param eventhandle The handle to the event
* \return The event type.
*/
extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
/**
* Returns the time this event was generated.
* @param eventhandle The handle to the event
* @return The event generation time.
* \param eventhandle The handle to the event
* \return The event generation time.
*/
extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
/**
* Returns the window this event was generated on,
* or NULL if it is a 'system' event.
* @param eventhandle The handle to the event
* @return The generating window.
* \param eventhandle The handle to the event
* \return The generating window.
*/
extern GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle);
/**
* Returns the event data.
* @param eventhandle The handle to the event
* @return The event data.
* \param eventhandle The handle to the event
* \return The event data.
*/
extern GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle);
/**
* Returns the timer callback.
* @param timertaskhandle The handle to the timertask
* @return The timer callback.
* \param timertaskhandle The handle to the timertask
* \return The timer callback.
*/
extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle);
/**
* Changes the timer callback.
* @param timertaskhandle The handle to the timertask
* @param timerProc The timer callback.
* \param timertaskhandle The handle to the timertask
* \param timerProc The timer callback.
*/
extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
GHOST_TimerProcPtr timerProc);
/**
* Returns the timer user data.
* @param timertaskhandle The handle to the timertask
* @return The timer user data.
* \param timertaskhandle The handle to the timertask
* \return The timer user data.
*/
extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle);
/**
* Changes the time user data.
* @param timertaskhandle The handle to the timertask
* @param data The timer user data.
* \param timertaskhandle The handle to the timertask
* \param data The timer user data.
*/
extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
GHOST_TUserDataPtr userData);
/**
* Returns indication as to whether the window is valid.
* @param windowhandle The handle to the window
* @return The validity of the window.
* \param windowhandle The handle to the window
* \return The validity of the window.
*/
extern int GHOST_GetValid(GHOST_WindowHandle windowhandle);
/**
* Returns the type of drawing context used in this window.
* @param windowhandle The handle to the window
* @return The current type of drawing context.
* \param windowhandle The handle to the window
* \return The current type of drawing context.
*/
extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle);
/**
* Tries to install a rendering context in this window.
* @param windowhandle The handle to the window
* @param type The type of rendering context installed.
* @return Indication as to whether installation has succeeded.
* \param windowhandle The handle to the window
* \param type The type of rendering context installed.
* \return Indication as to whether installation has succeeded.
*/
extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
GHOST_TDrawingContextType type);
/**
* Sets the title displayed in the title bar.
* @param windowhandle The handle to the window
* @param title The title to display in the title bar.
* \param windowhandle The handle to the window
* \param title The title to display in the title bar.
*/
extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
const char *title);
@ -525,57 +523,57 @@ extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
* Returns the title displayed in the title bar. The title
* should be free'd with free().
*
* @param windowhandle The handle to the window
* @return The title, free with free().
* \param windowhandle The handle to the window
* \return The title, free with free().
*/
extern char *GHOST_GetTitle(GHOST_WindowHandle windowhandle);
/**
* Returns the window rectangle dimensions.
* These are screen coordinates.
* @param windowhandle The handle to the window
* @return A handle to the bounding rectangle of the window.
* \param windowhandle The handle to the window
* \return A handle to the bounding rectangle of the window.
*/
extern GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle);
/**
* Returns the client rectangle dimensions.
* The left and top members of the rectangle are always zero.
* @param windowhandle The handle to the window
* @return A handle to the bounding rectangle of the window.
* \param windowhandle The handle to the window
* \return A handle to the bounding rectangle of the window.
*/
extern GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle);
/**
* Disposes a rectangle object
* @param rectanglehandle Handle to the rectangle.
* \param rectanglehandle Handle to the rectangle.
*/
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
/**
* Resizes client rectangle width.
* @param windowhandle The handle to the window
* @param width The new width of the client area of the window.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param width The new width of the client area of the window.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
GHOST_TUns32 width);
/**
* Resizes client rectangle height.
* @param windowhandle The handle to the window
* @param height The new height of the client area of the window.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param height The new height of the client area of the window.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
GHOST_TUns32 height);
/**
* Resizes client rectangle.
* @param windowhandle The handle to the window
* @param width The new width of the client area of the window.
* @param height The new height of the client area of the window.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param width The new width of the client area of the window.
* \param height The new height of the client area of the window.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
GHOST_TUns32 width,
@ -583,11 +581,11 @@ extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
/**
* Converts a point in screen coordinates to client rectangle coordinates
* @param windowhandle The handle to the window
* @param inX The x-coordinate on the screen.
* @param inY The y-coordinate on the screen.
* @param outX The x-coordinate in the client rectangle.
* @param outY The y-coordinate in the client rectangle.
* \param windowhandle The handle to the window
* \param inX The x-coordinate on the screen.
* \param inY The y-coordinate on the screen.
* \param outX The x-coordinate in the client rectangle.
* \param outY The y-coordinate in the client rectangle.
*/
extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
GHOST_TInt32 inX,
@ -597,11 +595,11 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
/**
* Converts a point in screen coordinates to client rectangle coordinates
* @param windowhandle The handle to the window
* @param inX The x-coordinate in the client rectangle.
* @param inY The y-coordinate in the client rectangle.
* @param outX The x-coordinate on the screen.
* @param outY The y-coordinate on the screen.
* \param windowhandle The handle to the window
* \param inX The x-coordinate in the client rectangle.
* \param inY The y-coordinate in the client rectangle.
* \param outX The x-coordinate on the screen.
* \param outY The y-coordinate on the screen.
*/
extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
GHOST_TInt32 inX,
@ -611,88 +609,88 @@ extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
/**
* Returns the state of the window (normal, minimized, maximized).
* @param windowhandle The handle to the window
* @return The state of the window.
* \param windowhandle The handle to the window
* \return The state of the window.
*/
extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
/**
* Sets the state of the window (normal, minimized, maximized).
* @param windowhandle The handle to the window
* @param state The state of the window.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param state The state of the window.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
GHOST_TWindowState state);
/**
* Sets the window "modified" status, indicating unsaved changes
* @param windowhandle The handle to the window
* @param isUnsavedChanges Unsaved changes or not
* @return Indication of success.
* \param windowhandle The handle to the window
* \param isUnsavedChanges Unsaved changes or not
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
GHOST_TUns8 isUnsavedChanges);
/**
* Sets the order of the window (bottom, top).
* @param windowhandle The handle to the window
* @param order The order of the window.
* @return Indication of success.
* \param windowhandle The handle to the window
* \param order The order of the window.
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
GHOST_TWindowOrder order);
/**
* Swaps front and back buffers of a window.
* @param windowhandle The handle to the window
* @return An intean success indicator.
* \param windowhandle The handle to the window
* \return An intean success indicator.
*/
extern GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle);
/**
* Activates the drawing context of this window.
* @param windowhandle The handle to the window
* @return An intean success indicator.
* \param windowhandle The handle to the window
* \return An intean success indicator.
*/
extern GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle);
/**
* Invalidates the contents of this window.
* @param windowhandle The handle to the window
* @return Indication of success.
* \param windowhandle The handle to the window
* \return Indication of success.
*/
extern GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle);
/**
* Returns the status of the tablet
* @param windowhandle The handle to the window
* @return Status of tablet
* \param windowhandle The handle to the window
* \return Status of tablet
*/
extern const GHOST_TabletData *GHOST_GetTabletData(GHOST_WindowHandle windowhandle);
/**
* Access to rectangle width.
* @param rectanglehandle The handle to the rectangle
* @return width of the rectangle
* \param rectanglehandle The handle to the rectangle
* \return width of the rectangle
*/
extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
/**
* Access to rectangle height.
* @param rectanglehandle The handle to the rectangle
* @return height of the rectangle
* \param rectanglehandle The handle to the rectangle
* \return height of the rectangle
*/
extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
/**
* Gets all members of the rectangle.
* @param rectanglehandle The handle to the rectangle
* @param l Pointer to return left coordinate in.
* @param t Pointer to return top coordinate in.
* @param r Pointer to return right coordinate in.
* @param b Pointer to return bottom coordinate in.
* \param rectanglehandle The handle to the rectangle
* \param l Pointer to return left coordinate in.
* \param t Pointer to return top coordinate in.
* \param r Pointer to return right coordinate in.
* \param b Pointer to return bottom coordinate in.
*/
extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 *l,
@ -702,11 +700,11 @@ extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
/**
* Sets all members of the rectangle.
* @param rectanglehandle The handle to the rectangle
* @param l requested left coordinate of the rectangle
* @param t requested top coordinate of the rectangle
* @param r requested right coordinate of the rectangle
* @param b requested bottom coordinate of the rectangle
* \param rectanglehandle The handle to the rectangle
* \param l requested left coordinate of the rectangle
* \param t requested top coordinate of the rectangle
* \param r requested right coordinate of the rectangle
* \param b requested bottom coordinate of the rectangle
*/
extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 l,
@ -717,24 +715,24 @@ extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
/**
* Returns whether this rectangle is empty.
* Empty rectangles are rectangles that have width==0 and/or height==0.
* @param rectanglehandle The handle to the rectangle
* @return intean value (true == empty rectangle)
* \param rectanglehandle The handle to the rectangle
* \return intean value (true == empty rectangle)
*/
extern GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle);
/**
* Returns whether this rectangle is valid.
* Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
* @param rectanglehandle The handle to the rectangle
* @return intean value (true==valid rectangle)
* \param rectanglehandle The handle to the rectangle
* \return intean value (true == valid rectangle)
*/
extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle);
/**
* Grows (or shrinks the rectangle).
* The method avoids negative insets making the rectangle invalid
* @param rectanglehandle The handle to the rectangle
* @param i The amount of offset given to each extreme (negative values shrink the rectangle).
* \param rectanglehandle The handle to the rectangle
* \param i The amount of offset given to each extreme (negative values shrink the rectangle).
*/
extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 i);
@ -742,17 +740,17 @@ extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
/**
* Does a union of the rectangle given and this rectangle.
* The result is stored in this rectangle.
* @param rectanglehandle The handle to the rectangle
* @param r The rectangle that is input for the union operation.
* \param rectanglehandle The handle to the rectangle
* \param anotherrectanglehandle The rectangle that is input for the union operation.
*/
extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle);
/**
* Grows the rectangle to included a point.
* @param rectanglehandle The handle to the rectangle
* @param x The x-coordinate of the point.
* @param y The y-coordinate of the point.
* \param rectanglehandle The handle to the rectangle
* \param x The x-coordinate of the point.
* \param y The y-coordinate of the point.
*/
extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 x,
@ -761,10 +759,10 @@ extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
/**
* Returns whether the point is inside this rectangle.
* Point on the boundary is considered inside.
* @param rectanglehandle The handle to the rectangle
* @param x x-coordinate of point to test.
* @param y y-coordinate of point to test.
* @return intean value (true if point is inside).
* \param rectanglehandle The handle to the rectangle
* \param x x-coordinate of point to test.
* \param y y-coordinate of point to test.
* \return intean value (true if point is inside).
*/
extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 x,
@ -772,9 +770,9 @@ extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehan
/**
* Returns whether the rectangle is inside this rectangle.
* @param rectanglehandle The handle to the rectangle
* @param r rectangle to test.
* @return visibility (not, partially or fully visible).
* \param rectanglehandle The handle to the rectangle
* \param anotherrectanglehandle The rectangle to test.
* \return visibility (not, partially or fully visible).
*/
extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle);
@ -782,9 +780,9 @@ extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rect
/**
* Sets rectangle members.
* Sets rectangle members such that it is centered at the given location.
* @param rectanglehandle The handle to the rectangle
* @param cx requested center x-coordinate of the rectangle
* @param cy requested center y-coordinate of the rectangle
* \param rectanglehandle The handle to the rectangle
* \param cx Requested center x-coordinate of the rectangle
* \param cy Requested center y-coordinate of the rectangle
*/
extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 cx,
@ -794,11 +792,11 @@ extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
* Sets rectangle members.
* Sets rectangle members such that it is centered at the given location,
* with the width requested.
* @param rectanglehandle The handle to the rectangle
* @param cx requested center x-coordinate of the rectangle
* @param cy requested center y-coordinate of the rectangle
* @param w requested width of the rectangle
* @param h requested height of the rectangle
* \param rectanglehandle The handle to the rectangle
* \param cx requested center x-coordinate of the rectangle
* \param cy requested center y-coordinate of the rectangle
* \param w requested width of the rectangle
* \param h requested height of the rectangle
*/
extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 cx,
@ -810,23 +808,23 @@ extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
* Clips a rectangle.
* Updates the rectangle given such that it will fit within this one.
* This can result in an empty rectangle.
* @param rectanglehandle The handle to the rectangle
* @param r the rectangle to clip
* @return whether clipping has occurred
* \param rectanglehandle The handle to the rectangle
* \param anotherrectanglehandle The rectangle to clip
* \return Whether clipping has occurred
*/
extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle);
/**
* Return the data from the clipboad
* @param return the selection instead, X11 only feature
* @return clipboard data
* \param selection Boolean to return the selection instead, X11 only feature.
* \return clipboard data
*/
extern GHOST_TUns8 *GHOST_getClipboard(int selection);
/**
* Put data to the Clipboard
* @param set the selection instead, X11 only feature
* \param set the selection instead, X11 only feature
*/
extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
@ -834,12 +832,13 @@ extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
/**
* Toggles console
* @action 0 - Hides
* 1 - Shows
* 2 - Toggles
* 3 - Hides if it runs not from command line
* * - Does nothing
* @return current status (1 -visible, 0 - hidden)
* \param action
* - 0: Hides
* - 1: Shows
* - 2: Toggles
* - 3: Hides if it runs not from command line
* - *: Does nothing
* \return current status (1 -visible, 0 - hidden)
*/
extern int GHOST_toggleConsole(int action);

@ -860,7 +860,8 @@ int GHOST_toggleConsole(int action)
}
int GHOST_confirmQuit(GHOST_WindowHandle windowhandle){
int GHOST_confirmQuit(GHOST_WindowHandle windowhandle)
{
GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->confirmQuit((GHOST_IWindow *) windowhandle);
}

@ -1662,17 +1662,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
case NSKeyDown:
case NSKeyUp:
charsIgnoringModifiers = [event charactersIgnoringModifiers];
if ([charsIgnoringModifiers length]>0)
if ([charsIgnoringModifiers length] > 0) {
keyCode = convertKey([event keyCode],
[charsIgnoringModifiers characterAtIndex:0],
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
else
}
else {
keyCode = convertKey([event keyCode],0,
[event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
}
/* handling both unicode or ascii */
characters = [event characters];
if ([characters length]>0) {
if ([characters length] > 0) {
convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding];
for (int x = 0; x < [convertedCharacters length]; x++) {

@ -502,7 +502,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
if (stereoVisual) pixelFormatAttrsWindow[i++] = NSOpenGLPFAStereo;
if (numOfAASamples>0) {
if (numOfAASamples > 0) {
// Multisample anti-aliasing
pixelFormatAttrsWindow[i++] = NSOpenGLPFAMultisample;
@ -550,7 +550,7 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
}
if (numOfAASamples>0) { //Set m_numOfAASamples to the actual value
if (numOfAASamples > 0) { //Set m_numOfAASamples to the actual value
GLint gli;
[pixelFormat getValues:&gli forAttribute:NSOpenGLPFASamples forVirtualScreen:0];
if (m_numOfAASamples != (GHOST_TUns16)gli) {
@ -653,7 +653,7 @@ void GHOST_WindowCocoa::setTitle(const STR_String& title)
fileStrRange.location = [windowTitle rangeOfString:@"["].location+1;
len = [windowTitle rangeOfString:@"]"].location - fileStrRange.location;
if (len >0)
if (len > 0)
{
fileStrRange.length = len;
associatedFileName = [windowTitle substringWithRange:fileStrRange];
@ -1424,9 +1424,9 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape(GHOST_TStandardCursor sha
/** Reverse the bits in a GHOST_TUns8
static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
{
ch= ((ch>>1)&0x55) | ((ch<<1)&0xAA);
ch= ((ch>>2)&0x33) | ((ch<<2)&0xCC);
ch= ((ch>>4)&0x0F) | ((ch<<4)&0xF0);
ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
ch= ((ch >> 4) & 0x0F) | ((ch << 4) & 0xF0);
return ch;
}
*/
@ -1435,10 +1435,10 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
/** Reverse the bits in a GHOST_TUns16 */
static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
{
shrt= ((shrt>>1)&0x5555) | ((shrt<<1)&0xAAAA);
shrt= ((shrt>>2)&0x3333) | ((shrt<<2)&0xCCCC);
shrt= ((shrt>>4)&0x0F0F) | ((shrt<<4)&0xF0F0);
shrt= ((shrt>>8)&0x00FF) | ((shrt<<8)&0xFF00);
shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
shrt = ((shrt >> 4) & 0x0F0F) | ((shrt << 4) & 0xF0F0);
shrt = ((shrt >> 8) & 0x00FF) | ((shrt << 8) & 0xFF00);
return shrt;
}

@ -344,7 +344,7 @@ protected:
static HDC s_firstHDC;
/** Flag for if window has captured the mouse */
bool m_hasMouseCaptured;
/** Flag if an operator grabs the mouse with WM_cursor_grab/ungrab()
/** Flag if an operator grabs the mouse with WM_cursor_grab_enable/ungrab()
* Multiple grabs must be realesed with a single ungrab*/
bool m_hasGrabMouse;
/** Count of number of pressed buttons */

@ -1314,8 +1314,8 @@ validate()
*/
GHOST_WindowX11::
~GHOST_WindowX11(
){
~GHOST_WindowX11()
{
static Atom Primary_atom, Clipboard_atom;
Window p_owner, c_owner;
/*Change the owner of the Atoms to None if we are the owner*/

@ -110,6 +110,16 @@ extern "C" {
#endif
;
/**
* A variant of realloc which zeros new bytes
*/
void *MEM_recallocN(void *vmemh, size_t len)
#if MEM_GNU_ATTRIBUTES
__attribute__((warn_unused_result))
__attribute__((alloc_size(2)))
#endif
;
/**
* Allocate a block of memory of size len, with tag name str. The
* memory is cleared. The name must be static, because only a

@ -302,10 +302,45 @@ void *MEM_reallocN(void *vmemh, size_t len)
newp = MEM_mallocN(len, memh->name);
if (newp) {
if (len < memh->len)
if (len < memh->len) {
/* shrink */
memcpy(newp, vmemh, len);
else
}
else {
/* grow (or remain same size) */
memcpy(newp, vmemh, memh->len);
}
}
MEM_freeN(vmemh);
}
return newp;
}
void *MEM_recallocN(void *vmemh, size_t len)
{
void *newp = NULL;
if (vmemh) {
MemHead *memh = vmemh;
memh--;
newp = MEM_mallocN(len, memh->name);
if (newp) {
if (len < memh->len) {
/* shrink */
memcpy(newp, vmemh, len);
}
else {
memcpy(newp, vmemh, memh->len);
if (len > memh->len) {
/* grow */
/* zero new bytes */
memset(((char *)newp) + memh->len, 0, len - memh->len);
}
}
}
MEM_freeN(vmemh);

@ -80,7 +80,7 @@ int main (int argc, char *argv[])
for (i = 0; i < NUM_BLOCKS; i++) {
int blocksize = 10000;
char tagstring[1000];
if (verbose >1) printf("|--* Allocating block %d\n", i);
if (verbose > 1) printf("|--* Allocating block %d\n", i);
sprintf(tagstring,"Memblock no. %d : ", i);
p[i]= MEM_callocN(blocksize, strdup(tagstring));
}
@ -112,7 +112,7 @@ int main (int argc, char *argv[])
for (i = 0; i < NUM_BLOCKS; i++) {
int blocksize = 10000;
char tagstring[1000];
if (verbose >1) printf("|--* Allocating block %d\n", i);
if (verbose > 1) printf("|--* Allocating block %d\n", i);
sprintf(tagstring,"Memblock no. %d : ", i);
p[i]= MEM_callocN(blocksize, strdup(tagstring));
}

@ -73,4 +73,4 @@ set(SRC
intern/TNT/version.h
)
blender_add_lib(bf_intern_ik "${SRC}" "${INC}" "${INC_SYS}")
blender_add_lib(bf_intern_iksolver "${SRC}" "${INC}" "${INC_SYS}")

@ -5,5 +5,5 @@ sources = env.Glob('intern/*.cpp')
incs = 'intern ../moto/include ../memutil'
env.BlenderLib ('bf_intern_ik', sources, Split(incs), [], libtype=['intern','player'], priority=[100,90] )
env.BlenderLib ('bf_intern_iksolver', sources, Split(incs), [], libtype=['intern','player'], priority=[100,90] )

@ -102,7 +102,7 @@ public:
// Properties
bool IsUpper() const;
bool IsLower() const;
inline bool IsEmpty() const { return Len==0; }
inline bool IsEmpty() const { return Len == 0; }
inline int Length() const { return Len; }
// Data access
@ -122,8 +122,8 @@ public:
// Comparison
int Compare(rcSTR_String rhs) const;
int CompareNoCase(rcSTR_String rhs) const;
inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs)==0); }
inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs)==0); }
inline bool IsEqual(rcSTR_String rhs) const { return (Compare(rhs) == 0); }
inline bool IsEqualNoCase(rcSTR_String rhs) const { return (CompareNoCase(rhs) == 0); }
// Search/replace
int Find(char c, int pos = 0) const;
@ -178,12 +178,12 @@ public:
inline friend bool operator>=(rcSTR_String lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator>=(rcSTR_String lhs, const char *rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator>=(const char *lhs, rcSTR_String rhs) { return (strcmp(lhs, rhs)>=0); }
inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length())==0)); }
inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)==0); }
inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)==0); }
inline friend bool operator==(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() == rhs.Length()) && (memcmp(lhs, rhs, lhs.Length()) == 0)); }
inline friend bool operator==(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length() + 1) == 0); }
inline friend bool operator==(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length() + 1) == 0); }
inline friend bool operator!=(rcSTR_String lhs, rcSTR_String rhs) { return ((lhs.Length() != rhs.Length()) || (memcmp(lhs, rhs, lhs.Length())!=0)); }
inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length()+1)!=0); }
inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length()+1)!=0); }
inline friend bool operator!=(rcSTR_String lhs, const char *rhs) { return (memcmp(lhs, rhs, lhs.Length() + 1) != 0); }
inline friend bool operator!=(const char *lhs, rcSTR_String rhs) { return (memcmp(lhs, rhs, rhs.Length() + 1) != 0); }
// serializing
//int Serialize(pCStream stream);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

@ -256,7 +256,7 @@ def module_names(path, recursive=False):
elif filename.endswith(".py") and filename != "__init__.py":
fullpath = join(path, filename)
modules.append((filename[0:-3], fullpath))
elif ("." not in filename):
elif "." not in filename:
directory = join(path, filename)
fullpath = join(directory, "__init__.py")
if isfile(fullpath):

@ -36,6 +36,7 @@ node_type_items_dict = {}
node_type_prefix = 'NODE_'
node_group_prefix = 'GROUP_'
# Generate a list of enum items for a given node class
# Copy existing type enum, adding a prefix to distinguish from node groups
# Skip the base node group type, node groups will be added below for all existing group trees
@ -43,23 +44,25 @@ def node_type_items(node_class):
return [(node_type_prefix + item.identifier, item.name, item.description)
for item in node_class.bl_rna.properties['type'].enum_items if item.identifier != 'GROUP']
# Generate items for node group types
# Filter by the given tree_type
# Filter by the given tree_type
# Node group trees don't have a description property yet (could add this as a custom property though)
def node_group_items(tree_type):
return [(node_group_prefix + group.name, group.name, '')
for group in bpy.data.node_groups if group.type == tree_type]
# Returns the enum item list for the edited tree in the context
def node_type_items_cb(self, context):
snode = context.space_data
if not snode:
return []
return ()
tree = snode.edit_tree
if not tree:
return []
return ()
# Lists of basic node types for each
# Lists of basic node types for each
if not node_type_items_dict:
node_type_items_dict.update({
'SHADER': node_type_items(bpy.types.ShaderNode),
@ -73,7 +76,7 @@ def node_type_items_cb(self, context):
if tree.type in node_type_items_dict:
return node_type_items_dict[tree.type] + node_group_items(tree.type)
else:
return []
return ()
class NODE_OT_add_search(Operator):
@ -97,10 +100,10 @@ class NODE_OT_add_search(Operator):
# Enum item identifier has an additional prefix to distinguish base node types from node groups
item = self.type
if (item.startswith(node_type_prefix)):
if item.startswith(node_type_prefix):
# item means base node type
node = tree.nodes.new(type=item[len(node_type_prefix):])
elif (item.startswith(node_group_prefix)):
elif item.startswith(node_group_prefix):
# item means node group type
node = tree.nodes.new(type='GROUP', group=bpy.data.node_groups[item[len(node_group_prefix):]])
else:
@ -119,7 +122,7 @@ class NODE_OT_add_search(Operator):
def poll(cls, context):
space = context.space_data
# needs active node editor and a tree to add nodes to
return space.type == 'NODE_EDITOR' and space.edit_tree
return (space.type == 'NODE_EDITOR' and space.edit_tree)
def execute(self, context):
self.create_node(context)
@ -134,3 +137,33 @@ class NODE_OT_add_search(Operator):
context.window_manager.invoke_search_popup(self)
return {'CANCELLED'}
class NODE_OT_collapse_hide_unused_toggle(Operator):
'''Toggle collapsed nodes and hide unused sockets'''
bl_idname = "node.collapse_hide_unused_toggle"
bl_label = "Collapse and Hide Unused Sockets"
bl_options = {'REGISTER', 'UNDO'}
@classmethod
def poll(cls, context):
space = context.space_data
# needs active node editor and a tree
return (space.type == 'NODE_EDITOR' and space.edit_tree)
def execute(self, context):
space = context.space_data
tree = space.edit_tree
for node in tree.nodes:
if node.select:
hide = (not node.hide)
node.hide = hide
# Note: connected sockets are ignored internally
for socket in node.inputs:
socket.hide = hide
for socket in node.outputs:
socket.hide = hide
return {'FINISHED'}

@ -44,10 +44,10 @@ class MotionPathButtonsPanel():
col = split.column()
col.label(text="Display Range:")
sub = col.column(align=True)
if (mps.type == 'CURRENT_FRAME'):
if mps.type == 'CURRENT_FRAME':
sub.prop(mps, "frame_before", text="Before")
sub.prop(mps, "frame_after", text="After")
elif (mps.type == 'RANGE'):
elif mps.type == 'RANGE':
sub.prop(mps, "frame_start", text="Start")
sub.prop(mps, "frame_end", text="End")

@ -106,7 +106,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
sub.prop(curve, "resolution_v", text="Preview V")
sub.prop(curve, "render_resolution_v", text="Render V")
if (is_curve or is_text):
if is_curve or is_text:
col.label(text="Fill:")
sub = col.column()
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))

@ -322,9 +322,9 @@ class DATA_PT_area(DataButtonsPanel, Panel):
col.row().prop(lamp, "shape", expand=True)
sub = col.row(align=True)
if (lamp.shape == 'SQUARE'):
if lamp.shape == 'SQUARE':
sub.prop(lamp, "size")
elif (lamp.shape == 'RECTANGLE'):
elif lamp.shape == 'RECTANGLE':
sub.prop(lamp, "size", text="Size X")
sub.prop(lamp, "size_y", text="Size Y")

@ -215,6 +215,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.label(text="Face Count" + ": %d" % md.face_count)
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)
split = layout.split()
col = split.column()
@ -226,12 +228,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.label(text="Direction:")
col.prop(md, "direction", text="")
col.label(text="Texture Coordinates:")
col.prop(md, "texture_coords", text="")
colsub = col.column()
colsub.active = has_texture
colsub.label(text="Texture Coordinates:")
colsub.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
layout.prop(md, "texture_coords_object", text="Object")
row = layout.row()
row.active = has_texture
row.prop(md, "texture_coords_object", text="Object")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
row = layout.row()
row.active = has_texture
row.prop_search(md, "uv_layer", ob.data, "uv_textures")
layout.separator()

@ -223,7 +223,7 @@ class MASK_PT_tools():
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
props = col.operator("transform.transform", text="Shrink/Fatten")
props = col.operator("transform.transform", text="Scale Feather")
props.mode = 'MASK_SHRINKFATTEN'
col = layout.column(align=True)
@ -237,6 +237,13 @@ class MASK_PT_tools():
col.operator("mask.parent_set")
col.operator("mask.parent_clear")
col = layout.column(align=True)
col.label(text="Animation:")
col.operator("mask.shape_key_clear")
col.operator("mask.shape_key_insert")
col.operator("mask.shape_key_feather_reset")
col.operator("mask.shape_key_rekey")
class MASK_MT_mask(Menu):
bl_label = "Mask"
@ -284,7 +291,7 @@ class MASK_MT_transform(Menu):
layout.operator("transform.translate")
layout.operator("transform.rotate")
layout.operator("transform.resize")
props = layout.operator("transform.transform", text="Shrink/Fatten")
props = layout.operator("transform.transform", text="Scale Feather")
props.mode = 'MASK_SHRINKFATTEN'

@ -1008,7 +1008,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
sub.active = (part.draw_color in {'VELOCITY', 'ACCELERATION'})
sub.prop(part, "color_maximum", text="Max")
if (path):
if path:
col.prop(part, "draw_step")

@ -92,7 +92,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
layout.separator()
layout.prop(field, "guide_kink_type")
if (field.guide_kink_type != 'NONE'):
if field.guide_kink_type != 'NONE':
layout.prop(field, "guide_kink_axis")
split = layout.split()

@ -182,6 +182,7 @@ class NODE_MT_node(Menu):
layout.operator("node.preview_toggle")
layout.operator("node.hide_socket_toggle")
layout.operator("node.options_toggle")
layout.operator("node.collapse_hide_unused_toggle")
layout.separator()

@ -75,6 +75,9 @@ class SEQUENCER_HT_header(Header):
row.prop(ed, "overlay_frame", text="")
row.prop(ed, "overlay_lock", text="", icon='LOCKED')
row = layout.row()
row.prop(st, "overlay_type", text="")
row = layout.row(align=True)
props = row.operator("render.opengl", text="", icon='RENDER_STILL')
props.sequencer = True
@ -423,18 +426,24 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
'MULTICAM'}
'MULTICAM', 'ADJUSTMENT'}
def draw(self, context):
layout = self.layout
sequencer = context.scene.sequence_editor
strip = act_strip(context)
if strip.input_count > 0:
col = layout.column()
col.prop(strip, "input_1")
if strip.input_count > 1:
col.prop(strip, "input_2")
if strip.is_supports_mask:
col = layout.column()
col.prop_search(strip, "input_mask", sequencer, "sequences")
if strip.type == 'COLOR':
layout.prop(strip, "color")
@ -488,7 +497,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col = layout.column(align=True)
col.prop(strip, "use_uniform_scale")
if (strip.use_uniform_scale):
if strip.use_uniform_scale:
col = layout.column(align=True)
col.prop(strip, "scale_start_x", text="Scale")
else:
@ -765,21 +774,21 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
if strip.use_color_balance and strip.color_balance: # TODO - need to add this somehow
col = layout.column()
col.label(text="Lift:")
col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True)
col.template_color_wheel(strip.color_balance, "lift", value_slider=True, cubic=True)
row = col.row()
row.prop(strip.color_balance, "lift", text="")
row.prop(strip.color_balance, "invert_lift", text="Inverse")
col = layout.column()
col.label(text="Gamma:")
col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True)
col.template_color_wheel(strip.color_balance, "gamma", value_slider=True, lock_luminosity=True, cubic=True)
row = col.row()
row.prop(strip.color_balance, "gamma", text="")
row.prop(strip.color_balance, "invert_gamma", text="Inverse")
col = layout.column()
col.label(text="Gain:")
col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True)
col.template_color_wheel(strip.color_balance, "gain", value_slider=True, lock_luminosity=True, cubic=True)
row = col.row()
row.prop(strip.color_balance, "gain", text="")
row.prop(strip.color_balance, "invert_gain", text="Inverse")

@ -1183,6 +1183,7 @@ class VIEW3D_MT_hook(Menu):
layout.operator_context = 'EXEC_AREA'
layout.operator("object.hook_add_newob")
layout.operator("object.hook_add_selob")
layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
layout.separator()
@ -2568,7 +2569,7 @@ class VIEW3D_PT_background_image(Panel):
if bg.source == 'IMAGE':
row = box.row()
row.template_ID(bg, "image", open="image.open")
if (bg.image):
if bg.image is not None:
box.template_image(bg, "image", bg.image_user, compact=True)
has_bg = True

@ -228,7 +228,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
col = layout.column(align=True)
col.operator("transform.tilt", text="Tilt")
col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
col.operator("transform.transform", text="Scale Feather").mode = 'CURVE_SHRINKFATTEN'
col = layout.column(align=True)
col.label(text="Curve:")

@ -90,6 +90,7 @@ set(SRC_DNA_INC
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_mask_types.h
)
add_subdirectory(datatoc)
add_subdirectory(editors)
add_subdirectory(windowmanager)
add_subdirectory(blenkernel)

@ -968,9 +968,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
const size_t entry_size = (movie->header->Streams + 1) * sizeof(AviIndexEntry);
if (movie->entries != NULL) {
temp = (AviIndexEntry *)MEM_reallocN(movie->entries, (frame_num + 1) * entry_size);
/* clear new bytes */
memset(&temp[movie->index_entries + 1], 0, (frame_num - movie->index_entries) * entry_size);
temp = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
}
else {
temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");

@ -145,13 +145,13 @@ void BLF_shadow_offset(int fontid, int x, int y);
/* Set the buffer, size and number of channels to draw, one thing to take care is call
* this function with NULL pointer when we finish, for example:
*
* BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4);
* BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4, TRUE);
*
* ... set color, position and draw ...
*
* BLF_buffer(NULL, NULL, 0, 0, 0);
* BLF_buffer(NULL, NULL, 0, 0, 0, FALSE);
*/
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch);
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management);
/* Set the color to be used for text. */
void BLF_buffer_col(int fontid, float r, float g, float b, float a);

@ -746,16 +746,17 @@ void BLF_shadow_offset(int fontid, int x, int y)
}
}
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, int do_color_management)
{
FontBLF *font = BLF_get(fontid);
if (font) {
font->b_fbuf = fbuf;
font->b_cbuf = cbuf;
font->bw = w;
font->bh = h;
font->bch = nch;
font->buf_info.fbuf = fbuf;
font->buf_info.cbuf = cbuf;
font->buf_info.w = w;
font->buf_info.h = h;
font->buf_info.ch = nch;
font->buf_info.do_color_management = do_color_management;
}
}
@ -764,10 +765,10 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a)
FontBLF *font = BLF_get(fontid);
if (font) {
font->b_col[0] = r;
font->b_col[1] = g;
font->b_col[2] = b;
font->b_col[3] = a;
font->buf_info.col[0] = r;
font->buf_info.col[1] = g;
font->buf_info.col[2] = b;
font->buf_info.col[3] = a;
}
}
@ -775,7 +776,7 @@ void BLF_draw_buffer(int fontid, const char *str)
{
FontBLF *font = BLF_get(fontid);
if (font && font->glyph_cache && (font->b_fbuf || font->b_cbuf)) {
if (font && font->glyph_cache && (font->buf_info.fbuf || font->buf_info.cbuf)) {
blf_font_buffer(font, str);
}
}

@ -225,11 +225,14 @@ void blf_font_buffer(FontBLF *font, const char *str)
size_t i = 0;
GlyphBLF **glyph_ascii_table = font->glyph_cache->glyph_ascii_table;
/* buffer specific vars*/
const unsigned char b_col_char[4] = {font->b_col[0] * 255,
font->b_col[1] * 255,
font->b_col[2] * 255,
font->b_col[3] * 255};
/* buffer specific vars */
FontBufInfoBLF *buf_info = &font->buf_info;
float b_col_float[4];
const unsigned char b_col_char[4] = {buf_info->col[0] * 255,
buf_info->col[1] * 255,
buf_info->col[2] * 255,
buf_info->col[3] * 255};
unsigned char *cbuf;
int chx, chy;
int y, x;
@ -239,6 +242,14 @@ void blf_font_buffer(FontBLF *font, const char *str)
blf_font_ensure_ascii_table(font);
/* another buffer spesific call for color conversion */
if (buf_info->do_color_management) {
srgb_to_linearrgb_v4(b_col_float, buf_info->col);
}
else {
copy_v4_v4(b_col_float, buf_info->col);
}
while (str[i]) {
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
@ -259,16 +270,16 @@ void blf_font_buffer(FontBLF *font, const char *str)
pen_y = (int)font->pos[1] - (g->height - (int)g->pos_y);
}
if ((chx + g->width) >= 0 && chx < font->bw && (pen_y + g->height) >= 0 && pen_y < font->bh) {
if ((chx + g->width) >= 0 && chx < buf_info->w && (pen_y + g->height) >= 0 && pen_y < buf_info->h) {
/* don't draw beyond the buffer bounds */
int width_clip = g->width;
int height_clip = g->height;
int yb_start = g->pitch < 0 ? 0 : g->height - 1;
if (width_clip + chx > font->bw)
width_clip -= chx + width_clip - font->bw;
if (height_clip + pen_y > font->bh)
height_clip -= pen_y + height_clip - font->bh;
if (width_clip + chx > buf_info->w)
width_clip -= chx + width_clip - buf_info->w;
if (height_clip + pen_y > buf_info->h)
height_clip -= pen_y + height_clip - buf_info->h;
/* drawing below the image? */
if (pen_y < 0) {
@ -277,7 +288,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
pen_y = 0;
}
if (font->b_fbuf) {
if (buf_info->fbuf) {
int yb = yb_start;
for (y = ((chy >= 0) ? 0 : -chy); y < height_clip; y++) {
for (x = ((chx >= 0) ? 0 : -chx); x < width_clip; x++) {
@ -285,18 +296,18 @@ void blf_font_buffer(FontBLF *font, const char *str)
if (a > 0.0f) {
float alphatest;
fbuf = font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y) * font->bw));
fbuf = buf_info->fbuf + buf_info->ch * ((chx + x) + ((pen_y + y) * buf_info->w));
if (a >= 1.0f) {
fbuf[0] = font->b_col[0];
fbuf[1] = font->b_col[1];
fbuf[2] = font->b_col[2];
fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3]))) < 1.0f ? alphatest : 1.0f;
fbuf[0] = b_col_float[0];
fbuf[1] = b_col_float[1];
fbuf[2] = b_col_float[2];
fbuf[3] = (alphatest = (fbuf[3] + (b_col_float[3]))) < 1.0f ? alphatest : 1.0f;
}
else {
fbuf[0] = (font->b_col[0] * a) + (fbuf[0] * (1 - a));
fbuf[1] = (font->b_col[1] * a) + (fbuf[1] * (1 - a));
fbuf[2] = (font->b_col[2] * a) + (fbuf[2] * (1 - a));
fbuf[3] = (alphatest = (fbuf[3] + (font->b_col[3] * a))) < 1.0f ? alphatest : 1.0f;
fbuf[0] = (b_col_float[0] * a) + (fbuf[0] * (1.0f - a));
fbuf[1] = (b_col_float[1] * a) + (fbuf[1] * (1.0f - a));
fbuf[2] = (b_col_float[2] * a) + (fbuf[2] * (1.0f - a));
fbuf[3] = (alphatest = (fbuf[3] + (b_col_float[3] * a))) < 1.0f ? alphatest : 1.0f;
}
}
}
@ -308,7 +319,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
}
}
if (font->b_cbuf) {
if (buf_info->cbuf) {
int yb = yb_start;
for (y = 0; y < height_clip; y++) {
for (x = 0; x < width_clip; x++) {
@ -316,7 +327,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
if (a > 0.0f) {
int alphatest;
cbuf = font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y) * font->bw));
cbuf = buf_info->cbuf + buf_info->ch * ((chx + x) + ((pen_y + y) * buf_info->w));
if (a >= 1.0f) {
cbuf[0] = b_col_char[0];
cbuf[1] = b_col_char[1];
@ -324,10 +335,10 @@ void blf_font_buffer(FontBLF *font, const char *str)
cbuf[3] = (alphatest = ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
}
else {
cbuf[0] = (b_col_char[0] * a) + (cbuf[0] * (1 - a));
cbuf[1] = (b_col_char[1] * a) + (cbuf[1] * (1 - a));
cbuf[2] = (b_col_char[2] * a) + (cbuf[2] * (1 - a));
cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((font->b_col[3] * a) * 255.0f))) <
cbuf[0] = (b_col_char[0] * a) + (cbuf[0] * (1.0f - a));
cbuf[1] = (b_col_char[1] * a) + (cbuf[1] * (1.0f - a));
cbuf[2] = (b_col_char[2] * a) + (cbuf[2] * (1.0f - a));
cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((b_col_float[3] * a) * 255.0f))) <
255 ? alphatest : 255;
}
}
@ -507,15 +518,17 @@ static void blf_font_fill(FontBLF *font)
font->glyph_cache = NULL;
font->blur = 0;
font->max_tex_size = -1;
font->b_fbuf = NULL;
font->b_cbuf = NULL;
font->bw = 0;
font->bh = 0;
font->bch = 0;
font->b_col[0] = 0;
font->b_col[1] = 0;
font->b_col[2] = 0;
font->b_col[3] = 0;
font->buf_info.fbuf = NULL;
font->buf_info.cbuf = NULL;
font->buf_info.w = 0;
font->buf_info.h = 0;
font->buf_info.ch = 0;
font->buf_info.col[0] = 0;
font->buf_info.col[1] = 0;
font->buf_info.col[2] = 0;
font->buf_info.col[3] = 0;
font->ft_lib = ft_lib;
}

@ -131,6 +131,28 @@ typedef struct GlyphBLF {
short build_tex;
} GlyphBLF;
typedef struct FontBufInfoBLF {
/* for draw to buffer, always set this to NULL after finish! */
float *fbuf;
/* the same but unsigned char */
unsigned char *cbuf;
/* buffer size, keep signed so comparisons with negative values work */
int w;
int h;
/* number of channels. */
int ch;
/* is the float buffer linear */
int do_color_management;
/* and the color, the alphas is get from the glyph!
* color is srgb space */
float col[4];
} FontBufInfoBLF;
typedef struct FontBLF {
/* font name. */
char *name;
@ -198,21 +220,8 @@ typedef struct FontBLF {
/* freetype2 face. */
FT_Face face;
/* for draw to buffer, always set this to NULL after finish! */
float *b_fbuf;
/* the same but unsigned char */
unsigned char *b_cbuf;
/* buffer size, keep signed so comparisons with negative values work */
int bw;
int bh;
/* number of channels. */
int bch;
/* and the color, the alphas is get from the glyph! */
float b_col[4];
/* data for buffer usage (drawing into a texture buffer) */
FontBufInfoBLF buf_info;
} FontBLF;
typedef struct DirBLF {

@ -217,8 +217,8 @@ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
const short do_sel_only, const short do_min_length);
/* get the bounding-box extents for F-Curve */
void calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles);
short calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles);
/* .............. */

@ -67,10 +67,16 @@ short *give_totcolp(struct Object *ob);
struct Material ***give_matarar_id(struct ID *id); /* same but for ID's */
short *give_totcolp_id(struct ID *id);
enum {
BKE_MAT_ASSIGN_USERPREF,
BKE_MAT_ASSIGN_OBDATA,
BKE_MAT_ASSIGN_OBJECT
};
struct Material *give_current_material(struct Object *ob, short act);
struct ID *material_from(struct Object *ob, short act);
void assign_material_id(struct ID *id, struct Material *ma, short act);
void assign_material(struct Object *ob, struct Material *ma, short act);
void assign_material(struct Object *ob, struct Material *ma, short act, int assign_type);
void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
short find_material_index(struct Object *ob, struct Material *ma);

@ -109,8 +109,8 @@ struct BoundBox *BKE_object_boundbox_get(struct Object *ob);
void BKE_object_dimensions_get(struct Object *ob, float vec[3]);
void BKE_object_dimensions_set(struct Object *ob, const float *value);
void BKE_object_boundbox_flag(struct Object *ob, int flag, int set);
void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3]);
int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]);
void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3], const short use_hidden);
int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3], const short use_hidden);
/* sometimes min-max isn't enough, we need to loop over each point */
void BKE_object_foreach_display_point(struct Object *ob, float obmat[4][4],

@ -110,7 +110,8 @@ enum {
};
struct SeqEffectHandle {
int multithreaded;
short multithreaded;
short supports_mask;
/* constructors & destructor */
/* init is _only_ called on first creation */
@ -150,11 +151,12 @@ struct SeqEffectHandle {
struct ImBuf * (*execute)(SeqRenderData context, struct Sequence *seq, float cfra, float facf0, float facf1,
struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3);
struct ImBuf * (*init_execution)(SeqRenderData context, struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3);
struct ImBuf * (*init_execution)(SeqRenderData context, struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3);
void (*execute_slice)(SeqRenderData context, struct Sequence *seq, float cfra, float facf0, float facf1,
struct ImBuf *ibuf1, struct ImBuf *ibuf2, struct ImBuf *ibuf3,
int start_line, int total_lines, struct ImBuf *out);
int start_line, int total_lines, struct ImBuf *out);
};
/* ********************* prototypes *************** */
@ -253,6 +255,7 @@ void BKE_sequence_effect_speed_rebuild_map(struct Scene *scene, struct Sequence
/* extern */
struct SeqEffectHandle BKE_sequence_get_effect(struct Sequence *seq);
int BKE_sequence_effect_get_num_inputs(int seq_type);
int BKE_sequence_effect_get_supports_mask(int seq_type);
/* **********************************************************************
* Sequencer editing functions
@ -284,6 +287,7 @@ void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, in
struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag);
int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str);
int BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur);
void BKE_sequence_invalidate_cache(struct Scene *scene, struct Sequence *seq);
void BKE_sequencer_update_sound_bounds_all(struct Scene *scene);
@ -293,10 +297,11 @@ void BKE_sequencer_update_sound(struct Scene *scene, struct bSound *sound);
void BKE_seqence_base_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
void BKE_sequence_base_dupli_recursive(struct Scene *scene, struct Scene *scene_to, ListBase *nseqbase, ListBase *seqbase, int dupe_flag);
int BKE_seqence_is_valid_check(struct Sequence *seq);
void BKE_sequencer_clear_scene_in_allseqs(struct Main *bmain, struct Scene *sce);
struct Sequence *BKE_sequwnce_get_by_name(struct ListBase *seqbase, const char *name, int recursive);
struct Sequence *BKE_sequence_get_by_name(struct ListBase *seqbase, const char *name, int recursive);
/* api for adding new sequence strips */
typedef struct SeqLoadInfo {

@ -257,6 +257,7 @@ endif()
if(WITH_MOD_CLOTH_ELTOPO)
list(APPEND INC
../../../extern/eltopo
../../../extern/eltopo/eltopo3d
)
add_definitions(-DWITH_ELTOPO)
endif()

@ -37,7 +37,8 @@ if env['WITH_BF_PYTHON']:
defs.append('DEBUG')
if env['WITH_BF_ELTOPO']:
incs += ' ../../../extern/eltopo'
incs += ' #/extern/eltopo'
incs += ' #/extern/eltopo/eltopo3d'
defs.append('WITH_ELTOPO')
if env['WITH_BF_QUICKTIME']:

@ -498,7 +498,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
}
}
else {
/*if no object, set to INT_MAX so we don't mess up any shapekey layers*/
/* if no object, set to INT_MAX so we don't mess up any shapekey layers */
uid = INT_MAX;
}
@ -1188,7 +1188,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, coba);
/* Now copy colors in all face verts. */
/*first add colors to the tessellation faces*/
/* first add colors to the tessellation faces */
/* XXX Why update that layer? We have to update WEIGHT_MLOOPCOL anyway,
* and tessellation recreates mface layers from mloop/mpoly ones, so no
* need to fill WEIGHT_MCOL here. */

@ -210,7 +210,7 @@ bArmature *BKE_armature_copy(bArmature *arm)
newArm = BKE_libblock_copy(&arm->id);
BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
/* Duplicate the childrens' lists*/
/* Duplicate the childrens' lists */
newBone = newArm->bonebase.first;
for (oldBone = arm->bonebase.first; oldBone; oldBone = oldBone->next) {
newBone->parent = NULL;

@ -425,7 +425,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
if (flbr->ob) {
float vec2[3], t;
/* first check we're not blocking the leader*/
/* first check we're not blocking the leader */
sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
mul_v3_fl(vec, 1.0f/bbd->timestep);

@ -1869,7 +1869,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
dm->deformedOnly = 1;
/*don't add origindex layer if one already exists*/
/* don't add origindex layer if one already exists */
add_orig = !CustomData_has_layer(&bm->pdata, CD_ORIGINDEX);
mask = use_mdisps ? CD_MASK_DERIVEDMESH | CD_MASK_MDISPS : CD_MASK_DERIVEDMESH;
@ -1886,7 +1886,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis
CustomData_merge(&bm->pdata, &dm->polyData, mask,
CD_CALLOC, dm->numPolyData);
/*add tessellation mface layers*/
/* add tessellation mface layers */
if (use_tessface) {
CustomData_from_bmeshpoly(&dm->faceData, &dm->polyData, &dm->loopData, em->tottri);
}
@ -2260,7 +2260,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
newe = MEM_callocN(sizeof(int) * dm->numEdgeData, "newv etable CDDM_merge_verts");
newl = MEM_callocN(sizeof(int) * totloop, "newv ltable CDDM_merge_verts");
/*fill newl with destination vertex indices*/
/* fill newl with destination vertex indices */
mv = cddm->mvert;
c = 0;
for (i = 0; i < dm->numVertData; i++, mv++) {
@ -2271,14 +2271,14 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
}
}
/*now link target vertices to destination indices*/
/* now link target vertices to destination indices */
for (i = 0; i < dm->numVertData; i++) {
if (vtargetmap[i] != -1) {
newv[i] = newv[vtargetmap[i]];
}
}
/*find-replace merged vertices with target vertices*/
/* find-replace merged vertices with target vertices */
ml = cddm->mloop;
for (i = 0; i < totloop; i++, ml++) {
if (vtargetmap[ml->v] != -1) {
@ -2286,7 +2286,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap)
}
}
/*now go through and fix edges and faces*/
/* now go through and fix edges and faces */
med = cddm->medge;
c = 0;
for (i = 0; i < dm->numEdgeData; i++, med++) {

@ -400,18 +400,8 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
copy_v3_v3(verts->txold, verts->x);
/* Get the current position. */
if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL) &&
((!(cloth->verts[i].flags & CLOTH_VERT_FLAG_PINNED))
&& (cloth->verts[i].goal > ALMOST_ZERO)))
{
copy_v3_v3(verts->xconst, mvert[i].co);
mul_m4_v3(ob->obmat, verts->xconst);
}
else
{
/* This fixed animated goals not to jump back to "first frame position" */
copy_v3_v3(verts->xconst, verts->txold);
}
copy_v3_v3(verts->xconst, mvert[i].co);
mul_m4_v3(ob->obmat, verts->xconst);
}
effectors = pdInitEffectors(clmd->scene, ob, NULL, clmd->sim_parms->effector_weights);

@ -3114,7 +3114,8 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
copy_v3_v3(ownLoc, obmat[3]);
INIT_MINMAX(curveMin, curveMax);
BKE_object_minmax(ct->tar, curveMin, curveMax);
/* XXX - don't think this is good calling this here - campbell */
BKE_object_minmax(ct->tar, curveMin, curveMax, TRUE);
/* get targetmatrix */
if (cu->path && cu->path->data) {

@ -1898,7 +1898,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
++dest_i;
dest_i++;
}
/* if there are no more dest layers, we're done */
@ -1936,7 +1936,7 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
* we don't want to copy all source layers to the same dest, so
* increment dest_i
*/
++dest_i;
dest_i++;
}
}
}
@ -1989,7 +1989,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
++dest_i;
dest_i++;
}
/* if there are no more dest layers, we're done */
@ -2011,7 +2011,7 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
* we don't want to copy all source layers to the same dest, so
* increment dest_i
*/
++dest_i;
dest_i++;
}
}
@ -2139,8 +2139,8 @@ void CustomData_set(const CustomData *data, int index, int type, void *source)
memcpy(dest, source, typeInfo->size);
}
/*Bmesh functions*/
/*needed to convert to/from different face reps*/
/* BMesh functions */
/* needed to convert to/from different face reps */
void CustomData_to_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData *ldata,
int totloop, int totpoly)
{
@ -2401,7 +2401,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
++dest_i;
dest_i++;
}
/* if there are no more dest layers, we're done */
@ -2425,7 +2425,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
* we don't want to copy all source layers to the same dest, so
* increment dest_i
*/
++dest_i;
dest_i++;
}
}
}
@ -2637,7 +2637,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
++dest_i;
dest_i++;
}
/* if there are no more dest layers, we're done */
@ -2661,7 +2661,7 @@ void CustomData_to_bmesh_block(const CustomData *source, CustomData *dest,
* we don't want to copy all source layers to the same dest, so
* increment dest_i
*/
++dest_i;
dest_i++;
}
}
}
@ -2680,7 +2680,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
* (this should work because layers are ordered by type)
*/
while (dest_i < dest->totlayer && dest->layers[dest_i].type < source->layers[src_i].type) {
++dest_i;
dest_i++;
}
/* if there are no more dest layers, we're done */
@ -2704,7 +2704,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest,
* we don't want to copy all source layers to the same dest, so
* increment dest_i
*/
++dest_i;
dest_i++;
}
}

@ -570,12 +570,14 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* softbody collision */
if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_LATTICE)) {
if (modifiers_isModifierEnabled(ob, eModifierType_Softbody)
|| modifiers_isModifierEnabled(ob, eModifierType_Cloth)
|| modifiers_isModifierEnabled(ob, eModifierType_Smoke)
|| modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint)
|| ob->particlesystem.first)
if (ob->particlesystem.first ||
modifiers_isModifierEnabled(ob, eModifierType_Softbody) ||
modifiers_isModifierEnabled(ob, eModifierType_Cloth) ||
modifiers_isModifierEnabled(ob, eModifierType_Smoke) ||
modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint))
{
dag_add_collision_field_relation(dag, scene, ob, node); /* TODO: use effectorweight->group */
}
}
/* object data drivers */
@ -2596,7 +2598,8 @@ static void dag_id_flush_update(Scene *sce, ID *id)
if (id) {
idtype = GS(id->name);
if (ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
if (OB_DATA_SUPPORT_ID(idtype)) {
for (obt = bmain->object.first; obt; obt = obt->id.next) {
if (!(ob && obt == ob) && obt->data == id) {
obt->recalc |= OB_RECALC_DATA;

@ -1997,7 +1997,10 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
/* Get closest edge to that subpixel on UV map */
{
float pixel[2], dist, t_dist;
float pixel[2];
/* distances only used for comparison */
float dist_squared, t_dist_squared;
int i, uindex[3], edge1_index, edge2_index,
e1_index, e2_index, target_face;
float closest_point[2], lambda, dir_vec[2];
@ -2019,17 +2022,17 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
/*
* Find closest edge to that pixel
*/
/* Dist to first edge */
/* Dist to first edge */
e1_index = cPoint->v1; e2_index = cPoint->v2; edge1_index = uindex[0]; edge2_index = uindex[1];
dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[edge1_index], tface[cPoint->face_index].uv[edge2_index]);
dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[edge1_index], tface[cPoint->face_index].uv[edge2_index]);
/* Dist to second edge */
t_dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[1]], tface[cPoint->face_index].uv[uindex[2]]);
if (t_dist < dist) { e1_index = cPoint->v2; e2_index = cPoint->v3; edge1_index = uindex[1]; edge2_index = uindex[2]; dist = t_dist; }
/* Dist to second edge */
t_dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[1]], tface[cPoint->face_index].uv[uindex[2]]);
if (t_dist_squared < dist_squared) { e1_index = cPoint->v2; e2_index = cPoint->v3; edge1_index = uindex[1]; edge2_index = uindex[2]; dist_squared = t_dist_squared; }
/* Dist to third edge */
t_dist = dist_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[2]], tface[cPoint->face_index].uv[uindex[0]]);
if (t_dist < dist) { e1_index = cPoint->v3; e2_index = cPoint->v1; edge1_index = uindex[2]; edge2_index = uindex[0]; dist = t_dist; }
/* Dist to third edge */
t_dist_squared = dist_squared_to_line_segment_v2(pixel, tface[cPoint->face_index].uv[uindex[2]], tface[cPoint->face_index].uv[uindex[0]]);
if (t_dist_squared < dist_squared) { e1_index = cPoint->v3; e2_index = cPoint->v1; edge1_index = uindex[2]; edge2_index = uindex[0]; dist_squared = t_dist_squared; }
/*
@ -4315,7 +4318,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
dir_factor = dir_dot * MIN2(speed_scale, 1.0f) * w_factor;
if (dir_factor > 0.5f) dir_factor = 0.5f;
/* mix new wetness*/
/* mix new wetness */
ePoint->wetness += dir_factor;
CLAMP(ePoint->wetness, 0.0f, MAX_WETNESS);

@ -151,7 +151,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
#endif
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
/*don't consider two-edged faces*/
/* don't consider two-edged faces */
if (efa->len < 3) {
/* do nothing */
}
@ -198,7 +198,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm)
/* scanfill time */
BM_ITER_ELEM_INDEX (l, &liter, efa, BM_LOOPS_OF_FACE, j) {
/*mark order*/
/*mark order */
BM_elem_index_set(l, j); /* set_loop */
sf_vert = BLI_scanfill_vert_add(&sf_ctx, l->v->co);
@ -334,7 +334,7 @@ typedef struct EditDerivedBMesh {
float (*polyNos)[3];
/* private variables, for number of verts/edges/faces
* within the above hash/table members*/
* within the above hash/table members */
int tv, te, tf;
} EditDerivedBMesh;

@ -433,16 +433,18 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
/* ...................................... */
/* helper for calc_fcurve_* functions -> find first and last BezTriple to be used */
static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
const short do_sel_only)
static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
const short do_sel_only)
{
short found = FALSE;
/* init outputs */
*first = NULL;
*last = NULL;
/* sanity checks */
if (fcu->bezt == NULL)
return;
return found;
/* only include selected items? */
if (do_sel_only) {
@ -454,6 +456,7 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
for (i = 0; i < fcu->totvert; bezt++, i++) {
if (BEZSELECTED(bezt)) {
*first = bezt;
found = TRUE;
break;
}
}
@ -463,6 +466,7 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
for (i = 0; i < fcu->totvert; bezt--, i++) {
if (BEZSELECTED(bezt)) {
*last = bezt;
found = TRUE;
break;
}
}
@ -471,13 +475,16 @@ static void get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple *
/* just full array */
*first = fcu->bezt;
*last = ARRAY_LAST_ITEM(fcu->bezt, BezTriple, sizeof(BezTriple), fcu->totvert);
found = TRUE;
}
return found;
}
/* Calculate the extents of F-Curve's data */
void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles)
short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles)
{
float xminv = 999999999.0f, xmaxv = -999999999.0f;
float yminv = 999999999.0f, ymaxv = -999999999.0f;
@ -490,7 +497,7 @@ void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
if (xmin || xmax) {
/* get endpoint keyframes */
get_fcurve_end_keyframes(fcu, &bezt_first, &bezt_last, do_sel_only);
foundvert = get_fcurve_end_keyframes(fcu, &bezt_first, &bezt_last, do_sel_only);
if (bezt_first) {
BLI_assert(bezt_last != NULL);
@ -566,6 +573,8 @@ void calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
if (ymin) *ymin = 0.0f;
if (ymax) *ymax = 1.0f;
}
return foundvert;
}
/* Calculate the extents of F-Curve's keyframes */

@ -422,7 +422,7 @@ static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo
}
#endif
/* make a copy at distance ofsx, ofsy with shear*/
/* make a copy at distance ofsx, ofsy with shear */
fsize = cu->fsize;
shear = cu->shear;
si = sinf(rot);

@ -97,7 +97,7 @@ void free_gpencil_layers(ListBase *list)
/* error checking */
if (list == NULL) return;
/* delete layers*/
/* delete layers */
for (gpl = list->first; gpl; gpl = gpln) {
gpln = gpl->next;

@ -159,12 +159,12 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
newarr = MEM_callocN(sizeof(IDProperty) * newsize, "idproperty array resized");
if (newlen >= prop->len) {
/* newlen is bigger*/
/* newlen is bigger */
memcpy(newarr, prop->data.pointer, prop->len * sizeof(IDProperty));
}
else {
int i;
/* newlen is smaller*/
/* newlen is smaller */
for (i = newlen; i < prop->len; i++) {
IDP_FreeProperty(GETPROP(prop, i));
}
@ -233,12 +233,12 @@ void IDP_ResizeArray(IDProperty *prop, int newlen)
newarr = MEM_callocN(idp_size_table[(int)prop->subtype] * newsize, "idproperty array resized");
if (newlen >= prop->len) {
/* newlen is bigger*/
/* newlen is bigger */
memcpy(newarr, prop->data.pointer, prop->len * idp_size_table[(int)prop->subtype]);
idp_resize_group_array(prop, newlen, newarr);
}
else {
/* newlen is smaller*/
/* newlen is smaller */
idp_resize_group_array(prop, newlen, newarr);
memcpy(newarr, prop->data.pointer, newlen * idp_size_table[(int)prop->subtype]);
}
@ -694,7 +694,7 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
break;
case IDP_ARRAY:
{
/*for now, we only support float and int and double arrays*/
/* for now, we only support float and int and double arrays */
if ( (val->array.type == IDP_FLOAT) ||
(val->array.type == IDP_INT) ||
(val->array.type == IDP_DOUBLE) ||

@ -1212,43 +1212,46 @@ void BKE_imformat_defaults(ImageFormatData *im_format)
void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *imbuf)
{
int ftype = imbuf->ftype & ~IB_CUSTOM_FLAGS_MASK;
int custom_flags = imbuf->ftype & IB_CUSTOM_FLAGS_MASK;
BKE_imformat_defaults(im_format);
/* file type */
if (imbuf->ftype == IMAGIC)
if (ftype == IMAGIC)
im_format->imtype = R_IMF_IMTYPE_IRIS;
#ifdef WITH_HDR
else if (imbuf->ftype == RADHDR)
else if (ftype == RADHDR)
im_format->imtype = R_IMF_IMTYPE_RADHDR;
#endif
else if (imbuf->ftype == PNG)
else if (ftype == PNG)
im_format->imtype = R_IMF_IMTYPE_PNG;
#ifdef WITH_DDS
else if (imbuf->ftype == DDS)
else if (ftype == DDS)
im_format->imtype = R_IMF_IMTYPE_DDS;
#endif
else if (imbuf->ftype == BMP)
else if (ftype == BMP)
im_format->imtype = R_IMF_IMTYPE_BMP;
#ifdef WITH_TIFF
else if (imbuf->ftype & TIF) {
else if (ftype == TIF) {
im_format->imtype = R_IMF_IMTYPE_TIFF;
if (imbuf->ftype & TIF_16BIT)
if (custom_flags & TIF_16BIT)
im_format->depth = R_IMF_CHAN_DEPTH_16;
}
#endif
#ifdef WITH_OPENEXR
else if (imbuf->ftype & OPENEXR) {
else if (ftype == OPENEXR) {
im_format->imtype = R_IMF_IMTYPE_OPENEXR;
if (imbuf->ftype & OPENEXR_HALF)
if (custom_flags & OPENEXR_HALF)
im_format->depth = R_IMF_CHAN_DEPTH_16;
if (imbuf->ftype & OPENEXR_COMPRESS)
if (custom_flags & OPENEXR_COMPRESS)
im_format->exr_codec = R_IMF_EXR_CODEC_ZIP; // Can't determine compression
if (imbuf->zbuf_float)
im_format->flag |= R_IMF_FLAG_ZBUF;
@ -1256,35 +1259,35 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
#endif
#ifdef WITH_CINEON
else if (imbuf->ftype == CINEON)
else if (ftype == CINEON)
im_format->imtype = R_IMF_IMTYPE_CINEON;
else if (imbuf->ftype == DPX)
else if (ftype == DPX)
im_format->imtype = R_IMF_IMTYPE_DPX;
#endif
else if (imbuf->ftype == TGA) {
else if (ftype == TGA) {
im_format->imtype = R_IMF_IMTYPE_TARGA;
}
else if (imbuf->ftype == RAWTGA) {
else if (ftype == RAWTGA) {
im_format->imtype = R_IMF_IMTYPE_RAWTGA;
}
#ifdef WITH_OPENJPEG
else if (imbuf->ftype & JP2) {
else if (ftype & JP2) {
im_format->imtype = R_IMF_IMTYPE_JP2;
im_format->quality = imbuf->ftype & ~JPG_MSK;
im_format->quality = custom_flags & ~JPG_MSK;
if (imbuf->ftype & JP2_16BIT)
if (ftype & JP2_16BIT)
im_format->depth = R_IMF_CHAN_DEPTH_16;
else if (imbuf->ftype & JP2_12BIT)
else if (ftype & JP2_12BIT)
im_format->depth = R_IMF_CHAN_DEPTH_12;
if (imbuf->ftype & JP2_YCC)
if (ftype & JP2_YCC)
im_format->jp2_flag |= R_IMF_JP2_FLAG_YCC;
if (imbuf->ftype & JP2_CINE) {
if (ftype & JP2_CINE) {
im_format->jp2_flag |= R_IMF_JP2_FLAG_CINE_PRESET;
if (imbuf->ftype & JP2_CINE_48FPS)
if (ftype & JP2_CINE_48FPS)
im_format->jp2_flag |= R_IMF_JP2_FLAG_CINE_48;
}
}
@ -1292,7 +1295,7 @@ void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *i
else {
im_format->imtype = R_IMF_IMTYPE_JPEG90;
im_format->quality = imbuf->ftype & ~JPG_MSK;
im_format->quality = custom_flags & ~JPG_MSK;
}
/* planes */
@ -1476,6 +1479,10 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
float h_fixed;
const int mono = blf_mono_font_render; // XXX
/* this could be an argument if we want to operate on non linear float imbuf's
* for now though this is only used for renders which use scene settings */
const int do_color_management = (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) != 0;
#define BUFF_MARGIN_X 2
#define BUFF_MARGIN_Y 1
@ -1491,7 +1498,7 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
/* set before return */
BLF_size(mono, scene->r.stamp_font_id, 72);
BLF_buffer(mono, rectf, rect, width, height, channels);
BLF_buffer(mono, rectf, rect, width, height, channels, do_color_management);
BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
pad = BLF_width_max(mono);
@ -1508,7 +1515,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
y -= h;
/* also a little of space to the background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
/* and draw the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
@ -1524,7 +1532,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
y -= h;
/* and space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.note);
@ -1539,7 +1548,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
y -= h;
/* and space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.date);
@ -1554,7 +1564,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
y -= h;
/* and space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
0, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.rendertime);
@ -1568,7 +1579,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
BLF_width_and_height(mono, stamp_data.marker, &w, &h); h = h_fixed;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
@ -1583,7 +1595,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
BLF_width_and_height(mono, stamp_data.time, &w, &h); h = h_fixed;
/* extra space for background */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
@ -1597,7 +1610,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
BLF_width_and_height(mono, stamp_data.frame, &w, &h); h = h_fixed;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
@ -1611,7 +1625,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
BLF_width_and_height(mono, stamp_data.camera, &w, &h); h = h_fixed;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.camera);
@ -1623,7 +1638,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
BLF_width_and_height(mono, stamp_data.cameralens, &w, &h); h = h_fixed;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.cameralens);
}
@ -1635,7 +1651,8 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
x = width - w - 2;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
/* and pad the text. */
BLF_position(mono, x, y + y_ofs, 0.0);
@ -1650,14 +1667,15 @@ void BKE_stamp_buf(Scene *scene, Object *camera, unsigned char *rect, float *rec
y = height - h;
/* extra space for background. */
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, do_color_management,
x - BUFF_MARGIN_X, y - BUFF_MARGIN_Y, x + w + BUFF_MARGIN_X, y + h + BUFF_MARGIN_Y);
BLF_position(mono, x, y + y_ofs, 0.0);
BLF_draw_buffer(mono, stamp_data.strip);
}
/* cleanup the buffer. */
BLF_buffer(mono, NULL, NULL, 0, 0, 0);
BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE);
#undef BUFF_MARGIN_X
#undef BUFF_MARGIN_Y

@ -289,7 +289,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
BLF_size(mono, 54, 72); /* hard coded size! */
BLF_buffer(mono, rect_float, rect, width, height, 4);
BLF_buffer(mono, rect_float, rect, width, height, 4, TRUE);
for (y = 0; y < height; y += step) {
text[1] = '1';
@ -330,7 +330,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
}
/* cleanup the buffer. */
BLF_buffer(mono, NULL, NULL, 0, 0, 0);
BLF_buffer(mono, NULL, NULL, 0, 0, 0, FALSE);
}
void BKE_image_buf_fill_checker_color(unsigned char *rect, float *rect_float, int width, int height)

@ -1764,8 +1764,7 @@ void do_versions_ipos_to_animato(Main *main)
for (act = ob->actuators.first; act; act = act->next) {
/* Any actuators set to ACT_IPO at this point are actually Action Actuators that
need this converted IPO to finish converting the actuator. */
if (act->type == ACT_IPO)
{
if (act->type == ACT_IPO) {
aa = (bActionActuator*)act->data;
aa->act = ob->adt->action;
act->type = ACT_ACTION;

@ -377,7 +377,7 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
k1 = k[0] = k[1] = k[2] = k[3] = firstkey;
t[0] = t[1] = t[2] = t[3] = k1->pos;
/* if (fac<0.0 || fac>1.0) return 1; */
/* if (fac < 0.0 || fac > 1.0) return 1; */
if (k1->next == NULL) return 1;
@ -1449,6 +1449,8 @@ KeyBlock *add_keyblock(Key *key, const char *name)
* \note sorting is a problematic side effect in some cases,
* better only do this explicitly by having its own function,
*
* \param key The key datablock to add to.
* \param name Optional name for the new keyblock.
* \param do_force always use ctime even for relative keys.
*/
KeyBlock *add_keyblock_ctime(Key *key, const char *name, const short do_force)

@ -40,18 +40,22 @@
#include "BLI_math.h"
#include "DNA_mask_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_tracking_types.h"
#include "DNA_sequence_types.h"
#include "BKE_curve.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_mask.h"
#include "BKE_node.h"
#include "BKE_sequencer.h"
#include "BKE_tracking.h"
#include "BKE_movieclip.h"
#include "BKE_utildefines.h"
@ -1561,26 +1565,83 @@ void BKE_mask_free(Mask *mask)
BKE_mask_layer_free_list(&mask->masklayers);
}
static void ntree_unlink_mask_cb(void *calldata, struct ID *UNUSED(owner_id), struct bNodeTree *ntree)
{
ID *id = (ID *)calldata;
bNode *node;
for (node = ntree->nodes.first; node; node = node->next) {
if (node->id == id) {
node->id = NULL;
}
}
}
void BKE_mask_unlink(Main *bmain, Mask *mask)
{
bScreen *scr;
ScrArea *area;
SpaceLink *sl;
Scene *scene;
for (scr = bmain->screen.first; scr; scr = scr->id.next) {
for (area = scr->areabase.first; area; area = area->next) {
for (sl = area->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_CLIP) {
SpaceClip *sc = (SpaceClip *) sl;
switch (sl->spacetype) {
case SPACE_CLIP:
{
SpaceClip *sc = (SpaceClip *)sl;
if (sc->mask_info.mask == mask)
sc->mask_info.mask = NULL;
if (sc->mask_info.mask == mask) {
sc->mask_info.mask = NULL;
}
break;
}
case SPACE_IMAGE:
{
SpaceImage *sima = (SpaceImage *)sl;
if (sima->mask_info.mask == mask) {
sima->mask_info.mask = NULL;
}
break;
}
}
}
}
}
mask->id.us = 0;
for (scene = bmain->scene.first; scene; scene = scene->id.next) {
if (scene->ed) {
Sequence *seq;
SEQ_BEGIN (scene->ed, seq)
{
if (seq->mask == mask) {
seq->mask = NULL;
}
}
SEQ_END
}
if (scene->nodetree) {
bNode *node;
for (node = scene->nodetree->nodes.first; node; node = node->next) {
if (node->id == &mask->id) {
node->id = NULL;
}
}
}
}
{
bNodeTreeType *treetype = ntreeGetType(NTREE_COMPOSIT);
treetype->foreach_nodetree(bmain, (void *)mask, &ntree_unlink_mask_cb);
}
BKE_libblock_free(&bmain->mask, mask);
}
void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float frame_size[2])

@ -495,6 +495,9 @@ short *give_totcolp(Object *ob)
/* same as above but for ID's */
Material ***give_matarar_id(ID *id)
{
/* ensure we don't try get materials from non-obdata */
BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
switch (GS(id->name)) {
case ID_ME:
return &(((Mesh *)id)->mat);
@ -511,6 +514,9 @@ Material ***give_matarar_id(ID *id)
short *give_totcolp_id(ID *id)
{
/* ensure we don't try get materials from non-obdata */
BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
switch (GS(id->name)) {
case ID_ME:
return &(((Mesh *)id)->totcol);
@ -527,6 +533,9 @@ short *give_totcolp_id(ID *id)
static void data_delete_material_index_id(ID *id, short index)
{
/* ensure we don't try get materials from non-obdata */
BLI_assert(OB_DATA_SUPPORT_ID(GS(id->name)));
switch (GS(id->name)) {
case ID_ME:
BKE_mesh_delete_material_index((Mesh *)id, index);
@ -766,11 +775,12 @@ void assign_material_id(ID *id, Material *ma, short act)
test_object_materials(id);
}
void assign_material(Object *ob, Material *ma, short act)
void assign_material(Object *ob, Material *ma, short act, int assign_type)
{
Material *mao, **matar, ***matarar;
char *matbits;
short *totcolp;
char bit = 0;
if (act > MAXMAT) return;
if (act < 1) act = 1;
@ -797,8 +807,29 @@ void assign_material(Object *ob, Material *ma, short act)
*matarar = matar;
*totcolp = act;
}
// Determine the object/mesh linking
if (assign_type == BKE_MAT_ASSIGN_USERPREF && ob->totcol && ob->actcol) {
/* copy from previous material */
bit = ob->matbits[ob->actcol - 1];
}
else {
switch (assign_type) {
case BKE_MAT_ASSIGN_OBDATA:
bit = 0;
break;
case BKE_MAT_ASSIGN_OBJECT:
bit = 1;
break;
case BKE_MAT_ASSIGN_USERPREF:
default:
bit = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
break;
}
}
if (act > ob->totcol) {
/* Need more space in the material arrays */
matar = MEM_callocN(sizeof(void *) * act, "matarray2");
matbits = MEM_callocN(sizeof(char) * act, "matbits1");
if (ob->totcol) {
@ -810,17 +841,12 @@ void assign_material(Object *ob, Material *ma, short act)
ob->mat = matar;
ob->matbits = matbits;
ob->totcol = act;
/* copy object/mesh linking, or assign based on userpref */
if (ob->actcol)
ob->matbits[act - 1] = ob->matbits[ob->actcol - 1];
else
ob->matbits[act - 1] = (U.flag & USER_MAT_ON_OB) ? 1 : 0;
}
/* do it */
if (ob->matbits[act - 1]) { /* in object */
ob->matbits[act - 1] = bit;
if (bit == 1) { /* in object */
mao = ob->mat[act - 1];
if (mao) mao->id.us--;
ob->mat[act - 1] = ma;
@ -846,7 +872,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
/* now we have the right number of slots */
for (i = 0; i < totcol; i++)
assign_material(ob, (*matar)[i], i + 1);
assign_material(ob, (*matar)[i], i + 1, BKE_MAT_ASSIGN_USERPREF);
if (actcol_orig > ob->totcol)
actcol_orig = ob->totcol;
@ -880,7 +906,7 @@ int object_add_material_slot(Object *ob)
if (ob == NULL) return FALSE;
if (ob->totcol >= MAXMAT) return FALSE;
assign_material(ob, NULL, ob->totcol + 1);
assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
ob->actcol = ob->totcol;
return TRUE;
}

@ -167,7 +167,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
for (j = 0; j < vtot; j++, v1++, v2++) {
if (len_v3v3(v1->co, v2->co) > thresh)
return MESHCMP_VERTCOMISMATCH;
/*I don't care about normals, let's just do coodinates*/
/* I don't care about normals, let's just do coodinates */
}
}
@ -990,7 +990,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
MEM_freeN(edsort);
/*set edge members of mloops*/
/* set edge members of mloops */
medge = *alledge;
for (a = 0; a < *_totedge; a++, medge++) {
BLI_edgehash_insert(hash, medge->v1, medge->v2, SET_INT_IN_POINTER(a));
@ -1846,7 +1846,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
return;
}
/* if we are not calculating verts and no verts were passes thene we have nothign to do */
/* if we are not calculating verts and no verts were passes then we have nothing to do */
if ((only_face_normals == TRUE) && (polyNors_r == NULL) && (faceNors_r == NULL)) {
printf("%s: called with nothing to do\n", __func__);
return;
@ -1910,7 +1910,7 @@ void BKE_mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpo
if (!pnors) pnors = MEM_callocN(sizeof(float) * 3 * numPolys, "poly_nors mesh.c");
/*first go through and calculate normals for all the polys*/
/* first go through and calculate normals for all the polys */
tnorms = MEM_callocN(sizeof(float) * 3 * numVerts, "tnorms mesh.c");
mp = mpolys;
@ -2820,7 +2820,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
mf = &mface[k];
if (mf->edcode == 3) {
/*sort loop indices to ensure winding is correct*/
/* sort loop indices to ensure winding is correct */
/* NO SORT - looks like we can skip this */
lindex[0] = mf->v1;
@ -2828,7 +2828,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
lindex[2] = mf->v3;
lindex[3] = 0; /* unused */
/*transform loop indices to vert indices*/
/* transform loop indices to vert indices */
mf->v1 = mloop[mf->v1].v;
mf->v2 = mloop[mf->v2].v;
mf->v3 = mloop[mf->v3].v;
@ -2839,7 +2839,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
test_index_face(mf, fdata, k, 3);
}
else {
/*sort loop indices to ensure winding is correct*/
/* sort loop indices to ensure winding is correct */
/* NO SORT - looks like we can skip this */
lindex[0] = mf->v1;
@ -2847,7 +2847,7 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
lindex[2] = mf->v3;
lindex[3] = mf->v4;
/*transform loop indices to vert indices*/
/* transform loop indices to vert indices */
mf->v1 = mloop[mf->v1].v;
mf->v2 = mloop[mf->v2].v;
mf->v3 = mloop[mf->v3].v;

@ -2244,7 +2244,7 @@ void BKE_object_dimensions_set(Object *ob, const float *value)
}
}
void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const short use_hidden)
{
BoundBox bb;
float vec[3];
@ -2294,14 +2294,23 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
break;
case OB_ARMATURE:
if (ob->pose) {
bArmature *arm = ob->data;
bPoseChannel *pchan;
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
minmax_v3v3_v3(min_r, max_r, vec);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
minmax_v3v3_v3(min_r, max_r, vec);
if ((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE)) {
/* pass */
}
else {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
minmax_v3v3_v3(min_r, max_r, vec);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
minmax_v3v3_v3(min_r, max_r, vec);
change = TRUE;
}
}
change = TRUE;
}
break;
case OB_MESH:
@ -2341,9 +2350,9 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3])
}
}
int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3])
int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3], const short use_hidden)
{
int ok = 0;
int ok = FALSE;
if ((ob->transflag & OB_DUPLI) == 0) {
return ok;
}
@ -2353,7 +2362,10 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma
lb = object_duplilist(scene, ob);
for (dob = lb->first; dob; dob = dob->next) {
if (dob->no_draw == 0) {
if ((use_hidden == FALSE) && (dob->no_draw != 0)) {
/* pass */
}
else {
BoundBox *bb = BKE_object_boundbox_get(dob->ob);
if (bb) {
@ -2364,7 +2376,7 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma
minmax_v3v3_v3(r_min, r_max, vec);
}
ok = 1;
ok = TRUE;
}
}
}

@ -717,7 +717,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
if (!sens) return;
/* move up */
if ( val==1 && sens->prev) {
if (val == 1 && sens->prev) {
for (tmp=sens->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & SENS_VISIBLE)
break;
@ -728,7 +728,7 @@ void sca_move_sensor(bSensor *sens_to_move, Object *ob, int move_up)
}
}
/* move down */
else if ( val==2 && sens->next) {
else if (val == 2 && sens->next) {
for (tmp=sens->next; tmp; tmp=tmp->next) {
if (tmp->flag & SENS_VISIBLE)
break;
@ -756,7 +756,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
if (!cont) return;
/* move up */
if ( val==1 && cont->prev) {
if (val == 1 && cont->prev) {
/* locate the controller that has the same state mask but is earlier in the list */
tmp = cont->prev;
while (tmp) {
@ -771,7 +771,7 @@ void sca_move_controller(bController *cont_to_move, Object *ob, int move_up)
}
/* move down */
else if ( val==2 && cont->next) {
else if (val == 2 && cont->next) {
tmp = cont->next;
while (tmp) {
if (tmp->state_mask & cont->state_mask)
@ -799,7 +799,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
if (!act) return;
/* move up */
if ( val==1 && act->prev) {
if (val == 1 && act->prev) {
/* locate the first visible actuators before this one */
for (tmp = act->prev; tmp; tmp=tmp->prev) {
if (tmp->flag & ACT_VISIBLE)
@ -811,7 +811,7 @@ void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up)
}
}
/* move down */
else if ( val==2 && act->next) {
else if (val == 2 && act->next) {
/* locate the first visible actuators after this one */
for (tmp=act->next; tmp; tmp=tmp->next) {
if (tmp->flag & ACT_VISIBLE)

@ -180,7 +180,8 @@ static int seqcache_key_check_seq(void *userkey, void *userdata)
void BKE_sequencer_cache_cleanup_sequence(Sequence *seq)
{
IMB_moviecache_cleanup(moviecache, seqcache_key_check_seq, seq);
if (moviecache)
IMB_moviecache_cleanup(moviecache, seqcache_key_check_seq, seq);
}
struct ImBuf *BKE_sequencer_cache_get(SeqRenderData context, Sequence *seq, float cfra, seq_stripelem_ibuf_t type)

@ -284,14 +284,14 @@ static void do_alphaover_effect(SeqRenderData context, Sequence *UNUSED(seq), fl
int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_alphaover_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -446,14 +446,14 @@ static void do_alphaunder_effect(SeqRenderData context, Sequence *UNUSED(seq), f
int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_alphaunder_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -556,14 +556,14 @@ static void do_cross_effect(SeqRenderData context, Sequence *UNUSED(seq), float
int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_cross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -805,14 +805,14 @@ static void do_gammacross_effect(SeqRenderData context, Sequence *UNUSED(seq), f
int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_gammacross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -911,14 +911,14 @@ static void do_add_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_add_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -1015,14 +1015,14 @@ static void do_sub_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_sub_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -1212,14 +1212,14 @@ static void do_mul_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *UNUSED(ibuf3), int start_line, int total_lines, ImBuf *out)
{
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
do_mul_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -2746,7 +2746,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
int y = total_lines;
if (out->rect_float) {
float *rect1, *rect2, *rect_out;
float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -2754,7 +2754,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
do_alphaover_effect_float(facf0, facf1, x, y, rect1, rect2, rect_out);
}
else {
unsigned char *rect1, *rect2, *rect_out;
unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
@ -2840,6 +2840,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
int sequence_type = seq_type;
rval.multithreaded = FALSE;
rval.supports_mask = FALSE;
rval.init = init_noop;
rval.num_inputs = num_inputs_default;
rval.load = load_noop;
@ -2945,6 +2946,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
rval.execute = do_multicam;
break;
case SEQ_TYPE_ADJUSTMENT:
rval.supports_mask = TRUE;
rval.num_inputs = num_inputs_adjustment;
rval.early_out = early_out_adjustment;
rval.execute = do_adjustment;
@ -2956,7 +2958,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
struct SeqEffectHandle BKE_sequence_get_effect(Sequence *seq)
{
struct SeqEffectHandle rval = {FALSE, NULL};
struct SeqEffectHandle rval = {FALSE, FALSE, NULL};
if (seq->type & SEQ_TYPE_EFFECT) {
rval = get_sequence_effect_impl(seq->type);
@ -2971,7 +2973,7 @@ struct SeqEffectHandle BKE_sequence_get_effect(Sequence *seq)
struct SeqEffectHandle BKE_sequence_get_blend(Sequence *seq)
{
struct SeqEffectHandle rval = {FALSE, NULL};
struct SeqEffectHandle rval = {FALSE, FALSE, NULL};
if (seq->blend_mode != 0) {
rval = get_sequence_effect_impl(seq->blend_mode);
@ -2994,3 +2996,10 @@ int BKE_sequence_effect_get_num_inputs(int seq_type)
}
return 0;
}
int BKE_sequence_effect_get_supports_mask(int seq_type)
{
struct SeqEffectHandle rval = get_sequence_effect_impl(seq_type);
return rval.supports_mask;
}

@ -203,6 +203,8 @@ void BKE_sequence_free(Scene *scene, Sequence *seq)
seq_free_animdata(scene, seq);
}
BKE_sequencer_cache_cleanup_sequence(seq);
MEM_freeN(seq);
}
@ -592,6 +594,9 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
}
break;
case SEQ_TYPE_MOVIECLIP:
if (seq->clip == NULL)
return;
seq->len = BKE_movieclip_get_duration(seq->clip);
seq->len -= seq->anim_startofs;
@ -601,8 +606,9 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
}
break;
case SEQ_TYPE_MASK:
if (seq->mask == NULL)
return;
seq->len = BKE_mask_get_duration(seq->mask);
seq->len -= seq->anim_startofs;
seq->len -= seq->anim_endofs;
if (seq->len < 0) {
@ -1426,12 +1432,13 @@ static void make_cb_table_float(float lift, float gain, float gamma,
}
}
static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, int width, int height, float mul)
static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, unsigned char *mask_rect, int width, int height, float mul)
{
unsigned char cb_tab[3][256];
int c;
unsigned char *p = rect;
unsigned char *e = p + width * 4 * height;
unsigned char *m = mask_rect;
StripColorBalance cb = calc_cb(seq->strip->color_balance);
@ -1440,20 +1447,32 @@ static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, int widt
}
while (p < e) {
p[0] = cb_tab[0][p[0]];
p[1] = cb_tab[1][p[1]];
p[2] = cb_tab[2][p[2]];
if (m) {
float t[3] = {m[0] / 255.0f, m[1] / 255.0f, m[2] / 255.0f};
p[0] = p[0] * (1.0f - t[0]) + t[0] * cb_tab[0][p[0]];
p[1] = p[1] * (1.0f - t[1]) + t[1] * cb_tab[1][p[1]];
p[2] = p[2] * (1.0f - t[2]) + t[2] * cb_tab[2][p[2]];
m += 4;
}
else {
p[0] = cb_tab[0][p[0]];
p[1] = cb_tab[1][p[1]];
p[2] = cb_tab[2][p[2]];
}
p += 4;
}
}
static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *rect_float, int width, int height, float mul)
static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *rect_float, unsigned char *mask_rect, int width, int height, float mul)
{
float cb_tab[4][256];
int c, i;
unsigned char *p = rect;
unsigned char *e = p + width * 4 * height;
unsigned char *m = mask_rect;
float *o;
StripColorBalance cb;
@ -1470,27 +1489,48 @@ static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *
}
while (p < e) {
o[0] = cb_tab[0][p[0]];
o[1] = cb_tab[1][p[1]];
o[2] = cb_tab[2][p[2]];
if (m) {
float t[3] = {m[0] / 255.0f, m[1] / 255.0f, m[2] / 255.0f};
p[0] = p[0] * (1.0f - t[0]) + t[0] * cb_tab[0][p[0]];
p[1] = p[1] * (1.0f - t[1]) + t[1] * cb_tab[1][p[1]];
p[2] = p[2] * (1.0f - t[2]) + t[2] * cb_tab[2][p[2]];
m += 4;
}
else {
o[0] = cb_tab[0][p[0]];
o[1] = cb_tab[1][p[1]];
o[2] = cb_tab[2][p[2]];
}
o[3] = cb_tab[3][p[3]];
p += 4; o += 4;
}
}
static void color_balance_float_float(Sequence *seq, float *rect_float, int width, int height, float mul)
static void color_balance_float_float(Sequence *seq, float *rect_float, float *mask_rect_float, int width, int height, float mul)
{
float *p = rect_float;
float *e = rect_float + width * 4 * height;
float *m = mask_rect_float;
StripColorBalance cb = calc_cb(seq->strip->color_balance);
while (p < e) {
int c;
for (c = 0; c < 3; c++) {
p[c] = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
float t = color_balance_fl(p[c], cb.lift[c], cb.gain[c], cb.gamma[c], mul);
if (m)
p[c] = p[c] * (1.0f - m[c]) + t * m[c];
else
p[c] = t;
}
p += 4;
if (m)
m += 4;
}
}
@ -1498,6 +1538,7 @@ typedef struct ColorBalanceInitData {
Sequence *seq;
ImBuf *ibuf;
float mul;
ImBuf *mask;
} ColorBalanceInitData;
typedef struct ColorBalanceThread {
@ -1506,8 +1547,8 @@ typedef struct ColorBalanceThread {
int width, height;
unsigned char *rect;
float *rect_float;
unsigned char *rect, *mask_rect;
float *rect_float, *mask_rect_float;
} ColorBalanceThread;
static void color_balance_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
@ -1515,6 +1556,7 @@ static void color_balance_init_handle(void *handle_v, int start_line, int tot_li
ColorBalanceThread *handle = (ColorBalanceThread *) handle_v;
ColorBalanceInitData *init_data = (ColorBalanceInitData *) init_data_v;
ImBuf *ibuf = init_data->ibuf;
ImBuf *mask = init_data->mask;
int offset = 4 * start_line * ibuf->x;
@ -1530,6 +1572,18 @@ static void color_balance_init_handle(void *handle_v, int start_line, int tot_li
if (ibuf->rect_float)
handle->rect_float = ibuf->rect_float + offset;
if (mask) {
if (mask->rect)
handle->mask_rect = (unsigned char *) mask->rect + offset;
if (mask->rect_float)
handle->mask_rect_float = mask->rect_float + offset;
}
else {
handle->mask_rect = NULL;
handle->mask_rect_float = NULL;
}
}
static void *color_balance_do_thread(void *thread_data_v)
@ -1538,53 +1592,67 @@ static void *color_balance_do_thread(void *thread_data_v)
Sequence *seq = thread_data->seq;
int width = thread_data->width, height = thread_data->height;
unsigned char *rect = thread_data->rect;
unsigned char *mask_rect = thread_data->mask_rect;
float *rect_float = thread_data->rect_float;
float *mask_rect_float = thread_data->mask_rect_float;
float mul = thread_data->mul;
if (rect_float) {
color_balance_float_float(seq, rect_float, width, height, mul);
color_balance_float_float(seq, rect_float, mask_rect_float, width, height, mul);
}
else if (seq->flag & SEQ_MAKE_FLOAT) {
color_balance_byte_float(seq, rect, rect_float, width, height, mul);
color_balance_byte_float(seq, rect, rect_float, mask_rect, width, height, mul);
}
else {
color_balance_byte_byte(seq, rect, width, height, mul);
color_balance_byte_byte(seq, rect, mask_rect, width, height, mul);
}
return NULL;
}
static void color_balance(Sequence *seq, ImBuf *ibuf, float mul)
static void color_balance(SeqRenderData context, Sequence *seq, ImBuf *ibuf, float mul, int cfra)
{
ColorBalanceInitData init_data;
if (!ibuf->rect_float && seq->flag & SEQ_MAKE_FLOAT)
imb_addrectfloatImBuf(ibuf);
if (BLI_thread_is_main()) {
/* color balance could have been called from prefetching job which
* is already multithreaded, so doing threading here makes no sense
*/
ColorBalanceInitData init_data;
init_data.seq = seq;
init_data.ibuf = ibuf;
init_data.mul = mul;
init_data.mask = NULL;
init_data.seq = seq;
init_data.ibuf = ibuf;
init_data.mul = mul;
if (seq->mask_sequence) {
if (seq->mask_sequence != seq && !BKE_sequence_check_depend(seq, seq->mask_sequence)) {
ImBuf *mask = seq_render_strip(context, seq->mask_sequence, cfra);
IMB_processor_apply_threaded(ibuf->y, sizeof(ColorBalanceThread), &init_data,
color_balance_init_handle, color_balance_do_thread);
if (mask) {
if (ibuf->rect_float) {
if (!mask->rect_float)
IMB_float_from_rect(mask);
}
else {
if (!mask->rect)
IMB_rect_from_float(mask);
}
init_data.mask = mask;
}
}
}
else {
ColorBalanceThread handle;
handle.seq = seq;
handle.mul = mul;
handle.width = ibuf->x;
handle.height = ibuf->y;
handle.rect = (unsigned char *)ibuf->rect;
handle.rect_float = ibuf->rect_float;
IMB_processor_apply_threaded(ibuf->y, sizeof(ColorBalanceThread), &init_data,
color_balance_init_handle, color_balance_do_thread);
color_balance_do_thread(&handle);
}
/* color balance either happens on float buffer or byte buffer, but never on both,
* free byte buffer if there's float buffer since float buffer would be used for
* color balance in favor of byte buffer
*/
if (ibuf->rect_float && ibuf->rect)
imb_freerectImBuf(ibuf);
if (init_data.mask)
IMB_freeImBuf(init_data.mask);
}
/*
@ -1632,7 +1700,7 @@ int BKE_sequencer_input_have_to_preprocess(SeqRenderData UNUSED(context), Sequen
return FALSE;
}
static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float UNUSED(cfra), ImBuf *ibuf,
static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra, ImBuf *ibuf,
int is_proxy_image, int is_preprocessed)
{
float mul;
@ -1727,7 +1795,7 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float UNUSE
}
if (seq->flag & SEQ_USE_COLOR_BALANCE && seq->strip->color_balance) {
color_balance(seq, ibuf, mul);
color_balance(context, seq, ibuf, mul, cfra);
mul = 1.0;
}
@ -2784,11 +2852,34 @@ static void free_anim_seq(Sequence *seq)
}
}
/* check whether sequence cur depends on seq */
int BKE_sequence_check_depend(Sequence *seq, Sequence *cur)
{
/* sequences are not intersecting in time, assume no dependency exists between them */
if (cur->enddisp < seq->startdisp || cur->startdisp > seq->enddisp)
return FALSE;
/* checking sequence is below reference one, not dependent on it */
if (cur->machine < seq->machine)
return FALSE;
/* sequence is not blending with lower machines, no dependency here occurs
* check for non-effects only since effect could use lower machines as input
*/
if ((cur->type & SEQ_TYPE_EFFECT) == 0 &&
((cur->blend_mode == SEQ_BLEND_REPLACE) ||
(cur->blend_mode == SEQ_TYPE_CROSS && cur->blend_opacity == 100.0f)))
{
return FALSE;
}
return TRUE;
}
void BKE_sequence_invalidate_cache(Scene *scene, Sequence *seq)
{
Editing *ed = scene->ed;
Sequence *cur;
int left = seq->startdisp, right = seq->enddisp;
/* invalidate cache for current sequence */
BKE_sequencer_cache_cleanup_sequence(seq);
@ -2796,27 +2887,11 @@ void BKE_sequence_invalidate_cache(Scene *scene, Sequence *seq)
/* invalidate cache for all dependent sequences */
SEQ_BEGIN (ed, cur)
{
int cur_left = cur->startdisp, cur_right = cur->enddisp;
if (cur == seq)
continue;
/* sequence is outside of changed one, shouldn't be invalidated */
if (cur_right < left || cur_left > right)
continue;
/* sequence is below changed one, not dependent on it */
if (cur->machine < seq->machine)
continue;
/* sequence is not blending with lower machines, no need to invalidate */
if ((cur->blend_mode == SEQ_BLEND_REPLACE) ||
(cur->blend_mode == SEQ_TYPE_CROSS && cur->blend_opacity == 100.0f))
{
continue;
}
BKE_sequencer_cache_cleanup_sequence(cur);
if (BKE_sequence_check_depend(seq, cur))
BKE_sequencer_cache_cleanup_sequence(cur);
}
SEQ_END
}
@ -3551,7 +3626,7 @@ static void seq_free_animdata(Scene *scene, Sequence *seq)
}
}
Sequence *BKE_sequwnce_get_by_name(ListBase *seqbase, const char *name, int recursive)
Sequence *BKE_sequence_get_by_name(ListBase *seqbase, const char *name, int recursive)
{
Sequence *iseq = NULL;
Sequence *rseq = NULL;
@ -3559,7 +3634,7 @@ Sequence *BKE_sequwnce_get_by_name(ListBase *seqbase, const char *name, int recu
for (iseq = seqbase->first; iseq; iseq = iseq->next) {
if (strcmp(name, iseq->name + 2) == 0)
return iseq;
else if (recursive && (iseq->seqbase.first) && (rseq = BKE_sequwnce_get_by_name(&iseq->seqbase, name, 1))) {
else if (recursive && (iseq->seqbase.first) && (rseq = BKE_sequence_get_by_name(&iseq->seqbase, name, 1))) {
return rseq;
}
}
@ -3967,3 +4042,21 @@ void BKE_sequence_base_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *
}
}
}
/* called on draw, needs to be fast,
* we could cache and use a flag if we want to make checks for file paths resolving for eg. */
int BKE_seqence_is_valid_check(Sequence *seq)
{
switch (seq->type) {
case SEQ_TYPE_MASK:
return (seq->mask != NULL);
case SEQ_TYPE_MOVIECLIP:
return (seq->clip != NULL);
case SEQ_TYPE_SCENE:
return (seq->scene != NULL);
case SEQ_TYPE_SOUND_RAM:
return (seq->sound != NULL);
}
return TRUE;
}

@ -2449,7 +2449,7 @@ int BKE_tracking_context_step(MovieTrackingContext *context)
frame_width = destination_ibuf->x;
frame_height = destination_ibuf->y;
#pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size>1)
#pragma omp parallel for private(a) shared(destination_ibuf, ok) if (map_size > 1)
for (a = 0; a < map_size; a++) {
TrackContext *track_context = NULL;
MovieTrackingTrack *track;

@ -180,13 +180,13 @@ static struct bUnitDef buMetricVolDef[] = {
static struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialVolDef[] = {
{"cubic mile", "cubic miles", "cu mi", "cu m", "Cubic Miles", UN_SC_MI * UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
{"cubic furlong", "cubic furlongs", "cu fur", NULL, "Cubic Furlongs", UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH * UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD * UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
{"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT * UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
{"cubic inch", "cubic inches", "cu in", NULL , "Cubic Inches", UN_SC_IN * UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
{"cubic thou", "cubic thous", "cu mil", NULL, "Cubic Thous", UN_SC_MIL * UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
{"cubic mile", "cubic miles", "cu mi", "cu m", "Cubic Miles", UN_SC_MI * UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
{"cubic furlong", "cubic furlongs", "cu fur", NULL, "Cubic Furlongs", UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH * UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
{"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD * UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
{"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT * UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
{"cubic inch", "cubic inches", "cu in", NULL, "Cubic Inches", UN_SC_IN * UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
{"cubic thou", "cubic thous", "cu mil", NULL, "Cubic Thous", UN_SC_MIL * UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0, sizeof(buImperialVolDef) / sizeof(bUnitDef)};

@ -46,7 +46,7 @@
* BLI_array_declare(arr);
* int i;
*
* for (i=0; i<10; i++) {
* for (i = 0; i < 10; i++) {
* BLI_array_grow_one(arr);
* arr[i] = something;
* }

@ -50,7 +50,7 @@ typedef struct BVHTreeOverlap {
} BVHTreeOverlap;
/* flags */
#define BVH_ONQUAD (1<<0)
#define BVH_ONQUAD (1 << 0)
typedef struct BVHTreeNearest {
int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */

@ -53,6 +53,10 @@ void BLI_rctf_translate(struct rctf *rect, float x, float y);
void BLI_rcti_translate(struct rcti *rect, int x, int y);
void BLI_rcti_resize(struct rcti *rect, int x, int y);
void BLI_rctf_resize(struct rctf *rect, float x, float y);
void BLI_rctf_interp(struct rctf *rect, const struct rctf *rect_a, const struct rctf *rect_b, const float fac);
//void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac);
int BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit);
int BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b);
int BLI_in_rcti(const struct rcti *rect, const int x, const int y);
int BLI_in_rcti_v(const struct rcti *rect, const int xy[2]);
int BLI_in_rctf(const struct rctf *rect, const float x, const float y);

@ -188,7 +188,7 @@ float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const
if (len == 0.0f) {
rc[0] = p[0] - l1[0];
rc[1] = p[1] - l1[1];
return (float)(sqrt(rc[0] * rc[0] + rc[1] * rc[1]));
return (rc[0] * rc[0] + rc[1] * rc[1]);
}
labda = (rc[0] * (p[0] - l1[0]) + rc[1] * (p[1] - l1[1])) / len;
@ -733,7 +733,7 @@ int isect_ray_tri_v3(const float p1[3], const float d[3],
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
* a human head (1BU == 1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
f = 1.0f / a;
@ -772,7 +772,7 @@ int isect_ray_plane_v3(const float p1[3], const float d[3],
cross_v3_v3v3(p, d, e2);
a = dot_v3v3(e1, p);
/* note: these values were 0.000001 in 2.4x but for projection snapping on
* a human head (1BU==1m), subsurf level 2, this gave many errors - campbell */
* a human head (1BU == 1m), subsurf level 2, this gave many errors - campbell */
if ((a > -0.00000001f) && (a < 0.00000001f)) return 0;
f = 1.0f / a;

@ -270,6 +270,39 @@ void BLI_rctf_resize(rctf *rect, float x, float y)
rect->ymax = rect->ymin + y;
}
void BLI_rctf_interp(rctf *rect, const rctf *rect_a, const rctf *rect_b, const float fac)
{
const float ifac = 1.0f - fac;
rect->xmin = (rect_a->xmin * ifac) + (rect_b->xmin * fac);
rect->xmax = (rect_a->xmax * ifac) + (rect_b->xmax * fac);
rect->ymin = (rect_a->ymin * ifac) + (rect_b->ymin * fac);
rect->ymax = (rect_a->ymax * ifac) + (rect_b->ymax * fac);
}
/* BLI_rcti_interp() not needed yet */
int BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit)
{
if (fabsf(rect_a->xmin - rect_b->xmin) < limit)
if (fabsf(rect_a->xmax - rect_b->xmax) < limit)
if (fabsf(rect_a->ymin - rect_b->ymin) < limit)
if (fabsf(rect_a->ymax - rect_b->ymax) < limit)
return 1;
return 0;
}
int BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b)
{
if (rect_a->xmin == rect_b->xmin)
if (rect_a->xmax == rect_b->xmax)
if (rect_a->ymin == rect_b->ymin)
if (rect_a->ymax == rect_b->ymax)
return 1;
return 0;
}
int BLI_rctf_isect(const rctf *src1, const rctf *src2, rctf *dest)
{
float xmin, xmax;

@ -415,7 +415,7 @@ static short boundinsideEV(ScanFillEdge *eed, ScanFillVert *eve)
static void testvertexnearedge(ScanFillContext *sf_ctx)
{
/* only vertices with ->h==1 are being tested for
/* only vertices with (->h == 1) are being tested for
* being close to an edge, if true insert */
ScanFillVert *eve;
@ -947,7 +947,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
return 0;
}
/* does it only for vertices with ->h==1 */
/* does it only for vertices with (->h == 1) */
testvertexnearedge(sf_ctx);
ok = 1;

@ -234,7 +234,7 @@ size_t BLI_wstrlen_utf8(const wchar_t *src)
// utf8slen
size_t BLI_strlen_utf8(const char *strc)
{
int len=0;
int len = 0;
while (*strc) {
if ((*strc & 0xe0) == 0xc0) {
@ -259,7 +259,7 @@ size_t BLI_strlen_utf8(const char *strc)
size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size_t maxcpy)
{
int len=0;
int len = 0;
if (dst_w == NULL || src_c == NULL) {
return 0;

@ -28,7 +28,7 @@
* http://blog.ivank.net/fortunes-algorithm-and-implementation.html
*/
/** \file blender/blenkernel/intern/voronoi.c
/** \file blender/blenlib/intern/voronoi.c
* \ingroup bli
*/

@ -4844,19 +4844,27 @@ static void lib_link_scene(FileData *fd, Main *main)
}
if (seq->clip) {
seq->clip = newlibadr(fd, sce->id.lib, seq->clip);
seq->clip->id.us++;
if (seq->clip) {
seq->clip->id.us++;
}
}
if (seq->mask) {
seq->mask = newlibadr(fd, sce->id.lib, seq->mask);
seq->mask->id.us++;
if (seq->mask) {
seq->mask->id.us++;
}
}
if (seq->scene_camera) {
seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera);
}
if (seq->scene_camera) seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera);
if (seq->sound) {
seq->scene_sound = NULL;
if (seq->type == SEQ_TYPE_SOUND_HD)
if (seq->type == SEQ_TYPE_SOUND_HD) {
seq->type = SEQ_TYPE_SOUND_RAM;
else
}
else {
seq->sound = newlibadr(fd, sce->id.lib, seq->sound);
}
if (seq->sound) {
seq->sound->id.us++;
seq->scene_sound = sound_add_scene_sound_defaults(sce, seq);
@ -4979,6 +4987,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
seq->seq1= newdataadr(fd, seq->seq1);
seq->seq2= newdataadr(fd, seq->seq2);
seq->seq3= newdataadr(fd, seq->seq3);
seq->mask_sequence= newdataadr(fd, seq->mask_sequence);
/* a patch: after introduction of effects with 3 input strips */
if (seq->seq3 == NULL) seq->seq3 = seq->seq2;
@ -5738,6 +5747,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
ar->v2d.tab_offset = NULL;
ar->v2d.tab_num = 0;
ar->v2d.tab_cur = 0;
ar->v2d.sms = NULL;
ar->handlers.first = ar->handlers.last = NULL;
ar->uiblocks.first = ar->uiblocks.last = NULL;
ar->headerstr = NULL;

@ -1816,7 +1816,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase)
/* backup */
/* now fill in polys to mfaces*/
/* now fill in polys to mfaces */
mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata,
mesh->totface, backup_mesh.totloop, backup_mesh.totpoly);

@ -539,8 +539,8 @@ void BMO_remove_tagged_verts(BMesh *bm, const short oflag)
}
}
/*************************************************************/
/* you need to make remove tagged verts/edges/faces
/**
* you need to make remove tagged verts/edges/faces
* api functions that take a filter callback.....
* and this new filter type will be for opstack flags.
* This is because the BM_remove_taggedXXX functions bypass iterator API.

@ -1134,7 +1134,7 @@ static BMFace *bm_face_create__sfme(BMesh *bm, BMFace *UNUSED(example))
* The second region has a new face assigned to it.
*
* \par Examples:
*
* <pre>
* Before: After:
* +--------+ +--------+
* | | | |
@ -1143,6 +1143,7 @@ static BMFace *bm_face_create__sfme(BMesh *bm, BMFace *UNUSED(example))
* | | | f2 |
* | | | |
* +--------+ +--------+
* </pre>
*
* \note the input vertices can be part of the same edge. This will
* result in a two edged face. This is desirable for advanced construction
@ -1302,12 +1303,13 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
* will be attached to that end and is returned in \a r_e.
*
* \par Examples:
*
* <pre>
* E
* Before: OV-------------TV
*
* E RE
* After: OV------NV-----TV
* </pre>
*
* \return The newly created BMVert pointer.
*/
@ -1474,7 +1476,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
* and collapses the edge on that vertex.
*
* \par Examples:
*
* <pre>
* Before: OE KE
* ------- -------
* | || |
@ -1485,6 +1487,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
* ---------------
* | |
* OV TV
* </pre>
*
* \par Restrictions:
* KV is a vertex that must have a valance of exactly two. Furthermore
@ -1636,7 +1639,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
* Both faces in its radial cycle
*
* \par Examples:
*
* <pre>
* A B
* +--------+ +--------+
* | | | |
@ -1645,6 +1648,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou
* | f2 | | f2 |
* | | | |
* +--------+ +--------+
* </pre>
*
* In the example A, faces \a f1 and \a f2 are joined by a single edge,
* and the euler can safely be used.
@ -1942,7 +1946,7 @@ int bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len)
}
/**
* High level function which wraps both #bm_vert_separate and #bm_edge_separate
* High level function which wraps both #bmesh_vert_separate and #bmesh_edge_separate
*/
int BM_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len,
BMEdge **e_in, int e_in_len)

@ -23,7 +23,7 @@
#ifndef __BMESH_ERROR_H__
#define __BMESH_ERROR_H__
/** \file blender/bmesh/bmesh_error.h
/** \file blender/bmesh/intern/bmesh_error.h
* \ingroup bmesh
*/

@ -186,7 +186,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source)
* \brief Multires Interpolation
*
* mdisps is a grid of displacements, ordered thus:
*
* <pre>
* v1/center----v4/next -> x
* | |
* | |
@ -194,6 +194,7 @@ void BM_face_interp_from_face(BMesh *bm, BMFace *target, BMFace *source)
* |
* V
* y
* </pre>
*/
static int compute_mdisp_quad(BMLoop *l, float v1[3], float v2[3], float v3[3], float v4[3],
float e1[3], float e2[3])

@ -567,9 +567,9 @@ BMFace *BM_active_face_get(BMesh *bm, int sloppy)
* These functions were written to be used by the Modifier widget
* when in Rotate about active mode, but can be used anywhere.
*
* - #EM_editselection_center
* - #EM_editselection_normal
* - #EM_editselection_plane
* - #BM_editselection_center
* - #BM_editselection_normal
* - #BM_editselection_plane
*/
void BM_editselection_center(BMEditSelection *ese, float r_center[3])
{

@ -45,20 +45,21 @@
* Turns the face region surrounding a manifold vertex into a single polygon.
*
* \par Example:
*
* <pre>
* +---------+ +---------+
* | \ / | | |
* Before: | v | After: | |
* | / \ | | |
* +---------+ +---------+
*
* </pre>
*
* This function can also collapse edges too
* in cases when it cant merge into faces.
*
* \par Example:
*
* <pre>
* Before: +----v----+ After: +---------+
* </pre>
*
* \note dissolves vert, in more situations then BM_disk_dissolve
* (e.g. if the vert is part of a wire edge, etc).
@ -383,7 +384,7 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
* \param bm The bmesh
* \param f the original face
* \param v1, v2 vertices which define the split edge, must be different
* \param co Array of coordinates for intermediate points
* \param cos Array of coordinates for intermediate points
* \param n Length of \a cos (must be > 0)
* \param r_l pointer which will receive the BMLoop for the first split edge (from \a v1) in the new face
* \param example Edge used for attributes of splitting edge, if non-NULL
@ -887,6 +888,7 @@ int BM_edge_rotate_check(BMEdge *e)
* 1) does the newly forms edge form a flipped face (compare with previous cross product)
* 2) does the newly formed edge cause a zero area corner (or close enough to be almost zero)
*
* \param e The edge to test rotation.
* \param l1,l2 are the loops of the proposed verts to rotate too and should
* be the result of calling #BM_edge_calc_rotate
*/

@ -23,7 +23,7 @@
#ifndef __BMESH_OPERATOR_API_H__
#define __BMESH_OPERATOR_API_H__
/** \file blender/bmesh/bmesh_operator_api.h
/** \file blender/bmesh/intern/bmesh_operator_api.h
* \ingroup bmesh
*/

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