Merged changes in the trunk up to revision 28911.

This commit is contained in:
2010-05-21 22:01:47 +00:00
178 changed files with 7473 additions and 8152 deletions

View File

@@ -61,6 +61,9 @@ MACRO(SETUP_LIBDIRS)
IF(WITH_OPENEXR) IF(WITH_OPENEXR)
LINK_DIRECTORIES(${OPENEXR_LIBPATH}) LINK_DIRECTORIES(${OPENEXR_LIBPATH})
ENDIF(WITH_OPENEXR) ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
LINK_DIRECTORIES(${TIFF_LIBPATH})
ENDIF(WITH_TIFF)
IF(WITH_QUICKTIME) IF(WITH_QUICKTIME)
LINK_DIRECTORIES(${QUICKTIME_LIBPATH}) LINK_DIRECTORIES(${QUICKTIME_LIBPATH})
ENDIF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME)
@@ -134,6 +137,9 @@ MACRO(SETUP_LIBLINKS
IF(WITH_QUICKTIME) IF(WITH_QUICKTIME)
TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB}) TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
ENDIF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME)
IF(WITH_TIFF)
TARGET_LINK_LIBRARIES(${target} ${TIFF_LIBRARY})
ENDIF(WITH_TIFF)
IF(WITH_OPENEXR) IF(WITH_OPENEXR)
IF(WIN32) IF(WIN32)
FOREACH(loop_var ${OPENEXR_LIB}) FOREACH(loop_var ${OPENEXR_LIB})

View File

@@ -63,6 +63,7 @@ OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON)
OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
OPTION(WITH_TIFF "Enable LibTIFF Support" ON)
OPTION(WITH_DDS "Enable DDS Support" ON) OPTION(WITH_DDS "Enable DDS Support" ON)
OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF)
OPTION(WITH_PYTHON "Enable Embedded Python API" ON) OPTION(WITH_PYTHON "Enable Embedded Python API" ON)
@@ -124,11 +125,9 @@ IF(UNIX AND NOT APPLE)
IF(WITH_OPENAL) IF(WITH_OPENAL)
FIND_PACKAGE(OpenAL) FIND_PACKAGE(OpenAL)
IF(OPENAL_FOUND) IF(NOT OPENAL_FOUND)
SET(WITH_OPENAL ON)
ELSE(OPENAL_FOUND)
SET(WITH_OPENAL OFF) SET(WITH_OPENAL OFF)
ENDIF(OPENAL_FOUND) ENDIF(NOT OPENAL_FOUND)
ENDIF(WITH_OPENAL) ENDIF(WITH_OPENAL)
IF(WITH_JACK) IF(WITH_JACK)
@@ -185,11 +184,11 @@ IF(UNIX AND NOT APPLE)
ENDIF(NOT SDL_FOUND) ENDIF(NOT SDL_FOUND)
ENDIF(WITH_SDL) ENDIF(WITH_SDL)
SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory") SET(OPENEXR /usr CACHE FILEPATH "OPENEXR Directory")
FIND_PATH(OPENEXR_INC FIND_PATH(OPENEXR_INC
ImfXdr.h ImfXdr.h
PATHS PATHS
${OPENEXR}/include/OpenEXR ${OPENEXR}/include/OpenEXR
/usr/local/include/OpenEXR /usr/local/include/OpenEXR
/sw/include/OpenEXR /sw/include/OpenEXR
/opt/local/include/OpenEXR /opt/local/include/OpenEXR
@@ -215,6 +214,13 @@ IF(UNIX AND NOT APPLE)
SET(LIBSAMPLERATE_LIB samplerate) SET(LIBSAMPLERATE_LIB samplerate)
SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
IF(WITH_TIFF)
FIND_PACKAGE(TIFF)
IF(NOT TIFF_FOUND)
SET(WITH_TIFF OFF)
ENDIF(NOT TIFF_FOUND)
ENDIF(WITH_TIFF)
FIND_PACKAGE(JPEG REQUIRED) FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
@@ -409,7 +415,9 @@ IF(WIN32)
SET(JPEG_LIBPATH ${JPEG}/lib) SET(JPEG_LIBPATH ${JPEG}/lib)
SET(TIFF ${LIBDIR}/tiff) SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include) SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBRARY tiff)
SET(TIFF_LIBPATH ${TIFF}/lib)
SET(WINTAB_INC ${LIBDIR}/wintab/include) SET(WINTAB_INC ${LIBDIR}/wintab/include)
@@ -478,7 +486,7 @@ IF(APPLE)
# SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}") # not used yet
SET(PYTHON_LIB python${PYTHON_VERSION}) SET(PYTHON_LIB python${PYTHON_VERSION})
SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}") SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}")
# SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
ELSE(PYTHON_VERSION MATCHES 3.1) ELSE(PYTHON_VERSION MATCHES 3.1)
# otherwise, use custom system framework # otherwise, use custom system framework
@@ -585,7 +593,9 @@ IF(APPLE)
SET(JPEG_LIBPATH ${JPEG}/lib) SET(JPEG_LIBPATH ${JPEG}/lib)
SET(TIFF ${LIBDIR}/tiff) SET(TIFF ${LIBDIR}/tiff)
SET(TIFF_INC ${TIFF}/include) SET(TIFF_INCLUDE_DIR ${TIFF}/include)
SET(TIFF_LIBRARY tiff)
SET(TIFF_LIBPATH ${TIFF}/lib)
SET(EXETYPE MACOSX_BUNDLE) SET(EXETYPE MACOSX_BUNDLE)

View File

@@ -163,8 +163,11 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png' BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib' BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff' BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include' BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
WITH_BF_ZLIB = True WITH_BF_ZLIB = True
BF_ZLIB = '/usr' BF_ZLIB = '/usr'

View File

@@ -68,8 +68,10 @@ BF_PNG = '/usr'
BF_PNG_INC = '${BF_PNG}/include' BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png' BF_PNG_LIB = 'png'
WITH_BF_TIFF = True
BF_TIFF = '/usr' BF_TIFF = '/usr'
BF_TIFF_INC = '${BF_TIFF}/include' BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'tiff'
WITH_BF_ZLIB = True WITH_BF_ZLIB = True
BF_ZLIB = '/usr' BF_ZLIB = '/usr'

View File

@@ -73,6 +73,7 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'png' BF_PNG_LIB = 'png'
BF_PNG_LIBPATH = '${BF_PNG}/lib' BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff' BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include' BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff' BF_TIFF_LIB = 'libtiff'

View File

@@ -79,6 +79,7 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng_st' BF_PNG_LIB = 'libpng_st'
BF_PNG_LIBPATH = '${BF_PNG}/lib' BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff' BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include' BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff' BF_TIFF_LIB = 'libtiff'

View File

@@ -75,6 +75,7 @@ BF_PNG_INC = '${BF_PNG}/include'
BF_PNG_LIB = 'libpng' BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '${BF_PNG}/lib' BF_PNG_LIBPATH = '${BF_PNG}/lib'
WITH_BF_TIFF = True
BF_TIFF = LIBDIR + '/tiff' BF_TIFF = LIBDIR + '/tiff'
BF_TIFF_INC = '${BF_TIFF}/include' BF_TIFF_INC = '${BF_TIFF}/include'
BF_TIFF_LIB = 'libtiff' BF_TIFF_LIB = 'libtiff'

View File

@@ -23,6 +23,9 @@
* ***** END LGPL LICENSE BLOCK ***** * ***** END LGPL LICENSE BLOCK *****
*/ */
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#include "AUD_FFMPEGFactory.h" #include "AUD_FFMPEGFactory.h"
#include "AUD_FFMPEGReader.h" #include "AUD_FFMPEGReader.h"
#include "AUD_Buffer.h" #include "AUD_Buffer.h"

View File

