diff --git a/CMakeLists.txt b/CMakeLists.txt index 1088d95ab67..29af4db6073 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,6 +261,7 @@ IF(UNIX AND NOT APPLE) SET(FFMPEG_INC ${FFMPEG}/include) SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") SET(FFMPEG_LIBPATH ${FFMPEG}/lib) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS") ENDIF(WITH_FFMPEG) IF(WITH_FFTW3) @@ -736,6 +737,7 @@ IF(APPLE) SET(FFMPEG_INC ${FFMPEG}/include) SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg) SET(FFMPEG_LIBPATH ${FFMPEG}/lib) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS") ENDIF(WITH_FFMPEG) SET(LIBSAMPLERATE ${LIBDIR}/samplerate) diff --git a/config/darwin-config.py b/config/darwin-config.py index f6d9ca97a19..1423e8fb392 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -279,9 +279,9 @@ else: CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS -CPPFLAGS = ['-fpascal-strings']+ARCH_FLAGS -CCFLAGS = ['-pipe','-funsigned-char','-fpascal-strings']+ARCH_FLAGS -CXXFLAGS = ['-pipe','-funsigned-char', '-fpascal-strings']+ARCH_FLAGS +CPPFLAGS = []+ARCH_FLAGS +CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS +CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS if WITH_GHOST_COCOA==True: PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS diff --git a/config/linux2-config.py b/config/linux2-config.py index 213c20bd7d0..7a350a74ed5 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -181,6 +181,9 @@ CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFIL CPPFLAGS = [] CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] +if WITH_BF_FFMPEG: + # libavutil needs UINT64_C() + CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] REL_CFLAGS = ['-O2'] REL_CCFLAGS = ['-O2'] ##BF_DEPEND = True diff --git a/extern/glew/include/GL/glew.h b/extern/glew/include/GL/glew.h index 2014092e877..3cb7bed3dda 100644 --- a/extern/glew/include/GL/glew.h +++ b/extern/glew/include/GL/glew.h @@ -2702,7 +2702,7 @@ typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURLAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); @@ -2723,7 +2723,7 @@ typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum targ #define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) #define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) #define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) -#define glFramebufferTexturLayer GLEW_GET_FUN(__glewFramebufferTexturLayer) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) #define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) #define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) #define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) @@ -8288,7 +8288,6 @@ typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -typedef void (GLAPIENTRY * PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint* params); #define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) #define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) @@ -10563,7 +10562,7 @@ GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; @@ -11612,7 +11611,6 @@ GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; -GLEW_FUN_EXPORT PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; diff --git a/extern/glew/src/glew.c b/extern/glew/src/glew.c index 24c6a726c38..1d947d364d3 100644 --- a/extern/glew/src/glew.c +++ b/extern/glew/src/glew.c @@ -547,7 +547,7 @@ PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; -PFNGLFRAMEBUFFERTEXTURLAYERPROC __glewFramebufferTexturLayer = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; @@ -1596,7 +1596,6 @@ PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; -PFNGLVIDEOPARAMETERIVNVPROC __glewVideoParameterivNV = NULL; PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; @@ -2739,7 +2738,7 @@ static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; - r = ((glFramebufferTexturLayer = (PFNGLFRAMEBUFFERTEXTURLAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexturLayer")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; @@ -5303,7 +5302,6 @@ static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; - r = ((glVideoParameterivNV = (PFNGLVIDEOPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoParameterivNV")) == NULL) || r; return r; } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index f65d4e93d59..6c29b7411fc 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -813,7 +813,11 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow(); if (!window) return GHOST_kFailure; + //Cursor and mouse dissociation placed here not to interfere with continuous grab + // (in cont. grab setMouseCursorPosition is directly called) + CGAssociateMouseAndMouseCursorPosition(false); setMouseCursorPosition(x, y); + CGAssociateMouseAndMouseCursorPosition(true); //Force mouse move event (not pushed by Cocoa) window->screenToClient(x, y, wx, wy); diff --git a/release/scripts/presets/cloth/cotton.py b/release/scripts/presets/cloth/cotton.py index 7fe8b890b38..695050cf195 100644 --- a/release/scripts/presets/cloth/cotton.py +++ b/release/scripts/presets/cloth/cotton.py @@ -1,3 +1,4 @@ +import bpy bpy.context.cloth.settings.quality = 5 bpy.context.cloth.settings.mass = 0.300 bpy.context.cloth.settings.structural_stiffness = 15.000 diff --git a/release/scripts/presets/cloth/denim.py b/release/scripts/presets/cloth/denim.py index 4cad384a014..bd72fa873da 100644 --- a/release/scripts/presets/cloth/denim.py +++ b/release/scripts/presets/cloth/denim.py @@ -1,3 +1,4 @@ +import bpy bpy.context.cloth.settings.quality = 12 bpy.context.cloth.settings.mass = 1 bpy.context.cloth.settings.structural_stiffness = 40 diff --git a/release/scripts/presets/cloth/leather.py b/release/scripts/presets/cloth/leather.py index 11176c7e814..b85f504b0bb 100644 --- a/release/scripts/presets/cloth/leather.py +++ b/release/scripts/presets/cloth/leather.py @@ -1,3 +1,4 @@ +import bpy bpy.context.cloth.settings.quality = 15 bpy.context.cloth.settings.mass = 0.4 bpy.context.cloth.settings.structural_stiffness = 80 diff --git a/release/scripts/presets/cloth/rubber.py b/release/scripts/presets/cloth/rubber.py index 101c11b141a..c2d7625d333 100644 --- a/release/scripts/presets/cloth/rubber.py +++ b/release/scripts/presets/cloth/rubber.py @@ -1,3 +1,4 @@ +import bpy bpy.context.active_object.modifiers['Cloth'].settings.quality = 7 bpy.context.active_object.modifiers['Cloth'].settings.mass = 3 bpy.context.active_object.modifiers['Cloth'].settings.structural_stiffness = 15 diff --git a/release/scripts/presets/cloth/silk.py b/release/scripts/presets/cloth/silk.py index a0dea5f1fd3..c2a98c270b8 100644 --- a/release/scripts/presets/cloth/silk.py +++ b/release/scripts/presets/cloth/silk.py @@ -1,3 +1,4 @@ +import bpy bpy.context.cloth.settings.quality = 5 bpy.context.cloth.settings.mass = 0.150 bpy.context.cloth.settings.structural_stiffness = 5 diff --git a/release/scripts/presets/ffmpeg/DV.py b/release/scripts/presets/ffmpeg/DV.py index db1bc0fac92..4cdb2f271b9 100644 --- a/release/scripts/presets/ffmpeg/DV.py +++ b/release/scripts/presets/ffmpeg/DV.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "DV" diff --git a/release/scripts/presets/ffmpeg/DVD.py b/release/scripts/presets/ffmpeg/DVD.py index 6ac6c3c5ff7..233bdab4f20 100644 --- a/release/scripts/presets/ffmpeg/DVD.py +++ b/release/scripts/presets/ffmpeg/DVD.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "MPEG2" @@ -15,4 +16,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 bpy.context.scene.render.ffmpeg_buffersize = 224*8 bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/SVCD.py b/release/scripts/presets/ffmpeg/SVCD.py index 1d8752f02d9..52f938623b8 100644 --- a/release/scripts/presets/ffmpeg/SVCD.py +++ b/release/scripts/presets/ffmpeg/SVCD.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "MPEG2" @@ -15,4 +16,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 2516 bpy.context.scene.render.ffmpeg_minrate = 0 bpy.context.scene.render.ffmpeg_buffersize = 224*8 bpy.context.scene.render.ffmpeg_packetsize = 2324 -bpy.context.scene.render.ffmpeg_muxrate = 0 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 0 diff --git a/release/scripts/presets/ffmpeg/VCD.py b/release/scripts/presets/ffmpeg/VCD.py index 303fd85eefb..876fa2d8ba6 100644 --- a/release/scripts/presets/ffmpeg/VCD.py +++ b/release/scripts/presets/ffmpeg/VCD.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "MPEG1" @@ -15,4 +16,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 1150 bpy.context.scene.render.ffmpeg_minrate = 1150 bpy.context.scene.render.ffmpeg_buffersize = 40*8 bpy.context.scene.render.ffmpeg_packetsize = 2324 -bpy.context.scene.render.ffmpeg_muxrate = 2352 * 75 * 8 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 2352 * 75 * 8 diff --git a/release/scripts/presets/ffmpeg/h264.py b/release/scripts/presets/ffmpeg/h264.py index e46dcd46176..74e6890a5d4 100644 --- a/release/scripts/presets/ffmpeg/h264.py +++ b/release/scripts/presets/ffmpeg/h264.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "H264" @@ -13,4 +14,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 bpy.context.scene.render.ffmpeg_buffersize = 224*8 bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/theora.py b/release/scripts/presets/ffmpeg/theora.py index bb84d977da3..6ce9d4ea7ed 100644 --- a/release/scripts/presets/ffmpeg/theora.py +++ b/release/scripts/presets/ffmpeg/theora.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "OGG" @@ -13,4 +14,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 bpy.context.scene.render.ffmpeg_buffersize = 224*8 bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/xvid.py b/release/scripts/presets/ffmpeg/xvid.py index c0f5a3adb10..0c8e3989451 100644 --- a/release/scripts/presets/ffmpeg/xvid.py +++ b/release/scripts/presets/ffmpeg/xvid.py @@ -1,3 +1,4 @@ +import bpy is_ntsc = (bpy.context.scene.render.fps != 25) bpy.context.scene.render.ffmpeg_format = "AVI" @@ -13,4 +14,4 @@ bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 bpy.context.scene.render.ffmpeg_buffersize = 224*8 bpy.context.scene.render.ffmpeg_packetsize = 2048 -bpy.context.scene.render.ffmpeg_muxrate = 10080000 \ No newline at end of file +bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/render/DVCPRO_HD_1080p.py b/release/scripts/presets/render/DVCPRO_HD_1080p.py index 27a2233909e..f97b389795e 100644 --- a/release/scripts/presets/render/DVCPRO_HD_1080p.py +++ b/release/scripts/presets/render/DVCPRO_HD_1080p.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 1280 bpy.context.scene.render.resolution_y = 1080 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/DVCPRO_HD_720p.py b/release/scripts/presets/render/DVCPRO_HD_720p.py index e3ababa6c5f..dbe4c9243d8 100644 --- a/release/scripts/presets/render/DVCPRO_HD_720p.py +++ b/release/scripts/presets/render/DVCPRO_HD_720p.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 960 bpy.context.scene.render.resolution_y = 720 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/HDTV_1080p.py b/release/scripts/presets/render/HDTV_1080p.py index 7693dae9347..32b771dc4a5 100644 --- a/release/scripts/presets/render/HDTV_1080p.py +++ b/release/scripts/presets/render/HDTV_1080p.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 1920 bpy.context.scene.render.resolution_y = 1080 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/HDTV_720p.py b/release/scripts/presets/render/HDTV_720p.py index ee16c1e8b33..c5c81eeb790 100644 --- a/release/scripts/presets/render/HDTV_720p.py +++ b/release/scripts/presets/render/HDTV_720p.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 1280 bpy.context.scene.render.resolution_y = 720 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/HDV_1080p.py b/release/scripts/presets/render/HDV_1080p.py index 8ac369f14a6..7637648e53a 100644 --- a/release/scripts/presets/render/HDV_1080p.py +++ b/release/scripts/presets/render/HDV_1080p.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 1440 bpy.context.scene.render.resolution_y = 1080 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/TV_NTSC_16_colon_9.py b/release/scripts/presets/render/TV_NTSC_16_colon_9.py index 26833ba0c09..12ecaab4800 100644 --- a/release/scripts/presets/render/TV_NTSC_16_colon_9.py +++ b/release/scripts/presets/render/TV_NTSC_16_colon_9.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 480 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/TV_NTSC_4_colon_3.py b/release/scripts/presets/render/TV_NTSC_4_colon_3.py index 219e9b0506d..471c45b04d7 100644 --- a/release/scripts/presets/render/TV_NTSC_4_colon_3.py +++ b/release/scripts/presets/render/TV_NTSC_4_colon_3.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 486 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/TV_PAL_16_colon_9.py b/release/scripts/presets/render/TV_PAL_16_colon_9.py index c8aa6616bb0..2add29e9408 100644 --- a/release/scripts/presets/render/TV_PAL_16_colon_9.py +++ b/release/scripts/presets/render/TV_PAL_16_colon_9.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 576 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/render/TV_PAL_4_colon_3.py b/release/scripts/presets/render/TV_PAL_4_colon_3.py index 45eaaf47e44..92cb794558e 100644 --- a/release/scripts/presets/render/TV_PAL_4_colon_3.py +++ b/release/scripts/presets/render/TV_PAL_4_colon_3.py @@ -1,3 +1,4 @@ +import bpy bpy.context.scene.render.resolution_x = 720 bpy.context.scene.render.resolution_y = 576 bpy.context.scene.render.resolution_percentage = 100 diff --git a/release/scripts/presets/sss/apple.py b/release/scripts/presets/sss/apple.py index 474769cd36f..d505be2b435 100644 --- a/release/scripts/presets/sss/apple.py +++ b/release/scripts/presets/sss/apple.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 11.605, 3.884, 1.754 bpy.context.active_object.active_material.subsurface_scattering.color = 0.430, 0.210, 0.168 diff --git a/release/scripts/presets/sss/chicken.py b/release/scripts/presets/sss/chicken.py index 6253de09376..53e199455c1 100644 --- a/release/scripts/presets/sss/chicken.py +++ b/release/scripts/presets/sss/chicken.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 9.436, 3.348, 1.790 bpy.context.active_object.active_material.subsurface_scattering.color = 0.439, 0.216, 0.141 diff --git a/release/scripts/presets/sss/cream.py b/release/scripts/presets/sss/cream.py index f0a5292b85c..221739a30ab 100644 --- a/release/scripts/presets/sss/cream.py +++ b/release/scripts/presets/sss/cream.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 15.028, 4.664, 2.541 bpy.context.active_object.active_material.subsurface_scattering.color = 0.987, 0.943, 0.827 diff --git a/release/scripts/presets/sss/ketchup.py b/release/scripts/presets/sss/ketchup.py index caece1ea7ca..96d136dc271 100644 --- a/release/scripts/presets/sss/ketchup.py +++ b/release/scripts/presets/sss/ketchup.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 4.762, 0.575, 0.394 bpy.context.active_object.active_material.subsurface_scattering.color = 0.222, 0.008, 0.002 diff --git a/release/scripts/presets/sss/marble.py b/release/scripts/presets/sss/marble.py index ea894f69800..cd68fd7d26f 100644 --- a/release/scripts/presets/sss/marble.py +++ b/release/scripts/presets/sss/marble.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 8.509, 5.566, 3.951 bpy.context.active_object.active_material.subsurface_scattering.color = 0.925, 0.905, 0.884 diff --git a/release/scripts/presets/sss/potato.py b/release/scripts/presets/sss/potato.py index 89407dff427..7a6c25db833 100644 --- a/release/scripts/presets/sss/potato.py +++ b/release/scripts/presets/sss/potato.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 14.266, 7.228, 2.036 bpy.context.active_object.active_material.subsurface_scattering.color = 0.855, 0.740, 0.292 diff --git a/release/scripts/presets/sss/skim_milk.py b/release/scripts/presets/sss/skim_milk.py index 2e5b19d4f53..5be37b820da 100644 --- a/release/scripts/presets/sss/skim_milk.py +++ b/release/scripts/presets/sss/skim_milk.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 18.424, 10.443, 3.502 bpy.context.active_object.active_material.subsurface_scattering.color = 0.889, 0.888, 0.796 diff --git a/release/scripts/presets/sss/skin1.py b/release/scripts/presets/sss/skin1.py index 42fb1fac43a..76dc64f61f9 100644 --- a/release/scripts/presets/sss/skin1.py +++ b/release/scripts/presets/sss/skin1.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 3.673, 1.367, 0.683 bpy.context.active_object.active_material.subsurface_scattering.color = 0.574, 0.313, 0.174 diff --git a/release/scripts/presets/sss/skin2.py b/release/scripts/presets/sss/skin2.py index 52b649ecd8f..6a72a782638 100644 --- a/release/scripts/presets/sss/skin2.py +++ b/release/scripts/presets/sss/skin2.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 4.821, 1.694, 1.090 bpy.context.active_object.active_material.subsurface_scattering.color = 0.749, 0.571, 0.467 diff --git a/release/scripts/presets/sss/whole_milk.py b/release/scripts/presets/sss/whole_milk.py index 4cb6ccf3dcf..59aaa135933 100644 --- a/release/scripts/presets/sss/whole_milk.py +++ b/release/scripts/presets/sss/whole_milk.py @@ -1,2 +1,3 @@ +import bpy bpy.context.active_object.active_material.subsurface_scattering.radius = 10.899, 6.575, 2.508 bpy.context.active_object.active_material.subsurface_scattering.color = 0.947, 0.931, 0.852 diff --git a/release/scripts/presets/sunsky/classic.py b/release/scripts/presets/sunsky/classic.py index 9ee35d68dad..4394dcce242 100644 --- a/release/scripts/presets/sunsky/classic.py +++ b/release/scripts/presets/sunsky/classic.py @@ -1,3 +1,4 @@ +import bpy bpy.context.object.data.sky.atmosphere_turbidity = 4.0 bpy.context.object.data.sky.sky_blend_type = 'ADD' bpy.context.object.data.sky.sky_blend = 1.0 diff --git a/release/scripts/presets/sunsky/desert.py b/release/scripts/presets/sunsky/desert.py index 26ed4527746..f68ea23845b 100644 --- a/release/scripts/presets/sunsky/desert.py +++ b/release/scripts/presets/sunsky/desert.py @@ -1,3 +1,4 @@ +import bpy bpy.context.object.data.sky.atmosphere_turbidity = 6.0 bpy.context.object.data.sky.sky_blend_type = 'ADD' bpy.context.object.data.sky.sky_blend = 1.0 diff --git a/release/scripts/presets/sunsky/mountain.py b/release/scripts/presets/sunsky/mountain.py index e35d3944042..9b81ffd4399 100644 --- a/release/scripts/presets/sunsky/mountain.py +++ b/release/scripts/presets/sunsky/mountain.py @@ -1,3 +1,4 @@ +import bpy bpy.context.object.data.sky.atmosphere_turbidity = 2.00000023842 bpy.context.object.data.sky.sky_blend_type = 'ADD' bpy.context.object.data.sky.sky_blend = 1.0 diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py index de181a13c25..e20b92c9b6a 100644 --- a/release/scripts/templates/operator.py +++ b/release/scripts/templates/operator.py @@ -1,4 +1,3 @@ - import bpy def write_some_data(context, filepath, use_some_setting): diff --git a/release/scripts/templates/operator_modal.py b/release/scripts/templates/operator_modal.py index b2839efabe4..e029d91a7fa 100644 --- a/release/scripts/templates/operator_modal.py +++ b/release/scripts/templates/operator_modal.py @@ -1,3 +1,4 @@ +import bpy from bpy.props import * class ModalOperator(bpy.types.Operator): diff --git a/release/scripts/templates/operator_modal_draw.py b/release/scripts/templates/operator_modal_draw.py index 98efa38e9ee..1f24672346b 100644 --- a/release/scripts/templates/operator_modal_draw.py +++ b/release/scripts/templates/operator_modal_draw.py @@ -1,3 +1,4 @@ +import bpy import bgl import blf diff --git a/release/scripts/templates/operator_modal_view3d.py b/release/scripts/templates/operator_modal_view3d.py index afe179376ed..da019c2b653 100644 --- a/release/scripts/templates/operator_modal_view3d.py +++ b/release/scripts/templates/operator_modal_view3d.py @@ -1,3 +1,4 @@ +import bpy from mathutils import Vector from bpy.props import FloatVectorProperty diff --git a/release/scripts/templates/operator_uv.py b/release/scripts/templates/operator_uv.py index 36d8333d49d..1003bd6c58b 100644 --- a/release/scripts/templates/operator_uv.py +++ b/release/scripts/templates/operator_uv.py @@ -1,3 +1,4 @@ +import bpy def main(context): obj = context.active_object diff --git a/release/scripts/ui/space_sequencer.py b/release/scripts/ui/space_sequencer.py index c1b042f0718..5f014f639e1 100644 --- a/release/scripts/ui/space_sequencer.py +++ b/release/scripts/ui/space_sequencer.py @@ -69,6 +69,14 @@ class SEQUENCER_HT_header(bpy.types.Header): else: layout.prop(st, "display_channel", text="Channel") + ed = context.scene.sequence_editor + if ed: + row = layout.row(align=True) + row.prop(ed, "show_overlay", text="", icon='GHOST_ENABLED') + if ed.show_overlay: + row.prop(ed, "overlay_frame", text="") + row.prop(ed, "overlay_lock", text="", icon='LOCKED') + class SEQUENCER_MT_view_toggle(bpy.types.Menu): bl_label = "View Type" @@ -126,6 +134,10 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.operator_context = 'INVOKE_REGION_PREVIEW' layout.operator("sequencer.view_all_preview", text='Fit preview in window') layout.operator_context = 'INVOKE_DEFAULT' + + # # XXX, invokes in the header view + # layout.operator("sequencer.view_ghost_border", text='Overlay Border') + layout.operator("sequencer.view_selected") layout.prop(st, "draw_frames") diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index f25c82fde3f..f36de996704 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -854,7 +854,7 @@ class USERPREF_PT_addons(bpy.types.Panel): cats = ["All", "Enabled", "Disabled"] + sorted(cats) - bpy.types.Scene.EnumProperty(items=[(cat, cat, str(i)) for i, cat in enumerate(cats)], + bpy.types.Scene.EnumProperty(items=[(cat, cat, cat + " addons") for cat in cats], name="Category", attr="addon_filter", description="Filter add-ons by category") bpy.types.Scene.StringProperty(name="Search", attr="addon_search", description="Search within the selected filter") diff --git a/release/windows/inno/blender.iss b/release/windows/inno/blender.iss deleted file mode 100644 index 5faf5b47406..00000000000 --- a/release/windows/inno/blender.iss +++ /dev/null @@ -1,92 +0,0 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - - -[Setup] -#define VERSION "2.49b" - -; NOTE: The value of AppId uniquely identifies this application. -; Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{C45CB76D-AD5F-49CC-86DE-72B168A6A888} -AppName=Blender -AppVerName=Blender {#VERSION} -AppPublisher=Blender Foundation -AppPublisherURL=http://www.blender.org -AppSupportURL=http://www.blender.org -AppUpdatesURL=http://www.blender.org -DefaultDirName={pf}\Blender -DefaultGroupName=Blender Foundation -AllowNoIcons=true -LicenseFile=.\copyright.txt -OutputBaseFilename=blender-{#VERSION} -Compression=lzma -SolidCompression=true -ChangesAssociations=true -WizardImageFile=.\installer.bmp -WizardSmallImageFile=.\header.bmp -SetupIconFile=.\installer.ico -MinVersion=,5.01.2600sp1 -PrivilegesRequired=none -AllowRootDirectory=true -ShowLanguageDialog=auto - -[Dirs] -Name: {userdocs}\Blender; Flags: uninsneveruninstall; Tasks: ; Languages: - -[Languages] -Name: english; MessagesFile: compiler:Default.isl - -[Tasks] -Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked -Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked - -[Files] -Source: ..\..\..\..\build\bin\release\blender.exe; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\blender.html; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\BlenderQuickStart.pdf; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\copyright.txt; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\GPL-license.txt; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\Python-license.txt; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\release_249.txt; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\*.dll; DestDir: {app}; Flags: ignoreversion -Source: ..\..\..\..\build\bin\release\plugins\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs -Source: ..\..\..\..\build\bin\release\.blender\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: {group}\Blender; Filename: {app}\blender.exe -Name: {group}\ReleaseNotes; Filename: {app}\release_249.txt -Name: {group}\Blender.org; Filename: {app}\blender.html -Name: {group}\Copyright; Filename: {app}\copyright.txt -Name: {group}\GPL; Filename: {app}\GPL-license.txt -Name: {group}\Uninstall; Filename: {uninstallexe}; Tasks: ; Languages: -Name: {commondesktop}\Blender; Filename: {app}\blender.exe; Tasks: desktopicon -Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Blender; Filename: {app}\blender.exe; Tasks: quicklaunchicon - -[Registry] -Root: HKCR; Subkey: .blend; ValueType: string; ValueName: ; ValueData: BlenderFile; Flags: uninsdeletevalue -Root: HKCR; Subkey: BlenderFile; ValueType: string; ValueName: ; ValueData: Blender File; Flags: uninsdeletekey -Root: HKCR; Subkey: BlenderFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\blender.exe,0 -Root: HKCR; Subkey: BlenderFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\blender.exe"" ""%1""" - -[Run] -Filename: {app}\blender.exe; Description: {cm:LaunchProgram,Blender}; Flags: nowait postinstall skipifsilent - - -[_ISToolDownload] - -[UninstallDelete] -Name: {app}\blender.exe; Type: files -Name: {app}\*.dll; Type: files -Name: {app}\blender.html; Type: files; Tasks: ; Languages: -Name: {app}\BlenderQuickStart.pdf; Type: files -Name: {app}\copyright.txt; Type: files -Name: {app}\GPL-license.txt; Type: files -Name: {app}\Python-license.txt; Type: files -Name: {app}\release_249.txt; Type: files -Name: {app}\.blender\*; Type: filesandordirs -Name: {app}\plugins\*; Type: filesandordirs -Name: {app}\.blender; Type: dirifempty -Name: {app}\plugins; Type: dirifempty -Name: {app}; Type: dirifempty diff --git a/release/windows/inno/copyright.txt b/release/windows/inno/copyright.txt deleted file mode 100644 index 4e67c2561d3..00000000000 --- a/release/windows/inno/copyright.txt +++ /dev/null @@ -1,56 +0,0 @@ -BLENDER CREATOR LICENSE AGREEMENT - -IMPORTANT: PLEASE READ CAREFULLY BEFORE USING THE BLENDER CREATOR SOFTWARE. - -This License Agreement for the Blender Creator software ("License Agreement") is an agreement between NaN Technologies B.V., Meerenakkerplein 11, 5652 BJ Eindhoven, the Netherlands ("NaN") and you (either an individual or a legal entity) ("You") with respect to the software product which this License Agreement accompanies (the "Software"). - -By installing, copying or otherwise using the Software, You agree to be bound by the terms of this License Agreement. If You do not agree to the terms of this License Agreement do not install or use the Software. - - -1. Grant of License - -Subject to the provisions of this License Agreement, NaN grants You a limited, non-exclusive, personal, non-sublicenseable, non-transferable, revocable license to use the Software at any computer You own or use. - -2. License Restrictions - -Except as expressly provided under this License Agreement, or without prior written consent from NaN, or without permission by law, You may not: (a) remove or alter any proprietary, copyright or trademark notices in or on the Software; (b) modify, decompile, disassemble or reverse-engineer the Software; (c) sublicense, rent, lease, lend, assign or otherwise transfer rights to the Software. - -3. Permitted copying and electronic distribution of Software - -You are hereby granted permission to copy and distribute the Software without written agreement from NaN, only for non-commercial purposes. Distributing the Software within a restricted non-public environment, such as using a local network in a company or a local network of a university, is considered a 'non-commercial purpose'. This entire License Agreement must appear in and/or accompany all copies of the Software. -Distributing the Software 'bundled' in with ANY product is considered to be a 'commercial purpose'. - -4. Intellectual Property Rights and Ownership - -Title and ownership to all rights, including intellectual property rights, in and to the Software shall at all times solely and exclusively remain with NaN. The Software is protected by national and international (copyright) laws and treaties. All rights not expressly granted herein are reserved to NaN. - -5. Disclaimer of Warranties - -NaN provides you with the Software "as is" and with all faults. NaN explicitly disclaims all warranties and guarantees and does not make any representations with respect to the Software, whether express, implied, or statutory, including, but not limited to any (if any) warranties of or related to: fitness for a particular purpose, title, non-infringement, lack of viruses, accuracy or completeness of responses, results, lack of negligence or lack of workmanlike effort, and correspondence to description. The entire risk arising out of use or performance of the Software remains with You. - -6. Limitation of Liability - -In no event shall NaN or its employees, agents or suppliers be liable for any direct, indirect, consequential, incidental, special, punitive, or other damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, claims of third parties, damages as a result of injury to any person, or any other loss) arising out of or in connection with the license granted under this License Agreement or the use of or inability to use the Software, even if NaN has been advised of the possibility of such damages. - -7. User warning and indemnification - -WARNING: use of the Software and use of any works that are (partially) created with the Software (the "Works") may cause physical or psychological reactions from You or from third parties, which may result in damages, injuries, losses and/or other negative consequences. You acknowledge that NaN can not be held liable for any such damages, injuries, losses and/or other negative consequences. You acknowledge that it is your obligation to investigate, prevent and/or minimize such reactions prior to having third parties use the Works. - -You shall indemnify and hold harmless NaN from and against all actions, claims, demands, proceedings, losses, damages, costs, charges and expenses, including but not limited to legal fees and expenses, arising out of or in connection with (i) the use of the Software by You and (ii) the use of any Works created with the Software by You or any third parties. - -8. Term and Termination - -This License Agreement and the license granted hereunder is effective until terminated. This License Agreement shall terminate automatically and forthwith if You fail to comply with the terms of this License Agreement. Upon termination, You shall cease the use of the Software, remove the Software from (the memory of) your computer and destroy all copies of the Software. - -9. Entire Agreement - -This License Agreement is the entire agreement between NaN and You in respect of the subject matter of the License Agreement. This License Agreement supersedes all prior written or oral agreements, proposals or understandings, and any other communications between NaN and You relating to the subject matter of this License Agreement. - -10. Enforceability - -If any provision of this License Agreement is held to be unenforceable by a court of competent jurisdiction for any reason, such provision shall be adapted or amended only to the extent necessary to make it enforceable, and the remainder of the License Agreement shall remain in effect. - -11. Governing law and disputes - -This License Agreement and all disputes arising from it will be governed by the laws of The Netherlands. All disputes arising in connection with this Agreement that cannot be settled amicably shall be brought before the competent court in Amsterdam, the Netherlands, to which jurisdiction NaN and You hereby irrevocably consent. - diff --git a/release/windows/inno/header.bmp b/release/windows/inno/header.bmp deleted file mode 100644 index b631ba73933..00000000000 Binary files a/release/windows/inno/header.bmp and /dev/null differ diff --git a/release/windows/inno/installer.bmp b/release/windows/inno/installer.bmp deleted file mode 100644 index 10fb01454a4..00000000000 Binary files a/release/windows/inno/installer.bmp and /dev/null differ diff --git a/release/windows/inno/installer.ico b/release/windows/inno/installer.ico deleted file mode 100644 index 922c9d472d9..00000000000 Binary files a/release/windows/inno/installer.ico and /dev/null differ diff --git a/release/windows/installer/00.sconsblender.nsi b/release/windows/installer/00.sconsblender.nsi index 4f31e17d004..89255ced981 100644 --- a/release/windows/installer/00.sconsblender.nsi +++ b/release/windows/installer/00.sconsblender.nsi @@ -25,6 +25,7 @@ Name "Blender [VERSION]" !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe" !define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt" @@ -86,6 +87,7 @@ Var HWND_INSTDIR Var HWND_HOMEDIR Function .onInit + ClearErrors StrCpy $SHORTVERSION "[SHORTVERSION]" FunctionEnd @@ -162,25 +164,20 @@ Section "Blender-[VERSION] (required)" SecCopyUI SectionEnd Section "Add Start Menu shortcuts" Section2 - SetOutPath $INSTDIR + SetShellVarContext all CreateDirectory "$SMPROGRAMS\Blender Foundation\Blender\" CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Blender.lnk" "$INSTDIR\Blender.exe" "" "$INSTDIR\blender.exe" 0 - CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\Blender.html" "" "" 0 + CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Readme.lnk" "$INSTDIR\readme.html" "" "" 0 CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Copyright.lnk" "$INSTDIR\Copyright.txt" "" "$INSTDIR\copyright.txt" 0 CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\GPL-license.lnk" "$INSTDIR\GPL-license.txt" "" "$INSTDIR\GPL-license.txt" 0 - CreateShortCut "$SMPROGRAMS\Blender Foundation\Blender\Help.lnk" "$INSTDIR\Help.url" SectionEnd Section "Add Desktop Blender-[VERSION] shortcut" Section3 - SetOutPath $INSTDIR CreateShortCut "$DESKTOP\Blender.lnk" "$INSTDIR\blender.exe" "" "$INSTDIR\blender.exe" 0 SectionEnd Section "Open .blend files with Blender-[VERSION]" Section4 - SetOutPath $INSTDIR - ;ExecShell "open" '"$INSTDIR\blender.exe"' "-R -b" - ;do it the manual way! ;) WriteRegStr HKCR ".blend" "" "blendfile" WriteRegStr HKCR "blendfile" "" "Blender .blend File" @@ -199,6 +196,10 @@ Section "Uninstall" ReadRegStr $SHORTVERSION HKLM "SOFTWARE\BlenderFoundation" "ShortVersion" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Blender" DeleteRegKey HKLM "SOFTWARE\BlenderFoundation" + SetShellVarContext all + + StrCpy $0 "$SMPROGRAMS\Blender Foundation\" + MessageBox MB_OK $0 ; remove files [DELROOTDIRCONTS] @@ -208,10 +209,9 @@ Section "Uninstall" RMDir /r "$BLENDERHOME" Next: ; remove shortcuts, if any. - Delete "$SMPROGRAMS\Blender Foundation\Blender\*.*" Delete "$DESKTOP\Blender.lnk" ; remove all link related directories and files - RMDir /r "$SMPROGRAMS\Blender Foundation" + RMDir /r "$SMPROGRAMS\Blender Foundation\" ; remove entire installation directory, including any file created by the user RMDir /r "$INSTDIR" SectionEnd diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 0e5ad8e3ee9..4c7dcff0cd2 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -383,6 +383,7 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMaterial *mat); #define CMP_SCALE_RELATIVE 0 #define CMP_SCALE_ABSOLUTE 1 #define CMP_SCALE_SCENEPERCENT 2 +#define CMP_SCALE_RENDERPERCENT 3 /* the type definitions array */ diff --git a/source/blender/blenkernel/BKE_sca.h b/source/blender/blenkernel/BKE_sca.h index 910f381823c..b1df32d5cd7 100644 --- a/source/blender/blenkernel/BKE_sca.h +++ b/source/blender/blenkernel/BKE_sca.h @@ -67,5 +67,9 @@ void set_sca_new_poins_ob(struct Object *ob); void set_sca_new_poins(void); void sca_remove_ob_poin(struct Object *obt, struct Object *ob); +void sca_move_sensor(struct bSensor *sens_to_move, Object *ob, int move_up); +void sca_move_controller(struct bController *cont_to_move, Object *ob, int move_up); +void sca_move_actuator(struct bActuator *act_to_move, Object *ob, int move_up); + #endif diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 5c5bf30980c..002a1958a13 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -187,6 +187,7 @@ void seq_single_fix(struct Sequence *seq); int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test); struct ListBase *seq_seqbase(struct ListBase *seqbase, struct Sequence *seq); void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs); +void seq_dupe_animdata(struct Scene *scene, char *name_from, char *name_to); int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene); int shuffle_seq_time(ListBase * seqbasep, struct Scene *evil_scene); int seqbase_isolated_sel_check(struct ListBase *seqbase); @@ -232,6 +233,8 @@ typedef struct SeqLoadInfo { /* seq_dupli' flags */ #define SEQ_DUPE_UNIQUE_NAME 1<<0 #define SEQ_DUPE_CONTEXT 1<<1 +#define SEQ_DUPE_ANIM 1<<2 +#define SEQ_DUPE_ALL 1<<3 /* otherwise only selected are copied */ /* use as an api function */ typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 0dbdd802ff6..1a1ca8a8d3e 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1877,26 +1877,19 @@ static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int } } -/* flushes all recalc flags in objects down the dependency tree */ -void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) +/* flush layer flags to dependencies */ +static void dag_scene_flush_layers(Scene *sce, int lay) { - DagNode *firstnode, *node; + DagNode *node, *firstnode; DagAdjList *itA; - Object *ob; Base *base; int lasttime; - - if(sce->theDag==NULL) { - printf("DAG zero... not allowed to happen!\n"); - DAG_scene_sort(sce); - } - + firstnode= sce->theDag->DagNode.first; // always scene node for(itA = firstnode->child; itA; itA= itA->next) itA->lay= 0; - - /* first we flush the layer flags */ + sce->theDag->time++; // so we know which nodes were accessed lasttime= sce->theDag->time; @@ -1930,7 +1923,26 @@ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) for(itA = firstnode->child; itA; itA= itA->next) if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) flush_layer_node(sce, itA->node, lasttime); +} + +/* flushes all recalc flags in objects down the dependency tree */ +void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) +{ + DagNode *firstnode; + DagAdjList *itA; + Object *ob; + int lasttime; + if(sce->theDag==NULL) { + printf("DAG zero... not allowed to happen!\n"); + DAG_scene_sort(sce); + } + + firstnode= sce->theDag->DagNode.first; // always scene node + + /* first we flush the layer flags */ + dag_scene_flush_layers(sce, lay); + /* then we use the relationships + layer info to flush update events */ sce->theDag->time++; // so we know which nodes were accessed lasttime= sce->theDag->time; @@ -2231,7 +2243,8 @@ void DAG_on_load_update(void) Object *ob; Group *group; GroupObject *go; - unsigned int lay; + DagNode *node; + unsigned int lay, oblay; dag_current_scene_layers(bmain, &scene, &lay); @@ -2240,10 +2253,14 @@ void DAG_on_load_update(void) remade, tag them so they get remade in the scene update loop, note armature poses or object matrices are preserved and do not require updates, so we skip those */ + dag_scene_flush_layers(scene, lay); + for(SETLOOPER(scene, base)) { ob= base->object; + node= (sce->theDag)? dag_get_node(sce->theDag, ob): NULL; + oblay= (node)? node->lay: ob->lay; - if(base->lay & lay) { + if(oblay & lay) { if(ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) ob->recalc |= OB_RECALC_DATA; if(ob->dup_group) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 4daa38001bf..dc78dac04dd 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1827,10 +1827,13 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ layer= (iuser)? iuser->layer: 0; pass= (iuser)? iuser->pass: 0; - if(from_render) + if(from_render) { RE_AcquireResultImage(re, &rres); - else if(ima->renders[ima->render_slot]) + } + else if(ima->renders[ima->render_slot]) { rres= *(ima->renders[ima->render_slot]); + rres.have_combined= rres.rectf != NULL; + } else memset(&rres, 0, sizeof(RenderResult)); @@ -1852,10 +1855,10 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ rectz= rres.rectz; dither= iuser->scene->r.dither_intensity; - /* get compo/seq result by default */ - if(rres.compo_seq && layer==0); + /* combined layer gets added as first layer */ + if(rres.have_combined && layer==0); else if(rres.layers.first) { - RenderLayer *rl= BLI_findlink(&rres.layers, layer-(rres.compo_seq?1:0)); + RenderLayer *rl= BLI_findlink(&rres.layers, layer-(rres.have_combined?1:0)); if(rl) { RenderPass *rpass; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 1b8405a91de..6d264b3fed2 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2479,6 +2479,17 @@ void object_handle_update(Scene *scene, Object *ob) if(ob->pose) make_pose_channels_hash(ob->pose); + if(ob->recalc & OB_RECALC_DATA) { + if(ob->type==OB_ARMATURE) { + /* this happens for reading old files and to match library armatures + with poses we do it ahead of where_is_object to ensure animation + is evaluated on the rebuilt pose, otherwise we get incorrect poses + on file load */ + if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC)) + armature_rebuild_pose(ob, ob->data); + } + } + /* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers, which is only in where_is_object now */ // XXX: should this case be OB_RECALC_OB instead? @@ -2541,11 +2552,6 @@ void object_handle_update(Scene *scene, Object *ob) lattice_calc_modifiers(scene, ob); } else if(ob->type==OB_ARMATURE) { - /* this happens for reading old files and to match library armatures with poses */ - // XXX this won't screw up the pose set already... - if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC)) - armature_rebuild_pose(ob, ob->data); - /* evaluate drivers */ BKE_animsys_evaluate_animdata(data_id, adt, ctime, ADT_RECALC_DRIVERS); @@ -2749,7 +2755,7 @@ void object_camera_matrix( float pixsize; float shiftx=0.0, shifty=0.0, winside, viewfac; - rd->mode &= ~R_ORTHO; + rd->mode &= ~(R_ORTHO|R_PANORAMA); /* question mark */ (*ycor)= rd->yasp / rd->xasp; diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 3102d4b054b..02b66dd9b32 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -683,3 +683,127 @@ void sca_remove_ob_poin(Object *obt, Object *ob) act= act->next; } } + +/* ******************** INTERFACE ******************* */ +void sca_move_sensor(bSensor *sens_to_move, Object *ob, int *move_up) +{ + bSensor *sens, *tmp; + + int val; + val = move_up ? 1:2; + + /* make sure this sensor belongs to this object */ + sens= ob->sensors.first; + while(sens) { + if(sens == sens_to_move) break; + sens= sens->next; + } + if(!sens) return; + + /* move up */ + if( val==1 && sens->prev) { + for (tmp=sens->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&ob->sensors, sens); + BLI_insertlinkbefore(&ob->sensors, tmp, sens); + } + } + /* move down */ + else if( val==2 && sens->next) { + for (tmp=sens->next; tmp; tmp=tmp->next) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&ob->sensors, sens); + BLI_insertlink(&ob->sensors, tmp, sens); + } + } +} + +void sca_move_controller(bController *cont_to_move, Object *ob, int move_up) +{ + bController *cont, *tmp; + + int val; + val = move_up ? 1:2; + + /* make sure this controller belongs to this object */ + cont= ob->controllers.first; + while(cont) { + if(cont == cont_to_move) break; + cont= cont->next; + } + if(!cont) return; + + /* move up */ + if( val==1 && cont->prev) { + /* locate the controller that has the same state mask but is earlier in the list */ + tmp = cont->prev; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->prev; + } + if (tmp) { + BLI_remlink(&ob->controllers, cont); + BLI_insertlinkbefore(&ob->controllers, tmp, cont); + } + } + + /* move down */ + else if( val==2 && cont->next) { + tmp = cont->next; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->next; + } + BLI_remlink(&ob->controllers, cont); + BLI_insertlink(&ob->controllers, tmp, cont); + } +} + +void sca_move_actuator(bActuator *act_to_move, Object *ob, int move_up) +{ + bActuator *act, *tmp; + int val; + + val = move_up ? 1:2; + + /* make sure this actuator belongs to this object */ + act= ob->actuators.first; + while(act) { + if(act == act_to_move) break; + act= act->next; + } + if(!act) return; + + /* move up */ + if( val==1 && act->prev) { + /* locate the first visible actuators before this one */ + for (tmp = act->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&ob->actuators, act); + BLI_insertlinkbefore(&ob->actuators, tmp, act); + } + } + /* move down */ + else if( val==2 && act->next) { + /* locate the first visible actuators after this one */ + for (tmp=act->next; tmp; tmp=tmp->next) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&ob->actuators, act); + BLI_insertlink(&ob->actuators, tmp, act); + } + } +} diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index cd4c2e9f98e..2538f61b81e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -222,7 +222,7 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type) if(sce->ed) { scen->ed= MEM_callocN( sizeof(Editing), "addseq"); scen->ed->seqbasep= &scen->ed->seqbase; - seqbase_dupli_recursive(sce, &scen->ed->seqbase, &sce->ed->seqbase, 0); + seqbase_dupli_recursive(sce, &scen->ed->seqbase, &sce->ed->seqbase, SEQ_DUPE_ALL); } } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 894b8b6ab60..36e768ec98d 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -40,6 +40,7 @@ #include "DNA_anim_types.h" #include "DNA_object_types.h" +#include "BKE_animsys.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" @@ -1536,9 +1537,14 @@ static StripColorBalance calc_cb(StripColorBalance * cb_) } /* note: lift is actually 2-lift */ -MINLINE float color_balance_fl(float v, const float lift, const float gain, const float gamma, const float mul) +MINLINE float color_balance_fl(float in, const float lift, const float gain, const float gamma, const float mul) { - return powf((((v - 1.0f) * lift) + 1.0f) * gain, gamma) * mul; + float x= (((in - 1.0f) * lift) + 1.0f) * gain; + + /* prevent NaN */ + if (x < 0.f) x = 0.f; + + return powf(x, gamma) * mul; } static void make_cb_table_byte(float lift, float gain, float gamma, @@ -2538,6 +2544,10 @@ static TStripElem* do_build_seq_array_recursively( int i; TStripElem* se = 0; + // XXX for prefetch and overlay offset!..., very bad!!! + AnimData *adt= BKE_animdata_from_id(&scene->id); + BKE_animsys_evaluate_animdata(&scene->id, adt, cfra, ADT_RECALC_ANIM); + count = get_shown_sequences(seqbasep, cfra, chanshown, (Sequence **)&seq_arr); @@ -3799,6 +3809,8 @@ ListBase *seq_seqbase(ListBase *seqbase, Sequence *seq) int seq_swap(Sequence *seq_a, Sequence *seq_b) { + char name[sizeof(seq_a->name)]; + if(seq_a->len != seq_b->len) return 0; @@ -3807,12 +3819,33 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b) if(seq_a->type == SEQ_SOUND || seq_b->type == SEQ_SOUND) { return 0; } + + /* disallow effects to swap with non-effects strips */ + if((seq_a->type & SEQ_EFFECT) != (seq_b->type & SEQ_EFFECT)) { + return 0; + } + + if((seq_a->type & SEQ_EFFECT) && (seq_b->type & SEQ_EFFECT)) { + if(get_sequence_effect_num_inputs(seq_a->type) != get_sequence_effect_num_inputs(seq_b->type)) { + return 0; + } + } } SWAP(Sequence, *seq_a, *seq_b); + + /* swap back names so animation fcurves dont get swapped */ + strcpy(name, seq_a->name+2); + strcpy(seq_a->name+2, seq_b->name+2); + strcpy(seq_b->name+2, name); + + /* swap back opacity, and overlay mode */ + SWAP(int, seq_a->blend_mode, seq_b->blend_mode); + SWAP(float, seq_a->blend_opacity, seq_b->blend_opacity); + + SWAP(void *, seq_a->prev, seq_b->prev); SWAP(void *, seq_a->next, seq_b->next); - SWAP(int, seq_a->start, seq_b->start); SWAP(int, seq_a->startofs, seq_b->startofs); SWAP(int, seq_a->endofs, seq_b->endofs); @@ -3849,6 +3882,35 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs) } } +void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to) +{ + char str_from[32]; + FCurve *fcu; + FCurve *fcu_last; + FCurve *fcu_cpy; + ListBase lb= {NULL, NULL}; + + if(scene->adt==NULL || scene->adt->action==NULL) + return; + + sprintf(str_from, "[\"%s\"]", name_from); + + fcu_last= scene->adt->action->curves.last; + + for (fcu= scene->adt->action->curves.first; fcu && fcu->prev != fcu_last; fcu= fcu->next) { + if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str_from)) { + fcu_cpy= copy_fcurve(fcu); + BLI_addtail(&lb, fcu_cpy); + } + } + + /* notice validate is 0, keep this because the seq may not be added to the scene yet */ + BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_from, name_to, 0, 0, 0); + + /* add the original fcurves back */ + addlisttolist(&scene->adt->action->curves, &lb); +} + /* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */ static void seq_free_animdata(Scene *scene, Sequence *seq) { @@ -4208,6 +4270,9 @@ static Sequence *seq_dupli(struct Scene *scene, Sequence *seq, int dupe_flag) if(dupe_flag & SEQ_DUPE_UNIQUE_NAME) seqbase_unique_name_recursive(&scene->ed->seqbase, seqn); + if(dupe_flag & SEQ_DUPE_ANIM) + seq_dupe_animdata(scene, seq->name+2, seqn->name+2); + return seqn; } @@ -4234,7 +4299,7 @@ void seqbase_dupli_recursive(Scene *scene, ListBase *nseqbase, ListBase *seqbase for(seq= seqbase->first; seq; seq= seq->next) { seq->tmp= NULL; - if(seq->flag & SELECT) { + if((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) { seqn = seq_dupli(scene, seq, dupe_flag); if (seqn) { /*should never fail */ if(dupe_flag & SEQ_DUPE_CONTEXT) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 93c93b07232..8f116828ac5 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -955,7 +955,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con, bPoseChannel *pchan= get_active_posechannel(ob); bConstraintTypeInfo *cti; uiBlock *block; - uiLayout *result= NULL, *col, *col1, *col2, *box, *row, *subrow, *split; + uiLayout *result= NULL, *col, *box, *row, *subrow; PointerRNA ptr; char typestr[32]; short proxy_protected, xco=0, yco=0; @@ -990,37 +990,30 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con, uiLayoutSetContextPointer(col, "constraint", &ptr); box= uiLayoutBox(col); - split = uiLayoutSplit(box, 0.35, 0); - - col1= uiLayoutColumn(split, 0); - col2= uiLayoutColumn(split, 0); - row = uiLayoutRow(col1, 0); - subrow = uiLayoutRow(col2, 0); - + row = uiLayoutRow(box, 0); block= uiLayoutGetBlock(box); /* Draw constraint header */ - uiBlockSetEmboss(block, UI_EMBOSSN); /* rounded header */ rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20; - + /* open/close */ + uiBlockSetEmboss(block, UI_EMBOSSN); uiItemR(row, &ptr, "expanded", UI_ITEM_R_ICON_ONLY, "", 0); - - /* name */ uiBlockSetEmboss(block, UI_EMBOSS); /* XXX if (con->flag & CONSTRAINT_DISABLE) uiBlockSetCol(block, TH_REDALERT);*/ + /* name */ uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); if(proxy_protected == 0) { - uiItemR(subrow, &ptr, "name", 0, "", 0); + uiItemR(row, &ptr, "name", 0, "", 0); } else - uiItemL(subrow, con->name, 0); + uiItemL(row, con->name, 0); /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */ if (proxy_protected) { @@ -1054,47 +1047,44 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con, show_upbut= ((prev_proxylock == 0) && (con->prev)); show_downbut= (con->next) ? 1 : 0; + + /* Code for compact Constraint UI */ + if (compact) { + subrow = uiLayoutRow(box, 0); + } + else { + subrow = row; + } uiLayoutSetOperatorContext(subrow, WM_OP_INVOKE_DEFAULT); - if (compact) { - /* Draw "Delete" Button in first row, before splitting */ - uiBlockSetEmboss(block, UI_EMBOSSN); - uiItemO(subrow, "", ICON_X, "CONSTRAINT_OT_delete"); - uiBlockSetEmboss(block, UI_EMBOSS); - - subrow = uiLayoutRow(col2, 0); - } - + /* up/down */ if (show_upbut || show_downbut) { uiBlockBeginAlign(block); - uiBlockSetEmboss(block, UI_EMBOSS); + if (show_upbut) + uiItemO(subrow, "", ICON_TRIA_UP, "CONSTRAINT_OT_move_up"); - if (show_upbut) - uiItemO(subrow, "", ICON_TRIA_UP, "CONSTRAINT_OT_move_up"); - - if (show_downbut) - uiItemO(subrow, "", ICON_TRIA_DOWN, "CONSTRAINT_OT_move_down"); + if (show_downbut) + uiItemO(subrow, "", ICON_TRIA_DOWN, "CONSTRAINT_OT_move_down"); uiBlockEndAlign(block); } - + + /* enabled */ + uiItemR(subrow, &ptr, "enabled", 0, "", 0); + + uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); + /* Close 'button' - emboss calls here disable drawing of 'button' behind X */ uiBlockSetEmboss(block, UI_EMBOSSN); - uiItemR(subrow, &ptr, "enabled", 0, "", 0); - - if (!compact) { - uiItemO(subrow, "", ICON_X, "CONSTRAINT_OT_delete"); - } + uiItemO(row, "", ICON_X, "CONSTRAINT_OT_delete"); uiBlockSetEmboss(block, UI_EMBOSS); } - + /* Set but-locks for protected settings (magic numbers are used here!) */ if (proxy_protected) uiBlockSetButLock(block, 1, "Cannot edit Proxy-Protected Constraint"); - /* Draw constraint data */ - if ((con->flag & CONSTRAINT_EXPAND) == 0) { (yco) -= 21; } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 1f112ec1105..681e14dd693 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -485,8 +485,12 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) int count = removedoublesflag(em,1,0,RNA_float_get(op->ptr, "limit")); - if(count) - BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count); + if(!count) + return OPERATOR_CANCELLED; + + recalc_editnormals(em); + + BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices", count); DAG_id_flush_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -5860,6 +5864,7 @@ static int merge_exec(bContext *C, wmOperator *op) if(!count) return OPERATOR_CANCELLED; + recalc_editnormals(em); BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices"); @@ -7116,7 +7121,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op) { RegionView3D *rv3d= ED_view3d_context_rv3d(C); View3D *v3d= CTX_wm_view3d(C); - Object *ob= CTX_data_active_object(C); + Object *ob= CTX_data_edit_object(C); Scene *scene= CTX_data_scene(C); Mesh *me; CustomDataLayer *layer; @@ -7125,9 +7130,7 @@ static int sort_faces_exec(bContext *C, wmOperator *op) float reverse = 1; // XXX int ctrl= 0; - if(!ob) return OPERATOR_FINISHED; - if(ob->type!=OB_MESH) return OPERATOR_FINISHED; - if (!v3d) return OPERATOR_FINISHED; + if (!v3d) return OPERATOR_CANCELLED; /* This operator work in Object Mode, not in edit mode. * After talk with Cambell we agree that there is no point to port this to EditMesh right now. @@ -7227,6 +7230,8 @@ static int sort_faces_exec(bContext *C, wmOperator *op) /* Return to editmode. */ ED_object_enter_editmode(C, 0); + + return OPERATOR_FINISHED; } void MESH_OT_sort_faces(wmOperatorType *ot) diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 70098e0812f..87b5c886b4a 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -82,10 +82,6 @@ /* own include */ #include "mesh_intern.h" -/* XXX */ -static int pupmenu(const char *dummy) {return 0;} -/* XXX */ - /* * ********************** no editmode!!! *********** */ diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 2235bdd8f2a..ff48e7e349a 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -166,6 +166,8 @@ int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot) return 1; } + else + return 0; } case ID_LT: { diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 44cc4066b03..2a179ac281c 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -211,6 +211,16 @@ static bActuator *edit_actuator_property_get(bContext *C, wmOperator *op, Object return act; } +static int logicbricks_move_property_get(wmOperator *op) +{ + int type = RNA_enum_get(op->ptr, "direction"); + + if (type == 1) + return TRUE; + else + return FALSE; +} + /* ************* Add/Remove Sensor Operator ************* */ static int sensor_remove_exec(bContext *C, wmOperator *op) @@ -530,12 +540,158 @@ void LOGIC_OT_actuator_add(wmOperatorType *ot) RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to"); } +/* ************* Move Logic Bricks Operator ************* */ +static EnumPropertyItem logicbricks_move_direction[] ={ + {1, "UP", 0, "Move Up", ""}, + {2, "DOWN", 0, "Move Down", ""}, + {0, NULL, 0, NULL, NULL}}; + + +static int sensor_move_exec(bContext *C, wmOperator *op) +{ + Object *ob=NULL; + bSensor *sens= edit_sensor_property_get(C, op, &ob); + int move_up= logicbricks_move_property_get(op); + + if (!sens) + return OPERATOR_CANCELLED; + + sca_move_sensor(sens, ob, move_up); + + WM_event_add_notifier(C, NC_LOGIC, NULL); + + return OPERATOR_FINISHED; +} + +static int sensor_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (edit_sensor_invoke_properties(C, op)) { + return sensor_move_exec(C, op); + } + else + return OPERATOR_CANCELLED; +} + +void LOGIC_OT_sensor_move(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Sensor"; + ot->description = "Move Densor"; + ot->idname= "LOGIC_OT_sensor_move"; + + /* api callbacks */ + ot->invoke= sensor_move_invoke; + ot->exec= sensor_move_exec; + ot->poll= edit_sensor_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + edit_sensor_properties(ot); + RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down"); +} + +static int controller_move_exec(bContext *C, wmOperator *op) +{ + Object *ob=NULL; + bController *cont= edit_controller_property_get(C, op, &ob); + int move_up= logicbricks_move_property_get(op); + + if (!cont) + return OPERATOR_CANCELLED; + + sca_move_controller(cont, ob, move_up); + + WM_event_add_notifier(C, NC_LOGIC, NULL); + + return OPERATOR_FINISHED; +} + +static int controller_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (edit_controller_invoke_properties(C, op)) { + return controller_move_exec(C, op); + } + else + return OPERATOR_CANCELLED; +} + +void LOGIC_OT_controller_move(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Controller"; + ot->description = "Move Controller"; + ot->idname= "LOGIC_OT_controller_move"; + + /* api callbacks */ + ot->invoke= controller_move_invoke; + ot->exec= controller_move_exec; + ot->poll= edit_controller_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + edit_controller_properties(ot); + RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down"); +} + +static int actuator_move_exec(bContext *C, wmOperator *op) +{ + Object *ob=NULL; + bActuator *act = edit_actuator_property_get(C, op, &ob); + int move_up= logicbricks_move_property_get(op); + + if (!act) + return OPERATOR_CANCELLED; + + sca_move_actuator(act, ob, move_up); + + WM_event_add_notifier(C, NC_LOGIC, NULL); + + return OPERATOR_FINISHED; +} + +static int actuator_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + if (edit_actuator_invoke_properties(C, op)) { + return actuator_move_exec(C, op); + } + else + return OPERATOR_CANCELLED; +} + +void LOGIC_OT_actuator_move(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Actuator"; + ot->description = "Move Actuator"; + ot->idname= "LOGIC_OT_actuator_move"; + + /* api callbacks */ + ot->invoke= actuator_move_invoke; + ot->exec= actuator_move_exec; + ot->poll= edit_actuator_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + edit_actuator_properties(ot); + RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down"); +} + + void ED_operatortypes_logic(void) { WM_operatortype_append(LOGIC_OT_sensor_remove); WM_operatortype_append(LOGIC_OT_sensor_add); + WM_operatortype_append(LOGIC_OT_sensor_move); WM_operatortype_append(LOGIC_OT_controller_remove); WM_operatortype_append(LOGIC_OT_controller_add); + WM_operatortype_append(LOGIC_OT_controller_move); WM_operatortype_append(LOGIC_OT_actuator_remove); WM_operatortype_append(LOGIC_OT_actuator_add); + WM_operatortype_append(LOGIC_OT_actuator_move); } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 26b4b6fc08c..4ab2511fcd2 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -194,8 +194,9 @@ static void make_unique_prop_names_cb(bContext *C, void *strv, void *redraw_view } -static void sca_move_sensor(bContext *C, void *datav, void *move_up) +static void old_sca_move_sensor(bContext *C, void *datav, void *move_up) { + /* deprecated, no longer using it (moved to sca.c) */ Scene *scene= CTX_data_scene(C); bSensor *sens_to_delete= datav; int val; @@ -246,8 +247,9 @@ static void sca_move_sensor(bContext *C, void *datav, void *move_up) } } -static void sca_move_controller(bContext *C, void *datav, void *move_up) +static void old_sca_move_controller(bContext *C, void *datav, void *move_up) { + /* deprecated, no longer using it (moved to sca.c) */ Scene *scene= CTX_data_scene(C); bController *controller_to_del= datav; int val; @@ -301,8 +303,9 @@ static void sca_move_controller(bContext *C, void *datav, void *move_up) } } -static void sca_move_actuator(bContext *C, void *datav, void *move_up) +static void old_sca_move_actuator(bContext *C, void *datav, void *move_up) { + /* deprecated, no longer using it (moved to sca.c) */ Scene *scene= CTX_data_scene(C); bActuator *actuator_to_move= datav; int val; @@ -3188,6 +3191,11 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo && RNA_boolean_get(ptr, "expanded")) || RNA_boolean_get(ptr, "pinned"))); uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); + if(RNA_boolean_get(ptr, "expanded")==0) { + uiItemEnumO(row, "LOGIC_OT_sensor_move", "", ICON_TRIA_UP, "direction", 1); // up + uiItemEnumO(row, "LOGIC_OT_sensor_move", "", ICON_TRIA_DOWN, "direction", 2); // down + } + uiItemO(row, "", ICON_X, "LOGIC_OT_sensor_remove"); } @@ -3527,6 +3535,11 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr) uiItemL(row, name, 0); uiItemR(row, ptr, "priority", 0, "", 0); + + if(RNA_boolean_get(ptr, "expanded")==0) { + uiItemEnumO(row, "LOGIC_OT_controller_move", "", ICON_TRIA_UP, "direction", 1); // up + uiItemEnumO(row, "LOGIC_OT_controller_move", "", ICON_TRIA_DOWN, "direction", 2); // down + } uiItemO(row, "", ICON_X, "LOGIC_OT_controller_remove"); } @@ -3606,6 +3619,10 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA * && RNA_boolean_get(ptr, "expanded")) || RNA_boolean_get(ptr, "pinned"))); uiItemR(subrow, ptr, "pinned", UI_ITEM_R_NO_BG, "", 0); + if(RNA_boolean_get(ptr, "expanded")==0) { + uiItemEnumO(row, "LOGIC_OT_actuator_move", "", ICON_TRIA_UP, "direction", 1); // up + uiItemEnumO(row, "LOGIC_OT_actuator_move", "", ICON_TRIA_DOWN, "direction", 2); // down + } uiItemO(row, "", ICON_X, "LOGIC_OT_actuator_remove"); } @@ -3966,9 +3983,11 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) Object *ob; PointerRNA settings_ptr; uiLayout *split, *row, *col, *subcol; + int physics_type; ob = (Object *)ptr->id.data; RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); + physics_type = RNA_enum_get(&settings_ptr, "physics_type"); uiItemR(layout, ptr, "mode", 0, NULL, 0); @@ -3984,33 +4003,32 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) uiItemR(row, ptr, "rot", 0, NULL, 0); uiItemR(split, ptr, "local_rotation", UI_ITEM_R_TOGGLE, NULL, 0); - if (RNA_enum_get(&settings_ptr, "physics_type") != OB_BODY_TYPE_DYNAMIC) - break; - - uiItemL(layout, "Dynamic Object Settings:", 0); - split = uiLayoutSplit(layout, 0.9, 0); - row = uiLayoutRow(split, 0); - uiItemR(row, ptr, "force", 0, NULL, 0); - uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0); + if (ELEM3(physics_type, OB_BODY_TYPE_DYNAMIC, OB_BODY_TYPE_RIGID, OB_BODY_TYPE_SOFT)) { + uiItemL(layout, "Dynamic Object Settings:", 0); + split = uiLayoutSplit(layout, 0.9, 0); + row = uiLayoutRow(split, 0); + uiItemR(row, ptr, "force", 0, NULL, 0); + uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0); - split = uiLayoutSplit(layout, 0.9, 0); - row = uiLayoutRow(split, 0); - uiItemR(row, ptr, "torque", 0, NULL, 0); - uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0); + split = uiLayoutSplit(layout, 0.9, 0); + row = uiLayoutRow(split, 0); + uiItemR(row, ptr, "torque", 0, NULL, 0); + uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0); - split = uiLayoutSplit(layout, 0.9, 0); - row = uiLayoutRow(split, 0); - uiItemR(row, ptr, "linear_velocity", 0, NULL, 0); - row = uiLayoutRow(split, 1); - uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0); - uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0); + split = uiLayoutSplit(layout, 0.9, 0); + row = uiLayoutRow(split, 0); + uiItemR(row, ptr, "linear_velocity", 0, NULL, 0); + row = uiLayoutRow(split, 1); + uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0); + uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0); - split = uiLayoutSplit(layout, 0.9, 0); - row = uiLayoutRow(split, 0); - uiItemR(row, ptr, "angular_velocity", 0, NULL, 0); - uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0); + split = uiLayoutSplit(layout, 0.9, 0); + row = uiLayoutRow(split, 0); + uiItemR(row, ptr, "angular_velocity", 0, NULL, 0); + uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0); - uiItemR(layout, ptr, "damping", 0, NULL, 0); + uiItemR(layout, ptr, "damping", 0, NULL, 0); + } break; case ACT_OBJECT_SERVO: uiItemR(layout, ptr, "reference_object", 0, NULL, 0); @@ -4563,6 +4581,9 @@ static void logic_buttons_new(bContext *C, ARegion *ar) { // gotta check if the current state is visible or not uiLayout *split, *col; + /* make as visible, for move operator */ + sens->flag |= SENS_VISIBLE; + split = uiLayoutSplit(layout, 0.95, 0); col = uiLayoutColumn(split, 1); uiLayoutSetContextPointer(col, "sensor", &ptr); @@ -4626,6 +4647,9 @@ static void logic_buttons_new(bContext *C, ARegion *ar) { // gotta check if the current state is visible or not uiLayout *split, *col; + /* make as visible, for move operator */ + act->flag |= ACT_VISIBLE; + split = uiLayoutSplit(layout, 0.05, 0); /* put inlink button to the left */ @@ -4818,15 +4842,15 @@ void logic_buttons(bContext *C, ARegion *ar) cpack(0x999999); glRecti(xco+22, yco, xco+width-22,yco+19); but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); - //uiButSetFunc(but, sca_move_controller, cont, NULL); + //uiButSetFunc(but, old_sca_move_controller, cont, NULL); but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); - //uiButSetFunc(but, sca_move_controller, cont, NULL); + //uiButSetFunc(but, old_sca_move_controller, cont, NULL); uiBlockBeginAlign(block); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); - uiButSetFunc(but, sca_move_controller, cont, (void *)TRUE); + uiButSetFunc(but, old_sca_move_controller, cont, (void *)TRUE); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); - uiButSetFunc(but, sca_move_controller, cont, (void *)FALSE); + uiButSetFunc(but, old_sca_move_controller, cont, (void *)FALSE); uiBlockEndAlign(block); ycoo= yco; @@ -4910,15 +4934,15 @@ void logic_buttons(bContext *C, ARegion *ar) set_col_sensor(sens->type, 1); glRecti(xco+22, yco, xco+width-22,yco+19); but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); - //uiButSetFunc(but, sca_move_sensor, sens, NULL); + //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, 31, 0, 0, ""); - //uiButSetFunc(but, sca_move_sensor, sens, NULL); + //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); uiBlockBeginAlign(block); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); - uiButSetFunc(but, sca_move_sensor, sens, (void *)TRUE); + uiButSetFunc(but, old_sca_move_sensor, sens, (void *)TRUE); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); - uiButSetFunc(but, sca_move_sensor, sens, (void *)FALSE); + uiButSetFunc(but, old_sca_move_sensor, sens, (void *)FALSE); uiBlockEndAlign(block); } @@ -4988,15 +5012,15 @@ void logic_buttons(bContext *C, ARegion *ar) set_col_actuator(act->type, 1); glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type"); - // uiButSetFunc(but, sca_move_actuator, act, NULL); + // uiButSetFunc(but, old_sca_move_actuator, act, NULL); but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name"); - // uiButSetFunc(but, sca_move_actuator, act, NULL); + // uiButSetFunc(but, old_sca_move_actuator, act, NULL); uiBlockBeginAlign(block); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); - uiButSetFunc(but, sca_move_actuator, act, (void *)TRUE); + uiButSetFunc(but, old_sca_move_actuator, act, (void *)TRUE); but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); - uiButSetFunc(but, sca_move_actuator, act, (void *)FALSE); + uiButSetFunc(but, old_sca_move_actuator, act, (void *)FALSE); uiBlockEndAlign(block); ycoo= yco; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 36ae475e64b..01a99ed2b1f 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -459,7 +459,9 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) se= strip->stripdata; RNA_BEGIN(op->ptr, itemptr, "files") { - RNA_string_get(&itemptr, "name", se->name); + char *filename= RNA_string_get_alloc(&itemptr, "name", NULL, 0); + BLI_strncpy(se->name, filename, sizeof(se->name)); + MEM_freeN(filename); se++; } RNA_END; diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index e449490516c..30f0f84c092 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -369,17 +369,17 @@ static void draw_seq_extensions(Scene *scene, SpaceSeq *sseq, Sequence *seq) { float x1, x2, y1, y2, pixely, a; char col[3], blendcol[3]; - View2D *v2d; + View2D *v2d= &sseq->v2d; if(seq->type >= SEQ_EFFECT) return; + if(v2d->mask.ymax == v2d->mask.ymin) return; /* avoid divide by zero */ x1= seq->startdisp; x2= seq->enddisp; y1= seq->machine+SEQ_STRIP_OFSBOTTOM; y2= seq->machine+SEQ_STRIP_OFSTOP; - - v2d = &sseq->v2d; + pixely = (v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin); blendcol[0] = blendcol[1] = blendcol[2] = 120; @@ -690,7 +690,7 @@ void set_special_seq_update(int val) else special_seq_update= 0; } -void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq) +void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs) { extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); struct ImBuf *ibuf; @@ -726,9 +726,11 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq viewrecty /= proxy_size / 100.0; } - /* XXX TODO: take color from theme */ - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); + if(frame_ofs == 0) { + /* XXX TODO: take color from theme */ + glClearColor(0.0, 0.0, 0.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + } /* without this colors can flicker from previous opengl state */ glColor4ub(255, 255, 255, 255); @@ -746,13 +748,13 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq else { recursive= 1; if (special_seq_update) { - ibuf= give_ibuf_seq_direct(scene, rectx, recty, (scene->r.cfra), proxy_size, special_seq_update); + ibuf= give_ibuf_seq_direct(scene, rectx, recty, cfra + frame_ofs, proxy_size, special_seq_update); } else if (!U.prefetchframes) { // XXX || (G.f & G_PLAYANIM) == 0) { - ibuf= (ImBuf *)give_ibuf_seq(scene, rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size); + ibuf= (ImBuf *)give_ibuf_seq(scene, rectx, recty, cfra + frame_ofs, sseq->chanshown, proxy_size); } else { - ibuf= (ImBuf *)give_ibuf_seq_threaded(scene, rectx, recty, (scene->r.cfra), sseq->chanshown, proxy_size); + ibuf= (ImBuf *)give_ibuf_seq_threaded(scene, rectx, recty, cfra + frame_ofs, sseq->chanshown, proxy_size); } recursive= 0; @@ -812,11 +814,26 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - glBegin(GL_QUADS); - glTexCoord2f(0.0f, 0.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymin); - glTexCoord2f(0.0f, 1.0f);glVertex2f(v2d->tot.xmin, v2d->tot.ymax); + glBegin(GL_QUADS); + + if(frame_ofs) { + rctf tot_clip; + tot_clip.xmin= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin); + tot_clip.ymin= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin); + tot_clip.xmax= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax); + tot_clip.ymax= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax); + + glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin);glVertex2f(tot_clip.xmin, tot_clip.ymin); + glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax);glVertex2f(tot_clip.xmin, tot_clip.ymax); + glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax);glVertex2f(tot_clip.xmax, tot_clip.ymax); + glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin);glVertex2f(tot_clip.xmax, tot_clip.ymin); + } + else { + glTexCoord2f(0.0f, 0.0f);glVertex2f(v2d->tot.xmin, v2d->tot.ymin); + glTexCoord2f(0.0f, 1.0f);glVertex2f(v2d->tot.xmin, v2d->tot.ymax); glTexCoord2f(1.0f, 1.0f);glVertex2f(v2d->tot.xmax, v2d->tot.ymax); - glTexCoord2f(1.0f, 0.0f);glVertex2f(v2d->tot.xmax, v2d->tot.ymin); + glTexCoord2f(1.0f, 0.0f);glVertex2f(v2d->tot.xmax, v2d->tot.ymin); + } glEnd( ); glBindTexture(GL_TEXTURE_2D, last_texid); glDisable(GL_TEXTURE_2D); @@ -1056,6 +1073,19 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* preview range */ UI_view2d_view_ortho(C, v2d); ANIM_draw_previewrange(C, v2d); + + /* overlap playhead */ + if(scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW) { + int cfra_over= (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) ? scene->ed->over_cfra : scene->r.cfra + scene->ed->over_ofs; + glColor3f(0.2, 0.2, 0.2); + // glRectf(cfra_over, v2d->cur.ymin, scene->ed->over_ofs + scene->r.cfra + 1, v2d->cur.ymax); + + glBegin(GL_LINES); + glVertex2f(cfra_over, v2d->cur.ymin); + glVertex2f(cfra_over, v2d->cur.ymax); + glEnd(); + + } /* reset view matrix */ UI_view2d_view_restore(C); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1592c2093c4..19b8e9d7a79 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -792,7 +792,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe) if (!skip_dup) { /* Duplicate AFTER the first change */ - seqn = seq_dupli_recursive(scene, seq, SEQ_DUPE_UNIQUE_NAME); + seqn = seq_dupli_recursive(scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } if (seqn) { @@ -881,7 +881,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe) if (!skip_dup) { /* Duplicate AFTER the first change */ - seqn = seq_dupli_recursive(scene, seq, SEQ_DUPE_UNIQUE_NAME); + seqn = seq_dupli_recursive(scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } if (seqn) { @@ -1117,6 +1117,15 @@ int sequencer_edit_poll(bContext *C) return (seq_give_editing(CTX_data_scene(C), FALSE) != NULL); } +int sequencer_view_poll(bContext *C) +{ + SpaceSeq *sseq= CTX_wm_space_seq(C); + Editing *ed= seq_give_editing(CTX_data_scene(C), FALSE); + if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF)) + return 1; + + return 0; +} /* snap operator*/ static int sequencer_snap_exec(bContext *C, wmOperator *op) @@ -1588,6 +1597,18 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot) } /* duplicate operator */ +static int apply_unique_name_cb(Sequence *seq, void *arg_pt) +{ + Scene *scene= (Scene *)arg_pt; + char name[sizeof(seq->name)-2]; + + strcpy(name, seq->name+2); + seqbase_unique_name_recursive(&scene->ed->seqbase, seq); + seq_dupe_animdata(scene, name, seq->name+2); + return 1; + +} + static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -1598,7 +1619,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - seqbase_dupli_recursive(scene, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME|SEQ_DUPE_CONTEXT); + seqbase_dupli_recursive(scene, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT); if(nseqbase.first) { Sequence * seq= nseqbase.first; @@ -1606,7 +1627,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) addlisttolist(ed->seqbasep, &nseqbase); for( ; seq; seq= seq->next) - seqbase_unique_name_recursive(&ed->seqbase, seq); + seq_recursive_apply(seq, apply_unique_name_cb, scene); WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); return OPERATOR_FINISHED; @@ -2711,3 +2732,62 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot) /* properties */ } +/* borderselect operator */ +static int view_ghost_border_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Editing *ed= seq_give_editing(scene, FALSE); + View2D *v2d= UI_view2d_fromcontext(C); + + rctf rect; + + /* convert coordinates of rect to 'tot' rect coordinates */ + UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmin"), RNA_int_get(op->ptr, "ymin"), &rect.xmin, &rect.ymin); + UI_view2d_region_to_view(v2d, RNA_int_get(op->ptr, "xmax"), RNA_int_get(op->ptr, "ymax"), &rect.xmax, &rect.ymax); + + if(ed==NULL) + return OPERATOR_CANCELLED; + + rect.xmin /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin)); + rect.ymin /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin)); + + rect.xmax /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin)); + rect.ymax /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin)); + + rect.xmin+=0.5; + rect.xmax+=0.5; + rect.ymin+=0.5; + rect.ymax+=0.5; + + CLAMP(rect.xmin, 0.0f, 1.0f); + CLAMP(rect.ymin, 0.0f, 1.0f); + CLAMP(rect.xmax, 0.0f, 1.0f); + CLAMP(rect.ymax, 0.0f, 1.0f); + + scene->ed->over_border= rect; + + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); + + return OPERATOR_FINISHED; +} + +/* ****** Border Select ****** */ +void SEQUENCER_OT_view_ghost_border(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Border Offset View"; + ot->idname= "SEQUENCER_OT_view_ghost_border"; + ot->description="Enable border select mode"; + + /* api callbacks */ + ot->invoke= WM_border_select_invoke; + ot->exec= view_ghost_border_exec; + ot->modal= WM_border_select_modal; + ot->poll= sequencer_view_poll; + + /* flags */ + ot->flag= 0; + + /* rna */ + WM_operator_properties_gesture_border(ot, FALSE); +} diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index df426e91075..bf0dfff8e98 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -48,7 +48,7 @@ struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa); /* sequencer_draw.c */ void draw_timeline_seq(const struct bContext *C, struct ARegion *ar); -void draw_image_seq(const struct bContext* C, struct Scene *scene,struct ARegion *ar, struct SpaceSeq *sseq); +void draw_image_seq(const struct bContext* C, struct Scene *scene,struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset); void seq_reset_imageofs(struct SpaceSeq *sseq); @@ -69,6 +69,7 @@ struct Sequence *alloc_sequence(struct ListBase *lb, int cfra, int machine); /* operator helpers */ int sequencer_edit_poll(struct bContext *C); +int sequencer_view_poll(struct bContext *C); /* externs */ extern EnumPropertyItem sequencer_prop_effect_types[]; @@ -103,6 +104,7 @@ void SEQUENCER_OT_view_toggle(struct wmOperatorType *ot); void SEQUENCER_OT_view_all(struct wmOperatorType *ot); void SEQUENCER_OT_view_selected(struct wmOperatorType *ot); void SEQUENCER_OT_view_zoom_ratio(struct wmOperatorType *ot); +void SEQUENCER_OT_view_ghost_border(struct wmOperatorType *ot); void SEQUENCER_OT_copy(struct wmOperatorType *ot); void SEQUENCER_OT_paste(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 9f5a97d4446..82f70eafc0a 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -82,6 +82,7 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_view_all_preview); WM_operatortype_append(SEQUENCER_OT_view_toggle); WM_operatortype_append(SEQUENCER_OT_view_zoom_ratio); + WM_operatortype_append(SEQUENCER_OT_view_ghost_border); /* sequencer_select.c */ WM_operatortype_append(SEQUENCER_OT_select_all_toggle); @@ -113,6 +114,9 @@ void sequencer_keymap(wmKeyConfig *keyconf) wmKeyMap *keymap= WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0); wmKeyMapItem *kmi; + kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.show_overlay"); + /* operators common to sequence and preview view */ WM_keymap_add_item(keymap, "SEQUENCER_OT_view_toggle", TABKEY, KM_PRESS, KM_CTRL, 0); @@ -223,6 +227,10 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "SEQUENCER_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", OKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.overlay_frame"); + RNA_int_set(kmi->ptr, "value", 0); + transform_keymap_for_space(keyconf, keymap, SPACE_SEQ); keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0); @@ -232,6 +240,8 @@ void sequencer_keymap(wmKeyConfig *keyconf) keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_view_ghost_border", OKEY, KM_PRESS, 0, 0); + /* would prefer to use numpad keys for job */ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 8.0f); RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD4, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 4.0f); diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 8b7670a55bc..586b76268e4 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -396,7 +396,21 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar) /* XXX temp fix for wrong setting in sseq->mainb */ if (sseq->mainb == SEQ_DRAW_SEQUENCE) sseq->mainb = SEQ_DRAW_IMG_IMBUF; - draw_image_seq(C, scene, ar, sseq); + + draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0); + + if(scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF) { + int over_cfra; + + if(scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + over_cfra= scene->ed->over_cfra; + else + over_cfra= scene->r.cfra + scene->ed->over_ofs; + + if(over_cfra != scene->r.cfra) + draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra); + } + } static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7cbcc982bf6..be98e24ea9d 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4475,13 +4475,13 @@ static void tekenvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel) a= nu->pntsu; while(a--) { if(bezt->hide==0) { - if (bezt == lastsel) { + if (sel == 1 && bezt == lastsel) { UI_ThemeColor(TH_LASTSEL_POINT); bglVertex3fv(bezt->vec[1]); if (!hide_handles) { - bglVertex3fv(bezt->vec[0]); - bglVertex3fv(bezt->vec[2]); + if(bezt->f1 & SELECT) bglVertex3fv(bezt->vec[0]); + if(bezt->f3 & SELECT) bglVertex3fv(bezt->vec[2]); } UI_ThemeColor(color); diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index f5ca32c6b32..3ab7cb73d56 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -196,6 +196,10 @@ typedef struct Editing { Sequence *act_seq; char act_imagedir[256]; char act_sounddir[256]; + + int over_ofs, over_cfra; + int over_flag, pad; + rctf over_border; } Editing; /* ************* Effect Variable Structs ********* */ @@ -242,6 +246,10 @@ typedef struct SpeedControlVars { int lastValidFrame; } SpeedControlVars; +/* Editor->over_flag */ +#define SEQ_EDIT_OVERLAY_SHOW 1 +#define SEQ_EDIT_OVERLAY_ABS 2 + #define SEQ_STRIP_OFSBOTTOM 0.2f #define SEQ_STRIP_OFSTOP 0.8f diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a7f2761526e..fb19e8976c3 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1940,7 +1940,6 @@ void RNA_def_constraint(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OFF); RNA_def_property_ui_text(prop, "Enabled", "Enable/Disable Constraint"); - RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1); prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index cc135ff124f..5ebf43fc2b7 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -865,7 +865,7 @@ static void def_cmp_blur(StructRNA *srna) prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "relative", 1); - RNA_def_property_ui_text(prop, "Relative", ""); + RNA_def_property_ui_text(prop, "Relative", "Use relative (percent) values to define blur radius"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); @@ -894,12 +894,12 @@ static void def_cmp_blur(StructRNA *srna) prop = RNA_def_property(srna, "bokeh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1); - RNA_def_property_ui_text(prop, "Bokeh", ""); + RNA_def_property_ui_text(prop, "Bokeh", "Uses circular filter (slower)"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "gamma", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1); - RNA_def_property_ui_text(prop, "Gamma", ""); + RNA_def_property_ui_text(prop, "Gamma", "Applies filter on gamma corrected values"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } @@ -1176,6 +1176,7 @@ static void def_cmp_scale(StructRNA *srna) {0, "RELATIVE", 0, "Relative", ""}, {1, "ABSOLUTE", 0, "Absolute", ""}, {2, "SCENE_SIZE", 0, "Scene Size", ""}, + {3, "RENDER_SIZE", 0, "Render Size", ""}, {0, NULL, 0, NULL, NULL}}; prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 2bb3a74252e..638d867e862 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1476,7 +1476,7 @@ static void rna_def_object(BlenderRNA *brna) {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "POLYHEDER", 0, "Polyheder", ""}, + {OB_BOUND_POLYH, "POLYHEDRON", 0, "Polyhedron", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dupli_items[] = { diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index b7bdffa0e13..9313a85c17f 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -30,6 +30,7 @@ #include "rna_internal.h" +#include "DNA_anim_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" @@ -270,6 +271,7 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) Scene *scene= (Scene*)ptr->id.data; Sequence *seq= (Sequence*)ptr->data; char oldname[sizeof(seq->name)]; + AnimData *adt; /* make a copy of the old name first */ BLI_strncpy(oldname, seq->name+2, sizeof(seq->name)-2); @@ -281,7 +283,12 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) seqbase_unique_name_recursive(&scene->ed->seqbase, seq); /* fix all the animation data which may link to this */ - BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2); + + /* dont rename everywhere because these are per scene */ + /* BKE_all_animdata_fix_paths_rename("sequence_editor.sequences_all", oldname, seq->name+2); */ + adt= BKE_animdata_from_id(&scene->id); + if(adt) + BKE_animdata_fix_paths_rename(&scene->id, adt, "sequence_editor.sequences_all", oldname, seq->name+2, 0, 0, 1); } static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) @@ -514,6 +521,55 @@ static char *rna_SequenceColorBalance_path(PointerRNA *ptr) return BLI_strdup(""); } +static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, int value) +{ + Scene *scene= ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return; + + /* convert from abs to relative and back */ + if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS)==0 && value) { + ed->over_cfra= scene->r.cfra + ed->over_ofs; + ed->over_flag |= SEQ_EDIT_OVERLAY_ABS; + } + else if((ed->over_flag & SEQ_EDIT_OVERLAY_ABS) && !value) { + ed->over_ofs= ed->over_cfra - scene->r.cfra; + ed->over_flag &= ~SEQ_EDIT_OVERLAY_ABS; + } +} + +static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) +{ + Scene *scene= (Scene *)ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return scene->r.cfra; + + if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + return ed->over_cfra - scene->r.cfra; + else + return ed->over_ofs; + +} + +static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) +{ + Scene *scene= (Scene *)ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + + if(ed==NULL) + return; + + + if(ed->over_flag & SEQ_EDIT_OVERLAY_ABS) + ed->over_cfra= (scene->r.cfra + value); + else + ed->over_ofs= value; +} + #else static void rna_def_strip_element(BlenderRNA *brna) @@ -527,9 +583,7 @@ static void rna_def_strip_element(BlenderRNA *brna) prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", ""); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SequenceElement_filename_set"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); } @@ -880,6 +934,22 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); RNA_def_property_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "show_overlay", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_SHOW); + RNA_def_property_ui_text(prop, "Draw Axes", "Partial overlay ontop of the sequencer"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); + + prop= RNA_def_property(srna, "overlay_lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "over_flag", SEQ_EDIT_OVERLAY_ABS); + RNA_def_property_ui_text(prop, "Overlay Lock", ""); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_overlay_lock_set"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); + + /* access to fixed and relative frame */ + prop= RNA_def_property(srna, "overlay_frame", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, "Overlay Offset", ""); + RNA_def_property_int_funcs(prop, "rna_SequenceEditor_overlay_frame_get", "rna_SequenceEditor_overlay_frame_set", NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); RNA_def_property_ui_text(prop, "Active Strip", "Sequencers active strip"); } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c index d7a9497f41d..9779875b01a 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c @@ -64,6 +64,10 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b else if(node->custom1==CMP_SCALE_SCENEPERCENT) { newx = cbuf->x * (rd->size / 100.0f); newy = cbuf->y * (rd->size / 100.0f); + } + else if (node->custom1==CMP_SCALE_RENDERPERCENT) { + newx= (rd->xsch * rd->size)/100; + newy= (rd->ysch * rd->size)/100; } else { /* CMP_SCALE_ABSOLUTE */ newx= MAX2((int)in[1]->vec[0], 1); newy= MAX2((int)in[2]->vec[0], 1); diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c index b130b3f38a8..f990fa452cb 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c @@ -95,10 +95,11 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, /* first make the preview image */ CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */ - - sizex = rd->xsch; - sizey = rd->ysch; - + + /* Also take care about the render size! */ + sizex = (rd->size*rd->xsch)/100; + sizey = (rd->size*rd->ysch)/100; + prevbuf->rect_procedural= texture_procedural; prevbuf->node= node; VECCOPY(prevbuf->procedural_offset, in[0]->vec); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 6a1495b5f65..bf91b0498ed 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -150,7 +150,6 @@ void BPY_update_modules( void ) *****************************************************************************/ static PyObject *CreateGlobalDictionary( bContext *C, const char *filename ) { - PyObject *mod; PyObject *item; PyObject *dict = PyDict_New( ); PyDict_SetItemString( dict, "__builtins__", PyEval_GetBuiltins( ) ); @@ -166,11 +165,6 @@ static PyObject *CreateGlobalDictionary( bContext *C, const char *filename ) Py_DECREF(item); } - /* add bpy to global namespace */ - mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0); - PyDict_SetItemString( dict, "bpy", mod ); - Py_DECREF(mod); - return dict; } diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index a75dd193de2..378a386478d 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -130,8 +130,8 @@ typedef struct RenderResult { /* for render results in Image, verify validity for sequences */ int framenr; - /* for acquire image, to indicate if it is compo/seq result */ - int compo_seq; + /* for acquire image, to indicate if it there is a combined layer */ + int have_combined; /* render info text */ char *text; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c3034768a4e..4436bdb9261 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4780,7 +4780,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp /* in the prev/next pass for making speed vectors, avoid creating * objects that are not on a renderlayer with a vector pass, can * save a lot of time in complex scenes */ - vectorlay= get_vector_renderlayers(sce); + vectorlay= get_vector_renderlayers(re->scene); lay= (timeoffset)? renderlay & vectorlay: renderlay; /* if the object has been restricted from rendering in the outliner, ignore it */ @@ -4807,7 +4807,7 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp /* create list of duplis generated by this object, particle * system need to have render settings set for dupli particles */ dupli_render_particle_set(re, ob, timeoffset, 0, 1); - lb= object_duplilist(sce, ob); + lb= object_duplilist(re->scene, ob); dupli_render_particle_set(re, ob, timeoffset, 0, 0); for(dob= lb->first; dob; dob= dob->next) { diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 9033729652e..bdf4eaec589 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1090,7 +1090,7 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr) rr->rectz= RE_RenderLayerGetPass(rl, SCE_PASS_Z); } - rr->compo_seq= (rr->rectf != NULL); + rr->have_combined= (re->result->rectf != NULL); rr->layers= re->result->layers; } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7c11c7ff3af..0023ded23f0 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -830,7 +830,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, RNA_def_property_flag(prop, PROP_HIDDEN); if(flag & WM_FILESEL_RELPATH) - RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Select the file relative to the blend file"); + RNA_def_boolean(ot->srna, "relative_path", (U.flag & USER_RELPATHS) ? 1:0, "Relative Path", "Select the file relative to the blend file"); } void WM_operator_properties_select_all(wmOperatorType *ot) { @@ -1819,7 +1819,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot) WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH); RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file"); - RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory"); + RNA_def_boolean(ot->srna, "relative_remap", 1, "Remap Relative", "Remap relative paths when saving in a different directory"); } /* *************** save file directly ******** */ @@ -3141,6 +3141,7 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_assign(keymap, "NODE_OT_select_border"); // WM_modalkeymap_assign(keymap, "SCREEN_OT_border_select"); // template WM_modalkeymap_assign(keymap, "SEQUENCER_OT_select_border"); + WM_modalkeymap_assign(keymap, "SEQUENCER_OT_view_ghost_border"); WM_modalkeymap_assign(keymap, "UV_OT_select_border"); WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border"); WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border"); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 2f0f70ed9fe..fa32cfdb866 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1548,7 +1548,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_boundclass = KX_BOUNDMESH; break; } - // Object is not a mesh... can't use polyheder. + // Object is not a mesh... can't use polyhedron. // Fall through and become a sphere. case OB_BOUND_SPHERE: { diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index a12d599b60b..c877e423a71 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -49,10 +49,6 @@ CPPFLAGS += -I../Ketsji CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -ifeq ($(OS),darwin) - CPPFLAGS += -fpascal-strings -endif - ############### SOURCEDIR = source/gameengine/Rasterizer diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile index 0327714dc5f..aedbc2705f0 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile @@ -51,7 +51,3 @@ CPPFLAGS += -I../../SceneGraph CPPFLAGS += -I.. CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include -ifeq ($(OS),darwin) - CPPFLAGS += -fpascal-strings -endif - diff --git a/source/nan_compile.mk b/source/nan_compile.mk index 3382f0bea37..36c315a8e11 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -101,7 +101,7 @@ ifeq ($(OS),darwin) REL_CCFLAGS += -O2 endif - CPPFLAGS += -D_THREAD_SAFE -fpascal-strings + CPPFLAGS += -D_THREAD_SAFE ifeq ($(WITH_COCOA), true) CPPFLAGS += -DGHOST_COCOA