@@ -27,6 +27,11 @@
#include <cstring> #include <cstring>
#include <cmath> #include <cmath>
#ifdef WITH_FFMPEG
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#endif
#include "AUD_NULLDevice.h" #include "AUD_NULLDevice.h"
#include "AUD_I3DDevice.h" #include "AUD_I3DDevice.h"
#include "AUD_FileFactory.h" #include "AUD_FileFactory.h"
@@ -62,6 +67,7 @@
#include "AUD_JackDevice.h" #include "AUD_JackDevice.h"
#endif #endif
#ifdef WITH_FFMPEG #ifdef WITH_FFMPEG
extern "C" { extern "C" {
#include <libavformat/avformat.h> #include <libavformat/avformat.h>

View File

@@ -29,6 +29,9 @@
#include <cstring> #include <cstring>
#ifdef WITH_FFMPEG #ifdef WITH_FFMPEG
// needed for INT64_C
#define __STDC_CONSTANT_MACROS
#include "AUD_FFMPEGReader.h" #include "AUD_FFMPEGReader.h"
#endif #endif
#ifdef WITH_SNDFILE #ifdef WITH_SNDFILE

View File

@@ -24,57 +24,67 @@
# #
# ***** END GPL LICENSE BLOCK ***** # ***** END GPL LICENSE BLOCK *****
SET(INC . ../string ../../extern/glew/include ../../source/blender/imbuf ../../source/blender/makesdna) SET(INC
.
../string
../../extern/glew/include
../../source/blender/imbuf
../../source/blender/makesdna
)
FILE(GLOB SRC intern/*.cpp intern/*.mm) SET(SRC
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Buttons.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_CallbackEventConsumer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_C-api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_EventManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_EventPrinter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ISystem.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_ModifierKeys.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_NDOFManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Rect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_System.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_TimerManager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_Window.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowManager.cpp
)
IF(APPLE) IF(APPLE)
IF(WITH_COCOA) IF(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") SET(SRC ${SRC}
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm
)
ELSE(WITH_COCOA) ELSE(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm") SET(SRC ${SRC}
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp
)
ENDIF(WITH_COCOA) ENDIF(WITH_COCOA)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
IF(WITH_QUICKTIME) IF(WITH_QUICKTIME)
ADD_DEFINITIONS(-DWITH_QUICKTIME) ADD_DEFINITIONS(-DWITH_QUICKTIME)
ENDIF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME)
ELSE(APPLE) ELSEIF(WIN32)
IF(WIN32) SET(INC ${INC} ${WINTAB_INC})
SET(INC ${INC} ${WINTAB_INC})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") SET(SRC ${SRC}
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm") )
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp") ELSEIF(UNIX)
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp") SET(INC ${INC} ${X11_X11_INCLUDE_PATH})
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp")
ELSE(WIN32) SET(SRC ${SRC}
SET(INC ${INC} ${X11_X11_INCLUDE_PATH}) ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DropTargetWin32.cpp") ${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") )
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCocoa.mm")
LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCocoa.mm")
ENDIF(WIN32)
ENDIF(APPLE) ENDIF(APPLE)
BLENDERLIB(bf_ghost "${SRC}" "${INC}") BLENDERLIB(bf_ghost "${SRC}" "${INC}")
#, libtype=['core','player'], priority = [25,15] )

View File

@@ -545,7 +545,7 @@ def write_pov(filename, scene=None, info_callback=None):
mist = world.mist mist = world.mist
if mist.enabled: if mist.use_mist:
file.write('fog {\n') file.write('fog {\n')
file.write('\tdistance %.6f\n' % mist.depth) file.write('\tdistance %.6f\n' % mist.depth)
file.write('\tcolor rgbt<%.3g, %.3g, %.3g, %.3g>\n' % (tuple(world.horizon_color) + (1 - mist.intensity,))) file.write('\tcolor rgbt<%.3g, %.3g, %.3g, %.3g>\n' % (tuple(world.horizon_color) + (1 - mist.intensity,)))
@@ -629,7 +629,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
file.write('Output_File_Type=T\n') # TGA, best progressive loading file.write('Output_File_Type=T\n') # TGA, best progressive loading
file.write('Output_Alpha=1\n') file.write('Output_Alpha=1\n')
if render.antialiasing: if render.render_antialiasing:
aa_mapping = {'5': 2, '8': 3, '11': 4, '16': 5} # method 1 assumed aa_mapping = {'5': 2, '8': 3, '11': 4, '16': 5} # method 1 assumed
file.write('Antialias=1\n') file.write('Antialias=1\n')
file.write('Antialias_Depth=%d\n' % aa_mapping[render.antialiasing_samples]) file.write('Antialias_Depth=%d\n' % aa_mapping[render.antialiasing_samples])

View File

@@ -458,13 +458,11 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
pose_bone = pose_bones[bone_name] pose_bone = pose_bones[bone_name]
pose_bone.rotation_mode = eul_order_lookup[tuple(bvh_node.rot_order)] pose_bone.rotation_mode = eul_order_lookup[tuple(bvh_node.rot_order)]
elif ROT_MODE == 'XYZ': elif ROT_MODE != 'QUATERNION':
print(2)
for pose_bone in pose_bones: for pose_bone in pose_bones:
pose_bone.rotation_mode = 'XYZ' pose_bone.rotation_mode = ROT_MODE
else: else:
# Quats default # Quats default
print(3)
pass pass
context.scene.update() context.scene.update()
@@ -520,13 +518,13 @@ def bvh_node_dict2armature(context, bvh_nodes, ROT_MODE='XYZ', IMPORT_START_FRAM
lx, ly, lz, rx, ry, rz = bvh_node.anim_data[frame_current + 1] lx, ly, lz, rx, ry, rz = bvh_node.anim_data[frame_current + 1]
if bvh_node.has_rot: if bvh_node.has_rot:
bone_rotation_matrix = Euler(rx, ry, rz).to_matrix().resize4x4() bone_rotation_matrix = Euler((rx, ry, rz)).to_matrix().resize4x4()
bone_rotation_matrix = bone_rest_matrix_inv * bone_rotation_matrix * bone_rest_matrix bone_rotation_matrix = bone_rest_matrix_inv * bone_rotation_matrix * bone_rest_matrix
if ROT_MODE == 'QUATERNION': if ROT_MODE == 'QUATERNION':
pose_bone.rotation_quaternion = bone_rotation_matrix.to_quat() pose_bone.rotation_quaternion = bone_rotation_matrix.to_quat()
else: else:
euler = bone_rotation_matrix.to_euler('XYZ', prev_euler[i]) # pose_bone.rotation_mode # TODO, XYZ default for now euler = bone_rotation_matrix.to_euler(pose_bone.rotation_mode, prev_euler[i])
pose_bone.rotation_euler = euler pose_bone.rotation_euler = euler
prev_euler[i] = euler prev_euler[i] = euler
@@ -569,17 +567,17 @@ class BvhImporter(bpy.types.Operator):
loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False) loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False)
rotate_mode = EnumProperty(items=( rotate_mode = EnumProperty(items=(
('QUATERNION', "Quaternion", "Convert rotations to quaternions"), ('QUATERNION', "Quaternion", "Convert rotations to quaternions"),
# ('NATIVE', "Euler (Native)", "Use the rotation order defined in the BVH file"), ('NATIVE', "Euler (Native)", "Use the rotation order defined in the BVH file"),
('XYZ', "Euler (XYZ)", "Convert rotations to euler XYZ"), ('XYZ', "Euler (XYZ)", "Convert rotations to euler XYZ"),
# ('XZY', "Euler (XZY)", "Convert rotations to euler XZY"), ('XZY', "Euler (XZY)", "Convert rotations to euler XZY"),
# ('YXZ', "Euler (YXZ)", "Convert rotations to euler YXZ"), ('YXZ', "Euler (YXZ)", "Convert rotations to euler YXZ"),
# ('YZX', "Euler (YZX)", "Convert rotations to euler YZX"), ('YZX', "Euler (YZX)", "Convert rotations to euler YZX"),
# ('ZXY', "Euler (ZXY)", "Convert rotations to euler ZXY"), ('ZXY', "Euler (ZXY)", "Convert rotations to euler ZXY"),
# ('ZYX', "Euler (ZYX)", "Convert rotations to euler ZYX")), ('ZYX', "Euler (ZYX)", "Convert rotations to euler ZYX"),
), ),
name="Rotation", name="Rotation",
description="Rotation conversion.", description="Rotation conversion.",
default='QUATERNION') default='NATIVE')
def execute(self, context): def execute(self, context):
# print("Selected: " + context.active_object.name) # print("Selected: " + context.active_object.name)

View File

@@ -104,7 +104,7 @@ from bpy.props import *
class importMDD(bpy.types.Operator): class importMDD(bpy.types.Operator):
'''Import MDD vertex keyframe file to shape keys''' '''Import MDD vertex keyframe file to shape keys'''
bl_idname = "import.mdd" bl_idname = "import_shape.mdd"
bl_label = "Import MDD" bl_label = "Import MDD"
# get first scene to get min and max properties for frames, fps # get first scene to get min and max properties for frames, fps

View File

@@ -26,7 +26,7 @@ def RKS_POLL_selected_objects(ksi, context):
def RKS_POLL_selected_bones(ksi, context): def RKS_POLL_selected_bones(ksi, context):
# we must be in Pose Mode, and there must be some bones selected # we must be in Pose Mode, and there must be some bones selected
if (context.active_object) and (context.active_object.mode == 'POSE'): if (context.active_object) and (context.active_object.mode == 'POSE'):
if context.active_pose_bone or len(context.select_pose_bones): if context.active_pose_bone or len(context.selected_pose_bones):
return True; return True;
# nothing selected # nothing selected

View File

@@ -348,7 +348,7 @@ def smpte_from_seconds(time, fps=None):
hours = minutes = seconds = frames = 0 hours = minutes = seconds = frames = 0
if time < 0: if time < 0:
time = -time time = - time
neg = "-" neg = "-"
else: else:
neg = "" neg = ""
@@ -361,10 +361,10 @@ def smpte_from_seconds(time, fps=None):
time = time % 60.0 time = time % 60.0
seconds = int(time) seconds = int(time)
frames= int(round(math.floor( ((time - seconds) * fps)))) frames= int(round(math.floor(((time - seconds) * fps))))
return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames) return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames)
def smpte_from_frame(frame, fps=None, fps_base=None): def smpte_from_frame(frame, fps=None, fps_base=None):
''' '''
@@ -380,4 +380,3 @@ def smpte_from_frame(frame, fps=None, fps_base=None):
fps_base = _bpy.context.scene.render.fps_base fps_base = _bpy.context.scene.render.fps_base
return smpte_from_seconds((frame * fps_base) / fps, fps) return smpte_from_seconds((frame * fps_base) / fps, fps)

View File

@@ -410,6 +410,19 @@ class MeshFace(StructRNA):
return ord_ind(verts[0], verts[1]), ord_ind(verts[1], verts[2]), ord_ind(verts[2], verts[3]), ord_ind(verts[3], verts[0]) return ord_ind(verts[0], verts[1]), ord_ind(verts[1], verts[2]), ord_ind(verts[2], verts[3]), ord_ind(verts[3], verts[0])
class Text(bpy_types.ID):
__slots__ = ()
def as_string(self):
"""Return the text as a string."""
return "\n".join(line.line for line in self.lines)
def from_string(self, string):
"""Replace text with this string."""
self.clear()
self.write(string)
import collections import collections

View File

@@ -200,8 +200,8 @@ class InfoPropertyRNA:
if self.type == "enum": if self.type == "enum":
self.enum_items[:] = rna_prop.items.keys() self.enum_items[:] = rna_prop.items.keys()
if self.array_length: if self.array_length:
self.default = tuple(getattr(rna_prop, "default_array", ())) self.default = tuple(getattr(rna_prop, "default_array", ()))
else: else:
@@ -245,7 +245,7 @@ class InfoPropertyRNA:
type_str += self.type type_str += self.type
if self.array_length: if self.array_length:
type_str += " array of %d items" % (self.array_length) type_str += " array of %d items" % (self.array_length)
if self.type in ("float", "int"): if self.type in ("float", "int"):
type_str += " in [%s, %s]" % (range_str(self.min), range_str(self.max)) type_str += " in [%s, %s]" % (range_str(self.min), range_str(self.max))
elif self.type == "enum": elif self.type == "enum":

View File

@@ -507,6 +507,26 @@ class MakeDupliFace(bpy.types.Operator):
return {'FINISHED'} return {'FINISHED'}
class IsolateTypeRender(bpy.types.Operator):
'''Select object matching a naming pattern'''
bl_idname = "object.isolate_type_render"
bl_label = "Isolate Render Selection"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
act_type = context.object.type
for obj in context.visible_objects:
if obj.selected:
obj.restrict_render = False
else:
if obj.type == act_type:
obj.restrict_render = True
return {'FINISHED'}
classes = [ classes = [
SelectPattern, SelectPattern,
SelectCamera, SelectCamera,
@@ -514,6 +534,7 @@ classes = [
SubdivisionSet, SubdivisionSet,
ShapeTransfer, ShapeTransfer,
JoinUVs, JoinUVs,
IsolateTypeRender,
MakeDupliFace] MakeDupliFace]

View File

@@ -22,6 +22,7 @@ import bpy
from bpy.props import * from bpy.props import *
class SequencerCrossfadeSounds(bpy.types.Operator): class SequencerCrossfadeSounds(bpy.types.Operator):
'''Do crossfading volume animation of two selected sound strips.''' '''Do crossfading volume animation of two selected sound strips.'''
@@ -95,16 +96,17 @@ class SequencerCutMulticam(bpy.types.Operator):
if not s.selected: if not s.selected:
s.selected = True s.selected = True
cfra = context.scene.frame_current cfra = context.scene.frame_current
bpy.ops.sequencer.cut(frame=cfra,type='HARD',side='RIGHT') bpy.ops.sequencer.cut(frame=cfra, type='HARD', side='RIGHT')
for s in context.scene.sequence_editor.sequences_all: for s in context.scene.sequence_editor.sequences_all:
if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end: if s.selected and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end:
context.scene.sequence_editor.active_strip = s context.scene.sequence_editor.active_strip = s
context.scene.sequence_editor.active_strip.multicam_source = camera context.scene.sequence_editor.active_strip.multicam_source = camera
return {'FINISHED'} return {'FINISHED'}
class SequencerDeinterlaceSelectedMovies(bpy.types.Operator): class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
'''Deinterlace all selected movie sources.''' '''Deinterlace all selected movie sources.'''
@@ -122,14 +124,13 @@ class SequencerDeinterlaceSelectedMovies(bpy.types.Operator):
for s in context.scene.sequence_editor.sequences_all: for s in context.scene.sequence_editor.sequences_all:
if s.selected and s.type == 'MOVIE': if s.selected and s.type == 'MOVIE':
s.de_interlace = True s.de_interlace = True
return {'FINISHED'}
return {'FINISHED'}
def register(): def register():
register = bpy.types.register register = bpy.types.register
register(SequencerCrossfadeSounds) register(SequencerCrossfadeSounds)
register(SequencerCutMulticam) register(SequencerCutMulticam)
register(SequencerDeinterlaceSelectedMovies) register(SequencerDeinterlaceSelectedMovies)
@@ -137,7 +138,7 @@ def register():
def unregister(): def unregister():
unregister = bpy.types.unregister unregister = bpy.types.unregister
unregister(SequencerCrossfadeSounds) unregister(SequencerCrossfadeSounds)
unregister(SequencerCutMulticam) unregister(SequencerCutMulticam)
unregister(SequencerDeinterlaceSelectedMovies) unregister(SequencerDeinterlaceSelectedMovies)

View File

@@ -0,0 +1,56 @@
from mathutils import Vector
from bpy.props import FloatVectorProperty
class ViewOperator(bpy.types.Operator):
'''Translate the view using mouse events.'''
bl_idname = "view3d.modal_operator"
bl_label = "Simple View Operator"
offset = FloatVectorProperty(name="Offset", size=3)
def execute(self, context):
v3d = context.area.spaces[0]
rv3d = v3d.region_3d
rv3d.view_location = self._initial_location + Vector(self.properties.offset)
def modal(self, context, event):
v3d = context.area.spaces[0]
rv3d = v3d.region_3d
if event.type == 'MOUSEMOVE':
self.properties.offset = (self._initial_mouse - Vector((event.mouse_x, event.mouse_y, 0.0))) * 0.02
self.execute(context)
elif event.type == 'LEFTMOUSE':
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'):
rv3d.view_location = self._initial_location
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def invoke(self, context, event):
active_space = context.area.spaces[0]
if active_space.type == 'VIEW_3D':
v3d = active_space
rv3d = v3d.region_3d
context.manager.add_modal_handler(self)
if rv3d.view_perspective == 'CAMERA':
rv3d.view_perspective = 'PERSP'
self._initial_mouse = Vector((event.mouse_x, event.mouse_y, 0.0))
self._initial_location = rv3d.view_location.copy()
return {'RUNNING_MODAL'}
else:
self.report({'WARNING'}, "Active space must be a View3d")
return {'CANCELLED'}
bpy.types.register(ViewOperator)

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
################################################ ################################################
# Generic Panels (Independent of DataType) # Generic Panels (Independent of DataType)
@@ -61,6 +61,8 @@ class MotionPathButtonsPanel(bpy.types.Panel):
col.label(text="Display:") col.label(text="Display:")
col.prop(mps, "show_frame_numbers", text="Frame Numbers") col.prop(mps, "show_frame_numbers", text="Frame Numbers")
col.prop(mps, "highlight_keyframes", text="Keyframes") col.prop(mps, "highlight_keyframes", text="Keyframes")
if bones:
col.prop(mps, "search_all_action_keyframes", text="+ Non-Grouped Keyframes")
col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers") col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers")

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PoseTemplateSettings(bpy.types.IDPropertyGroup): class PoseTemplateSettings(bpy.types.IDPropertyGroup):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class BoneButtonsPanel(bpy.types.Panel): class BoneButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class LAMP_MT_sunsky_presets(bpy.types.Menu): class LAMP_MT_sunsky_presets(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class MESH_MT_vertex_group_specials(bpy.types.Menu): class MESH_MT_vertex_group_specials(bpy.types.Menu):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
narrowmod = 260 narrowmod = 260
@@ -229,7 +229,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
def DECIMATE(self, layout, ob, md, wide_ui): def DECIMATE(self, layout, ob, md, wide_ui):
layout.prop(md, "ratio") layout.prop(md, "ratio")
layout.prop(md, "face_count") layout.label(text="Face Count: %s" % str(md.face_count))
def DISPLACE(self, layout, ob, md, wide_ui): def DISPLACE(self, layout, ob, md, wide_ui):
split = layout.split() split = layout.split()

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicsButtonsPanel(bpy.types.Panel): class PhysicsButtonsPanel(bpy.types.Panel):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
def active_node_mat(mat): def active_node_mat(mat):

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class ObjectButtonsPanel(bpy.types.Panel): class ObjectButtonsPanel(bpy.types.Panel):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class ConstraintButtonsPanel(bpy.types.Panel): class ConstraintButtonsPanel(bpy.types.Panel):

View File

@@ -25,7 +25,7 @@ from properties_physics_common import effector_weights_ui
from properties_physics_common import basic_force_field_settings_ui from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui from properties_physics_common import basic_force_field_falloff_ui
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
def particle_panel_enabled(context, psys): def particle_panel_enabled(context, psys):

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui
@@ -75,7 +75,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
# add modifier # add modifier
split.operator("object.modifier_add", text="Add").type = 'CLOTH' split.operator("object.modifier_add", text="Add").type = 'CLOTH'
if wide_ui: if wide_ui:
split.column() split.label()
if md: if md:
cloth = md.settings cloth = md.settings

View File

@@ -18,16 +18,18 @@
# <pep8 compliant> # <pep8 compliant>
narrowui = 180
import bpy import bpy
narrowui = bpy.context.user_preferences.view.properties_width_check
#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
def point_cache_ui(self, context, cache, enabled, cachetype): def point_cache_ui(self, context, cache, enabled, cachetype):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
layout.set_context_pointer("PointCache", cache) layout.set_context_pointer("point_cache", cache)
row = layout.row() row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2)
@@ -68,7 +70,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
sub = col.column() sub = col.column()
sub.enabled = enabled sub.enabled = enabled
sub.prop(cache, "quick_cache") sub.prop(cache, "quick_cache")
sub = col.column() sub = col.column()
sub.enabled = bpy.data.file_is_saved sub.enabled = bpy.data.file_is_saved
sub.prop(cache, "disk_cache") sub.prop(cache, "disk_cache")
@@ -103,6 +105,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
col.operator("ptcache.free_bake_all", text="Free All Bakes") col.operator("ptcache.free_bake_all", text="Free All Bakes")
col.operator("ptcache.bake_all", text="Update All To Frame").bake = False col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
def effector_weights_ui(self, context, weights): def effector_weights_ui(self, context, weights):
layout = self.layout layout = self.layout

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import basic_force_field_settings_ui from properties_physics_common import basic_force_field_settings_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class PhysicButtonsPanel(bpy.types.Panel): class PhysicButtonsPanel(bpy.types.Panel):
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
md = context.fluid md = context.fluid
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
split = layout.split(percentage=0.5) split = layout.split()
if md: if md:
# remove modifier + settings # remove modifier + settings

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
from properties_physics_common import point_cache_ui from properties_physics_common import point_cache_ui

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class RENDER_MT_presets(bpy.types.Menu): class RENDER_MT_presets(bpy.types.Menu):
@@ -215,14 +215,14 @@ class RENDER_PT_shading(RenderButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(rd, "render_textures", text="Textures") col.prop(rd, "use_textures", text="Textures")
col.prop(rd, "render_shadows", text="Shadows") col.prop(rd, "use_shadows", text="Shadows")
col.prop(rd, "render_sss", text="Subsurface Scattering") col.prop(rd, "use_sss", text="Subsurface Scattering")
col.prop(rd, "render_envmaps", text="Environment Map") col.prop(rd, "use_envmaps", text="Environment Map")
if wide_ui: if wide_ui:
col = split.column() col = split.column()
col.prop(rd, "render_raytracing", text="Ray Tracing") col.prop(rd, "use_raytracing", text="Ray Tracing")
col.prop(rd, "color_management") col.prop(rd, "color_management")
col.prop(rd, "alpha_mode", text="Alpha") col.prop(rd, "alpha_mode", text="Alpha")
@@ -261,7 +261,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
sub.active = rd.use_compositing sub.active = rd.use_compositing
sub.prop(rd, "free_image_textures") sub.prop(rd, "free_image_textures")
sub = col.column() sub = col.column()
sub.active = rd.render_raytracing sub.active = rd.use_raytracing
sub.label(text="Acceleration structure:") sub.label(text="Acceleration structure:")
sub.prop(rd, "raytrace_structure", text="") sub.prop(rd, "raytrace_structure", text="")
if rd.raytrace_structure == 'OCTREE': if rd.raytrace_structure == 'OCTREE':
@@ -347,6 +347,15 @@ class RENDER_PT_output(RenderButtonsPanel):
if rd.file_format in ('AVI_JPEG', 'JPEG'): if rd.file_format in ('AVI_JPEG', 'JPEG'):
split = layout.split() split = layout.split()
split.prop(rd, "file_quality", slider=True) split.prop(rd, "file_quality", slider=True)
elif rd.file_format == 'MULTILAYER':
split = layout.split()
col = split.column()
col.label(text="Codec:")
col.prop(rd, "exr_codec", text="")
if wide_ui:
col = split.column()
elif rd.file_format == 'OPEN_EXR': elif rd.file_format == 'OPEN_EXR':
split = layout.split() split = layout.split()
@@ -506,14 +515,14 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
def draw_header(self, context): def draw_header(self, context):
rd = context.scene.render rd = context.scene.render
self.layout.prop(rd, "antialiasing", text="") self.layout.prop(rd, "render_antialiasing", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
rd = context.scene.render rd = context.scene.render
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
layout.active = rd.antialiasing layout.active = rd.render_antialiasing
split = layout.split() split = layout.split()

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class SceneButtonsPanel(bpy.types.Panel): class SceneButtonsPanel(bpy.types.Panel):
@@ -89,7 +89,6 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
row = layout.row() row = layout.row()
col = row.column() col = row.column()
# XXX: this fails because index is not what this expects...
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2) col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
col = row.column(align=True) col = row.column(align=True)

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class TEXTURE_MT_specials(bpy.types.Menu): class TEXTURE_MT_specials(bpy.types.Menu):
@@ -374,7 +374,8 @@ class TEXTURE_PT_influence(TextureSlotPanel):
factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror") factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
col.label(text="Geometry:") col.label(text="Geometry:")
factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal") # XXX replace 'or' when displacement is fixed to not rely on normal influence value.
factor_but(col, (tex.map_normal or tex.map_displacement), "map_normal", "normal_factor", "Normal")
factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp") factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace") factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")

View File

@@ -20,7 +20,7 @@
import bpy import bpy
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class WorldButtonsPanel(bpy.types.Panel): class WorldButtonsPanel(bpy.types.Panel):
@@ -111,14 +111,14 @@ class WORLD_PT_mist(WorldButtonsPanel):
def draw_header(self, context): def draw_header(self, context):
world = context.world world = context.world
self.layout.prop(world.mist, "enabled", text="") self.layout.prop(world.mist, "use_mist", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
world = context.world world = context.world
layout.active = world.mist.enabled layout.active = world.mist.use_mist
split = layout.split() split = layout.split()
@@ -142,14 +142,14 @@ class WORLD_PT_stars(WorldButtonsPanel):
def draw_header(self, context): def draw_header(self, context):
world = context.world world = context.world
self.layout.prop(world.stars, "enabled", text="") self.layout.prop(world.stars, "use_stars", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wide_ui = context.region.width > narrowui wide_ui = context.region.width > narrowui
world = context.world world = context.world
layout.active = world.stars.enabled layout.active = world.stars.use_stars
split = layout.split() split = layout.split()

View File

@@ -19,7 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
narrowui = 180 narrowui = bpy.context.user_preferences.view.properties_width_check
class IMAGE_MT_view(bpy.types.Menu): class IMAGE_MT_view(bpy.types.Menu):

View File

@@ -245,7 +245,7 @@ class INFO_MT_add(bpy.types.Menu):
layout.operator_context = 'INVOKE_DEFAULT' layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY') layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
else: else:
layout.operator_menu_enum("object.group_instance_add", "type", text="Group Instance", icon='OUTLINER_OB_EMPTY') layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
class INFO_MT_game(bpy.types.Menu): class INFO_MT_game(bpy.types.Menu):

View File

@@ -46,9 +46,18 @@ class LOGIC_PT_properties(bpy.types.Panel):
row.prop(prop, "debug", text="", toggle=True, icon='INFO') row.prop(prop, "debug", text="", toggle=True, icon='INFO')
row.operator("object.game_property_remove", text="", icon='X').index = i row.operator("object.game_property_remove", text="", icon='X').index = i
class LOGIC_MT_logicbricks_add(bpy.types.Menu):
bl_label = "Add"
def draw(self, context):
layout = self.layout
layout.operator_menu_enum("logic.sensor_add", "type", text="Sensor")
layout.operator_menu_enum("logic.controller_add", "type", text="Controller")
layout.operator_menu_enum("logic.actuator_add", "type", text="Actuator")
classes = [ classes = [
LOGIC_PT_properties] LOGIC_PT_properties, LOGIC_MT_logicbricks_add]
def register(): def register():

View File

@@ -19,6 +19,7 @@
# <pep8 compliant> # <pep8 compliant>
import bpy import bpy
def act_strip(context): def act_strip(context):
try: try:
return context.scene.sequence_editor.active_strip return context.scene.sequence_editor.active_strip

View File

@@ -286,7 +286,7 @@ class TEXT_MT_toolbox(bpy.types.Menu):
layout.operator("text.paste") layout.operator("text.paste")
layout.separator() layout.separator()
layout.operator("text.run_script") layout.operator("text.run_script")

View File

@@ -165,6 +165,13 @@ class USERPREF_PT_interface(bpy.types.Panel):
sub.enabled = view.show_mini_axis sub.enabled = view.show_mini_axis
sub.prop(view, "mini_axis_size", text="Size") sub.prop(view, "mini_axis_size", text="Size")
sub.prop(view, "mini_axis_brightness", text="Brightness") sub.prop(view, "mini_axis_brightness", text="Brightness")
col.separator()
col.separator()
col.separator()
col.label(text="Properties Window:")
col.prop(view, "properties_width_check")
row.separator() row.separator()
row.separator() row.separator()

View File

@@ -32,14 +32,13 @@ class VIEW3D_HT_header(bpy.types.Header):
obj = context.active_object obj = context.active_object
toolsettings = context.tool_settings toolsettings = context.tool_settings
row = layout.row() row = layout.row(align=True)
row.template_header() row.template_header()
sub = row.row(align=True)
# Menus # Menus
if context.area.show_menus: if context.area.show_menus:
sub = row.row(align=True)
sub.menu("VIEW3D_MT_view") sub.menu("VIEW3D_MT_view")
# Select Menu # Select Menu
@@ -54,6 +53,7 @@ class VIEW3D_HT_header(bpy.types.Header):
else: else:
sub.menu("VIEW3D_MT_object") sub.menu("VIEW3D_MT_object")
row = layout.row()
row.template_header_3D() row.template_header_3D()
# do in C for now since these buttons cant be both toggle AND exclusive. # do in C for now since these buttons cant be both toggle AND exclusive.
@@ -706,14 +706,13 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
def poll(self, context): def poll(self, context):
# add more special types # add more special types
obj = context.object return context.object
return bool(obj and obj.type == 'LAMP')
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
obj = context.object obj = context.object
if obj and obj.type == 'LAMP': if obj.type == 'LAMP':
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
props = layout.operator("wm.context_modal_mouse", text="Spot Size") props = layout.operator("wm.context_modal_mouse", text="Spot Size")
@@ -736,6 +735,10 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
props.path_item = "data.shadow_buffer_clip_end" props.path_item = "data.shadow_buffer_clip_end"
props.input_scale = 0.05 props.input_scale = 0.05
layout.separator()
props = layout.operator("object.isolate_type_render")
class VIEW3D_MT_object_apply(bpy.types.Menu): class VIEW3D_MT_object_apply(bpy.types.Menu):
bl_label = "Apply" bl_label = "Apply"

View File

@@ -83,9 +83,6 @@ typedef struct Global {
struct VFont *selfont; struct VFont *selfont;
struct ListBase ttfdata; struct ListBase ttfdata;
/* libtiff flag used to determine if shared library loaded for libtiff*/
int have_libtiff;
/* this variable is written to / read from FileGlobal->fileflags */ /* this variable is written to / read from FileGlobal->fileflags */
int fileflags; int fileflags;

View File

@@ -52,9 +52,9 @@ void multiresModifier_join(struct Object *);
void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction); void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
int updateblock, int simple); int updateblock, int simple);
int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src); int multiresModifier_reshape(struct Object *dst, struct Object *src);
int multiresModifier_reshapeFromDM(struct MultiresModifierData *mmd, struct Object *ob, struct DerivedMesh *srcdm); int multiresModifier_reshapeFromDM(struct Object *ob, struct DerivedMesh *srcdm);
int multiresModifier_reshapeFromDeformMod(struct MultiresModifierData *mmd, struct Object *ob, struct ModifierData *md); int multiresModifier_reshapeFromDeformMod(struct Object *ob, struct ModifierData *md);
void multires_stitch_grids(struct Object *); void multires_stitch_grids(struct Object *);

View File

@@ -105,6 +105,7 @@
#define AVG2(x, y) ( 0.5 * ((x) + (y)) ) #define AVG2(x, y) ( 0.5 * ((x) + (y)) )
#define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f)) #define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f))
#define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f))
#define VECCOPY(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2);} #define VECCOPY(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2);}
#define VECCOPY2D(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1);} #define VECCOPY2D(v1,v2) {*(v1)= *(v2); *(v1+1)= *(v2+1);}

View File

@@ -50,6 +50,10 @@ IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR) ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
ADD_DEFINITIONS(-DWITH_TIFF)
ENDIF(WITH_TIFF)
IF(WITH_OPENJPEG) IF(WITH_OPENJPEG)
ADD_DEFINITIONS(-DWITH_OPENJPEG) ADD_DEFINITIONS(-DWITH_OPENJPEG)
ENDIF(WITH_OPENJPEG) ENDIF(WITH_OPENJPEG)

View File

@@ -38,6 +38,9 @@ else:
if env['WITH_BF_OPENEXR']: if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR') defs.append('WITH_OPENEXR')
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
if env['WITH_BF_OPENJPEG']: if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG') defs.append('WITH_OPENJPEG')

View File

@@ -132,6 +132,10 @@ ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -DWITH_QUICKTIME CPPFLAGS += -DWITH_QUICKTIME
endif endif
ifeq ($(WITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif
ifeq ($(OS), darwin) ifeq ($(OS), darwin)
ifeq ($(WITH_BF_OPENMP), true) ifeq ($(WITH_BF_OPENMP), true)
CPPFLAGS += -DPARALLEL=1 CPPFLAGS += -DPARALLEL=1

View File

@@ -187,6 +187,8 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *
if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS) if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS)
mpath->flag |= MOTIONPATH_FLAG_BHEAD; mpath->flag |= MOTIONPATH_FLAG_BHEAD;
else
mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
/* allocate a cache */ /* allocate a cache */
mpath->points= MEM_callocN(sizeof(bMotionPathVert)*mpath->length, "bMotionPathVerts"); mpath->points= MEM_callocN(sizeof(bMotionPathVert)*mpath->length, "bMotionPathVerts");
@@ -250,6 +252,83 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
/* ........ */ /* ........ */
/* Note on evaluation optimisations:
* Optimisations currently used here play tricks with the depsgraph in order to try and
* evaluate as few objects as strictly necessary to get nicer performance under standard
* production conditions. For those people who really need the accurate version,
* disable the ifdef (i.e. 1 -> 0) and comment out the call to motionpaths_calc_optimise_depsgraph()
*/
/* tweak the object ordering to trick depsgraph into making MotionPath calculations run faster */
static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
{
Base *base, *baseNext;
MPathTarget *mpt;
/* make sure our temp-tag isn't already in use */
for (base= scene->base.first; base; base= base->next)
base->object->flag &= ~BA_TEMP_TAG;
/* for each target, dump its object to the start of the list if it wasn't moved already */
for (mpt= targets->first; mpt; mpt= mpt->next) {
for (base=scene->base.first; base; base=baseNext) {
baseNext = base->next;
if ((base->object == mpt->ob) && !(mpt->ob->flag & BA_TEMP_TAG)) {
BLI_remlink(&scene->base, base);
BLI_addhead(&scene->base, base);
mpt->ob->flag |= BA_TEMP_TAG;
break; // we really don't need to continue anymore once this happens, but this line might really 'break'
}
}
}
/* "brew me a list that's sorted a bit faster now depsy" */
DAG_scene_sort(scene);
}
/* update scene for current frame */
static void motionpaths_calc_update_scene(Scene *scene)
{
#if 1 // 'production' optimisations always on
Base *base, *last=NULL;
/* only stuff that moves or needs display still */
DAG_scene_update_flags(scene, scene->lay);
/* find the last object with the tag
* - all those afterwards are assumed to not be relevant for our calculations
*/
// optimise further by moving out...
for (base=scene->base.first; base; base=base->next) {
if (base->object->flag & BA_TEMP_TAG)
last = base;
}
/* perform updates for tagged objects */
// XXX: this will break if rigs depend on scene or other data that
// is animated but not attached to/updatable from objects
for (base=scene->base.first; base; base=base->next) {
/* update this object */
object_handle_update(scene, base->object);
/* if this is the last one we need to update, let's stop to save some time */
if (base == last)
break;
}
#else // original, 'always correct' version
/* do all updates
* - if this is too slow, resort to using a more efficient way
* that doesn't force complete update, but for now, this is the
* most accurate way!
*/
scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving
#endif
}
/* ........ */
/* perform baking for the targets on the current frame */ /* perform baking for the targets on the current frame */
static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets)
{ {
@@ -311,7 +390,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
// TODO: this method could be improved... // TODO: this method could be improved...
// 1) max range for standard baking // 1) max range for standard baking
// 2) minimum range for recalc baking (i.e. between keyfames, but how?) // 2) minimum range for recalc baking (i.e. between keyframes, but how?)
for (mpt= targets->first; mpt; mpt= mpt->next) { for (mpt= targets->first; mpt; mpt= mpt->next) {
/* try to increase area to do (only as much as needed) */ /* try to increase area to do (only as much as needed) */
sfra= MIN2(sfra, mpt->mpath->start_frame); sfra= MIN2(sfra, mpt->mpath->start_frame);
@@ -319,14 +398,14 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
} }
if (efra <= sfra) return; if (efra <= sfra) return;
/* optimise the depsgraph for faster updates */
// TODO: whether this is used should depend on some setting for the level of optimisations used
motionpaths_calc_optimise_depsgraph(scene, targets);
/* calculate path over requested range */ /* calculate path over requested range */
for (CFRA=sfra; CFRA<=efra; CFRA++) { for (CFRA=sfra; CFRA<=efra; CFRA++) {
/* do all updates /* update relevant data for new frame */
* - if this is too slow, resort to using a more efficient way motionpaths_calc_update_scene(scene);
* that doesn't force complete update, but for now, this is the
* most accurate way!
*/
scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving
/* perform baking for targets */ /* perform baking for targets */
motionpaths_calc_bake_targets(scene, targets); motionpaths_calc_bake_targets(scene, targets);
@@ -334,7 +413,7 @@ void animviz_calc_motionpaths(Scene *scene, ListBase *targets)
/* reset original environment */ /* reset original environment */
CFRA= cfra; CFRA= cfra;
scene_update_for_newframe(scene, scene->lay); // XXX this is the best way we can get anything moving motionpaths_calc_update_scene(scene);
/* clear recalc flags from targets */ /* clear recalc flags from targets */
for (mpt= targets->first; mpt; mpt= mpt->next) { for (mpt= targets->first; mpt; mpt= mpt->next) {

View File

@@ -339,6 +339,19 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName,
/* firstly, handle the F-Curve's own path */ /* firstly, handle the F-Curve's own path */
if (fcu->rna_path) if (fcu->rna_path)
fcu->rna_path= rna_path_rename_fix(owner_id, prefix, oldName, newName, fcu->rna_path, verify_paths); fcu->rna_path= rna_path_rename_fix(owner_id, prefix, oldName, newName, fcu->rna_path, verify_paths);
}
}
/* Check RNA-Paths for a list of Drivers */
static void drivers_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, char *oldKey, char *newKey, ListBase *curves, int verify_paths)
{
FCurve *fcu;
/* we need to check every curve - drivers are F-Curves too! */
for (fcu= curves->first; fcu; fcu= fcu->next) {
/* firstly, handle the F-Curve's own path */
if (fcu->rna_path)
fcu->rna_path= rna_path_rename_fix(owner_id, prefix, oldKey, newKey, fcu->rna_path, verify_paths);
/* driver? */ /* driver? */
if (fcu->driver) { if (fcu->driver) {
@@ -352,15 +365,16 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName,
{ {
/* rename RNA path */ /* rename RNA path */
if (dtar->rna_path) if (dtar->rna_path)
dtar->rna_path= rna_path_rename_fix(dtar->id, prefix, oldName, newName, dtar->rna_path, verify_paths); dtar->rna_path= rna_path_rename_fix(dtar->id, prefix, oldKey, newKey, dtar->rna_path, verify_paths);
/* also fix the bone-name (if applicable) */ /* also fix the bone-name (if applicable) */
// XXX this has been disabled because the old/new names have padding which means this check will fail if (strstr(prefix, "bones")) {
//if ( ((dtar->id) && (GS(dtar->id->name) == ID_OB)) && if ( ((dtar->id) && (GS(dtar->id->name) == ID_OB)) &&
// (dtar->pchan_name[0]) && (strcmp(oldName, dtar->pchan_name)==0) ) (dtar->pchan_name[0]) && (strcmp(oldName, dtar->pchan_name)==0) )
//{ {
// BLI_strncpy(dtar->pchan_name, newName, sizeof(dtar->pchan_name)); BLI_strncpy(dtar->pchan_name, newName, sizeof(dtar->pchan_name));
//} }
}
} }
DRIVER_TARGETS_LOOPER_END DRIVER_TARGETS_LOOPER_END
} }
@@ -398,11 +412,12 @@ void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, c
if (ELEM(NULL, owner_id, adt)) if (ELEM(NULL, owner_id, adt))
return; return;
if (oldName != NULL && newName != NULL) { if ((oldName != NULL) && (newName != NULL)) {
/* pad the names with [" "] so that only exact matches are made */ /* pad the names with [" "] so that only exact matches are made */
oldN= BLI_sprintfN("[\"%s\"]", oldName); oldN= BLI_sprintfN("[\"%s\"]", oldName);
newN= BLI_sprintfN("[\"%s\"]", newName); newN= BLI_sprintfN("[\"%s\"]", newName);
} else { }
else {
oldN= BLI_sprintfN("[%d]", oldSubscript); oldN= BLI_sprintfN("[%d]", oldSubscript);
newN= BLI_sprintfN("[%d]", newSubscript); newN= BLI_sprintfN("[%d]", newSubscript);
} }
@@ -414,7 +429,7 @@ void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, c
fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->tmpact->curves, verify_paths); fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->tmpact->curves, verify_paths);
/* Drivers - Drivers are really F-Curves */ /* Drivers - Drivers are really F-Curves */
fcurves_path_rename_fix(owner_id, prefix, oldN, newN, &adt->drivers, verify_paths); drivers_path_rename_fix(owner_id, prefix, oldName, newName, oldN, newN, &adt->drivers, verify_paths);
/* NLA Data - Animation Data for Strips */ /* NLA Data - Animation Data for Strips */
for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next)

View File

@@ -2055,7 +2055,7 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
/* we need to clamp this within sensible values */ /* we need to clamp this within sensible values */
// NOTE: these should be fine for now, but should get sanitised in future // NOTE: these should be fine for now, but should get sanitised in future
scale= MIN2( MAX2(scale, 0.0001) , 100000); scale= MIN2(MAX2(scale, 0.0001) , 100000);
} }
else else
scale= 1.0f; scale= 1.0f;
@@ -2127,8 +2127,6 @@ static void splineik_execute_tree(Scene *scene, Object *ob, bPoseChannel *pchan_
splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime); splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime);
} }
// TODO: if another pass is needed to ensure the validity of the chain after blending, it should go here
/* free the tree info specific to SplineIK trees now */ /* free the tree info specific to SplineIK trees now */
if (tree->chain) MEM_freeN(tree->chain); if (tree->chain) MEM_freeN(tree->chain);
if (tree->free_points) MEM_freeN(tree->points); if (tree->free_points) MEM_freeN(tree->points);

View File

@@ -779,10 +779,12 @@ void BKE_add_image_extension(char *string, int imtype)
if(!BLI_testextensie(string, ".bmp")) if(!BLI_testextensie(string, ".bmp"))
extension= ".bmp"; extension= ".bmp";
} }
else if(G.have_libtiff && (imtype==R_TIFF)) { #ifdef WITH_TIFF
else if(imtype==R_TIFF) {
if(!BLI_testextensie(string, ".tif") && if(!BLI_testextensie(string, ".tif") &&
!BLI_testextensie(string, ".tiff")) extension= ".tif"; !BLI_testextensie(string, ".tiff")) extension= ".tif";
} }
#endif
#ifdef WITH_OPENEXR #ifdef WITH_OPENEXR
else if( ELEM(imtype, R_OPENEXR, R_MULTILAYER)) { else if( ELEM(imtype, R_OPENEXR, R_MULTILAYER)) {
if(!BLI_testextensie(string, ".exr")) if(!BLI_testextensie(string, ".exr"))
@@ -1187,12 +1189,14 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt
else if ((imtype==R_BMP)) { else if ((imtype==R_BMP)) {
ibuf->ftype= BMP; ibuf->ftype= BMP;
} }
else if ((G.have_libtiff) && (imtype==R_TIFF)) { #ifdef WITH_TIFF
else if (imtype==R_TIFF) {
ibuf->ftype= TIF; ibuf->ftype= TIF;
if(subimtype & R_TIFF_16BIT) if(subimtype & R_TIFF_16BIT)
ibuf->ftype |= TIF_16BIT; ibuf->ftype |= TIF_16BIT;
} }
#endif
#ifdef WITH_OPENEXR #ifdef WITH_OPENEXR
else if (imtype==R_OPENEXR || imtype==R_MULTILAYER) { else if (imtype==R_OPENEXR || imtype==R_MULTILAYER) {
ibuf->ftype= OPENEXR; ibuf->ftype= OPENEXR;

View File

@@ -207,7 +207,7 @@ void multiresModifier_join(Object *ob)
} }
#endif #endif
int multiresModifier_reshapeFromDM(MultiresModifierData *mmd, Object *ob, DerivedMesh *srcdm) int multiresModifier_reshapeFromDM(Object *ob, DerivedMesh *srcdm)
{ {
DerivedMesh *mrdm = get_multires_dm (ob); DerivedMesh *mrdm = get_multires_dm (ob);
@@ -228,13 +228,13 @@ int multiresModifier_reshapeFromDM(MultiresModifierData *mmd, Object *ob, Derive
} }
/* Returns 1 on success, 0 if the src's totvert doesn't match */ /* Returns 1 on success, 0 if the src's totvert doesn't match */
int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src) int multiresModifier_reshape(Object *dst, Object *src)
{ {
DerivedMesh *srcdm = src->derivedFinal; DerivedMesh *srcdm = src->derivedFinal;
return multiresModifier_reshapeFromDM(mmd, dst, srcdm); return multiresModifier_reshapeFromDM(dst, srcdm);
} }
int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob, ModifierData *md) int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
{ {
ModifierTypeInfo *mti = modifierType_getInfo(md->type); ModifierTypeInfo *mti = modifierType_getInfo(md->type);
DerivedMesh *dm, *ndm; DerivedMesh *dm, *ndm;
@@ -256,7 +256,7 @@ int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob,
dm->release(dm); dm->release(dm);
/* Reshaping */ /* Reshaping */
result= multiresModifier_reshapeFromDM(mmd, ob, ndm); result= multiresModifier_reshapeFromDM(ob, ndm);
/* Cleanup */ /* Cleanup */
ndm->release(ndm); ndm->release(ndm);

View File

@@ -186,7 +186,7 @@ PackedFile *newPackedFile(ReportList *reports, char *filename)
file= open(name, O_BINARY|O_RDONLY); file= open(name, O_BINARY|O_RDONLY);
if (file <= 0) { if (file <= 0) {
BKE_reportf(reports, RPT_ERROR, "Can't open file: \"%s\"", name); BKE_reportf(reports, RPT_ERROR, "Unable to pack file, source path not found: \"%s\"", name);
} else { } else {
filelen = BLI_filesize(file); filelen = BLI_filesize(file);
@@ -216,15 +216,15 @@ void packAll(Main *bmain, ReportList *reports)
bSound *sound; bSound *sound;
for(ima=bmain->image.first; ima; ima=ima->id.next) for(ima=bmain->image.first; ima; ima=ima->id.next)
if(ima->packedfile == NULL) if(ima->packedfile == NULL && ima->id.lib==NULL && ELEM3(ima->type, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
ima->packedfile = newPackedFile(reports, ima->name); ima->packedfile = newPackedFile(reports, ima->name);
for(vf=bmain->vfont.first; vf; vf=vf->id.next) for(vf=bmain->vfont.first; vf; vf=vf->id.next)
if(vf->packedfile == NULL) if(vf->packedfile == NULL && vf->id.lib==NULL)
vf->packedfile = newPackedFile(reports, vf->name); vf->packedfile = newPackedFile(reports, vf->name);
for(sound=bmain->sound.first; sound; sound=sound->id.next) for(sound=bmain->sound.first; sound; sound=sound->id.next)
if(sound->packedfile == NULL) if(sound->packedfile == NULL && vf->id.lib==NULL)
sound->packedfile = newPackedFile(reports, sound->name); sound->packedfile = newPackedFile(reports, sound->name);
} }

View File

@@ -2366,8 +2366,12 @@ typedef struct {
static void *ptcache_make_cache_thread(void *ptr) { static void *ptcache_make_cache_thread(void *ptr) {
ptcache_make_cache_data *data = (ptcache_make_cache_data*)ptr; ptcache_make_cache_data *data = (ptcache_make_cache_data*)ptr;
for(; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) for(; (*data->cfra_ptr <= data->endframe) && !data->break_operation; *data->cfra_ptr+=data->step) {
scene_update_for_newframe(data->scene, data->scene->lay); scene_update_for_newframe(data->scene, data->scene->lay);
if(G.background) {
printf("bake: frame %d :: %d\n", (int)*data->cfra_ptr, data->endframe);
}
}
data->thread_ended = TRUE; data->thread_ended = TRUE;
return NULL; return NULL;
@@ -2489,36 +2493,40 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
thread_data.thread_ended = FALSE; thread_data.thread_ended = FALSE;
old_progress = -1; old_progress = -1;
BLI_init_threads(&threads, ptcache_make_cache_thread, 1); if(G.background) {
BLI_insert_thread(&threads, (void*)&thread_data); ptcache_make_cache_thread((void*)&thread_data);
while (thread_data.thread_ended == FALSE) {
if(bake)
progress = (int)(100.0f * (float)(CFRA - startframe)/(float)(thread_data.endframe-startframe));
else
progress = CFRA;
/* NOTE: baking should not redraw whole ui as this slows things down */
if ((baker->progressbar) && (progress != old_progress)) {
baker->progressbar(baker->progresscontext, progress);
old_progress = progress;
}
/* Delay to lessen CPU load from UI thread */
PIL_sleep_ms(200);
/* NOTE: breaking baking should leave calculated frames in cache, not clear it */
if(blender_test_break() && !thread_data.break_operation) {
thread_data.break_operation = TRUE;
if (baker->progressend)
baker->progressend(baker->progresscontext);
WM_cursor_wait(1);
}
} }
else {
BLI_init_threads(&threads, ptcache_make_cache_thread, 1);
BLI_insert_thread(&threads, (void*)&thread_data);
while (thread_data.thread_ended == FALSE) {
if(bake)
progress = (int)(100.0f * (float)(CFRA - startframe)/(float)(thread_data.endframe-startframe));
else
progress = CFRA;
/* NOTE: baking should not redraw whole ui as this slows things down */
if ((baker->progressbar) && (progress != old_progress)) {
baker->progressbar(baker->progresscontext, progress);
old_progress = progress;
}
/* Delay to lessen CPU load from UI thread */
PIL_sleep_ms(200);
/* NOTE: breaking baking should leave calculated frames in cache, not clear it */
if(blender_test_break() && !thread_data.break_operation) {
thread_data.break_operation = TRUE;
if (baker->progressend)
baker->progressend(baker->progresscontext);
WM_cursor_wait(1);
}
}
BLI_end_threads(&threads); BLI_end_threads(&threads);
}
/* clear baking flag */ /* clear baking flag */
if(pid) { if(pid) {
cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED); cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED);

View File

@@ -239,10 +239,19 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype)
for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
if (bhead->code==ofblocktype) { if (bhead->code==ofblocktype) {
ID *id= (ID*) (bhead+1); ID *id= (ID*) (bhead+1);
if ( (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) { switch(GS(id->name))
new_prv = MEM_callocN(sizeof(PreviewImage), "newpreview"); {
BLI_linklist_prepend(&previews, new_prv); case ID_MA: /* fall through */
looking = 1; case ID_TE: /* fall through */
case ID_IM: /* fall through */
case ID_WO: /* fall through */
case ID_LA: /* fall through */
new_prv = MEM_callocN(sizeof(PreviewImage), "newpreview");
BLI_linklist_prepend(&previews, new_prv);
looking = 1;
break;
default:
break;
} }
} else if (bhead->code==DATA) { } else if (bhead->code==DATA) {
if (looking) { if (looking) {

View File

@@ -4162,8 +4162,8 @@ static void lib_link_scene(FileData *fd, Main *main)
base->object= newlibadr_us(fd, sce->id.lib, base->object); base->object= newlibadr_us(fd, sce->id.lib, base->object);
if(base->object==NULL) { if(base->object==NULL) {
printf("LIB ERROR: base removed\n");
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: Object lost from scene:'%s\'\n", sce->id.name+2); BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: Object lost from scene:'%s\'\n", sce->id.name+2);
if(G.background==0) printf("LIB ERROR: base removed from scene:'%s\'\n", sce->id.name+2);
BLI_remlink(&sce->base, base); BLI_remlink(&sce->base, base);
if(base==sce->basact) sce->basact= 0; if(base==sce->basact) sce->basact= 0;
MEM_freeN(base); MEM_freeN(base);
@@ -12301,8 +12301,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if(fd==NULL) { if(fd==NULL) {
/* printf and reports for now... its important users know this */ /* printf and reports for now... its important users know this */
printf("read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
BKE_reportf(basefd->reports, RPT_INFO, "read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name); BKE_reportf(basefd->reports, RPT_INFO, "read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
if(!G.background && basefd->reports) printf("read library: '%s', '%s'\n", mainptr->curlib->filename, mainptr->curlib->name);
fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports); fd= blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
@@ -12347,8 +12347,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
else mainptr->curlib->filedata= NULL; else mainptr->curlib->filedata= NULL;
if (fd==NULL) { if (fd==NULL) {
printf("ERROR: can't find lib %s \n", mainptr->curlib->filename);
BKE_reportf(basefd->reports, RPT_ERROR, "Can't find lib '%s'\n", mainptr->curlib->filename); BKE_reportf(basefd->reports, RPT_ERROR, "Can't find lib '%s'\n", mainptr->curlib->filename);
if(!G.background && basefd->reports) printf("ERROR: can't find lib %s \n", mainptr->curlib->filename);
} }
} }
if(fd) { if(fd) {
@@ -12365,8 +12365,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid); append_id_part(fd, mainptr, id, &realid);
if (!realid) { if (!realid) {
printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename); BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
if(!G.background && basefd->reports) printf("LIB ERROR: %s:'%s' missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
} }
change_idid_adr(mainlist, basefd, id, realid); change_idid_adr(mainlist, basefd, id, realid);
@@ -12401,8 +12401,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
ID *idn= id->next; ID *idn= id->next;
if(id->flag & LIB_READ) { if(id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id); BLI_remlink(lbarray[a], id);
printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename); BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BLO_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filename);
change_idid_adr(mainlist, basefd, id, NULL); change_idid_adr(mainlist, basefd, id, NULL);
MEM_freeN(id); MEM_freeN(id);

View File

@@ -58,6 +58,10 @@ IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR) ENDIF(WITH_OPENEXR)
IF(WITH_TIFF)
ADD_DEFINITIONS(-DWITH_TIFF)
ENDIF(WITH_TIFF)
IF(WITH_OPENJPEG) IF(WITH_OPENJPEG)
ADD_DEFINITIONS(-DWITH_OPENJPEG) ADD_DEFINITIONS(-DWITH_OPENJPEG)
ENDIF(WITH_OPENJPEG) ENDIF(WITH_OPENJPEG)

View File

@@ -939,7 +939,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *op)
/* do groups only first (unless in Drivers mode, where there are none) */ /* do groups only first (unless in Drivers mode, where there are none) */
if (ac.datatype != ANIMCONT_DRIVERS) { if (ac.datatype != ANIMCONT_DRIVERS) {
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CHANNELS | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CHANNELS | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* delete selected groups and their associated channels */ /* delete selected groups and their associated channels */
@@ -978,7 +978,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *op)
/* now do F-Curves */ /* now do F-Curves */
if (ac.datatype != ANIMCONT_GPENCIL) { if (ac.datatype != ANIMCONT_GPENCIL) {
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* delete selected F-Curves */ /* delete selected F-Curves */
@@ -1038,7 +1038,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
/* hide all channels not selected */ /* hide all channels not selected */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_UNSEL); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1054,7 +1054,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
BLI_freelistN(&anim_data); BLI_freelistN(&anim_data);
/* make all the selected channels visible */ /* make all the selected channels visible */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1113,11 +1113,11 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
/* get list of all channels that selection may need to be flushed to */ /* get list of all channels that selection may need to be flushed to */
filter= ANIMFILTER_CHANNELS; filter= (ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* See if we should be making showing all selected or hiding */ /* See if we should be making showing all selected or hiding */
@@ -1215,7 +1215,8 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
} }
/* filter data that we're working on */ /* filter data that we're working on */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); // XXX: noduplis enabled so that results don't cancel, but will be problematic for some channels where only type differs
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS);
if (onlysel) filter |= ANIMFILTER_SEL; if (onlysel) filter |= ANIMFILTER_SEL;
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);

View File

@@ -68,6 +68,7 @@
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_action.h" #include "BKE_action.h"
@@ -2512,6 +2513,65 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
return 1; return 1;
} }
/* ----------- Cleanup API --------------- */
/* Remove entries with invalid types in animation channel list */
static int animdata_filter_remove_invalid (ListBase *anim_data)
{
bAnimListElem *ale, *next;
int items = 0;
/* only keep entries with valid types */
for (ale= anim_data->first; ale; ale= next) {
next= ale->next;
if (ale->type == ANIMTYPE_NONE)
BLI_freelinkN(anim_data, ale);
else
items++;
}
return items;
}
/* Remove duplicate entries in animation channel list */
static int animdata_filter_remove_duplis (ListBase *anim_data)
{
bAnimListElem *ale, *next;
GHash *gh;
int items = 0;
/* build new hashtable to efficiently store and retrieve which entries have been
* encountered already while searching
*/
gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "animdata_filter_duplis_remove gh");
/* loop through items, removing them from the list if a similar item occurs already */
for (ale = anim_data->first; ale; ale = next) {
next = ale->next;
/* check if hash has any record of an entry like this
* - just use ale->data for now, though it would be nicer to involve
* ale->type in combination too to capture corner cases (where same data performs differently)
*/
if (BLI_ghash_haskey(gh, ale->data) == 0) {
/* this entry is 'unique' and can be kept */
BLI_ghash_insert(gh, ale->data, NULL);
items++;
}
else {
/* this entry isn't needed anymore */
BLI_freelinkN(anim_data, ale);
}
}
/* free the hash... */
BLI_ghash_free(gh, NULL, NULL);
/* return the number of items still in the list */
return items;
}
/* ----------- Public API --------------- */ /* ----------- Public API --------------- */
/* This function filters the active data source to leave only animation channels suitable for /* This function filters the active data source to leave only animation channels suitable for
@@ -2527,7 +2587,6 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
/* only filter data if there's somewhere to put it */ /* only filter data if there's somewhere to put it */
if (data && anim_data) { if (data && anim_data) {
bAnimListElem *ale, *next;
Object *obact= (ac) ? ac->obact : NULL; Object *obact= (ac) ? ac->obact : NULL;
/* firstly filter the data */ /* firstly filter the data */
@@ -2572,16 +2631,12 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
break; break;
} }
/* remove any weedy entries */ /* remove any 'weedy' entries */
// XXX this is weedy code! items = animdata_filter_remove_invalid(anim_data);
for (ale= anim_data->first; ale; ale= next) {
next= ale->next; /* remove duplicates (if required) */
if (filter_mode & ANIMFILTER_NODUPLIS)
if (ale->type == ANIMTYPE_NONE) { items = animdata_filter_remove_duplis(anim_data);
items--;
BLI_freelinkN(anim_data, ale);
}
}
} }
/* return the number of items in the list */ /* return the number of items in the list */

View File

@@ -192,6 +192,7 @@ typedef enum eAnimFilter_Flags {
ANIMFILTER_ANIMDATA = (1<<9), /* only return the underlying AnimData blocks (not the tracks, etc.) data comes from */ ANIMFILTER_ANIMDATA = (1<<9), /* only return the underlying AnimData blocks (not the tracks, etc.) data comes from */
ANIMFILTER_NLATRACKS = (1<<10), /* only include NLA-tracks */ ANIMFILTER_NLATRACKS = (1<<10), /* only include NLA-tracks */
ANIMFILTER_SELEDIT = (1<<11), /* link editability with selected status */ ANIMFILTER_SELEDIT = (1<<11), /* link editability with selected status */
ANIMFILTER_NODUPLIS = (1<<12), /* duplicate entries for animation data attached to multi-user blocks must not occur */
/* all filters - the power inside the bracket must be the last power for left-shifts + 1 */ /* all filters - the power inside the bracket must be the last power for left-shifts + 1 */
ANIMFILTER_ALLFILTERS = ((1<<12) - 1) ANIMFILTER_ALLFILTERS = ((1<<12) - 1)

View File

@@ -2119,8 +2119,13 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE
} }
if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) { if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) {
int ret = WM_UI_HANDLER_BREAK;
/* XXX (a bit ugly) Special case handling for filebrowser drag button */
if(but->dragpoin && but->imb && ui_but_mouse_inside_icon(but, data->region, event)) {
ret = WM_UI_HANDLER_CONTINUE;
}
button_activate_state(C, but, BUTTON_STATE_EXIT); button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK; return ret;
} }
} }
else if(data->state == BUTTON_STATE_WAIT_DRAG) { else if(data->state == BUTTON_STATE_WAIT_DRAG) {

View File

@@ -1107,7 +1107,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, ui
continue; continue;
if(itemptr.type && RNA_struct_is_ID(itemptr.type)) if(itemptr.type && RNA_struct_is_ID(itemptr.type))
iconid= ui_id_icon_get((bContext*)C, itemptr.data, 0); iconid= ui_id_icon_get((bContext*)C, itemptr.data, 1);
else else
iconid = 0; iconid = 0;

View File

@@ -170,7 +170,7 @@ static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSea
continue; continue;
if(BLI_strcasestr(id->name+2, str)) { if(BLI_strcasestr(id->name+2, str)) {
iconid= ui_id_icon_get((bContext*)C, id, 0); iconid= ui_id_icon_get((bContext*)C, id, 1);
if(!uiSearchItemAdd(items, id->name+2, id, iconid)) if(!uiSearchItemAdd(items, id->name+2, id, iconid))
break; break;

View File

@@ -1488,6 +1488,11 @@ void init_userdef_do_versions(void)
if (U.v2d_min_gridsize == 0) { if (U.v2d_min_gridsize == 0) {
U.v2d_min_gridsize= 35; U.v2d_min_gridsize= 35;
} }
/* Single Column UI Value */
if (U.propwidth == 0) {
U.propwidth = 200;
}
/* funny name, but it is GE stuff, moves userdef stuff to engine */ /* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options(); // XXX space_set_commmandline_options();

View File

@@ -1340,7 +1340,7 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot)
void OBJECT_OT_constraint_copy(wmOperatorType *ot) void OBJECT_OT_constraint_copy(wmOperatorType *ot)
{ {
/* identifiers */ /* identifiers */
ot->name= "Copy Constraints to Others"; ot->name= "Copy Constraints to Selected";
ot->description = "Copy constraints to other selected objects."; ot->description = "Copy constraints to other selected objects.";
ot->idname= "OBJECT_OT_constraint_copy"; ot->idname= "OBJECT_OT_constraint_copy";

View File

@@ -30,6 +30,7 @@
#include <time.h> #include <time.h>
#include <float.h> #include <float.h>
#include <ctype.h> #include <ctype.h>
#include <stddef.h> //for offsetof
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
@@ -104,6 +105,7 @@
/* for menu/popup icons etc etc*/ /* for menu/popup icons etc etc*/
#include "UI_interface.h"
#include "WM_api.h" #include "WM_api.h"
#include "WM_types.h" #include "WM_types.h"
@@ -1098,6 +1100,7 @@ void flip_subdivison(Scene *scene, View3D *v3d, int level)
static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob) static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
{ {
//XXX no longer used - to be removed - replaced by game_properties_copy_exec
bProperty *prop; bProperty *prop;
Base *base; Base *base;
int nr, tot=0; int nr, tot=0;
@@ -1156,6 +1159,7 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob) static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob)
{ {
//XXX no longer used - to be removed - replaced by logicbricks_copy_exec
Base *base; Base *base;
for(base= FIRSTBASE; base; base= base->next) { for(base= FIRSTBASE; base; base= base->next) {
@@ -2203,3 +2207,166 @@ void OBJECT_OT_game_property_remove(wmOperatorType *ot)
RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX); RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX);
} }
static EnumPropertyItem game_properties_copy_types[] ={
{1, "REPLACE", 0, "Replace Properties", ""},
{2, "MERGE", 0, "Merge Properties", ""},
{3, "CLEAR", 0, "Clear All", ""},
{4, "COPY", 0, "Copy a Property", ""},
{0, NULL, 0, NULL, NULL}};
static int game_property_copy_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Object *ob= CTX_data_active_object(C);
bProperty *prop;
int tot=0;
uiPopupMenu *pup;
uiLayout *menu;
/* count number of available properties */
prop= ob->prop.first;
while(prop) {
tot++;
prop= prop->next;
}
/* start building */
pup= uiPupMenuBegin(C, op->type->name, 0);
menu= uiPupMenuLayout(pup);
uiLayoutSetOperatorContext(menu, WM_OP_EXEC_DEFAULT);
if(!tot)
uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 3);//CLEAR);
else {
uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 1);//REPLACE);
uiItemEnumO(menu, "OBJECT_OT_game_property_copy", NULL, 0, "type", 2);//MERGE);
//Menu Separator
uiItemL(menu, "Copy a Property", 0);
prop= ob->prop.first;
while(prop) {
uiItemStringO(menu, prop->name, 0, "OBJECT_OT_game_property_copy", "property", prop->name);
prop= prop->next;
}
}
uiPupMenuEnd(C, pup);
/* this operator is only for a menu, not used further */
return OPERATOR_CANCELLED;
}
static int game_property_copy_exec(bContext *C, wmOperator *op)
{
Object *ob=ED_object_active_context(C);
bProperty *prop;
char prop_name[32];
int type = RNA_enum_get(op->ptr, "type");
RNA_string_get(op->ptr, "property", prop_name);
if ( type == 1 || type == 2 || type == 3) {
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if (ob != ob_iter) {
if (ob->data != ob_iter->data){
if (type == 2) {/* merge */
for(prop = ob->prop.first; prop; prop= prop->next ) {
set_ob_property(ob_iter, prop);
}
} else /* replace or clear */
copy_properties( &ob_iter->prop, &ob->prop );
}
}
}
CTX_DATA_END;
}
else if(strlen(prop_name) > 0) { /* copy */
prop = (bProperty *) BLI_findstring(&ob->prop, prop_name, offsetof(bProperty, name));
if(prop) {
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if (ob != ob_iter) {
if (ob->data != ob_iter->data)
set_ob_property(ob_iter, prop);
}
} CTX_DATA_END;
}
}
return OPERATOR_FINISHED;
}
void OBJECT_OT_game_property_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Game Property";
ot->idname= "OBJECT_OT_game_property_copy";
/* api callbacks */
ot->invoke= game_property_copy_invoke;
ot->exec= game_property_copy_exec;
ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_enum(ot->srna, "type", game_properties_copy_types, 4, "Operation", "");
RNA_def_string(ot->srna, "property", "", 32, "Name", "Name of the property to copy");
}
/************************ Copy Logic Bricks ***********************/
static int logicbricks_copy_exec(bContext *C, wmOperator *op)
{
Object *ob=ED_object_active_context(C);
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
if(ob != ob_iter) {
if (ob->data != ob_iter->data){
/* first: free all logic */
free_sensors(&ob_iter->sensors);
unlink_controllers(&ob_iter->controllers);
free_controllers(&ob_iter->controllers);
unlink_actuators(&ob_iter->actuators);
free_actuators(&ob_iter->actuators);
/* now copy it, this also works without logicbricks! */
clear_sca_new_poins_ob(ob);
copy_sensors(&ob_iter->sensors, &ob->sensors);
copy_controllers(&ob_iter->controllers, &ob->controllers);
copy_actuators(&ob_iter->actuators, &ob->actuators);
set_sca_new_poins_ob(ob_iter);
/* some menu settings */
ob_iter->scavisflag= ob->scavisflag;
ob_iter->scaflag= ob->scaflag;
/* set the initial state */
ob_iter->state= ob->state;
ob_iter->init_state= ob->init_state;
}
if(ob_iter->totcol==ob->totcol) {
ob_iter->actcol= ob->actcol;
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob_iter);
}
}
}
CTX_DATA_END;
WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
}
void OBJECT_OT_logic_bricks_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Logic Bricks to Selected";
ot->description = "Copy logic bricks to other selected objects.";
ot->idname= "OBJECT_OT_logic_bricks_copy";
/* api callbacks */
ot->exec= logicbricks_copy_exec;
ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}

View File

@@ -85,6 +85,11 @@ void OBJECT_OT_shade_flat(struct wmOperatorType *ot);
void OBJECT_OT_paths_calculate(struct wmOperatorType *ot); void OBJECT_OT_paths_calculate(struct wmOperatorType *ot);
void OBJECT_OT_paths_clear(struct wmOperatorType *ot); void OBJECT_OT_paths_clear(struct wmOperatorType *ot);
void OBJECT_OT_game_property_new(struct wmOperatorType *ot);
void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
/* object_select.c */ /* object_select.c */
void OBJECT_OT_select_all(struct wmOperatorType *ot); void OBJECT_OT_select_all(struct wmOperatorType *ot);
void OBJECT_OT_select_inverse(struct wmOperatorType *ot); void OBJECT_OT_select_inverse(struct wmOperatorType *ot);
@@ -201,9 +206,6 @@ void OBJECT_OT_vertex_group_set_active(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_sort(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_sort(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_move(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_move(struct wmOperatorType *ot);
void OBJECT_OT_game_property_new(struct wmOperatorType *ot);
void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
/* object_shapekey.c */ /* object_shapekey.c */
void OBJECT_OT_shape_key_add(struct wmOperatorType *ot); void OBJECT_OT_shape_key_add(struct wmOperatorType *ot);
void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot); void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot);

View File

@@ -413,7 +413,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
multires_force_update(ob); multires_force_update(ob);
if (mmd && mti->type==eModifierTypeType_OnlyDeform) { if (mmd && mti->type==eModifierTypeType_OnlyDeform) {
multiresModifier_reshapeFromDeformMod (mmd, ob, md); multiresModifier_reshapeFromDeformMod (ob, md);
} else { } else {
dm = mesh_create_derived_for_modifier(scene, ob, md); dm = mesh_create_derived_for_modifier(scene, ob, md);
if (!dm) { if (!dm) {
@@ -972,7 +972,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if(!multiresModifier_reshape(mmd, ob, secondob)) { if(!multiresModifier_reshape(ob, secondob)) {
BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices."); BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices.");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@@ -183,6 +183,8 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_game_property_new); WM_operatortype_append(OBJECT_OT_game_property_new);
WM_operatortype_append(OBJECT_OT_game_property_remove); WM_operatortype_append(OBJECT_OT_game_property_remove);
WM_operatortype_append(OBJECT_OT_game_property_copy);
WM_operatortype_append(OBJECT_OT_logic_bricks_copy);
WM_operatortype_append(OBJECT_OT_shape_key_add); WM_operatortype_append(OBJECT_OT_shape_key_add);
WM_operatortype_append(OBJECT_OT_shape_key_remove); WM_operatortype_append(OBJECT_OT_shape_key_remove);

View File

@@ -71,7 +71,7 @@ static int ptcache_bake_all_poll(bContext *C)
static int ptcache_poll(bContext *C) static int ptcache_poll(bContext *C)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
return (ptr.data && ptr.id.data); return (ptr.data && ptr.id.data);
} }
@@ -89,7 +89,7 @@ void bake_console_progress_end(void *arg)
static int ptcache_bake_all_exec(bContext *C, wmOperator *op) static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
{ {
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
wmWindow *win = CTX_wm_window(C); wmWindow *win = G.background ? NULL : CTX_wm_window(C);
PTCacheBaker baker; PTCacheBaker baker;
@@ -171,8 +171,8 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot)
static int ptcache_bake_exec(bContext *C, wmOperator *op) static int ptcache_bake_exec(bContext *C, wmOperator *op)
{ {
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
wmWindow *win = CTX_wm_window(C); wmWindow *win = G.background ? NULL : CTX_wm_window(C);
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Object *ob= ptr.id.data; Object *ob= ptr.id.data;
PointCache *cache= ptr.data; PointCache *cache= ptr.data;
PTCacheBaker baker; PTCacheBaker baker;
@@ -216,7 +216,7 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
} }
static int ptcache_free_bake_exec(bContext *C, wmOperator *op) static int ptcache_free_bake_exec(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
PointCache *cache= ptr.data; PointCache *cache= ptr.data;
if(cache->edit) { if(cache->edit) {
@@ -233,7 +233,7 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *op)
} }
static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *op) static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
PointCache *cache= ptr.data; PointCache *cache= ptr.data;
cache->flag |= PTCACHE_BAKED; cache->flag |= PTCACHE_BAKED;
@@ -285,7 +285,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
static int ptcache_add_new_exec(bContext *C, wmOperator *op) static int ptcache_add_new_exec(bContext *C, wmOperator *op)
{ {
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Object *ob= ptr.id.data; Object *ob= ptr.id.data;
PointCache *cache= ptr.data; PointCache *cache= ptr.data;
PTCacheID *pid; PTCacheID *pid;
@@ -308,7 +308,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *op)
} }
static int ptcache_remove_exec(bContext *C, wmOperator *op) static int ptcache_remove_exec(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
Object *ob= ptr.id.data; Object *ob= ptr.id.data;
PointCache *cache= ptr.data; PointCache *cache= ptr.data;

View File

@@ -211,7 +211,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
if(oglrender->timer) { /* exec will not have a timer */ if(oglrender->timer) { /* exec will not have a timer */
scene->r.cfra= oglrender->cfrao; scene->r.cfra= oglrender->cfrao;
scene_update_for_newframe(scene, scene->lay); scene_update_for_newframe(scene, scene->lay|oglrender->v3d->lay);
WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), oglrender->timer); WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), oglrender->timer);
} }
@@ -268,16 +268,16 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
/* go to next frame */ /* go to next frame */
while(CFRA<oglrender->nfra) { while(CFRA<oglrender->nfra) {
if(scene->lay & 0xFF000000) lay = scene->lay | oglrender->v3d->lay;
lay= scene->lay & 0xFF000000;
else if(lay & 0xFF000000)
lay= scene->lay; lay &= 0xFF000000;
scene_update_for_newframe(scene, lay); scene_update_for_newframe(scene, lay);
CFRA++; CFRA++;
} }
scene_update_for_newframe(scene, scene->lay); scene_update_for_newframe(scene, scene->lay | oglrender->v3d->lay);
if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) { if(oglrender->rv3d->persp==RV3D_CAMOB && oglrender->v3d->camera && oglrender->v3d->scenelock) {
/* since scene_update_for_newframe() is used rather /* since scene_update_for_newframe() is used rather

View File

@@ -3040,7 +3040,8 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELDOWNMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", 1); RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELDOWNMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", 1);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELUPMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1); RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELUPMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1);
WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0);

View File

@@ -133,7 +133,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max)
int filter; int filter;
/* get data to filter, from Action or Dopesheet */ /* get data to filter, from Action or Dopesheet */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* set large values to try to override */ /* set large values to try to override */
@@ -284,7 +284,7 @@ static short copy_action_keys (bAnimContext *ac)
free_anim_copybuf(); free_anim_copybuf();
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* copy keyframes */ /* copy keyframes */
@@ -303,7 +303,7 @@ static short paste_action_keys (bAnimContext *ac)
int filter, ok=0; int filter, ok=0;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* paste keyframes */ /* paste keyframes */
@@ -421,7 +421,7 @@ static void insert_action_keys(bAnimContext *ac, short mode)
short flag = 0; short flag = 0;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
if (mode == 2) filter |= ANIMFILTER_SEL; if (mode == 2) filter |= ANIMFILTER_SEL;
else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED; else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED;
@@ -508,9 +508,9 @@ static void duplicate_action_keys (bAnimContext *ac)
/* filter data */ /* filter data */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */ /* loop through filtered data and delete selected keys */
@@ -586,9 +586,9 @@ static void delete_action_keys (bAnimContext *ac)
/* filter data */ /* filter data */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */ /* loop through filtered data and delete selected keys */
@@ -659,7 +659,7 @@ static void clean_action_keys (bAnimContext *ac, float thresh)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and clean curves */ /* loop through filtered data and clean curves */
@@ -727,7 +727,7 @@ static void sample_action_keys (bAnimContext *ac)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */ /* loop through filtered data and add keys between selected keyframes on every frame */
@@ -797,7 +797,7 @@ static void setexpo_action_keys(bAnimContext *ac, short mode)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting mode per F-Curve */ /* loop through setting mode per F-Curve */
@@ -868,7 +868,7 @@ static void setipo_action_keys(bAnimContext *ac, short mode)
KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode); KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting BezTriple interpolation /* loop through setting BezTriple interpolation
@@ -952,7 +952,7 @@ static void sethandles_action_keys(bAnimContext *ac, short mode)
KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting flags for handles /* loop through setting flags for handles
@@ -1036,7 +1036,7 @@ static void setkeytype_action_keys(bAnimContext *ac, short mode)
KeyframeEditFunc set_cb= ANIM_editkeyframes_keytype(mode); KeyframeEditFunc set_cb= ANIM_editkeyframes_keytype(mode);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting BezTriple interpolation /* loop through setting BezTriple interpolation
@@ -1118,7 +1118,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op)
memset(&ked, 0, sizeof(KeyframeEditData)); memset(&ked, 0, sizeof(KeyframeEditData));
/* loop over action data, averaging values */ /* loop over action data, averaging values */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1186,7 +1186,7 @@ static void snap_action_keys(bAnimContext *ac, short mode)
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing callbacks */ /* get beztriple editing callbacks */
@@ -1311,9 +1311,9 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
/* filter data */ /* filter data */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* mirror keyframes */ /* mirror keyframes */

View File

@@ -95,9 +95,9 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel)
/* determine type-based settings */ /* determine type-based settings */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
/* filter data */ /* filter data */
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -212,7 +212,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short
UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax-2, &rectf.xmax, &rectf.ymax); UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax-2, &rectf.xmax, &rectf.ymax);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get filtering flag for dopesheet data (if applicable) */ /* get filtering flag for dopesheet data (if applicable) */
@@ -389,7 +389,7 @@ static void markers_selectkeys_between (bAnimContext *ac)
ked.f2= max; ked.f2= max;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* select keys in-between */ /* select keys in-between */
@@ -572,7 +572,7 @@ static int actkeys_select_linked_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
/* loop through all of the keys and select additional keyframes based on these */ /* loop through all of the keys and select additional keyframes based on these */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -627,7 +627,7 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode)
memset(&ked, 0, sizeof(KeyframeEditData)); memset(&ked, 0, sizeof(KeyframeEditData));
/* loop through all of the keys and select additional keyframes based on these */ /* loop through all of the keys and select additional keyframes based on these */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -800,9 +800,9 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short
/* filter data */ /* filter data */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* select keys on the side where most data occurs */ /* select keys on the side where most data occurs */
@@ -823,13 +823,14 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short
/* Sync marker support */ /* Sync marker support */
if((select_mode==SELECT_ADD) && (ac->spacetype==SPACE_ACTION) && ELEM(leftright, ACTKEYS_LRSEL_LEFT, ACTKEYS_LRSEL_RIGHT)) { if((select_mode==SELECT_ADD) && (ac->spacetype==SPACE_ACTION) && ELEM(leftright, ACTKEYS_LRSEL_LEFT, ACTKEYS_LRSEL_RIGHT)) {
SpaceAction *saction= ac->sa->spacedata.first; SpaceAction *saction= ac->sa->spacedata.first;
if (saction && saction->flag & SACTION_MARKERS_MOVE) { if (saction && saction->flag & SACTION_MARKERS_MOVE) {
TimeMarker *marker; TimeMarker *marker;
for (marker= scene->markers.first; marker; marker= marker->next) { for (marker= scene->markers.first; marker; marker= marker->next) {
if( ((leftright == ACTKEYS_LRSEL_LEFT) && marker->frame < CFRA) || if( ((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
((leftright == ACTKEYS_LRSEL_RIGHT) && marker->frame >= CFRA) ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA)) )
) { {
marker->flag |= SELECT; marker->flag |= SELECT;
} }
else { else {
@@ -864,9 +865,9 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se
* based on the keys found to be selected above * based on the keys found to be selected above
*/ */
if (ac->datatype == ANIMCONT_GPENCIL) if (ac->datatype == ANIMCONT_GPENCIL)
filter= (ANIMFILTER_VISIBLE); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NODUPLIS);
else else
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -997,10 +998,8 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode,
gpl_to_keylist(ads, gpl, &anim_keys, NULL); gpl_to_keylist(ads, gpl, &anim_keys, NULL);
} }
// the call below is not strictly necessary, since we have adjacency info anyway
//BLI_dlrbTree_linkedlist_sync(&anim_keys);
/* loop through keyframes, finding one that was within the range clicked on */ /* loop through keyframes, finding one that was within the range clicked on */
// TODO: replace this with API calls instead of inlining
for (ak= anim_keys.root; ak; ak= akn) { for (ak= anim_keys.root; ak; ak= akn) {
if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) { if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) {
/* set the frame to use, and apply inverse-correction for NLA-mapping /* set the frame to use, and apply inverse-correction for NLA-mapping

View File

@@ -63,3 +63,7 @@ ifeq ($(WITH_OPENEXR), true)
CPPFLAGS += -DWITH_OPENEXR CPPFLAGS += -DWITH_OPENEXR
endif endif
ifeq ($(WITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif

View File

@@ -12,9 +12,13 @@ defs = []
if env['WITH_BF_OPENJPEG']: if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG') defs.append('WITH_OPENJPEG')
if env['WITH_BF_OPENEXR']: if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR') defs.append('WITH_OPENEXR')
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] == 'linux2':
cflags='-pthread' cflags='-pthread'
incs += ' ../../../extern/binreloc/include' incs += ' ../../../extern/binreloc/include'

View File

@@ -143,10 +143,11 @@ void save_image_filesel_str(Scene *scene, char *str)
case R_BMP: case R_BMP:
strcpy(str, "Save BMP"); strcpy(str, "Save BMP");
break; break;
#ifdef WITH_TIFF
case R_TIFF: case R_TIFF:
if (G.have_libtiff) strcpy(str, "Save TIFF");
strcpy(str, "Save TIFF");
break; break;
#endif
#ifdef WITH_OPENEXR #ifdef WITH_OPENEXR
case R_OPENEXR: case R_OPENEXR:
strcpy(str, "Save OpenEXR"); strcpy(str, "Save OpenEXR");

View File

@@ -208,11 +208,88 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM)); uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
uiItemR(subrow, &fcu_ptr, "color", 0, "", 0); uiItemR(subrow, &fcu_ptr, "color", 0, "", 0);
/* TODO: the following settings could be added here MEM_freeN(ale);
* - Access details (ID-block + RNA-Path + Array Index) }
* - ...
*/
/* ******************* active Keyframe ************** */
/* get 'active' keyframe for panel editing */
static short get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezTriple **prevbezt)
{
BezTriple *b;
int i;
/* zero the pointers */
*bezt = *prevbezt = NULL;
/* sanity checks */
if ((fcu->bezt == NULL) || (fcu->totvert == 0))
return 0;
/* find first selected keyframe for now, and call it the active one
* - this is a reasonable assumption, given that whenever anyone
* wants to edit numerically, there is likely to only be 1 vert selected
*/
for (i=0, b=fcu->bezt; i < fcu->totvert; i++, b++) {
if (BEZSELECTED(b)) {
/* found
* - 'previous' is either the one before, of the keyframe itself (which is still fine)
* XXX: we can just make this null instead if needed
*/
*prevbezt = (i > 0) ? b-1 : b;
*bezt = b;
return 1;
}
}
/* not found */
return 0;
}
static void graph_panel_key_properties(const bContext *C, Panel *pa)
{
bAnimListElem *ale;
FCurve *fcu;
BezTriple *bezt, *prevbezt;
uiLayout *layout = pa->layout;
uiLayout *col;
uiBlock *block;
if (!graph_panel_context(C, &ale, &fcu))
return;
block = uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL);
/* only show this info if there are keyframes to edit */
if (get_active_fcurve_keyframe_edit(fcu, &bezt, &prevbezt)) {
PointerRNA bezt_ptr;
/* RNA pointer to keyframe, to allow editing */
RNA_pointer_create(ale->id, &RNA_Keyframe, bezt, &bezt_ptr);
/* interpolation */
col= uiLayoutColumn(layout, 0);
uiItemR(col, &bezt_ptr, "interpolation", 0, NULL, 0);
/* numerical coordinate editing */
col= uiLayoutColumn(layout, 1);
/* keyframe itself */
uiItemR(col, &bezt_ptr, "co", 0, "Key", 0);
/* previous handle - only if previous was Bezier interpolation */
if ((prevbezt) && (prevbezt->ipo == BEZT_IPO_BEZ))
uiItemR(col, &bezt_ptr, "handle1", 0, NULL, 0);
/* next handle - only if current is Bezier interpolation */
if (bezt->ipo == BEZT_IPO_BEZ)
uiItemR(col, &bezt_ptr, "handle2", 0, NULL, 0);
}
else
uiItemL(layout, "No active keyframe on F-Curve", 0);
MEM_freeN(ale); MEM_freeN(ale);
} }
@@ -631,6 +708,7 @@ void graph_buttons_register(ARegionType *art)
strcpy(pt->idname, "GRAPH_PT_view"); strcpy(pt->idname, "GRAPH_PT_view");
strcpy(pt->label, "View Properties"); strcpy(pt->label, "View Properties");
pt->draw= graph_panel_view; pt->draw= graph_panel_view;
pt->flag |= PNL_DEFAULT_CLOSED;
BLI_addtail(&art->paneltypes, pt); BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties"); pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
@@ -639,6 +717,14 @@ void graph_buttons_register(ARegionType *art)
pt->draw= graph_panel_properties; pt->draw= graph_panel_properties;
pt->poll= graph_panel_poll; pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt); BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_key_properties");
strcpy(pt->label, "Active Keyframe");
pt->draw= graph_panel_key_properties;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers"); pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers");
strcpy(pt->idname, "GRAPH_PT_drivers"); strcpy(pt->idname, "GRAPH_PT_drivers");

View File

@@ -86,7 +86,7 @@ void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, flo
int filter; int filter;
/* get data to filter, from Dopesheet */ /* get data to filter, from Dopesheet */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* set large values to try to override */ /* set large values to try to override */
@@ -258,7 +258,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end)
} }
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */ /* loop through filtered data and add keys between selected keyframes on every frame */
@@ -417,7 +417,7 @@ static void insert_graph_keys(bAnimContext *ac, short mode)
short flag = 0; short flag = 0;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
if (mode == 2) filter |= ANIMFILTER_SEL; if (mode == 2) filter |= ANIMFILTER_SEL;
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -456,8 +456,6 @@ static int graphkeys_insertkey_exec(bContext *C, wmOperator *op)
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (ac.datatype == ANIMCONT_GPENCIL)
return OPERATOR_CANCELLED;
/* which channels to affect? */ /* which channels to affect? */
mode= RNA_enum_get(op->ptr, "type"); mode= RNA_enum_get(op->ptr, "type");
@@ -599,7 +597,7 @@ static short copy_graph_keys (bAnimContext *ac)
free_anim_copybuf(); free_anim_copybuf();
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* copy keyframes */ /* copy keyframes */
@@ -617,7 +615,7 @@ static short paste_graph_keys (bAnimContext *ac)
int filter, ok=0; int filter, ok=0;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* paste keyframes */ /* paste keyframes */
@@ -713,7 +711,7 @@ static void duplicate_graph_keys (bAnimContext *ac)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */ /* loop through filtered data and delete selected keys */
@@ -785,7 +783,7 @@ static void delete_graph_keys (bAnimContext *ac)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */ /* loop through filtered data and delete selected keys */
@@ -852,7 +850,7 @@ static void clean_graph_keys (bAnimContext *ac, float thresh)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and clean curves */ /* loop through filtered data and clean curves */
@@ -919,7 +917,7 @@ static void bake_graph_curves (bAnimContext *ac, int start, int end)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */ /* loop through filtered data and add keys between selected keyframes on every frame */
@@ -1066,7 +1064,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
end = CFRA + sbi.length - 1; end = CFRA + sbi.length - 1;
/* filter anim channels */ /* filter anim channels */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* loop through all selected F-Curves, replacing its data with the sound samples */ /* loop through all selected F-Curves, replacing its data with the sound samples */
@@ -1144,7 +1142,7 @@ static void sample_graph_keys (bAnimContext *ac)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and add keys between selected keyframes on every frame */ /* loop through filtered data and add keys between selected keyframes on every frame */
@@ -1213,7 +1211,7 @@ static void setexpo_graph_keys(bAnimContext *ac, short mode)
int filter; int filter;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting mode per F-Curve */ /* loop through setting mode per F-Curve */
@@ -1282,7 +1280,7 @@ static void setipo_graph_keys(bAnimContext *ac, short mode)
KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode); KeyframeEditFunc set_cb= ANIM_editkeyframes_ipo(mode);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting BezTriple interpolation /* loop through setting BezTriple interpolation
@@ -1364,7 +1362,7 @@ static void sethandles_graph_keys(bAnimContext *ac, short mode)
KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); KeyframeEditFunc sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through setting flags for handles /* loop through setting flags for handles
@@ -1475,7 +1473,7 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op)
*/ */
/* step 1: extract only the rotation f-curves */ /* step 1: extract only the rotation f-curves */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_FOREDIT); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1554,7 +1552,7 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op)
memset(&ked, 0, sizeof(KeyframeEditData)); memset(&ked, 0, sizeof(KeyframeEditData));
/* loop over action data, averaging values */ /* loop over action data, averaging values */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -1632,7 +1630,7 @@ static void snap_graph_keys(bAnimContext *ac, short mode)
KeyframeEditFunc edit_cb; KeyframeEditFunc edit_cb;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing callbacks */ /* get beztriple editing callbacks */
@@ -1770,7 +1768,7 @@ static void mirror_graph_keys(bAnimContext *ac, short mode)
} }
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* mirror keyframes */ /* mirror keyframes */
@@ -1854,7 +1852,7 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* smooth keyframes */ /* smooth keyframes */
@@ -1945,7 +1943,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op)
type= RNA_enum_get(op->ptr, "type"); type= RNA_enum_get(op->ptr, "type");
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
if (RNA_boolean_get(op->ptr, "only_active")) if (RNA_boolean_get(op->ptr, "only_active"))
filter |= ANIMFILTER_ACTIVE; filter |= ANIMFILTER_ACTIVE;
else else

View File

@@ -95,7 +95,7 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel)
KeyframeEditFunc test_cb, sel_cb; KeyframeEditFunc test_cb, sel_cb;
/* determine type-based settings */ /* determine type-based settings */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
/* filter data */ /* filter data */
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -213,7 +213,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing/validation funcs */ /* get beztriple editing/validation funcs */
@@ -402,7 +402,7 @@ static void markers_selectkeys_between (bAnimContext *ac)
ked.f2= max; ked.f2= max;
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* select keys in-between */ /* select keys in-between */
@@ -442,7 +442,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode)
/* build list of columns */ /* build list of columns */
switch (mode) { switch (mode) {
case GRAPHKEYS_COLUMNSEL_KEYS: /* list of selected keys */ case GRAPHKEYS_COLUMNSEL_KEYS: /* list of selected keys */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) for (ale= anim_data.first; ale; ale= ale->next)
@@ -474,7 +474,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode)
/* loop through all of the keys and select additional keyframes /* loop through all of the keys and select additional keyframes
* based on the keys found to be selected above * based on the keys found to be selected above
*/ */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -561,7 +561,7 @@ static int graphkeys_select_linked_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
/* loop through all of the keys and select additional keyframes based on these */ /* loop through all of the keys and select additional keyframes based on these */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -616,7 +616,7 @@ static void select_moreless_graph_keys (bAnimContext *ac, short mode)
memset(&ked, 0, sizeof(KeyframeEditData)); memset(&ked, 0, sizeof(KeyframeEditData));
/* loop through all of the keys and select additional keyframes based on these */ /* loop through all of the keys and select additional keyframes based on these */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {
@@ -834,7 +834,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa
* - if the option to only show keyframes that belong to selected F-Curves is enabled, * - if the option to only show keyframes that belong to selected F-Curves is enabled,
* include the 'only selected' flag... * include the 'only selected' flag...
*/ */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
if (sipo->flag & SIPO_SELCUVERTSONLY) // FIXME: this should really be check for by the filtering code... if (sipo->flag & SIPO_SELCUVERTSONLY) // FIXME: this should really be check for by the filtering code...
filter |= ANIMFILTER_SEL; filter |= ANIMFILTER_SEL;
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -1055,7 +1055,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
/* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */ /* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */
if (nvi->fcu->flag & FCURVE_SELECTED) { if (nvi->fcu->flag & FCURVE_SELECTED) {
int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nvi->fcu, ANIMTYPE_FCURVE); ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nvi->fcu, ANIMTYPE_FCURVE);
} }
} }
@@ -1107,7 +1107,7 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor
} }
/* filter data */ /* filter data */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* select keys on the side where most data occurs */ /* select keys on the side where most data occurs */
@@ -1180,7 +1180,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec
/* loop through all of the keys and select additional keyframes /* loop through all of the keys and select additional keyframes
* based on the keys found to be selected above * based on the keys found to be selected above
*/ */
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale= anim_data.first; ale; ale= ale->next) { for (ale= anim_data.first; ale; ale= ale->next) {

View File

@@ -521,7 +521,7 @@ static void graph_refresh(const bContext *C, ScrArea *sa)
* - we don't include ANIMFILTER_CURVEVISIBLE filter, as that will result in a * - we don't include ANIMFILTER_CURVEVISIBLE filter, as that will result in a
* mismatch between channel-colors and the drawn curves * mismatch between channel-colors and the drawn curves
*/ */
filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CURVESONLY); filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CURVESONLY|ANIMFILTER_NODUPLIS);
items= ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); items= ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* loop over F-Curves, assigning colors */ /* loop over F-Curves, assigning colors */

View File

@@ -57,3 +57,7 @@ ifeq ($(WITH_OPENEXR), true)
CPPFLAGS += -DWITH_OPENEXR CPPFLAGS += -DWITH_OPENEXR
endif endif
ifeq ($(WHITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif

View File

@@ -13,6 +13,8 @@ if env['WITH_BF_LCMS']:
defs.append('WITH_LCMS') defs.append('WITH_LCMS')
if env['WITH_BF_OPENEXR']: if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR') defs.append('WITH_OPENEXR')
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC'] incs += ' ' + env['BF_PTHREADS_INC']

View File

@@ -637,8 +637,9 @@ static const EnumPropertyItem image_file_type_items[] = {
{R_JP2, "JPEG_2000", 0, "Jpeg 2000", ""}, {R_JP2, "JPEG_2000", 0, "Jpeg 2000", ""},
#endif #endif
{R_IRIS, "IRIS", 0, "Iris", ""}, {R_IRIS, "IRIS", 0, "Iris", ""},
//if(G.have_libtiff) #ifdef WITH_TIFF
{R_TIFF, "TIFF", 0, "Tiff", ""}, {R_TIFF, "TIFF", 0, "Tiff", ""},
#endif
{R_RADHDR, "RADIANCE_HDR", 0, "Radiance HDR", ""}, {R_RADHDR, "RADIANCE_HDR", 0, "Radiance HDR", ""},
{R_CINEON, "CINEON", 0, "Cineon", ""}, {R_CINEON, "CINEON", 0, "Cineon", ""},
{R_DPX, "DPX", 0, "DPX", ""}, {R_DPX, "DPX", 0, "DPX", ""},
@@ -1155,7 +1156,6 @@ static int reload_exec(bContext *C, wmOperator *op)
BKE_image_signal(ima, (sima)? &sima->iuser: NULL, IMA_SIGNAL_RELOAD); BKE_image_signal(ima, (sima)? &sima->iuser: NULL, IMA_SIGNAL_RELOAD);
WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
ED_area_tag_redraw(CTX_wm_area(C));
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }
@@ -1168,7 +1168,6 @@ void IMAGE_OT_reload(wmOperatorType *ot)
/* api callbacks */ /* api callbacks */
ot->exec= reload_exec; ot->exec= reload_exec;
ot->poll= space_image_poll;
/* flags */ /* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;

View File

@@ -3221,9 +3221,14 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
bArmatureSensor *as = (bArmatureSensor *) sens->data; bArmatureSensor *as = (bArmatureSensor *) sens->data;
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
PointerRNA pose_ptr, pchan_ptr; PointerRNA pose_ptr, pchan_ptr;
PropertyRNA *bones_prop; PropertyRNA *bones_prop= NULL;
uiLayout *row; uiLayout *row;
if(ob->type != OB_ARMATURE){
uiItemL(layout, "Sensor only available for armatures", 0);
return;
}
if (ob->pose) { if (ob->pose) {
RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr); RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr);
bones_prop = RNA_struct_find_property(&pose_ptr, "bones"); bones_prop = RNA_struct_find_property(&pose_ptr, "bones");
@@ -3588,6 +3593,10 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
PointerRNA settings_ptr; PointerRNA settings_ptr;
uiLayout *row; uiLayout *row;
if(ob->type != OB_ARMATURE){
uiItemL(layout, "Actuator only available for armatures", 0);
return;
}
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
row= uiLayoutRow(layout, 0); row= uiLayoutRow(layout, 0);
@@ -3623,6 +3632,11 @@ static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr)
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
PointerRNA pose_ptr, pchan_ptr; PointerRNA pose_ptr, pchan_ptr;
PropertyRNA *bones_prop; PropertyRNA *bones_prop;
if(ob->type != OB_ARMATURE){
uiItemL(layout, "Actuator only available for armatures", 0);
return;
}
if (ob->pose) { if (ob->pose) {
RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr); RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose, &pose_ptr);
@@ -3782,6 +3796,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr)
static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr) static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
{ {
Object *ob = (Object *)ptr->id.data;
uiLayout *row, *split, *subsplit; uiLayout *row, *split, *subsplit;
uiItemR(layout, ptr, "mode", 0, NULL, 0); uiItemR(layout, ptr, "mode", 0, NULL, 0);
@@ -3805,6 +3820,10 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
case ACT_EDOB_END_OBJECT: case ACT_EDOB_END_OBJECT:
break; break;
case ACT_EDOB_REPLACE_MESH: case ACT_EDOB_REPLACE_MESH:
if(ob->type != OB_MESH) {
uiItemL(layout, "Mode only available for mesh objects", 0);
break;
}
split = uiLayoutSplit(layout, 0.6, 0); split = uiLayoutSplit(layout, 0.6, 0);
uiItemR(split, ptr, "mesh", 0, NULL, 0); uiItemR(split, ptr, "mesh", 0, NULL, 0);
row = uiLayoutRow(split, 0); row = uiLayoutRow(split, 0);
@@ -3819,6 +3838,10 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr)
uiItemR(subsplit, ptr, "enable_3d_tracking", UI_ITEM_R_TOGGLE, NULL, 0); uiItemR(subsplit, ptr, "enable_3d_tracking", UI_ITEM_R_TOGGLE, NULL, 0);
break; break;
case ACT_EDOB_DYNAMICS: case ACT_EDOB_DYNAMICS:
if(ob->type != OB_MESH) {
uiItemL(layout, "Mode only available for mesh objects", 0);
break;
}
uiItemR(layout, ptr, "dynamic_operation", 0, NULL, 0); uiItemR(layout, ptr, "dynamic_operation", 0, NULL, 0);
if (RNA_enum_get(ptr, "dynamic_operation") == ACT_EDOB_SET_MASS) if (RNA_enum_get(ptr, "dynamic_operation") == ACT_EDOB_SET_MASS)
uiItemR(layout, ptr, "mass", 0, NULL, 0); uiItemR(layout, ptr, "mass", 0, NULL, 0);
@@ -4144,6 +4167,11 @@ static void draw_actuator_shape_action(uiLayout *layout, PointerRNA *ptr)
PointerRNA settings_ptr; PointerRNA settings_ptr;
uiLayout *row; uiLayout *row;
if(ob->type != OB_MESH){
uiItemL(layout, "Actuator only available for mesh objects", 0);
return;
}
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
row= uiLayoutRow(layout, 0); row= uiLayoutRow(layout, 0);

View File

@@ -182,6 +182,7 @@ void logic_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_menu(keymap, "LOGIC_MT_logicbricks_add", AKEY, KM_PRESS, KM_SHIFT, 0);
} }
static void logic_refresh(const bContext *C, ScrArea *sa) static void logic_refresh(const bContext *C, ScrArea *sa)

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