From cf3956f450127956f92e0efea6010c5e9eb2c490 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Sep 2011 15:51:58 +0000 Subject: [PATCH 001/113] formatting edits only --- CMakeLists.txt | 98 ++++++++++++++++++---------------- build_files/cmake/macros.cmake | 14 ++--- source/creator/CMakeLists.txt | 20 +++---- 3 files changed, 71 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d48cba8d76..43ecdaa2650 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,8 @@ # ***** END GPL LICENSE BLOCK ***** #----------------------------------------------------------------------------- -# We don't allow in-source builds. This causes no end of troubles because -# all out-of-source builds will use the CMakeCache.txt file there and even +# We don't allow in-source builds. This causes no end of troubles because +# all out-of-source builds will use the CMakeCache.txt file there and even # build the libs and objects in it. if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) @@ -197,7 +197,7 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" # Misc option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON) -option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON) +option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON) if(UNIX AND NOT APPLE) option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON) endif() @@ -286,7 +286,7 @@ endif() # linux only, not cached set(WITH_BINRELOC OFF) -# MAXOSX only, set to avoid uninitialized +# MAXOSX only, set to avoid uninitialized set(EXETYPE) # C/C++ flags @@ -311,13 +311,13 @@ set(PLATFORM_LINKFLAGS_DEBUG) # option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g: -# On Unix: +# On Unix: # cmake ../blender \ # -D PYTHON_VERSION=3.2 \ # -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \ # -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so # -# On Macs: +# On Macs: # cmake ../blender \ # -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \ # -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \ @@ -329,7 +329,7 @@ set(PLATFORM_LINKFLAGS_DEBUG) #Platform specifics if(UNIX AND NOT APPLE) - + # needed for ubuntu 11.04 if(EXISTS "/usr/lib/x86_64-linux-gnu") set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}") @@ -381,10 +381,12 @@ if(UNIX AND NOT APPLE) if(WITH_SDL) find_package(SDL) - mark_as_advanced(SDLMAIN_LIBRARY) - mark_as_advanced(SDL_INCLUDE_DIR) - mark_as_advanced(SDL_LIBRARY) - mark_as_advanced(SDL_LIBRARY_TEMP) + mark_as_advanced( + SDLMAIN_LIBRARY + SDL_INCLUDE_DIR + SDL_LIBRARY + SDL_LIBRARY_TEMP + ) # unset(SDLMAIN_LIBRARY CACHE) if(NOT SDL_FOUND) set(WITH_SDL OFF) @@ -428,8 +430,10 @@ if(UNIX AND NOT APPLE) PATHS /sw/lib ) - mark_as_advanced(ICONV_LIBRARY) - mark_as_advanced(INTL_LIBRARY) + mark_as_advanced( + ICONV_LIBRARY + INTL_LIBRARY + ) if(INTL_LIBRARY AND ICONV_LIBRARY) set(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) @@ -519,16 +523,16 @@ if(UNIX AND NOT APPLE) # Intel C++ Compiler elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") # think these next two are broken - find_program(XIAR xiar) - if(XIAR) + find_program(XIAR xiar) + if(XIAR) set(CMAKE_AR "${XIAR}") - endif() + endif() mark_as_advanced(XIAR) - find_program(XILD xild) - if(XILD) + find_program(XILD xild) + if(XILD) set(CMAKE_LINKER "${XILD}") - endif() + endif() mark_as_advanced(XILD) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel") @@ -551,7 +555,7 @@ elseif(WIN32) message("64 bit compiler detected.") set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64) endif() - + add_definitions(-DWIN32) if(WITH_INTERNATIONAL) @@ -576,7 +580,7 @@ elseif(WIN32) set(JPEG_INCLUDE_DIR "${JPEG}/include") set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined - set(WINTAB_INC ${LIBDIR}/wintab/include) + set(WINTAB_INC ${LIBDIR}/wintab/include) if(WITH_OPENAL) set(OPENAL ${LIBDIR}/openal) @@ -684,7 +688,7 @@ elseif(WIN32) ${LIBDIR}/opencollada/include/COLLADABaseUtils/include ${LIBDIR}/opencollada/include/COLLADAFramework/include ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include - ${LIBDIR}/opencollada/include/GeneratedSaxParser/include + ${LIBDIR}/opencollada/include/GeneratedSaxParser/include ) set(OPENCOLLADA_LIBRARIES @@ -817,7 +821,7 @@ elseif(WIN32) set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include) set(PTHREADS_LIBPATH ${PTHREADS}/lib) set(PTHREADS_LIBRARIES pthreadGC2) - + set(FREETYPE ${LIBDIR}/gcc/freetype) set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) set(FREETYPE_LIBPATH ${FREETYPE}/lib) @@ -837,13 +841,13 @@ elseif(WIN32) ${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include ${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include ${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include - ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include + ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include ) set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib) set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa) set(PCRE_LIBRARIES pcre) endif() - + if(WITH_CODEC_FFMPEG) set(FFMPEG ${LIBDIR}/ffmpeg) set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include) @@ -870,7 +874,7 @@ elseif(WIN32) set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include) set(JACK_LIBRARIES jack) set(JACK_LIBPATH ${JACK}/lib) - + # TODO, gives linking errors, force off set(WITH_JACK OFF) endif() @@ -908,7 +912,7 @@ elseif(APPLE) set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc) endif() endif() - + if(WITH_OPENAL) find_package(OpenAL) @@ -998,9 +1002,9 @@ elseif(APPLE) set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib) endif() - find_library(SYSTEMSTUBS_LIBRARY - NAMES - SystemStubs + find_library(SYSTEMSTUBS_LIBRARY + NAMES + SystemStubs PATHS ) mark_as_advanced(SYSTEMSTUBS_LIBRARY) @@ -1018,13 +1022,13 @@ elseif(APPLE) set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit") if(CMAKE_OSX_ARCHITECTURES MATCHES i386) set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime") - #libSDL still needs 32bit carbon quicktime + #libSDL still needs 32bit carbon quicktime endif() elseif(WITH_CODEC_QUICKTIME) set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime") endif() - # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED! + # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED! # ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL if(WITH_INPUT_NDOF) # This thread it *should* work and check the framework - campbell @@ -1184,7 +1188,7 @@ endif() #----------------------------------------------------------------------------- # Blender WebPlugin -if(WITH_WEBPLUGIN) +if(WITH_WEBPLUGIN) set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path") set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none") @@ -1196,13 +1200,13 @@ endif() # Configure OpenGL. find_package(OpenGL) blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}") -# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake -# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake +# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake +# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake #----------------------------------------------------------------------------- # Configure OpenMP. if(WITH_OPENMP) - find_package(OpenMP) + find_package(OpenMP) if(OPENMP_FOUND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") @@ -1214,9 +1218,11 @@ if(WITH_OPENMP) set(WITH_OPENMP OFF) endif() - mark_as_advanced(OpenMP_C_FLAGS) - mark_as_advanced(OpenMP_CXX_FLAGS) -endif() + mark_as_advanced( + OpenMP_C_FLAGS + OpenMP_CXX_FLAGS + ) +endif() #----------------------------------------------------------------------------- # Configure GLEW @@ -1231,8 +1237,10 @@ else() message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW") endif() - mark_as_advanced(GLEW_LIBRARY) - mark_as_advanced(GLEW_INCLUDE_PATH) + mark_as_advanced( + GLEW_LIBRARY + GLEW_INCLUDE_PATH + ) endif() #----------------------------------------------------------------------------- @@ -1240,7 +1248,7 @@ endif() if(WITH_PYTHON_MODULE) add_definitions(-DPy_ENABLE_SHARED) -endif() +endif() #----------------------------------------------------------------------------- # Extra compile flags @@ -1249,7 +1257,7 @@ if((NOT WIN32) AND (NOT MSVC)) # used for internal debug checks set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") - + # assert() checks for this. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG") @@ -1399,8 +1407,8 @@ if(FIRST_RUN) macro(info_cfg_text _text) set(_config_msg "${_config_msg}\n\n ${_text}") - - + + endmacro() info_cfg_text("Build Options:") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 8a665405e72..e279249fdfe 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -335,14 +335,14 @@ macro(TEST_SSE_SUPPORT) #include int main() { __m128 v = _mm_setzero_ps(); return 0; }" SUPPORT_SSE_BUILD) - + if(SUPPORT_SSE_BUILD) message(STATUS "SSE Support: detected.") else() message(STATUS "SSE Support: missing.") endif() set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test") - endif() + endif() if(NOT DEFINED ${SUPPORT_SSE2_BUILD}) check_c_source_runs(" @@ -354,7 +354,7 @@ macro(TEST_SSE_SUPPORT) message(STATUS "SSE2 Support: detected.") else() message(STATUS "SSE2 Support: missing.") - endif() + endif() set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test") endif() @@ -493,7 +493,7 @@ endmacro() # hacks to override initial project settings -# these macros must be called directly before/after project(Blender) +# these macros must be called directly before/after project(Blender) macro(blender_project_hack_pre) # ---------------- # MINGW HACK START @@ -535,8 +535,10 @@ macro(blender_project_hack_post) # have libs we define and that cmake & scons builds match. set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) - mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES) - mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES) + mark_as_advanced( + CMAKE_C_STANDARD_LIBRARIES + CMAKE_CXX_STANDARD_LIBRARIES + ) endif() unset(_reset_standard_libraries) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 28a621c923c..86aebe47edc 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -125,7 +125,7 @@ if(WIN32 AND NOT UNIX) -DBLEN_VER_RC_4=0 ) endif() - + list(APPEND SRC ../icons/winblender.rc @@ -198,16 +198,16 @@ if(WITH_PYTHON_MODULE) LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows ) - + if(WIN32) # python modules use this set_target_properties( blender PROPERTIES SUFFIX ".pyd" - ) + ) endif() - + else() add_executable(blender ${EXETYPE} ${SRC}) endif() @@ -687,14 +687,14 @@ elseif(APPLE) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python) set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip") - + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/ COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/ DEPENDS ${LIBDIR}/release/${PYTHON_ZIP}) - + add_dependencies(blender extractpyzip) # copy extracted python files @@ -728,7 +728,7 @@ elseif(APPLE) FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo DESTINATION ${TARGETDIR}/blenderplayer.app/Contents ) - + install_dir( ${PLAYER_SOURCEDIR}/Contents/Resources \${TARGETDIR}/blenderplayer.app/Contents/ @@ -742,7 +742,7 @@ elseif(APPLE) COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/ COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/ DEPENDS ${LIBDIR}/release/${PYTHON_ZIP}) - + # copy extracted python files install_dir( ${CMAKE_CURRENT_BINARY_DIR}/python @@ -917,12 +917,12 @@ endif() message(STATUS "Blender Skipping: (${REM_MSG})") endif() target_link_libraries(blender ${BLENDER_SORTED_LIBS}) - + unset(SEARCHLIB) unset(SORTLIB) unset(REMLIB) unset(REM_MSG) - + #else() # target_link_libraries(blender ${BLENDER_LINK_LIBS}) #endif() From 7ef5464236144da9bc73212477ecbf8dd48ceccc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Sep 2011 16:37:46 +0000 Subject: [PATCH 002/113] sse flags for intel c++ compiler --- CMakeLists.txt | 5 ++++- build_files/cmake/macros.cmake | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ecdaa2650..c95509b0a08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1134,8 +1134,11 @@ if(WITH_RAYOPTIMIZATION) elseif(MSVC) set(_sse "/arch:SSE") set(_sse2 "/arch:SSE2") + elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") + set(_sse) # icc only has sse2 + set(_sse2 "-xSSE2") else() - message(WARNING "SSE flags for this compiler not known") + message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known") set(_sse) set(_sse2) endif() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index e279249fdfe..35c84e8359b 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -328,6 +328,10 @@ macro(TEST_SSE_SUPPORT) set(CMAKE_REQUIRED_FLAGS "-msse -msse2") elseif(MSVC) set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ? + elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") + set(CMAKE_REQUIRED_FLAGS "-xSSE2") + else() + message(STATUS "Compiler: '${CMAKE_C_COMPILER_ID}' has no SSE flags defiend for it!") endif() if(NOT DEFINED ${SUPPORT_SSE_BUILD}) From 7b9f3eac42316f32fce7732345162983f19419cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Sep 2011 16:54:11 +0000 Subject: [PATCH 003/113] fix for odd linking error with ffmpeg. --- build_files/cmake/macros.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 35c84e8359b..709779dc3eb 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -280,6 +280,11 @@ macro(setup_liblinks target_link_libraries(${target} ${OPENJPEG_LIBRARIES}) endif() if(WITH_CODEC_FFMPEG) + + # Strange!, without this ffmpeg gives linking errors (on linux) + # even though its linked above + target_link_libraries(${target} ${OPENGL_glu_LIBRARY}) + target_link_libraries(${target} ${FFMPEG_LIBRARIES}) endif() if(WITH_OPENCOLLADA) From b05a3f7e42359e2a067d40f1edf10b6431390012 Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Fri, 30 Sep 2011 20:26:14 +0000 Subject: [PATCH 004/113] Cgange compile cindition for gcc-4.6-objC++ workaround --- intern/ghost/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index ccf641eaee1..0c3109b1482 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -102,7 +102,7 @@ if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-v if window_system in ('win32-vc', 'win64-vc'): env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') ) -elif env['OURPLATFORM'] == 'darwin': # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet +elif env['WITH_GHOST_COCOA']: # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/gcc-4.2' ) print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC" From 471ea617b2dbe002ed57ef06a7ea6ab83f0924b7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 1 Oct 2011 00:56:36 +0000 Subject: [PATCH 005/113] Bugfix [#28781] Grease pencil segfaults when deleting or duplicating frames in dopesheet --- .../editors/space_action/action_edit.c | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index fdf9209c813..a05053a2d9d 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -459,6 +459,8 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op) /* copy keyframes */ if (ac.datatype == ANIMCONT_GPENCIL) { // FIXME... + BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode"); + return OPERATOR_CANCELLED; } else { if (copy_action_keys(&ac)) { @@ -497,13 +499,15 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - if(ac.reports==NULL) { + if (ac.reports==NULL) { ac.reports= op->reports; } /* paste keyframes */ if (ac.datatype == ANIMCONT_GPENCIL) { // FIXME... + BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode"); + return OPERATOR_CANCELLED; } else { if (paste_action_keys(&ac, offset_mode, merge_mode)) { @@ -680,12 +684,13 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) duplicate_action_keys(&ac); /* validate keyframes after editing */ - ANIM_editkeyframes_refresh(&ac); + if (ac.datatype != ANIMCONT_GPENCIL) + ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); - return OPERATOR_FINISHED; // xxx - start transform + return OPERATOR_FINISHED; } static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) @@ -709,9 +714,6 @@ void ACTION_OT_duplicate (wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* to give to transform */ - RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /* ******************** Delete Keyframes Operator ************************* */ @@ -764,7 +766,8 @@ static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op)) delete_action_keys(&ac); /* validate keyframes after editing */ - ANIM_editkeyframes_refresh(&ac); + if (ac.datatype != ANIMCONT_GPENCIL) + ANIM_editkeyframes_refresh(&ac); /* set notifier that keyframes have changed */ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); @@ -1381,6 +1384,10 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; + // XXX... + if (ac.datatype == ANIMCONT_GPENCIL) + return OPERATOR_PASS_THROUGH; + /* get snapping mode */ mode= RNA_enum_get(op->ptr, "type"); @@ -1491,6 +1498,10 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; + // XXX... + if (ac.datatype == ANIMCONT_GPENCIL) + return OPERATOR_PASS_THROUGH; + /* get mirroring mode */ mode= RNA_enum_get(op->ptr, "type"); From b062056c05a3b116d87466be03e0bc7d97dfca8e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 1 Oct 2011 01:27:44 +0000 Subject: [PATCH 006/113] Bugfixes for: [#28525] [#28690] [#28774] [#28777] This commit basically disables the RNA update caches for now, and introduces a workaround/hack to ensure that modifier properties still work when animated/driven. The whole way that updates currently get handled needs reviewing in future. Fix provided by Brecht. --- source/blender/blenkernel/intern/anim_sys.c | 3 +++ source/blender/blenkernel/intern/depsgraph.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 5d01db87422..13abf18e20c 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1160,6 +1160,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i return 0; } + /* RNA property update disabled for now - [#28525] [#28690] [#28774] [#28777] */ +#if 0 /* buffer property update for later flushing */ if (RNA_property_update_check(prop)) { short skip_updates_hack = 0; @@ -1176,6 +1178,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i if (skip_updates_hack == 0) RNA_property_update_cache_add(&new_ptr, prop); } +#endif } /* successful */ diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 6f27a104144..80a40c0a3a3 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2028,17 +2028,27 @@ static int object_modifiers_use_time(Object *ob) /* check whether any modifiers are animated */ if (ob->adt) { AnimData *adt = ob->adt; + FCurve *fcu; /* action - check for F-Curves with paths containing 'modifiers[' */ if (adt->action) { - FCurve *fcu; - for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) { if (fcu->rna_path && strstr(fcu->rna_path, "modifiers[")) return 1; } } + /* This here allows modifier properties to get driven and still update properly + * + * Workaround to get [#26764] (e.g. subsurf levels not updating when animated/driven) + * working, without the updating problems ([#28525] [#28690] [#28774] [#28777]) caused + * by the RNA updates cache introduced in r.38649 + */ + for (fcu = adt->drivers.first; fcu; fcu = fcu->next) { + if (fcu->rna_path && strstr(fcu->rna_path, "modifiers[")) + return 1; + } + // XXX: also, should check NLA strips, though for now assume that nobody uses // that and we can omit that for performance reasons... } From fdcfb9a4a017224c9d9b8c66d6cd1efff55b00ab Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 1 Oct 2011 11:21:47 +0000 Subject: [PATCH 007/113] * Updating readme.html and link to release logs for 2.60, now that we approach the RC state. --- release/scripts/startup/bl_ui/space_info.py | 2 +- release/text/readme.html | 16 ++++++---------- .../blender/windowmanager/intern/wm_operators.c | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 644676310fc..2d22a398624 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -360,7 +360,7 @@ class INFO_MT_help(Menu): layout = self.layout layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual' - layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-259/' + layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-260/' layout.separator() diff --git a/release/text/readme.html b/release/text/readme.html index 95094b9c0cb..e0bef8a50e1 100644 --- a/release/text/readme.html +++ b/release/text/readme.html @@ -12,22 +12,18 @@ -

Blender 2.59

+

Blender 2.60


About

Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.

Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.

For more information, visit blender.org.


-

2.59

-

The Blender Foundation and online developer community is proud to present Blender 2.59. This release is the third official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. More information about this release.

-

What to Expect:

-

• Big improvements - This is our most exciting version to date, already a significant improvement in many ways over 2.49

-

• Missing/Incomplete Features - Although most of it is there, not all functionality from pre-2.5 versions has been restored yet. Some functionality may be re-implemented a different way.

-

• Changes - If you're used to the old Blenders, Blender 2.5 may seem quite different at first, but it won't be long before it grows on you even more than before.

+

2.60

+

The Blender Foundation and online developer community is proud to present Blender 2.60. This release is the first official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.More information about this release.


Bugs

-

Although Blender 2.59 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.59. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.

+

Although Blender 2.60 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.


Package Contents

The downloaded Blender package includes:

@@ -43,7 +39,7 @@

Installing Add-ons (all systems) Add-ons can be installed from the user preferences addons section, download an addon as a .py or .zip file, then press the "Install Add-on" button and select the file to install it.


Getting Started

-

When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area on the right and a Timeline at the bottom.

+

When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area and an Outliner area on the right and a Timeline at the bottom.

Orbit around in the 3D view by holding the middle mouse button and dragging. Alternatively, hold the alt key and drag the left mouse button. Additionally, hold Shift to pan the view and Ctrl to zoom.

Select objects using the right mouse button. With the object selected, perform actions by clicking any of the tool buttons on the left, or make changes to its properties by altering any of the setting on the right.

For more information on how to use Blender, watch tutorials or read the manual.

@@ -51,7 +47,7 @@

Links

Users:

General information www.blender.org
- Full release log www.blender.org/development/release-logs/blender-259/
+ Full release log www.blender.org/development/release-logs/blender-260/
Tutorials www.blender.org/education-help/
Manual wiki.blender.org/index.php/Doc:Manual
User Forum www.blenderartists.org
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b980b45bae4..16cba7d6758 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1280,7 +1280,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemL(col, "Links", ICON_NONE); uiItemStringO(col, UI_translate_do_iface(N_("Donations")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); uiItemStringO(col, UI_translate_do_iface(N_("Credits")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); - uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259"); + uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-260"); uiItemStringO(col, UI_translate_do_iface(N_("Manual")), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); uiItemStringO(col, UI_translate_do_iface(N_("Blender Website")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); uiItemStringO(col, UI_translate_do_iface(N_("User Community")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); From ca5871c26fa11dd856aae1731877902bc4169cbf Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 1 Oct 2011 13:46:20 +0000 Subject: [PATCH 008/113] reverting part of rev40594. Pardoon, looks like i've forgot to revert current work before commiting actual patch i wanted to send to the svn. --- source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/windowmanager/intern/wm_event_system.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index d3d7b1b1505..0854f9f3685 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3226,7 +3226,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve else WM_event_add_notifier(C, NC_SCENE|NA_EDITED, scene); - return OPERATOR_PASS_THROUGH; + return OPERATOR_FINISHED; } void VIEW3D_OT_cursor3d(wmOperatorType *ot) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 596fa35d597..cafee6b49ca 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1278,6 +1278,10 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand } /* Finished and pass through flag as handled */ + /* Finished and pass through flag as handled */ + if(retval == (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH)) + return WM_HANDLER_HANDLED; + /* Modal unhandled, break */ if(retval == (OPERATOR_PASS_THROUGH|OPERATOR_RUNNING_MODAL)) return (WM_HANDLER_BREAK|WM_HANDLER_MODAL); From 7b398f271ec543c72e622074467d6861db797ccc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 15:02:55 +0000 Subject: [PATCH 009/113] fix for mingw --- source/blender/python/intern/bpy_rna.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 98aa8c9be35..ff2a3dd1303 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4706,7 +4706,11 @@ PyTypeObject pyrna_struct_meta_idprop_Type= { NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ +#ifdef FREE_WINDOWS + NULL, /* defer assignment */ +#else + &PyType_Type, /* struct _typeobject *tp_base; */ +#endif NULL, /* PyObject *tp_dict; */ NULL, /* descrgetfunc tp_descr_get; */ NULL, /* descrsetfunc tp_descr_set; */ @@ -5277,7 +5281,11 @@ PyTypeObject pyrna_prop_collection_iter_Type= { NULL, /* reprfunc tp_str; */ /* will only use these if this is a subtype of a py class */ +#ifdef FREE_WINDOWS + NULL, /* defer assignment */ +#else PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ +#endif NULL, /* setattrofunc tp_setattro; */ /* Functions to access object as input/output buffer */ @@ -5306,7 +5314,11 @@ PyTypeObject pyrna_prop_collection_iter_Type= { #endif /*** Added in release 2.2 ***/ /* Iterators */ +#ifdef FREE_WINDOWS + NULL, /* defer assignment */ +#else PyObject_SelfIter, /* getiterfunc tp_iter; */ +#endif (iternextfunc) pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */ /*** Attribute descriptor and subclassing stuff ***/ @@ -5692,8 +5704,15 @@ void BPY_rna_init(void) mathutils_rna_matrix_cb_index= Mathutils_RegisterCallback(&mathutils_rna_matrix_cb); #endif - /* metaclass */ + /* for some reason MSVC complains of these */ +#ifdef FREE_WINDOWS pyrna_struct_meta_idprop_Type.tp_base= &PyType_Type; + + pyrna_prop_collection_iter_Type.tp_iter= PyObject_SelfIter; + pyrna_prop_collection_iter_Type.tp_getattro= PyObject_GenericGetAttr; +#endif + + /* metaclass */ if(PyType_Ready(&pyrna_struct_meta_idprop_Type) < 0) return; From 646a397297d55452a8908122eb67e0d8eaceef5e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 15:40:32 +0000 Subject: [PATCH 010/113] add a collection function slot for assignment (not used yet). --- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/RNA_define.h | 2 +- source/blender/makesrna/intern/makesrna.c | 2 +- source/blender/makesrna/intern/rna_ID.c | 2 +- source/blender/makesrna/intern/rna_access.c | 15 +++++++++ source/blender/makesrna/intern/rna_action.c | 2 +- source/blender/makesrna/intern/rna_armature.c | 2 +- source/blender/makesrna/intern/rna_color.c | 2 +- source/blender/makesrna/intern/rna_curve.c | 4 +-- source/blender/makesrna/intern/rna_define.c | 5 +-- source/blender/makesrna/intern/rna_fluidsim.c | 2 +- source/blender/makesrna/intern/rna_group.c | 2 +- .../makesrna/intern/rna_internal_types.h | 2 ++ source/blender/makesrna/intern/rna_key.c | 2 +- source/blender/makesrna/intern/rna_lattice.c | 4 +-- source/blender/makesrna/intern/rna_main.c | 2 +- source/blender/makesrna/intern/rna_material.c | 3 +- source/blender/makesrna/intern/rna_mesh.c | 33 +++++++------------ source/blender/makesrna/intern/rna_modifier.c | 2 +- source/blender/makesrna/intern/rna_object.c | 2 +- .../makesrna/intern/rna_object_force.c | 3 +- source/blender/makesrna/intern/rna_pose.c | 2 +- source/blender/makesrna/intern/rna_render.c | 6 ++-- source/blender/makesrna/intern/rna_rna.c | 12 +++---- source/blender/makesrna/intern/rna_scene.c | 7 ++-- .../blender/makesrna/intern/rna_sequencer.c | 8 ++--- 26 files changed, 66 insertions(+), 63 deletions(-) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 26bae68d5a4..6dbc002d505 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -778,6 +778,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr); int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr); int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr); +int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, PointerRNA *assign_ptr); int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); /* efficient functions to set properties for arrays */ diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index e003b7198b8..9b87bbc2f4e 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -173,7 +173,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item); void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set); void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef, const char *poll); -void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring); +void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint); void RNA_def_property_srna(PropertyRNA *prop, const char *type); void RNA_def_py_data(PropertyRNA *prop, void *py_data); diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index bc45ea4deed..bb4d6d3a330 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2279,7 +2279,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring)); + fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint)); if(cprop->item_type) fprintf(f, "&RNA_%s\n", (char*)cprop->item_type); else fprintf(f, "NULL\n"); break; diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index bf83d33a0a3..492f51967b2 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -367,7 +367,7 @@ static void rna_def_ID_properties(BlenderRNA *brna) prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "PropertyGroup"); - RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL); RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); // never tested, maybe its useful to have this? diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index b995b5ab731..c6a9627aa3c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2864,6 +2864,21 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co } } +/* zero return is an assignment error */ +int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, PointerRNA *assign_ptr) +{ + CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop); + + BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); + + if(cprop->assignint) { + /* we have a callback defined, use it */ + return cprop->assignint(ptr, key, assign_ptr); + } + + return 0; +} + int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) { BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 718f70cea1e..44c37f93b5e 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -451,7 +451,7 @@ static void rna_def_action_group(BlenderRNA *brna) prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); RNA_def_property_struct_type(prop, "FCurve"); - RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", 0, 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group"); prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 75c21e3f47e..c8e5faee7c8 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -841,7 +841,7 @@ static void rna_def_armature(BlenderRNA *brna) /* Collections */ prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); - RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); rna_def_armature_bones(brna, prop); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 4ef6e9f4af7..65745ca2afd 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -405,7 +405,7 @@ static void rna_def_curvemapping(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range"); prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "CurveMap"); RNA_def_property_ui_text(prop, "Curves", ""); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 5d0c1db572d..28c1a3bc234 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1262,7 +1262,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL); #else /* this way we get editmode nurbs too, keyframe in editmode */ - RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); #endif RNA_def_property_struct_type(prop, "Spline"); RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object"); @@ -1450,7 +1450,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bp", NULL); RNA_def_property_struct_type(prop, "SplinePoint"); - RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline"); rna_def_curve_spline_points(brna, prop); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 63a41762f4c..ab469c19e15 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -689,7 +689,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * if(DefRNA.preprocess) { RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", NULL, NULL, "rna_builtin_properties_lookup_string"); + RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", NULL, NULL, "rna_builtin_properties_lookup_string", NULL); } else { #ifdef RNA_RUNTIME @@ -2047,7 +2047,7 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch } } -void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring) +void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint) { StructRNA *srna= DefRNA.laststruct; @@ -2067,6 +2067,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con if(length) cprop->length= (PropCollectionLengthFunc)length; if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint; if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring; + if(assignint) cprop->assignint= (PropCollectionAssignIntFunc)assignint; break; } default: diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index ccb24d7dd9b..82911ebb3be 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -412,7 +412,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) prop= RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "FluidMeshVertex"); RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation"); - RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL); rna_def_fluid_mesh_vertices(brna); } diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 597f05ed9f6..0a66ff9fa99 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -132,7 +132,7 @@ void RNA_def_group(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects"); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_Group_objects_get", NULL, NULL, NULL, NULL); rna_def_group_objects(brna, prop); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 249833ae94b..87b35459d40 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -102,6 +102,7 @@ typedef PointerRNA (*PropCollectionGetFunc)(struct CollectionPropertyIterator *i typedef int (*PropCollectionLengthFunc)(struct PointerRNA *ptr); typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *r_ptr); typedef int (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr); +typedef int (*PropCollectionAssignIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); /* Container - generic abstracted container of RNA properties */ typedef struct ContainerRNA { @@ -285,6 +286,7 @@ typedef struct CollectionPropertyRNA { PropCollectionLengthFunc length; /* optional */ PropCollectionLookupIntFunc lookupint; /* optional */ PropCollectionLookupStringFunc lookupstring; /* optional */ + PropCollectionAssignIntFunc assignint; /* optional */ struct StructRNA *item_type; /* the type of this item */ } CollectionPropertyRNA; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index ad6f67cddaf..353da196e89 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -581,7 +581,7 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "data", "totelem"); RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", 0, 0, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", NULL, NULL, NULL); } static void rna_def_key(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 8387b3286d6..2a81c4f0a2c 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -237,7 +237,7 @@ static void rna_def_latticepoint(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of"); } @@ -317,7 +317,7 @@ static void rna_def_lattice(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "LatticePoint"); - RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Points", "Points of the lattice"); /* pointers */ diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 352aaa890a5..0b44f7c98d0 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -337,7 +337,7 @@ void RNA_def_main(BlenderRNA *brna) { prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i].type); - RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, lists[i].name, lists[i].description); /* collection functions */ diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 80a418a0047..a9878ab2bf2 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -2040,8 +2040,7 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, /* mtex */ prop= RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, structname); - RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", - "rna_iterator_array_dereference_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Textures", "Texture slots defining the mapping and influence of textures"); rna_def_texture_slots(brna, prop, structname, structname_slots); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 00c79c32b3a..44be5ae8e35 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1226,8 +1226,7 @@ static void rna_def_mvert(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of"); @@ -1401,9 +1400,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshTextureFace"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshTextureFaceLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshTextureFace", NULL); RNA_def_struct_sdna(srna, "MTFace"); @@ -1515,9 +1512,7 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshColor"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshColorLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshColor", NULL); RNA_def_struct_sdna(srna, "MCol"); @@ -1572,9 +1567,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshFloatProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshFloatPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshFloatProperty", NULL); RNA_def_struct_sdna(srna, "MFloatProperty"); @@ -1600,9 +1593,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshIntProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshIntPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshIntProperty", NULL); RNA_def_struct_sdna(srna, "MIntProperty"); @@ -1628,9 +1619,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshStringProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshStringPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshStringProperty", NULL); RNA_def_struct_sdna(srna, "MStringProperty"); @@ -1834,7 +1823,7 @@ static void rna_def_mesh(BlenderRNA *brna) /* UV textures */ prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); RNA_def_property_ui_text(prop, "UV Textures", ""); rna_def_uv_textures(brna, prop); @@ -1864,26 +1853,26 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshColorLayer"); RNA_def_property_ui_text(prop, "Vertex Colors", ""); rna_def_vertex_colors(brna, prop); prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer"); RNA_def_property_ui_text(prop, "Float Property Layers", ""); prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshIntPropertyLayer"); RNA_def_property_ui_text(prop, "Int Property Layers", ""); prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MeshStringPropertyLayer"); RNA_def_property_ui_text(prop, "String Property Layers", ""); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 00ac371f929..5259ee1f6d1 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1564,7 +1564,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "UVProjector"); - RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Projectors", ""); prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f271673d278..3141369fcd4 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1915,7 +1915,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "MaterialSlot"); - RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL); /* don't dereference pointer! */ + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL); /* don't dereference pointer! */ RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object"); prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 0b137633349..a6e0e9f3331 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -827,8 +827,7 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", - "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list"); rna_def_ptcache_point_caches(brna, prop); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 338073fde00..b61495edc94 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -1240,7 +1240,7 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL); RNA_def_property_struct_type(prop, "PoseBone"); RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature"); - RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string"); /* can be removed, only for fast lookup */ + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); /* can be removed, only for fast lookup */ /* bone groups */ prop= RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 1003c9bfba2..f5fab9d2f33 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -329,8 +329,7 @@ static void rna_def_render_result(BlenderRNA *brna) parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(parm, "RenderLayer"); - RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", - "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_define_verify_sdna(1); } @@ -361,8 +360,7 @@ static void rna_def_render_layer(BlenderRNA *brna) prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "RenderPass"); - RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", - "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 95c6b066510..454fd6275d9 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -979,13 +979,13 @@ static void rna_def_struct(BlenderRNA *brna) prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Properties", "Properties in the struct"); prop= RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Function"); - RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Functions", ""); } @@ -1135,7 +1135,7 @@ static void rna_def_function(BlenderRNA *brna) prop= RNA_def_property(srna, "parameters", PROP_COLLECTION, PROP_NONE); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/ RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Parameters", "Parameters for the function"); prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE); @@ -1286,7 +1286,7 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "EnumPropertyItem"); - RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Items", "Possible values for the property"); srna= RNA_def_struct(brna, "EnumPropertyItem", NULL); @@ -1389,9 +1389,9 @@ void RNA_def_rna(BlenderRNA *brna) RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", /* included for speed, can be removed */ #if 0 - 0,0,0); + 0,0,0,0); #else - "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int", "rna_BlenderRNA_structs_lookup_string"); + "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int", "rna_BlenderRNA_structs_lookup_string", NULL); #endif RNA_def_property_ui_text(prop, "Structs", ""); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index ff1cd052913..86f77629ec7 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3480,14 +3480,14 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "base", NULL); RNA_def_property_struct_type(prop, "ObjectBase"); RNA_def_property_ui_text(prop, "Bases", ""); - RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, "rna_Scene_object_bases_lookup_string"); + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_Scene_object_bases_lookup_string", NULL); rna_def_scene_bases(brna, prop); prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "base", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Objects", ""); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_Scene_objects_get", NULL, NULL, NULL, NULL); rna_def_scene_objects(brna, prop); /* Layers */ @@ -3617,8 +3617,7 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_scene_keying_sets(brna, prop); prop= RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", - "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "KeyingSet"); RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 3d81ec24d29..a75166c3e99 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1174,13 +1174,13 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL); RNA_def_property_struct_type(prop, "Sequence"); RNA_def_property_ui_text(prop, "Sequences", ""); - RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", 0, 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL); prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL); RNA_def_property_struct_type(prop, "Sequence"); RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip"); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL); prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); @@ -1350,7 +1350,7 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); RNA_def_property_ui_text(prop, "Elements", ""); - RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", NULL, NULL, NULL); rna_def_filter_video(srna); rna_def_proxy(srna); @@ -1426,7 +1426,7 @@ static void rna_def_movie(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL); RNA_def_property_struct_type(prop, "SequenceElement"); RNA_def_property_ui_text(prop, "Elements", ""); - RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", NULL, NULL, NULL); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_ui_text(prop, "File", ""); From 975c4e717798e71af3d46f06c3e25ae54e11fcca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 15:54:36 +0000 Subject: [PATCH 011/113] fix for msvc, I thought this was only needed for mingw. --- source/blender/python/intern/bpy_rna.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index ff2a3dd1303..d367ea92cf4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4706,7 +4706,7 @@ PyTypeObject pyrna_struct_meta_idprop_Type= { NULL, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyGetSetDef *tp_getset; */ -#ifdef FREE_WINDOWS +#if defined(_MSC_VER) || defined(FREE_WINDOWS) NULL, /* defer assignment */ #else &PyType_Type, /* struct _typeobject *tp_base; */ @@ -5281,7 +5281,7 @@ PyTypeObject pyrna_prop_collection_iter_Type= { NULL, /* reprfunc tp_str; */ /* will only use these if this is a subtype of a py class */ -#ifdef FREE_WINDOWS +#if defined(_MSC_VER) || defined(FREE_WINDOWS) NULL, /* defer assignment */ #else PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ @@ -5314,7 +5314,7 @@ PyTypeObject pyrna_prop_collection_iter_Type= { #endif /*** Added in release 2.2 ***/ /* Iterators */ -#ifdef FREE_WINDOWS +#if defined(_MSC_VER) || defined(FREE_WINDOWS) NULL, /* defer assignment */ #else PyObject_SelfIter, /* getiterfunc tp_iter; */ @@ -5705,7 +5705,7 @@ void BPY_rna_init(void) #endif /* for some reason MSVC complains of these */ -#ifdef FREE_WINDOWS +#if defined(_MSC_VER) || defined(FREE_WINDOWS) pyrna_struct_meta_idprop_Type.tp_base= &PyType_Type; pyrna_prop_collection_iter_Type.tp_iter= PyObject_SelfIter; From 738491555d4e831186de337800dce4f14c56d252 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 17:51:47 +0000 Subject: [PATCH 012/113] BKE material api function: assign_material_id, like assign_material but takes the object data rather then the object. --- source/blender/blenkernel/BKE_material.h | 1 + source/blender/blenkernel/intern/material.c | 42 +++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index cb6a0b9ab37..0e0348e78e9 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -71,6 +71,7 @@ short *give_totcolp_id(struct ID *id); struct Material *give_current_material(struct Object *ob, short act); struct ID *material_from(struct Object *ob, short act); +void assign_material_id(struct ID *id, struct Material *ma, short act); void assign_material(struct Object *ob, struct Material *ma, short act); void assign_matarar(struct Object *ob, struct Material ***matar, short totcol); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a25da56d573..6e1303e375e 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -723,6 +723,48 @@ void test_object_materials(ID *id) } } +void assign_material_id(ID *id, Material *ma, short act) +{ + Material *mao, **matar, ***matarar; + short *totcolp; + + if(act>MAXMAT) return; + if(act<1) act= 1; + + /* prevent crashing when using accidentally */ + BLI_assert(id->lib == NULL); + if(id->lib) return; + + /* test arraylens */ + + totcolp= give_totcolp_id(id); + matarar= give_matarar_id(id); + + if(totcolp==NULL || matarar==NULL) return; + + if(act > *totcolp) { + matar= MEM_callocN(sizeof(void *)*act, "matarray1"); + + if(*totcolp) { + memcpy(matar, *matarar, sizeof(void *)*(*totcolp)); + MEM_freeN(*matarar); + } + + *matarar= matar; + *totcolp= act; + } + + /* in data */ + mao= (*matarar)[act-1]; + if(mao) mao->id.us--; + (*matarar)[act-1]= ma; + + if(ma) + id_us_plus((ID *)ma); + + test_object_materials(id); +} + void assign_material(Object *ob, Material *ma, short act) { Material *mao, **matar, ***matarar; From 9a88524f681d62cee51dfbc3186d59b4b0712a05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 17:54:33 +0000 Subject: [PATCH 013/113] support for object data material assignment in python eg: bpy.context.object.data.materials[0] = bpy.data.materials["SomeMaterial"] --- source/blender/makesrna/RNA_access.h | 2 +- source/blender/makesrna/intern/rna_ID.c | 8 + source/blender/makesrna/intern/rna_access.c | 5 +- source/blender/makesrna/intern/rna_curve.c | 3 +- source/blender/makesrna/intern/rna_internal.h | 3 + .../makesrna/intern/rna_internal_types.h | 2 +- source/blender/makesrna/intern/rna_mesh.c | 1 + source/blender/makesrna/intern/rna_meta.c | 3 +- source/blender/python/intern/bpy_rna.c | 175 ++++++++++++++++-- 9 files changed, 184 insertions(+), 18 deletions(-) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 6dbc002d505..1e9496fdbbb 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -778,7 +778,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr); int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr); int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr); -int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, PointerRNA *assign_ptr); +int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr); int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); /* efficient functions to set properties for arrays */ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 492f51967b2..3f8a310285e 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -314,6 +314,14 @@ static int rna_IDPArray_length(PointerRNA *ptr) return prop->len; } +int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, PointerRNA *assign_ptr) +{ + ID *id= ptr->id.data; + Material *mat_id= assign_ptr->id.data; + assign_material_id(id, mat_id, key + 1); + return 1; +} + #else static void rna_def_ID_properties(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c6a9627aa3c..24e1aa078cf 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1095,6 +1095,9 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) if(cprop->item_type) return cprop->item_type; } + else { + BLI_assert(0); + } return &RNA_UnknownType; } @@ -2865,7 +2868,7 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co } /* zero return is an assignment error */ -int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, PointerRNA *assign_ptr) +int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr) { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 28c1a3bc234..edae977f3f6 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1428,7 +1428,8 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_ui_text(prop, "Materials", ""); - RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int"); } static void rna_def_curve_nurb(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index cf1be39124e..aab74056ad9 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -382,6 +382,9 @@ struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, str struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index); void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index); + +int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); + #endif /* RNA_INTERNAL_H */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 87b35459d40..50790a0077f 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -102,7 +102,7 @@ typedef PointerRNA (*PropCollectionGetFunc)(struct CollectionPropertyIterator *i typedef int (*PropCollectionLengthFunc)(struct PointerRNA *ptr); typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *r_ptr); typedef int (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr); -typedef int (*PropCollectionAssignIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); +typedef int (*PropCollectionAssignIntFunc)(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr); /* Container - generic abstracted container of RNA properties */ typedef struct ContainerRNA { diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 44be5ae8e35..ad4467a6d0b 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1942,6 +1942,7 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Material"); RNA_def_property_ui_text(prop, "Materials", ""); RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int"); /* Mesh Draw Options for Edit Mode*/ diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 5e5cf0be0ae..1c7359cc195 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -330,7 +330,8 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_ui_text(prop, "Materials", ""); - RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int"); /* anim */ rna_def_animdata_common(srna); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index d367ea92cf4..d5a950fc5bb 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1922,6 +1922,21 @@ static int pyrna_prop_collection_bool(BPy_PropertyRNA *self) return test; } + +#define PYRNA_PROP_COLLECTION_ABS_INDEX(ret_err) \ + /* notice getting the length of the collection is avoided unless negative \ + * index is used or to detect internal error with a valid index. \ + * This is done for faster lookups. */ \ + if(keynum < 0) { \ + keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \ + if(keynum_abs < 0) { \ + PyErr_Format(PyExc_IndexError, \ + "bpy_prop_collection[%d]: out of range.", keynum); \ + return ret_err; \ + } \ + } \ + + /* internal use only */ static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum) { @@ -1930,17 +1945,7 @@ static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_s PYRNA_PROP_CHECK_OBJ(self) - /* notice getting the length of the collection is avoided unless negative index is used - * or to detect internal error with a valid index. - * This is done for faster lookups. */ - if(keynum < 0) { - keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); - - if(keynum_abs < 0) { - PyErr_Format(PyExc_IndexError, "bpy_prop_collection[%d]: out of range.", keynum); - return NULL; - } - } + PYRNA_PROP_COLLECTION_ABS_INDEX(NULL); if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum_abs, &newptr)) { return pyrna_struct_CreatePyObject(&newptr); @@ -1963,6 +1968,28 @@ static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_s } } +/* values type must have been already checked */ +static int pyrna_prop_collection_ass_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum, PyObject *value) +{ + Py_ssize_t keynum_abs= keynum; + const PointerRNA *ptr= (value == Py_None) ? (&PointerRNA_NULL) : &((BPy_StructRNA *)value)->ptr; + + PYRNA_PROP_CHECK_INT(self) + + PYRNA_PROP_COLLECTION_ABS_INDEX(-1); + + if(RNA_property_collection_assign_int(&self->ptr, self->prop, keynum_abs, ptr) == 0) { + + PyErr_Format(PyExc_IndexError, + "bpy_prop_collection[index] = value: " + "failed assignment (unknown reason)", keynum); + + return -1; + } + + return 0; +} + static PyObject *pyrna_prop_array_subscript_int(BPy_PropertyArrayRNA *self, int keynum) { int len; @@ -2173,6 +2200,128 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject } } +/* generic check to see if a PyObject is compatible with a collection + * -1 on failier, 0 on success, sets the error */ +static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *value) +{ + StructRNA *prop_srna; + + if(value == Py_None) { + if (RNA_property_flag(self->prop) & PROP_NEVER_NULL) { + PyErr_Format(PyExc_TypeError, + "bpy_prop_collection[key] = value: invalid, " + "this collection doesnt support None assignment"); + return -1; + } + else { + return 0; /* None is OK */ + } + } + else if (BPy_StructRNA_Check(value) == 0) { + PyErr_Format(PyExc_TypeError, + "bpy_prop_collection[key] = value: invalid, " + "expected a StructRNA type or None, not a %.200s", + Py_TYPE(value)->tp_name); + return -1; + } + else if((prop_srna= RNA_property_pointer_type(&self->ptr, self->prop))) { + StructRNA *value_srna= ((BPy_StructRNA *)value)->ptr.type; + if (RNA_struct_is_a(value_srna, prop_srna) == 0) { + PyErr_Format(PyExc_TypeError, + "bpy_prop_collection[key] = value: invalid, " + "expected a '%.200s' type or None, not a '%.200s'", + RNA_struct_identifier(prop_srna), + RNA_struct_identifier(value_srna) + ); + return -1; + } + else { + return 0; /* OK, this is the correct type!*/ + } + } + + PyErr_Format(PyExc_TypeError, + "bpy_prop_collection[key] = value: internal error, " + "failed to get the collection type"); + return -1; +} + +/* note: currently this is a copy of 'pyrna_prop_collection_subscript' with + * large blocks commented, we may support slice/key indicies later */ +static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value) +{ + PYRNA_PROP_CHECK_INT(self); + + /* validate the assigned value */ + if(value == NULL) { + PyErr_SetString(PyExc_TypeError, + "del bpy_prop_collection[key]: not supported"); + return -1; + } + else if (pyrna_prop_collection_type_check(self, value) == -1) { + return -1; /* exception is set */ + } + +#if 0 + if (PyUnicode_Check(key)) { + return pyrna_prop_collection_subscript_str(self, _PyUnicode_AsString(key)); + } + else +#endif + if (PyIndex_Check(key)) { + Py_ssize_t i= PyNumber_AsSsize_t(key, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + + return pyrna_prop_collection_ass_subscript_int(self, i, value); + } +#if 0 /* TODO, fake slice assignment */ + else if (PySlice_Check(key)) { + PySliceObject *key_slice= (PySliceObject *)key; + Py_ssize_t step= 1; + + if(key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) { + return NULL; + } + else if (step != 1) { + PyErr_SetString(PyExc_TypeError, "bpy_prop_collection[slice]: slice steps not supported"); + return NULL; + } + else if(key_slice->start == Py_None && key_slice->stop == Py_None) { + return pyrna_prop_collection_subscript_slice(self, 0, PY_SSIZE_T_MAX); + } + else { + Py_ssize_t start= 0, stop= PY_SSIZE_T_MAX; + + /* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */ + if(key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL; + if(key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL; + + if(start < 0 || stop < 0) { + /* only get the length for negative values */ + Py_ssize_t len= (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop); + if(start < 0) start += len; + if(stop < 0) start += len; + } + + if (stop - start <= 0) { + return PyList_New(0); + } + else { + return pyrna_prop_collection_subscript_slice(self, start, stop); + } + } + } +#endif + else { + PyErr_Format(PyExc_TypeError, + "bpy_prop_collection[key]: invalid key, " + "must be a string or an int, not %.200s", + Py_TYPE(key)->tp_name); + return -1; + } +} + static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject *key) { PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self) @@ -2409,7 +2558,7 @@ static PyMappingMethods pyrna_prop_array_as_mapping= { static PyMappingMethods pyrna_prop_collection_as_mapping= { (lenfunc) pyrna_prop_collection_length, /* mp_length */ (binaryfunc) pyrna_prop_collection_subscript, /* mp_subscript */ - (objobjargproc) NULL, /* mp_ass_subscript */ + (objobjargproc) pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */ }; /* only for fast bool's, large structs, assign nb_bool on init */ @@ -2505,7 +2654,7 @@ static PySequenceMethods pyrna_prop_collection_as_sequence= { NULL, /* sq_repeat */ (ssizeargfunc)pyrna_prop_collection_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */ NULL, /* *was* sq_slice */ - NULL, /* sq_ass_item */ + (ssizeobjargproc)/* pyrna_prop_collection_ass_subscript_int */ NULL /* let mapping take this one */, /* sq_ass_item */ NULL, /* *was* sq_ass_slice */ (objobjproc)pyrna_prop_collection_contains, /* sq_contains */ (binaryfunc) NULL, /* sq_inplace_concat */ From 622e8ee363333dee5a80564ca1d13cbbbb6de3cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 18:29:40 +0000 Subject: [PATCH 014/113] cmake: sse flags were being defined in 2 different places --- CMakeLists.txt | 23 +++-------------------- build_files/cmake/macros.cmake | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c95509b0a08..1b65c888cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,7 +273,7 @@ if(WITH_PYTHON_MODULE) set(WITH_HEADLESS ON) endif() -TEST_SSE_SUPPORT() +TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG) # don't store paths to libs for portable distrobution if(WITH_INSTALL_PORTABLE) @@ -1128,34 +1128,17 @@ endif() # See TEST_SSE_SUPPORT() for how this is defined. if(WITH_RAYOPTIMIZATION) - if(CMAKE_COMPILER_IS_GNUCC) - set(_sse "-msse") - set(_sse2 "-msse2") - elseif(MSVC) - set(_sse "/arch:SSE") - set(_sse2 "/arch:SSE2") - elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") - set(_sse) # icc only has sse2 - set(_sse2 "-xSSE2") - else() - message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known") - set(_sse) - set(_sse2) - endif() - if(SUPPORT_SSE_BUILD) - set(PLATFORM_CFLAGS " ${_sse} ${PLATFORM_CFLAGS}") + set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}") add_definitions(-D__SSE__ -D__MMX__) endif() if(SUPPORT_SSE2_BUILD) - set(PLATFORM_CFLAGS " ${_sse2} ${PLATFORM_CFLAGS}") + set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}") add_definitions(-D__SSE2__) if(NOT SUPPORT_SSE_BUILD) # dont double up add_definitions(-D__MMX__) endif() endif() - unset(_sse) - unset(_sse2) endif() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 709779dc3eb..52e48a0c1ca 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -325,18 +325,30 @@ macro(setup_liblinks endif() endmacro() -macro(TEST_SSE_SUPPORT) +macro(TEST_SSE_SUPPORT + _sse_flags + _sse2_flags) + include(CheckCSourceRuns) # message(STATUS "Detecting SSE support") - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_REQUIRED_FLAGS "-msse -msse2") + if(CMAKE_COMPILER_IS_GNUCC) + set(${_sse_flags} "-msse") + set(${_sse2_flags} "-msse2") elseif(MSVC) - set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ? + set(${_sse_flags} "/arch:SSE") + set(${_sse2_flags} "/arch:SSE2") elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") - set(CMAKE_REQUIRED_FLAGS "-xSSE2") + set(${_sse_flags}) # icc only has sse2 + set(${_sse2_flags} "-xSSE2") else() - message(STATUS "Compiler: '${CMAKE_C_COMPILER_ID}' has no SSE flags defiend for it!") + message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known") + set(_sse_flags) + set(_sse2_flags) + endif() + + if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_REQUIRED_FLAGS ${_sse_flags} ${_sse2_flags}) endif() if(NOT DEFINED ${SUPPORT_SSE_BUILD}) From 077fd134167d7ee73fb026b5b7dea21d31c0b28c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 19:52:33 +0000 Subject: [PATCH 015/113] cmake: - fix for cmake's SSE detection which would fail because of strict warnings and also had redundant cache setting. - was incorrectly initializing variables (own bad) - python was searching for libs on every run, now only do this if there not cached. --- CMakeLists.txt | 24 ++--- .../cmake/Modules/FindPythonLibsUnix.cmake | 102 +++++++++--------- build_files/cmake/macros.cmake | 23 ++-- source/blender/blenfont/CMakeLists.txt | 2 +- 4 files changed, 77 insertions(+), 74 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b65c888cfc..69d6bd5ae90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,7 +287,7 @@ endif() set(WITH_BINRELOC OFF) # MAXOSX only, set to avoid uninitialized -set(EXETYPE) +set(EXETYPE "") # C/C++ flags set(PLATFORM_CFLAGS) @@ -298,13 +298,13 @@ set(CXX_WARNINGS) # libraries to link the binary with passed to target_link_libraries() # known as LLIBS to scons -set(PLATFORM_LINKLIBS) +set(PLATFORM_LINKLIBS "") # Added to linker flags in setup_liblinks # - CMAKE_EXE_LINKER_FLAGS # - CMAKE_EXE_LINKER_FLAGS_DEBUG -set(PLATFORM_LINKFLAGS) -set(PLATFORM_LINKFLAGS_DEBUG) +set(PLATFORM_LINKFLAGS "") +set(PLATFORM_LINKFLAGS_DEBUG "") # disabled for now, not supported @@ -436,7 +436,7 @@ if(UNIX AND NOT APPLE) ) if(INTL_LIBRARY AND ICONV_LIBRARY) - set(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) + set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY}) endif() endif() @@ -645,9 +645,9 @@ elseif(WIN32) if(WITH_INTERNATIONAL) set(GETTEXT ${LIBDIR}/gettext) - set(GETTEXT_INC ${GETTEXT}/include) + set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include) set(GETTEXT_LIBPATH ${GETTEXT}/lib) - set(GETTEXT_LIB gnu_gettext) + set(GETTEXT_LIBRARIES gnu_gettext) endif() if(CMAKE_CL_64) @@ -745,7 +745,7 @@ elseif(WIN32) set(OPENEXR_INCUDE ${OPENEXR}/include${MSVC_INC}) set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCUDE} - ${OPENEXR_INCUDE}/IlmImf + ${OPENEXR_INCUDE}/IlmImf ${OPENEXR_INCUDE}/Iex ${OPENEXR_INCUDE}/Imath ) @@ -804,9 +804,9 @@ elseif(WIN32) if(WITH_INTERNATIONAL) set(GETTEXT ${LIBDIR}/gcc/gettext) - set(GETTEXT_INC ${GETTEXT}/include) + set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include) set(GETTEXT_LIBPATH ${GETTEXT}/lib) - set(GETTEXT_LIB intl) + set(GETTEXT_LIBRARIES intl) endif() set(JPEG_LIBRARIES libjpeg) @@ -956,8 +956,8 @@ elseif(APPLE) if(WITH_INTERNATIONAL) set(GETTEXT ${LIBDIR}/gettext) - set(GETTEXT_INC "${GETTEXT}/include") - set(GETTEXT_LIB intl iconv) + set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include") + set(GETTEXT_LIBRARIES intl iconv) set(GETTEXT_LIBPATH ${GETTEXT}/lib) endif() diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake index 882f1e2ea77..fd5d20920da 100644 --- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake +++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake @@ -34,67 +34,71 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "") SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR}) ENDIF() -IF(DEFINED PYTHON_VERSION) - SET(PYTHON_VERSION "${PYTHON_VERSION}" CACHE STRING "") -ELSE() - SET(PYTHON_VERSION 3.2 CACHE STRING "") -ENDIF() +SET(PYTHON_VERSION 3.2 CACHE STRING "Python Version (major and minor only)") MARK_AS_ADVANCED(PYTHON_VERSION) -SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic") + +# See: http://docs.python.org/extending/embedding.html#linking-requirements +# for why this is needed +SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python") MARK_AS_ADVANCED(PYTHON_LINKFLAGS) -SET(_python_ABI_FLAGS - "m;mu;u; " # release - "md;mud;ud;d" # debug -) -STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) +# only search for the dirs if we havn't already +IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY)) -SET(_python_SEARCH_DIRS - ${PYTHON_ROOT_DIR} - "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" - "/opt/py${_PYTHON_VERSION_NO_DOTS}" -) - -FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS}) - #IF(CMAKE_BUILD_TYPE STREQUAL Debug) - # SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}") - #ENDIF() - STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS}) - - FIND_PATH(PYTHON_INCLUDE_DIR - NAMES - Python.h - HINTS - ${_python_SEARCH_DIRS} - PATH_SUFFIXES - include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS} + SET(_python_ABI_FLAGS + "m;mu;u; " # release + "md;mud;ud;d" # debug ) - FIND_LIBRARY(PYTHON_LIBRARY - NAMES - "python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}" - HINTS - ${_python_SEARCH_DIRS} - PATH_SUFFIXES - lib64 lib + STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) + + SET(_python_SEARCH_DIRS + ${PYTHON_ROOT_DIR} + "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" + "/opt/py${_PYTHON_VERSION_NO_DOTS}" ) - IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) - break() - ELSE() - # ensure we dont find values from 2 different ABI versions - UNSET(PYTHON_INCLUDE_DIR CACHE) - UNSET(PYTHON_LIBRARY CACHE) - ENDIF() -ENDFOREACH() + FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS}) + #IF(CMAKE_BUILD_TYPE STREQUAL Debug) + # SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}") + #ENDIF() + STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS}) -UNSET(_CURRENT_ABI_FLAGS) -UNSET(_CURRENT_PATH) + FIND_PATH(PYTHON_INCLUDE_DIR + NAMES + Python.h + HINTS + ${_python_SEARCH_DIRS} + PATH_SUFFIXES + include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS} + ) -UNSET(_python_ABI_FLAGS) -UNSET(_python_SEARCH_DIRS) + FIND_LIBRARY(PYTHON_LIBRARY + NAMES + "python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}" + HINTS + ${_python_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib + ) + + IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR) + break() + ELSE() + # ensure we dont find values from 2 different ABI versions + UNSET(PYTHON_INCLUDE_DIR CACHE) + UNSET(PYTHON_LIBRARY CACHE) + ENDIF() + ENDFOREACH() + + UNSET(_CURRENT_ABI_FLAGS) + UNSET(_CURRENT_PATH) + + UNSET(_python_ABI_FLAGS) + UNSET(_python_SEARCH_DIRS) +ENDIF() # handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF # all listed variables are TRUE diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 52e48a0c1ca..64f46db3ed6 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -235,7 +235,7 @@ macro(setup_liblinks endif() if(WITH_INTERNATIONAL) - target_link_libraries(${target} ${GETTEXT_LIB}) + target_link_libraries(${target} ${GETTEXT_LIBRARIES}) if(WIN32 AND NOT UNIX) target_link_libraries(${target} ${ICONV_LIBRARIES}) @@ -343,18 +343,17 @@ macro(TEST_SSE_SUPPORT set(${_sse2_flags} "-xSSE2") else() message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known") - set(_sse_flags) - set(_sse2_flags) + set(${_sse_flags}) + set(${_sse2_flags}) endif() - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_REQUIRED_FLAGS ${_sse_flags} ${_sse2_flags}) - endif() + set(CMAKE_REQUIRED_FLAGS "${${_sse_flags}} ${${_sse2_flags}}") - if(NOT DEFINED ${SUPPORT_SSE_BUILD}) + if(NOT DEFINED SUPPORT_SSE_BUILD) + # result cached check_c_source_runs(" #include - int main() { __m128 v = _mm_setzero_ps(); return 0; }" + int main(void) { __m128 v = _mm_setzero_ps(); return 0; }" SUPPORT_SSE_BUILD) if(SUPPORT_SSE_BUILD) @@ -362,13 +361,13 @@ macro(TEST_SSE_SUPPORT else() message(STATUS "SSE Support: missing.") endif() - set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test") endif() - if(NOT DEFINED ${SUPPORT_SSE2_BUILD}) + if(NOT DEFINED SUPPORT_SSE2_BUILD) + # result cached check_c_source_runs(" #include - int main() { __m128d v = _mm_setzero_pd(); return 0; }" + int main(void) { __m128d v = _mm_setzero_pd(); return 0; }" SUPPORT_SSE2_BUILD) if(SUPPORT_SSE2_BUILD) @@ -376,9 +375,9 @@ macro(TEST_SSE_SUPPORT else() message(STATUS "SSE2 Support: missing.") endif() - set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test") endif() + unset(CMAKE_REQUIRED_FLAGS) endmacro() # when we have warnings as errors applied globally this diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index 838a36d9fe2..49323ec658f 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -53,7 +53,7 @@ set(SRC if(WITH_INTERNATIONAL) list(APPEND INC_SYS - ${GETTEXT_INC} + ${GETTEXT_INCLUDE_DIRS} ) add_definitions(-DWITH_INTERNATIONAL) endif() From 91283853b27fd793b3bcaff58af0991288bba437 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 21:09:42 +0000 Subject: [PATCH 016/113] fix [#28786] Large enum lists display columns in inverted order (right to left) also cleared annoying intel c++ warnings. --- CMakeLists.txt | 4 ++++ source/blender/editors/interface/interface_regions.c | 9 ++++++++- source/blender/makesrna/intern/rna_ID.c | 2 +- source/blender/makesrna/intern/rna_internal.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69d6bd5ae90..d1070baad9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1293,6 +1293,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof) ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare) + # disable numbered, false positives + set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556") + set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556") + endif() # MSVC2010 fails to links C++ libs right diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c898ba983c7..d29e5975afb 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2308,7 +2308,6 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; - pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); @@ -2323,6 +2322,14 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut pup->popup= 1; pup->block->flag |= UI_BLOCK_NO_FLIP; } + else { + /* if this is an rna button then we can assume its an enum + * flipping enums is generally not good since the order can be + * important [#28786] */ + if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) { + pup->block->flag |= UI_BLOCK_NO_FLIP; + } + } if(str) { /* menu is created from a string */ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 3f8a310285e..ddd0fcc1007 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -314,7 +314,7 @@ static int rna_IDPArray_length(PointerRNA *ptr) return prop->len; } -int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, PointerRNA *assign_ptr) +int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) { ID *id= ptr->id.data; Material *mat_id= assign_ptr->id.data; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index aab74056ad9..4cd4a2f11f9 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -383,7 +383,7 @@ struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index); -int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, struct PointerRNA *assign_ptr); +int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr); #endif /* RNA_INTERNAL_H */ From 90b38eaa0c05754ef8bab20b6bdc906dd506fa6c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 2 Oct 2011 08:46:46 +0000 Subject: [PATCH 017/113] Minor: Other UI strings typos and tweaks. Also updated french po & mo. --- source/blender/editors/object/object_vgroup.c | 41 ++++++++++++------- source/blender/makesrna/intern/rna_ui.c | 4 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 49205318fd4..7b4db347315 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -892,7 +892,8 @@ static float distance(float* a, float *b, int length) compute the amount of vertical distance relative to the plane and store it in dists, then get the horizontal and vertical change and store them in changes */ -static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, float *end, float (*changes)[2], float *dists, int index) +static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, + float *end, float (*changes)[2], float *dists, int index) { // A=Q-((Q-P).N)N // D = (a*x0 + b*y0 +c*z0 +d) @@ -930,15 +931,17 @@ static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob) return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); } -/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to distToBe distance away from the provided plane -strength can change distToBe so that it moves towards distToBe by that percentage -cp changes how much the weights are adjusted to check the distance +/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to +distToBe distance away from the provided plane strength can change distToBe so that it moves +towards distToBe by that percentage cp changes how much the weights are adjusted +to check the distance index is the index of the vertex being moved norm and d are the plane's properties for the equation: ax + by + cz + d = 0 coord is a point on the plane */ -static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], float coord[3], float d, float distToBe, float strength, float cp) +static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], + float coord[3], float d, float distToBe, float strength, float cp) { DerivedMesh *dm; MDeformWeight *dw; @@ -1094,7 +1097,8 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in dm_deform_clear(dm, ob); dm = NULL; } } - }while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) == (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe)); + } while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) == + (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe)); MEM_freeN(upDown); MEM_freeN(changes); MEM_freeN(dists); @@ -2319,7 +2323,8 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others"); + RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", + "Keep the values of the active group while normalizing others"); } static int vertex_group_fix_exec(bContext *C, wmOperator *op) @@ -2357,7 +2362,8 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) /* identifiers */ ot->name= "Fix Vertex Group Deform"; ot->idname= "OBJECT_OT_vertex_group_fix"; - ot->description= "Modify the position of selected vertices by changing only their respective groups' weights (this tool may be slow for many vertices)"; + ot->description= "Modify the position of selected vertices by changing only their respective " + "groups' weights (this tool may be slow for many vertices)"; /* api callbacks */ ot->poll= vertex_group_poll; @@ -2366,8 +2372,10 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to", -10.0f, 10.0f); - RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength", "The distance moved can be changed by this multiplier", -2.0f, 2.0f); - RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", "Changes the amount weights are altered with each iteration: lower values are slower", 0.05f, 1.f); + RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength", + "The distance moved can be changed by this multiplier", -2.0f, 2.0f); + RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", + "Change the amount weights are altered with each iteration: lower values are slower", 0.05f, 1.f); } @@ -2425,8 +2433,10 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", "Add verts from groups that have zero weight before inverting"); - RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", "Remove verts from groups that have zero weight after inverting"); + RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", + "Add verts from groups that have zero weight before inverting"); + RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", + "Remove verts from groups that have zero weight after inverting"); } @@ -2515,7 +2525,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) /* identifiers */ ot->name= "Mirror Vertex Group"; ot->idname= "OBJECT_OT_vertex_group_mirror"; - ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, flipping when both sides are selected otherwise copy from unselected"; + ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, " + "flipping when both sides are selected otherwise copy from unselected"; /* api callbacks */ ot->poll= vertex_group_poll_edit; @@ -2587,7 +2598,9 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) CTX_DATA_END; if((change == 0 && fail == 0) || fail) { - BKE_reportf(op->reports, RPT_ERROR, "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies", change, fail); + BKE_reportf(op->reports, RPT_ERROR, + "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies", + change, fail); } return OPERATOR_FINISHED; diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 29357362ae2..2c2bc4704bf 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -781,9 +781,9 @@ static void rna_def_menu(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); RNA_def_property_ui_text(prop, "ID Name", "If this is set, the menu gets a custom ID, otherwise it takes the " - "name of the class used to define the panel. For example, if the " + "name of the class used to define the menu (for example, if the " "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the " - "script, then bl_idname = \"OBJECT_MT_hello\""); + "script, then bl_idname = \"OBJECT_MT_hello\")"); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); From a1d647e92cd7f51659f0bcb16fb05c1b30177b79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 12:21:24 +0000 Subject: [PATCH 018/113] remove some redundant checks and compiler warnings. --- source/blender/editors/transform/transform.c | 14 ++++++-------- source/blender/python/mathutils/mathutils.c | 11 ++++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c77f7620326..8699bc88645 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2611,8 +2611,8 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { copy_v3_v3(center, td->center); } else if (t->flag & T_EDIT) { - - if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) { + + if(t->settings->selectmode & SCE_SELECT_FACE) { copy_v3_v3(center, td->center); } else { @@ -2899,19 +2899,17 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short float vec[3], totmat[3][3], smat[3][3]; float eul[3], fmat[3][3], quat[4]; float *center = t->center; - + /* local constraint shouldn't alter center */ if (around == V3D_LOCAL) { if (t->flag & (T_OBJECT|T_POSE)) { center = td->center; } - else { - if(around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) { - center = td->center; - } + else if (t->settings->selectmode & SCE_SELECT_FACE) { + center = td->center; } } - + if (t->flag & T_POINTS) { mul_m3_m3m3(totmat, mat, td->mtx); mul_m3_m3m3(smat, td->smtx, totmat); diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index 50b75b09cb2..c6cbb04edd0 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -94,11 +94,12 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject * #if 1 /* approx 6x speedup for mathutils types */ int size; - if( (VectorObject_Check(value) && (size= ((VectorObject *)value)->size)) || - (EulerObject_Check(value) && (size= 3)) || - (QuaternionObject_Check(value) && (size= 4)) || - (ColorObject_Check(value) && (size= 3)) - ) { + if( (size= VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) || + (size= EulerObject_Check(value) ? 3 : 0) || + (size= QuaternionObject_Check(value) ? 4 : 0) || + (size= ColorObject_Check(value) ? 3 : 0)) + { + printf("siez %d\n", size); if(BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } From acac22f3f2c1e1cd0c1df55472a41b68a6b819e5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 12:34:41 +0000 Subject: [PATCH 019/113] enable cmake building makesdna with ghash --- source/blender/makesdna/intern/CMakeLists.txt | 2 +- source/blender/python/mathutils/mathutils.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 5edebfe3903..e9fd2b2baa2 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -27,7 +27,7 @@ # message(STATUS "Configuring makesdna") -# add_definitions(-DWITH_DNA_GHASH) +add_definitions(-DWITH_DNA_GHASH) blender_include_dirs( ../../../../intern/guardedalloc diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index c6cbb04edd0..9adeae9dc29 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -99,7 +99,6 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject * (size= QuaternionObject_Check(value) ? 4 : 0) || (size= ColorObject_Check(value) ? 3 : 0)) { - printf("siez %d\n", size); if(BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } From 6ad5e2ef1f69b4235538051f4702f6faa418fe43 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 2 Oct 2011 12:57:49 +0000 Subject: [PATCH 020/113] =?UTF-8?q?Fix=20[#28436]=20ID=20mask=20creates=20?= =?UTF-8?q?'feather'=20around=20ID=20even=20with=20AA=20turned=20off.=20Pe?= =?UTF-8?q?rhaps=20not=20the=20ideal=20solution,=20but=20it=20works,=20is?= =?UTF-8?q?=20easy=20to=20undo=20if/when=20we=20have=20a=20better=20one,?= =?UTF-8?q?=20and=20I=E2=80=99m=20pretty=20sure=20it=20won=E2=80=99t=20bre?= =?UTF-8?q?ak=20anything...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/blender/editors/space_node/drawnode.c | 1 + source/blender/makesrna/intern/rna_nodetree.c | 5 +++++ source/blender/nodes/composite/nodes/node_composite_idMask.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 970eccb8be3..219aa3261c7 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1538,6 +1538,7 @@ static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), Poi static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "index", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE); } static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 1b113620663..23a71b20c32 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1874,6 +1874,11 @@ static void def_cmp_id_mask(StructRNA *srna) RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "smooth_mask", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "custom2", 0); + RNA_def_property_ui_text(prop, "Smooth Mask", "Apply an anti-aliasing filter to the mask"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } static void def_cmp_map_uv(StructRNA *srna) diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c index 43f78a90add..ddab415b3be 100644 --- a/source/blender/nodes/composite/nodes/node_composite_idMask.c +++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c @@ -99,7 +99,7 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in, stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */; - if(rd->scemode & R_FULL_SAMPLE) + if((rd->scemode & R_FULL_SAMPLE) || node->custom2 == 0) do_idmask_fsa(stackbuf, cbuf, (float)node->custom1); else do_idmask(stackbuf, cbuf, (float)node->custom1); From c664275386b6e2cf202ebfe59fbd14871ea026ac Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 2 Oct 2011 14:41:13 +0000 Subject: [PATCH 021/113] * 2.60 release cycle, moving on to bcon4, only bugfixes! --- source/blender/blenkernel/BKE_blender.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 0f674995294..f6910fede8e 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -53,7 +53,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE beta +#define BLENDER_VERSION_CYCLE rc struct ListBase; struct MemFile; From 71f772a0ed18daf3ea1729e4568a21320d2c1986 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 16:43:39 +0000 Subject: [PATCH 022/113] minor cmake edits: - osx was defaulting to -O3. - clang wasnt detecting sse compiler args. --- CMakeLists.txt | 8 ++++---- build_files/cmake/macros.cmake | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1070baad9f..24f5360f353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1105,11 +1105,11 @@ elseif(APPLE) set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g") set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g") if(CMAKE_OSX_ARCHITECTURES MATCHES "i386") - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller") - set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller") + set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller") elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller") - set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller") + set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller") else() set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing") set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 64f46db3ed6..fa815e12187 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -332,7 +332,7 @@ macro(TEST_SSE_SUPPORT include(CheckCSourceRuns) # message(STATUS "Detecting SSE support") - if(CMAKE_COMPILER_IS_GNUCC) + if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang")) set(${_sse_flags} "-msse") set(${_sse2_flags} "-msse2") elseif(MSVC) From 07ad83a4398473da1a5f32607f64cd6cdfaa72a3 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 2 Oct 2011 17:09:39 +0000 Subject: [PATCH 023/113] * Removing libsamplerate from build systems * Enabling OpenAL for scons win64-vc in default config; Nathan or Sergey: please update the build bot to build with OpenAL! --- CMakeLists.txt | 23 ------------------- .../buildbot/config/user-config-i686.py | 2 -- .../config/user-config-player-i686.py | 2 -- .../config/user-config-player-x86_64.py | 2 -- .../buildbot/config/user-config-x86_64.py | 2 -- .../cmake/config/blender_headless.cmake | 1 - build_files/cmake/config/blender_lite.cmake | 1 - build_files/cmake/config/bpy_module.cmake | 1 - build_files/cmake/macros.cmake | 6 ----- build_files/package_spec/debian/control | 2 +- build_files/package_spec/pacman/PKGBUILD | 2 +- build_files/scons/config/darwin-config.py | 5 ---- build_files/scons/config/freebsd7-config.py | 5 ---- build_files/scons/config/freebsd8-config.py | 5 ---- build_files/scons/config/freebsd9-config.py | 5 ---- build_files/scons/config/linux-config.py | 7 ------ build_files/scons/config/linuxcross-config.py | 5 ---- build_files/scons/config/openbsd3-config.py | 5 ---- build_files/scons/config/sunos5-config.py | 5 ---- .../scons/config/win32-mingw-config.py | 5 ---- build_files/scons/config/win32-vc-config.py | 5 ---- build_files/scons/config/win64-vc-config.py | 7 +----- build_files/scons/tools/Blender.py | 7 ------ build_files/scons/tools/btools.py | 8 ------- intern/audaspace/CMakeLists.txt | 14 ----------- intern/audaspace/SConscript | 5 +--- 26 files changed, 4 insertions(+), 133 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24f5360f353..405c8850504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,6 @@ option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org option(WITH_SDL "Enable SDL for sound and joystick support" ON) option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) -option(WITH_SAMPLERATE "Enable samplerate conversion" ON) # Compression option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON) @@ -447,13 +446,6 @@ if(UNIX AND NOT APPLE) endif() endif() - if(WITH_SAMPLERATE) - find_package(Samplerate) - if(NOT SAMPLERATE_FOUND) - set(WITH_SAMPLERATE OFF) - endif() - endif() - if(WITH_OPENCOLLADA) find_package(OpenCOLLADA) if(OPENCOLLADA_FOUND) @@ -565,13 +557,6 @@ elseif(WIN32) set(ICONV_LIBPATH ${ICONV}/lib) endif() - if(WITH_SAMPLERATE) - set(SAMPLERATE ${LIBDIR}/samplerate) - set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include) - set(SAMPLERATE_LIBRARIES libsamplerate) - set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib) - endif() - set(PNG "${LIBDIR}/png") set(PNG_INCLUDE_DIR "${PNG}/include") set(PNG_LIBPATH ${PNG}/lib) # not cmake defined @@ -995,13 +980,6 @@ elseif(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS") endif() - if(WITH_SAMPLERATE) - set(SAMPLERATE ${LIBDIR}/samplerate) - set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include) - set(SAMPLERATE_LIBRARIES samplerate) - set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib) - endif() - find_library(SYSTEMSTUBS_LIBRARY NAMES SystemStubs @@ -1436,7 +1414,6 @@ if(FIRST_RUN) info_cfg_option(WITH_JACK) info_cfg_option(WITH_CODEC_FFMPEG) info_cfg_option(WITH_CODEC_SNDFILE) - info_cfg_option(WITH_SAMPLERATE) info_cfg_text("Compression:") info_cfg_option(WITH_LZMA) diff --git a/build_files/buildbot/config/user-config-i686.py b/build_files/buildbot/config/user-config-i686.py index facbf493a23..5d337a0db68 100644 --- a/build_files/buildbot/config/user-config-i686.py +++ b/build_files/buildbot/config/user-config-i686.py @@ -58,8 +58,6 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32' -WITH_BF_STATICLIBSAMPLERATE = True - WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' diff --git a/build_files/buildbot/config/user-config-player-i686.py b/build_files/buildbot/config/user-config-player-i686.py index d02779e63e5..7c07240caa5 100644 --- a/build_files/buildbot/config/user-config-player-i686.py +++ b/build_files/buildbot/config/user-config-player-i686.py @@ -52,8 +52,6 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32' -WITH_BF_STATICLIBSAMPLERATE = True - WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' diff --git a/build_files/buildbot/config/user-config-player-x86_64.py b/build_files/buildbot/config/user-config-player-x86_64.py index 810dcb895de..0df2a24f603 100644 --- a/build_files/buildbot/config/user-config-player-x86_64.py +++ b/build_files/buildbot/config/user-config-player-x86_64.py @@ -52,8 +52,6 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64' -WITH_BF_STATICLIBSAMPLERATE = True - WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' diff --git a/build_files/buildbot/config/user-config-x86_64.py b/build_files/buildbot/config/user-config-x86_64.py index 536f8f9e6c1..9fb9fbd56fa 100644 --- a/build_files/buildbot/config/user-config-x86_64.py +++ b/build_files/buildbot/config/user-config-x86_64.py @@ -58,8 +58,6 @@ WITH_BF_PNG = True BF_PNG_LIB = 'libpng' BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64' -WITH_BF_STATICLIBSAMPLERATE = True - WITH_BF_ZLIB = True WITH_BF_STATICZLIB = True BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' diff --git a/build_files/cmake/config/blender_headless.cmake b/build_files/cmake/config/blender_headless.cmake index bd69eed30dd..c4d64125744 100644 --- a/build_files/cmake/config/blender_headless.cmake +++ b/build_files/cmake/config/blender_headless.cmake @@ -11,7 +11,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL) # disable audio, its possible some devs may want this but for now disable # so the python module doesnt hold the audio device and loads quickly. set(WITH_AUDASPACE OFF CACHE FORCE BOOL) -set(WITH_SAMPLERATE OFF CACHE FORCE BOOL) set(WITH_FFTW3 OFF CACHE FORCE BOOL) set(WITH_JACK OFF CACHE FORCE BOOL) set(WITH_SDL OFF CACHE FORCE BOOL) diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake index f09a8058f14..6791028a888 100644 --- a/build_files/cmake/config/blender_lite.cmake +++ b/build_files/cmake/config/blender_lite.cmake @@ -38,6 +38,5 @@ set(WITH_OPENCOLLADA OFF CACHE FORCE BOOL) set(WITH_OPENMP OFF CACHE FORCE BOOL) set(WITH_PYTHON_INSTALL OFF CACHE FORCE BOOL) set(WITH_RAYOPTIMIZATION OFF CACHE FORCE BOOL) -set(WITH_SAMPLERATE OFF CACHE FORCE BOOL) set(WITH_SDL OFF CACHE FORCE BOOL) set(WITH_X11_XINPUT OFF CACHE FORCE BOOL) diff --git a/build_files/cmake/config/bpy_module.cmake b/build_files/cmake/config/bpy_module.cmake index 5392705f0dc..6279f06214f 100644 --- a/build_files/cmake/config/bpy_module.cmake +++ b/build_files/cmake/config/bpy_module.cmake @@ -18,7 +18,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL) # disable audio, its possible some devs may want this but for now disable # so the python module doesnt hold the audio device and loads quickly. set(WITH_AUDASPACE OFF CACHE FORCE BOOL) -set(WITH_SAMPLERATE OFF CACHE FORCE BOOL) set(WITH_FFTW3 OFF CACHE FORCE BOOL) set(WITH_JACK OFF CACHE FORCE BOOL) set(WITH_SDL OFF CACHE FORCE BOOL) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index fa815e12187..ac77872da83 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -181,9 +181,6 @@ macro(SETUP_LIBDIRS) if(WITH_CODEC_SNDFILE) link_directories(${SNDFILE_LIBPATH}) endif() - if(WITH_SAMPLERATE) - link_directories(${SAMPLERATE_LIBPATH}) - endif() if(WITH_FFTW3) link_directories(${FFTW3_LIBPATH}) endif() @@ -254,9 +251,6 @@ macro(setup_liblinks if(WITH_CODEC_SNDFILE) target_link_libraries(${target} ${SNDFILE_LIBRARIES}) endif() - if(WITH_SAMPLERATE) - target_link_libraries(${target} ${SAMPLERATE_LIBRARIES}) - endif() if(WITH_SDL) target_link_libraries(${target} ${SDL_LIBRARY}) endif() diff --git a/build_files/package_spec/debian/control b/build_files/package_spec/debian/control index be703e05071..addd71760d8 100644 --- a/build_files/package_spec/debian/control +++ b/build_files/package_spec/debian/control @@ -2,7 +2,7 @@ Source: blender Section: graphics Priority: extra Maintainer: Dan Eicher -Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsamplerate0-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev +Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev Standards-Version: 3.9.1 Homepage: http://blender.org/ X-Python3-Version: >= 3.2, << 3.3 diff --git a/build_files/package_spec/pacman/PKGBUILD b/build_files/package_spec/pacman/PKGBUILD index 0c4164b1242..f7dbf1782ce 100644 --- a/build_files/package_spec/pacman/PKGBUILD +++ b/build_files/package_spec/pacman/PKGBUILD @@ -25,7 +25,7 @@ arch=('i686' 'x86_64') url="www.blender.org" license=('GPL') groups=() -depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'libsamplerate' 'ffmpeg') +depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg') makedepends=('cmake' 'svn') optdepends=() provides=() diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 935827e7237..0c132041d82 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -148,11 +148,6 @@ BF_CXX = '/usr' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = LIBDIR + '/samplerate' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - # TODO - set proper paths here (add precompiled to lib/ ? ) WITH_BF_JACK = False BF_JACK = '/usr' diff --git a/build_files/scons/config/freebsd7-config.py b/build_files/scons/config/freebsd7-config.py index a73574abf67..fec7531b3c7 100644 --- a/build_files/scons/config/freebsd7-config.py +++ b/build_files/scons/config/freebsd7-config.py @@ -25,11 +25,6 @@ BF_CXX = '/usr/local' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = '/usr/local' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_JACK = True BF_JACK = '/usr/local' BF_JACK_INC = '${BF_JACK}/include/jack' diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py index dd7ab5f9ab9..eea89bf24ff 100644 --- a/build_files/scons/config/freebsd8-config.py +++ b/build_files/scons/config/freebsd8-config.py @@ -25,11 +25,6 @@ BF_CXX = '/usr/local' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = '/usr/local' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_JACK = True BF_JACK = '/usr/local' BF_JACK_INC = '${BF_JACK}/include/jack' diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py index 9c53d52ce71..a63da6e35f9 100644 --- a/build_files/scons/config/freebsd9-config.py +++ b/build_files/scons/config/freebsd9-config.py @@ -25,11 +25,6 @@ BF_CXX = '/usr/local' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = '/usr/local' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_JACK = True BF_JACK = '/usr/local' BF_JACK_INC = '${BF_JACK}/include/jack' diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index c6613ec0ac1..a26748cd8dc 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -23,13 +23,6 @@ BF_CXX = '/usr' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = '/usr' -WITH_BF_STATICLIBSAMPLERATE = False -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' -BF_LIBSAMPLERATE_LIB_STATIC = '${BF_LIBSAMPLERATE}/lib/libsamplerate.a' - WITH_BF_JACK = False BF_JACK = '/usr' BF_JACK_INC = '${BF_JACK}/include/jack' diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py index 8057d478c31..070e18a5af0 100644 --- a/build_files/scons/config/linuxcross-config.py +++ b/build_files/scons/config/linuxcross-config.py @@ -23,11 +23,6 @@ BF_CXX = '/usr' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = LIBDIR + '/samplerate' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' BF_SDL_INC = '${BF_SDL}/include' diff --git a/build_files/scons/config/openbsd3-config.py b/build_files/scons/config/openbsd3-config.py index 67d850ff48d..83c515d52f3 100644 --- a/build_files/scons/config/openbsd3-config.py +++ b/build_files/scons/config/openbsd3-config.py @@ -16,11 +16,6 @@ WITH_BF_OPENAL = False #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' #BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' -BF_LIBSAMPLERATE = '/usr/local' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_SDL = True BF_SDL = '/usr/local' #$(shell sdl-config --prefix) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) diff --git a/build_files/scons/config/sunos5-config.py b/build_files/scons/config/sunos5-config.py index 828e286efee..0cf78c9220f 100644 --- a/build_files/scons/config/sunos5-config.py +++ b/build_files/scons/config/sunos5-config.py @@ -22,11 +22,6 @@ BF_CXX = '/usr' WITH_BF_STATICCXX = False BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' -BF_LIBSAMPLERATE = '/usr/local' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'samplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_SDL = True BF_SDL = '/usr/local' #$(shell sdl-config --prefix) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py index 37d693db560..167ed502bf6 100644 --- a/build_files/scons/config/win32-mingw-config.py +++ b/build_files/scons/config/win32-mingw-config.py @@ -23,11 +23,6 @@ BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib' BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include' BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll' -BF_LIBSAMPLERATE = LIBDIR + '/samplerate' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'libsamplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_JACK = False BF_JACK = LIBDIR + '/jack' BF_JACK_INC = '${BF_JACK}/include' diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 2950ca9380f..42bf63ed073 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -29,11 +29,6 @@ BF_ICONV_INC = '${BF_ICONV}/include' BF_ICONV_LIB = 'iconv' BF_ICONV_LIBPATH = '${BF_ICONV}/lib' -BF_LIBSAMPLERATE = LIBDIR + '/samplerate' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'libsamplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_JACK = False BF_JACK = LIBDIR + '/jack' BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc' diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 280ba3dd3f1..69f1e78e3a7 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -17,7 +17,7 @@ BF_PYTHON_LIB = 'python32' BF_PYTHON_DLL = '${BF_PYTHON_LIB}' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' -WITH_BF_OPENAL = False +WITH_BF_OPENAL = True BF_OPENAL = LIBDIR + '/openal' BF_OPENAL_INC = '${BF_OPENAL}/include ' BF_OPENAL_LIB = 'wrap_oal' @@ -40,11 +40,6 @@ BF_ICONV_INC = '${BF_ICONV}/include' BF_ICONV_LIB = 'iconv' BF_ICONV_LIBPATH = '${BF_ICONV}/lib' -BF_LIBSAMPLERATE = LIBDIR + '/samplerate' -BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include' -BF_LIBSAMPLERATE_LIB = 'libsamplerate' -BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib' - WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' BF_SDL_INC = '${BF_SDL}/include' diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 06c3f9d206e..0f8d710d3b5 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -131,7 +131,6 @@ def setup_staticlibs(lenv): lenv['BF_JPEG_LIBPATH'], lenv['BF_ZLIB_LIBPATH'], lenv['BF_PNG_LIBPATH'], - lenv['BF_LIBSAMPLERATE_LIBPATH'], lenv['BF_ICONV_LIBPATH'] ]) @@ -194,9 +193,6 @@ def setup_staticlibs(lenv): if lenv['OURPLATFORM'] == 'linuxcross': libincs += Split(lenv['BF_OPENMP_LIBPATH']) - if lenv['WITH_BF_STATICLIBSAMPLERATE']: - statlibs += Split(lenv['BF_LIBSAMPLERATE_LIB_STATIC']) - # setting this last so any overriding of manually libs could be handled if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): libincs.append('/usr/lib') @@ -270,9 +266,6 @@ def setup_syslibs(lenv): syslibs += Split(lenv['BF_OPENCOLLADA_LIB']) syslibs.append(lenv['BF_EXPAT_LIB']) - if not lenv['WITH_BF_STATICLIBSAMPLERATE']: - syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB']) - if lenv['WITH_BF_JEMALLOC']: if not lenv['WITH_BF_STATICJEMALLOC']: syslibs += Split(lenv['BF_JEMALLOC_LIB']) diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index caa83ea41be..fe56d40ea56 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -99,7 +99,6 @@ def validate_arguments(args, bc): 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC', 'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', - 'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_STATICLIBSAMPLERATE', 'BF_LIBSAMPLERATE_LIB_STATIC', 'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC', 'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH', @@ -267,13 +266,6 @@ def read_opts(env, cfg, args): ('BF_SDL_LIB', 'SDL library', ''), ('BF_SDL_LIBPATH', 'SDL library path', ''), - ('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''), - ('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''), - ('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''), - ('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''), - ('BF_LIBSAMPLERATE_LIB_STATIC', 'Path to libsamplerate static library', ''), - (BoolVariable('WITH_BF_STATICLIBSAMPLERATE', 'Staticly link to libsamplerate', False)), - (BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)), ('BF_JACK', 'jack base path', ''), ('BF_JACK_INC', 'jack include path', ''), diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index b7571adf3d5..cc30e6685f0 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -262,20 +262,6 @@ if(WITH_CODEC_SNDFILE) ) endif() -if(WITH_SAMPLERATE) - add_definitions(-DWITH_SAMPLERATE) - list(APPEND INC_SYS - ${SAMPLERATE_INCLUDE_DIRS} - ) - list(APPEND SRC - SRC/AUD_SRCResampleFactory.cpp - SRC/AUD_SRCResampleReader.cpp - - SRC/AUD_SRCResampleFactory.h - SRC/AUD_SRCResampleReader.h - ) -endif() - if(WITH_FFTW3 AND FALSE) add_definitions(-DWITH_FFTW3) list(APPEND INC diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index 67f859b0e5f..acf7b839f79 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp') -incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] + ' ' + env['BF_LIBSAMPLERATE_INC'] +ncs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] defs = [] if env['WITH_BF_FFMPEG']: @@ -44,7 +44,4 @@ if env['WITH_BF_PYTHON']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -# not optional with scons yet -defs.append('WITH_SAMPLERATE') - env.BlenderLib ('bf_intern_audaspace', sources, Split(incs), defs, libtype=['intern','player'], priority = [25,215] ) From da73642ed1415e4547d485cbfea42672c9da0695 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 17:16:28 +0000 Subject: [PATCH 024/113] remove find samplerate module, use -msse2 flag for intel c++ since its supported. --- .../cmake/Modules/FindSamplerate.cmake | 70 ------------------- build_files/cmake/macros.cmake | 4 +- 2 files changed, 2 insertions(+), 72 deletions(-) delete mode 100644 build_files/cmake/Modules/FindSamplerate.cmake diff --git a/build_files/cmake/Modules/FindSamplerate.cmake b/build_files/cmake/Modules/FindSamplerate.cmake deleted file mode 100644 index ea7a0d7a18c..00000000000 --- a/build_files/cmake/Modules/FindSamplerate.cmake +++ /dev/null @@ -1,70 +0,0 @@ -# - Find Samplerate library -# Find the native Samplerate includes and library -# This module defines -# SAMPLERATE_INCLUDE_DIRS, where to find samplerate.h, Set when -# SAMPLERATE_INCLUDE_DIR is found. -# SAMPLERATE_LIBRARIES, libraries to link against to use Samplerate. -# SAMPLERATE_ROOT_DIR, The base directory to search for Samplerate. -# This can also be an environment variable. -# SAMPLERATE_FOUND, If false, do not try to use Samplerate. -# -# also defined, but not for general use are -# SAMPLERATE_LIBRARY, where to find the Samplerate library. - -#============================================================================= -# Copyright 2011 Blender Foundation. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= - -# If SAMPLERATE_ROOT_DIR was defined in the environment, use it. -IF(NOT SAMPLERATE_ROOT_DIR AND NOT $ENV{SAMPLERATE_ROOT_DIR} STREQUAL "") - SET(SAMPLERATE_ROOT_DIR $ENV{SAMPLERATE_ROOT_DIR}) -ENDIF() - -SET(_samplerate_SEARCH_DIRS - ${SAMPLERATE_ROOT_DIR} - /usr/local - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave -) - -FIND_PATH(SAMPLERATE_INCLUDE_DIR - NAMES - samplerate.h - HINTS - ${_samplerate_SEARCH_DIRS} - PATH_SUFFIXES - include -) - -FIND_LIBRARY(SAMPLERATE_LIBRARY - NAMES - samplerate - HINTS - ${_samplerate_SEARCH_DIRS} - PATH_SUFFIXES - lib64 lib - ) - -# handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Samplerate DEFAULT_MSG - SAMPLERATE_LIBRARY SAMPLERATE_INCLUDE_DIR) - -IF(SAMPLERATE_FOUND) - SET(SAMPLERATE_LIBRARIES ${SAMPLERATE_LIBRARY}) - SET(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE_INCLUDE_DIR}) -ENDIF(SAMPLERATE_FOUND) - -MARK_AS_ADVANCED( - SAMPLERATE_INCLUDE_DIR - SAMPLERATE_LIBRARY -) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index ac77872da83..e4665124c8f 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -333,8 +333,8 @@ macro(TEST_SSE_SUPPORT set(${_sse_flags} "/arch:SSE") set(${_sse2_flags} "/arch:SSE2") elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") - set(${_sse_flags}) # icc only has sse2 - set(${_sse2_flags} "-xSSE2") + set(${_sse_flags} "") # icc defaults to -msse + set(${_sse2_flags} "-msse2") else() message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known") set(${_sse_flags}) From 1023ed4e4d62710357cafbbeb81ff55c4fdcebcc Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 2 Oct 2011 17:53:52 +0000 Subject: [PATCH 025/113] Make sure that default settings have OpenMP support by default (also good for buildbots). Note that builders that don't have VS pro version need to manually disable this setting in their respective user-config.py --- build_files/scons/config/win32-vc-config.py | 2 ++ build_files/scons/config/win64-vc-config.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 42bf63ed073..9604eb5d320 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -147,6 +147,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' WITH_BF_3DMOUSE = True +WITH_BF_OPENMP = True + #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE'] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 69f1e78e3a7..049b7eb5d40 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -151,6 +151,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib' WITH_BF_3DMOUSE = True +WITH_BF_OPENMP = True + #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2'] From 1714d1cfe2e932f1ab04467f611b8dbb377ead32 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 2 Oct 2011 17:58:21 +0000 Subject: [PATCH 026/113] Typo fix. nexYon commit caused bit-loss in the word incs. --- intern/audaspace/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index acf7b839f79..7ea82be39a5 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp') -ncs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] +incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] defs = [] if env['WITH_BF_FFMPEG']: From a4a09fc638e5a37a365fe24597393a4068da279d Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 2 Oct 2011 18:00:06 +0000 Subject: [PATCH 027/113] Fix for [#28792] Invalid 'aud' documentation examples. --- doc/python_api/examples/aud.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/python_api/examples/aud.py b/doc/python_api/examples/aud.py index e41e8214cc0..2c74d6a0eb1 100644 --- a/doc/python_api/examples/aud.py +++ b/doc/python_api/examples/aud.py @@ -11,10 +11,10 @@ device = aud.device() factory = aud.Factory('music.ogg') # play the audio, this return a handle to control play/pause -handle = device.play(sound) +handle = device.play(factory) # if the audio is not too big and will be used often you can buffer it -factory_buffered = aud.Factory.buffer(sound) -handle_buffered = device.play(buffered) +factory_buffered = aud.Factory.buffer(factory) +handle_buffered = device.play(factory_buffered) # stop the sounds (otherwise they play until their ends) handle.stop() From 4bafd13eaf67bb48487180b5e5c1214140f53ce5 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 2 Oct 2011 18:08:16 +0000 Subject: [PATCH 028/113] Missed some stoff when removing libsamplerate. --- intern/audaspace/CMakeLists.txt | 1 - intern/audaspace/SConscript | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index cc30e6685f0..e321673b07d 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -23,7 +23,6 @@ set(INC . FX - SRC intern ../ffmpeg ) diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index 7ea82be39a5..b8d5a56a625 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -2,8 +2,8 @@ Import ('env') -sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp') -incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] +sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') +incs = '. intern FX ' + env['BF_PTHREADS_INC'] defs = [] if env['WITH_BF_FFMPEG']: From ccb7a81d8684a376bfd872db307ca4bcde887a92 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 18:09:36 +0000 Subject: [PATCH 029/113] - fix for keymap test operator - cleanup pep8 warnings and unused py imports py pep8 cleanup --- po/clean_po.py | 16 ++++----- po/merge_po.py | 9 +++-- .../modules/bpy_extras/keyconfig_utils.py | 36 ++++++++++--------- .../bl_operators/screen_play_rendered_anim.py | 6 ++-- .../scripts/startup/bl_ui/space_userpref.py | 2 -- .../startup/bl_ui/space_userpref_keymap.py | 1 - 6 files changed, 34 insertions(+), 36 deletions(-) diff --git a/po/clean_po.py b/po/clean_po.py index 2cbd2cb33ac..685ec585ffd 100755 --- a/po/clean_po.py +++ b/po/clean_po.py @@ -133,12 +133,12 @@ def do_clean(po, pot_messages): if pot_messages.get(msgid): t = po_messages.get(msgid) if not t: - print(('Reusing full item from commented ' + \ - 'lines for msgid \'%s\'') % (msgid)) + print("Reusing full item from commented " + "lines for msgid '%s'" % msgid) po_messages[msgid] = commented_messages[msgid] elif not t['translation']: - print(('Reusing translation from commented ' + \ - 'lines for msgid \'%s\'') % (msgid)) + print("Reusing translation from commented " + "lines for msgid '%s'" % msgid) m = commented_messages[msgid] t['translation'] = m['translation'] t['translation_lines'] = m['translation_lines'] @@ -153,17 +153,17 @@ def do_clean(po, pot_messages): first = True for x in item['message_lines']: if first: - handle.write("msgid \"%s\"\n" % (x)) + handle.write("msgid \"%s\"\n" % x) else: - handle.write("\"%s\"\n" % (x)) + handle.write("\"%s\"\n" % x) first = False first = True for x in item['translation_lines']: if first: - handle.write("msgstr \"%s\"\n" % (x)) + handle.write("msgstr \"%s\"\n" % x) else: - handle.write("\"%s\"\n" % (x)) + handle.write("\"%s\"\n" % x) first = False handle.write("\n") diff --git a/po/merge_po.py b/po/merge_po.py index b4a1ffa399e..b0b29a3ac8e 100755 --- a/po/merge_po.py +++ b/po/merge_po.py @@ -23,7 +23,6 @@ # update the pot file according the POTFILES.in -import os import sys import collections @@ -145,17 +144,17 @@ def main(): first = True for x in item['message_lines']: if first: - handle.write("msgid \"%s\"\n" % (x)) + handle.write("msgid \"%s\"\n" % x) else: - handle.write("\"%s\"\n" % (x)) + handle.write("\"%s\"\n" % x) first = False first = True for x in item['translation_lines']: if first: - handle.write("msgstr \"%s\"\n" % (x)) + handle.write("msgstr \"%s\"\n" % x) else: - handle.write("\"%s\"\n" % (x)) + handle.write("\"%s\"\n" % x) first = False handle.write("\n") diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index e87db659918..78f010245a0 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -119,14 +119,17 @@ def keyconfig_merge(kc1, kc2): """ merged_keymaps = [(km, kc1) for km in kc1.keymaps] if kc1 != kc2: - merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps)) + merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not km_exists_in(km, merged_keymaps)) return merged_keymaps -def keyconfig_export(wm, kc, filepath): +def _export_properties(prefix, properties, lines=None): from bpy.types import OperatorProperties + if lines is None: + lines = [] + def string_value(value): if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int): result = repr(value) @@ -137,20 +140,19 @@ def keyconfig_export(wm, kc, filepath): return result - def export_properties(prefix, properties, lines=None): - if lines is None: - lines = [] + for pname in properties.bl_rna.properties.keys(): + if pname != "rna_type" and not properties.is_property_hidden(pname): + value = getattr(properties, pname) + if isinstance(value, OperatorProperties): + _export_properties(prefix + "." + pname, value, lines) + elif properties.is_property_set(pname): + value = string_value(value) + if value != "": + lines.append("%s.%s = %s\n" % (prefix, pname, value)) + return lines - for pname in properties.bl_rna.properties.keys(): - if pname != "rna_type" and not properties.is_property_hidden(pname): - value = getattr(properties, pname) - if isinstance(value, OperatorProperties): - export_properties(prefix + "." + pname, value, lines) - elif properties.is_property_set(pname): - value = string_value(value) - if value != "": - lines.append("%s.%s = %s\n" % (prefix, pname, value)) - return lines + +def keyconfig_export(wm, kc, filepath): f = open(filepath, "w") @@ -209,7 +211,7 @@ def keyconfig_export(wm, kc, filepath): props = kmi.properties if props is not None: - f.write("".join(export_properties("kmi.properties", props))) + f.write("".join(_export_properties("kmi.properties", props))) f.write("\n") @@ -246,7 +248,7 @@ def keyconfig_test(kc): props = kmi.properties if props is not None: - export_properties("kmi.properties", props, s) + _export_properties("kmi.properties", props, s) return "".join(s).strip() diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index 3c5bc68203f..3479a3f9e53 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -136,7 +136,8 @@ class PlayRenderedAnim(Operator): del process # ----------------------------------------------------------------- - opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), "-j", str(scene.frame_step), file] + opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), + "-j", str(scene.frame_step), file] cmd.extend(opts) elif preset == 'DJV': opts = [file, "-playback_speed", "%d" % int(rd.fps / rd.fps_base)] @@ -166,9 +167,8 @@ class PlayRenderedAnim(Operator): print("Executing command:\n %r" % " ".join(cmd)) try: - process = subprocess.Popen(cmd) + subprocess.Popen(cmd) except Exception as e: - import traceback self.report({'ERROR'}, "Couldn't run external animation player with command " "%r\n%s" % (" ".join(cmd), str(e))) diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 5670b912c7b..1ec6cc39164 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -22,8 +22,6 @@ from bpy.types import Header, Menu, Panel import os import addon_utils -from bpy.props import StringProperty, BoolProperty, EnumProperty - def ui_items_general(col, context): """ General UI Theme Settings (User Interface) diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 79b13e3bec0..25f955085f6 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -19,7 +19,6 @@ # import bpy from bpy.types import Menu, OperatorProperties -import os class USERPREF_MT_keyconfigs(Menu): From 74c681330f2da09cbc5e409ea4cc61426681c027 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 19:57:34 +0000 Subject: [PATCH 030/113] fix [#28788] Scale using "Individual origins" in bones works for rotate and scale --- source/blender/editors/transform/transform.c | 12 +++++++----- .../editors/transform/transform_conversions.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 8699bc88645..898785fd120 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2612,7 +2612,9 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { } else if (t->flag & T_EDIT) { - if(t->settings->selectmode & SCE_SELECT_FACE) { + if( (t->settings->selectmode & SCE_SELECT_FACE) || + (t->obedit && t->obedit->type == OB_ARMATURE)) + { copy_v3_v3(center, td->center); } else { @@ -2902,10 +2904,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* local constraint shouldn't alter center */ if (around == V3D_LOCAL) { - if (t->flag & (T_OBJECT|T_POSE)) { - center = td->center; - } - else if (t->settings->selectmode & SCE_SELECT_FACE) { + if ( (t->flag & (T_OBJECT|T_POSE)) || + (t->settings->selectmode & SCE_SELECT_FACE) || + (t->obedit && t->obedit->type == OB_ARMATURE)) + { center = td->center; } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c3a249d69bc..e37435a0cd5 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1194,7 +1194,7 @@ static void createTransArmatureVerts(TransInfo *t) if (ebo->flag & BONE_TIPSEL) { copy_v3_v3(td->iloc, ebo->tail); - copy_v3_v3(td->center, td->iloc); + copy_v3_v3(td->center, (t->around==V3D_LOCAL) ? ebo->head : td->iloc); td->loc= ebo->tail; td->flag= TD_SELECTED; if (ebo->flag & BONE_EDITMODE_LOCKED) From e49688f021dd7d19b46efb54f0cbe21aaf6f45ee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 20:09:45 +0000 Subject: [PATCH 031/113] use use_ prefix for boolean value. --- source/blender/editors/space_node/drawnode.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 219aa3261c7..5f443509801 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1538,7 +1538,7 @@ static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), Poi static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "index", 0, NULL, ICON_NONE); - uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "use_smooth_mask", 0, NULL, ICON_NONE); } static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 23a71b20c32..813375a3549 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1875,7 +1875,7 @@ static void def_cmp_id_mask(StructRNA *srna) RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "smooth_mask", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_smooth_mask", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom2", 0); RNA_def_property_ui_text(prop, "Smooth Mask", "Apply an anti-aliasing filter to the mask"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); From 4a0c3e2a12498c0769eabf9ee1dab30d01fe658d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 21:21:14 +0000 Subject: [PATCH 032/113] fix [#28784] CRASHER on load with load_post handler also fix pacman package build spec. --- build_files/package_spec/pacman/PKGBUILD | 2 +- source/blender/windowmanager/intern/wm_files.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build_files/package_spec/pacman/PKGBUILD b/build_files/package_spec/pacman/PKGBUILD index f7dbf1782ce..0f070f3d558 100644 --- a/build_files/package_spec/pacman/PKGBUILD +++ b/build_files/package_spec/pacman/PKGBUILD @@ -4,7 +4,7 @@ blender_srcdir=$(dirname $startdir)"/../.." # value may be formatted: 35042:35051M blender_revision=$(svnversion $blender_srcdir | cut -d: -f2 | awk '{print $3}') -blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}') +blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}') blender_version=$(expr $blender_version / 100).$(expr $blender_version % 100) # 256 -> 2.56 blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender.h) # blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 76ebeaa9f21..bf5b60d691f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -412,6 +412,10 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) BPY_app_handlers_reset(); BPY_modules_load_user(C); #endif + + /* important to do before NULL'ing the context */ + BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + CTX_wm_window_set(C, NULL); /* exits queues */ #if 0 /* gives popups on windows but not linux, bug in report API but disable for now to stop users getting annoyed */ @@ -429,8 +433,6 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) // XXX undo_editmode_clear(); BKE_reset_undo(); BKE_write_undo(C, "original"); /* save current state */ - - BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); } else if(retval == BKE_READ_EXOTIC_OK_OTHER) BKE_write_undo(C, "Import file"); From e42146c1ec01d8cbaf05d554ef08814901fc666d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 22:28:49 +0000 Subject: [PATCH 033/113] remove .Blanguages, its not used anymore --- SConstruct | 2 +- build_files/scons/tools/Blender.py | 2 -- release/bin/.blender/.Blanguages | 24 ------------------------ source/creator/CMakeLists.txt | 14 -------------- 4 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 release/bin/.blender/.Blanguages diff --git a/SConstruct b/SConstruct index 6de11d8fe4e..eacf18266f0 100644 --- a/SConstruct +++ b/SConstruct @@ -523,7 +523,7 @@ if env['OURPLATFORM']!='darwin': for f in df: # This files aren't used anymore - if f in ['.Blanguages', '.bfont.ttf']: + if f in (".bfont.ttf", ): continue if not env['WITH_BF_INTERNATIONAL']: diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 0f8d710d3b5..8e1bdcb1c62 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -565,8 +565,6 @@ def AppIt(target=None, source=None, env=None): commands.getoutput(cmd) cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) - cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) - commands.getoutput(cmd) cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) diff --git a/release/bin/.blender/.Blanguages b/release/bin/.blender/.Blanguages deleted file mode 100644 index 1a83c46039a..00000000000 --- a/release/bin/.blender/.Blanguages +++ /dev/null @@ -1,24 +0,0 @@ -English:en_US -Japanese:ja_JP -Dutch:nl_NL -Italian:it_IT -German:de_DE -Finnish:fi_FI -Swedish:sv_SE -French:fr_FR -Spanish:es_ES -Catalan:ca_ES -Czech:cs_CZ -Brazilian Portuguese:pt_BR -Simplified Chinese:zh_CN -Traditional Chinese:zh_TW -Russian:ru_RU -Croatian:hr_HR -Serbian:sr_RS -Ukrainian:uk_UA -Polish:pl_PL -Romanian:ro_RO -Arabic:ar_SA -Bulgarian:bg_BG -Greek:el_GR -Korean:ko_KR diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 86aebe47edc..d36bd3cd344 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -350,11 +350,6 @@ if(UNIX AND NOT APPLE) ) if(WITH_INTERNATIONAL) - install( - FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages - DESTINATION ${TARGETDIR_VER} - ) - install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale @@ -427,10 +422,6 @@ elseif(WIN32) ) if(WITH_INTERNATIONAL) # same as linux!, deduplicate - install( - FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages - DESTINATION ${TARGETDIR_VER} - ) install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale @@ -663,11 +654,6 @@ elseif(APPLE) # localization if(WITH_INTERNATIONAL) - install( - FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages - DESTINATION ${TARGETDIR_VER}/datafiles - ) - install( DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts From 447a60b7c461b0351bcb6a2c9976bb9099f85fe2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 23:23:45 +0000 Subject: [PATCH 034/113] svn merge -rHEAD:40523 doc/python_api/rst/change_log.rst revert changes for texface, will apply manually after. --- doc/python_api/rst/change_log.rst | 495 ------------------------------ 1 file changed, 495 deletions(-) diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst index b9c154bb9d0..e7db5df4a1f 100644 --- a/doc/python_api/rst/change_log.rst +++ b/doc/python_api/rst/change_log.rst @@ -909,498 +909,3 @@ Added * :class:`bpy.types.SceneGameData.use_glsl_color_management` -bpy.types.RenderSettings ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.RenderSettings.ffmpeg_audio_channels` - -bpy.types.DriverTarget ----------------------- - -Added -^^^^^ - -* :class:`bpy.types.DriverTarget.transform_space` - -Removed -^^^^^^^ - -* **use_local_space_transform** - -bpy.types.Sound ---------------- - -Added -^^^^^ - -* :class:`bpy.types.Sound.factory` -* :class:`bpy.types.Sound.mono` - -bpy.types.Scene ---------------- - -Added -^^^^^ - -* :class:`bpy.types.Scene.audio_volume` - -bpy.types.KeyingSet -------------------- - -Added -^^^^^ - -* :class:`bpy.types.KeyingSet.refresh` - -bpy.types.Armature ------------------- - -Added -^^^^^ - -* :class:`bpy.types.Armature.vert_deformer` - -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.create_obstacle` -* :class:`bpy.types.GameObjectSettings.obstacle_radius` - -bpy.types.BlendData -------------------- - -Added -^^^^^ - -* :class:`bpy.types.BlendData.speakers` - -bpy.types.SolidifyModifier --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.SolidifyModifier.thickness_vertex_group` - -bpy.types.ThemeGraphEditor --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ThemeGraphEditor.handle_auto_clamped` -* :class:`bpy.types.ThemeGraphEditor.handle_sel_auto_clamped` - -bpy.types.MultiresModifier --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.MultiresModifier.use_subsurf_uv` - -bpy.types.Node --------------- - -Added -^^^^^ - -* :class:`bpy.types.Node.parent` - -bpy.types.KeyMap ----------------- - -Removed -^^^^^^^ - -* **copy_to_user** - -Renamed -^^^^^^^ - -* **is_user_defined** -> :class:`bpy.types.KeyMap.is_user_modified` - -bpy.types.SceneRenderLayer --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.SceneRenderLayer.use_pass_material_index` - -bpy.types.Texture ------------------ - -Added -^^^^^ - -* :class:`bpy.types.Texture.evaluate` - -bpy.types.ToolSettings ----------------------- - -Added -^^^^^ - -* :class:`bpy.types.ToolSettings.use_multipaint` - -Renamed -^^^^^^^ - -* **use_snap_project_self** -> :class:`bpy.types.ToolSettings.use_snap_self` - -bpy.types.RenderEngine ----------------------- - -Added -^^^^^ - -* :class:`bpy.types.RenderEngine.report` - -bpy.types.UserPreferencesInput ------------------------------- - -Added -^^^^^ - -* :class:`bpy.types.UserPreferencesInput.ndof_fly_helicopter` -* :class:`bpy.types.UserPreferencesInput.ndof_lock_horizon` -* :class:`bpy.types.UserPreferencesInput.ndof_orbit_invert_axes` -* :class:`bpy.types.UserPreferencesInput.ndof_panx_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_pany_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_panz_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_roll_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_rotate_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_sensitivity` -* :class:`bpy.types.UserPreferencesInput.ndof_show_guide` -* :class:`bpy.types.UserPreferencesInput.ndof_tilt_invert_axis` -* :class:`bpy.types.UserPreferencesInput.ndof_zoom_invert` -* :class:`bpy.types.UserPreferencesInput.ndof_zoom_updown` - -Removed -^^^^^^^ - -* **edited_keymaps** -* **ndof_pan_speed** -* **ndof_rotate_speed** - -bpy.types.LockedTrackConstraint -------------------------------- - -Added -^^^^^ - -* :class:`bpy.types.LockedTrackConstraint.head_tail` - -bpy.types.SpaceGraphEditor --------------------------- - -Renamed -^^^^^^^ - -* **use_fancy_drawing** -> :class:`bpy.types.SpaceGraphEditor.use_beauty_drawing` - -bpy.types.Mesh --------------- - -Added -^^^^^ - -* :class:`bpy.types.Mesh.use_paint_mask_vertex` - -bpy.types.FCurve ----------------- - -Removed -^^^^^^^ - -* **use_auto_handle_clamp** - -bpy.types.DampedTrackConstraint -------------------------------- - -Added -^^^^^ - -* :class:`bpy.types.DampedTrackConstraint.head_tail` - -bpy.types.ImageTexture ----------------------- - -Added -^^^^^ - -* :class:`bpy.types.ImageTexture.use_derivative_map` - -bpy.types.SoundSequence ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SoundSequence.pan` -* :class:`bpy.types.SoundSequence.pitch` - -Removed -^^^^^^^ - -* **attenuation** - -bpy.types.FModifier -------------------- - -Added -^^^^^ - -* :class:`bpy.types.FModifier.blend_in` -* :class:`bpy.types.FModifier.blend_out` -* :class:`bpy.types.FModifier.frame_end` -* :class:`bpy.types.FModifier.frame_start` -* :class:`bpy.types.FModifier.influence` -* :class:`bpy.types.FModifier.use_influence` -* :class:`bpy.types.FModifier.use_restricted_range` - -bpy.types.EnvironmentMap ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.EnvironmentMap.clear` -* :class:`bpy.types.EnvironmentMap.is_valid` -* :class:`bpy.types.EnvironmentMap.save` - -bpy.types.IDMaterials ---------------------- - -Function Arguments -^^^^^^^^^^^^^^^^^^ - -* :class:`bpy.types.IDMaterials.save` (index, update_data), *was (index)* - -bpy.types.UserPreferencesSystem -------------------------------- - -Added -^^^^^ - -* :class:`bpy.types.UserPreferencesSystem.use_translate_interface` - -Removed -^^^^^^^ - -* **use_translate_buttons** -* **use_translate_toolbox** - -bpy.types.LimitDistanceConstraint ---------------------------------- - -Added -^^^^^ - -* :class:`bpy.types.LimitDistanceConstraint.head_tail` -* :class:`bpy.types.LimitDistanceConstraint.use_transform_limit` - -bpy.types.MovieSequence ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.MovieSequence.streamindex` - -bpy.types.Material ------------------- - -Added -^^^^^ - -* :class:`bpy.types.Material.game_settings` -* :class:`bpy.types.Material.pass_index` - -bpy.types.RenderLayer ---------------------- - -Added -^^^^^ - -* :class:`bpy.types.RenderLayer.use_pass_material_index` - -bpy.types.Object ----------------- - -Added -^^^^^ - -* :class:`bpy.types.Object.closest_point_on_mesh` -* :class:`bpy.types.Object.matrix_parent_inverse` - -bpy.types.ThemeNodeEditor -------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ThemeNodeEditor.noodle_curving` - -bpy.types.SequenceProxy ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SequenceProxy.build_100` -* :class:`bpy.types.SequenceProxy.build_25` -* :class:`bpy.types.SequenceProxy.build_50` -* :class:`bpy.types.SequenceProxy.build_75` -* :class:`bpy.types.SequenceProxy.build_free_run` -* :class:`bpy.types.SequenceProxy.build_free_run_rec_date` -* :class:`bpy.types.SequenceProxy.build_record_run` -* :class:`bpy.types.SequenceProxy.quality` -* :class:`bpy.types.SequenceProxy.timecode` - -bpy.types.SpaceUVEditor ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SpaceUVEditor.show_faces` - -bpy.types.Sequence ------------------- - -Added -^^^^^ - -* :class:`bpy.types.Sequence.waveform` - -bpy.types.ChildOfConstraint ---------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ChildOfConstraint.inverse_matrix` - -bpy.types.DopeSheet -------------------- - -Added -^^^^^ - -* :class:`bpy.types.DopeSheet.show_datablock_filters` -* :class:`bpy.types.DopeSheet.show_speakers` - -bpy.types.ActionActuator ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ActionActuator.apply_to_children` -* :class:`bpy.types.ActionActuator.layer` -* :class:`bpy.types.ActionActuator.layer_weight` -* :class:`bpy.types.ActionActuator.use_additive` -* :class:`bpy.types.ActionActuator.use_force` -* :class:`bpy.types.ActionActuator.use_local` - -bpy.types.KeyConfigurations ---------------------------- - -Added -^^^^^ - -* :class:`bpy.types.KeyConfigurations.addon` -* :class:`bpy.types.KeyConfigurations.user` - -bpy.types.VertexGroup ---------------------- - -Added -^^^^^ - -* :class:`bpy.types.VertexGroup.lock_weight` - -bpy.types.ThemeView3D ---------------------- - -Added -^^^^^ - -* :class:`bpy.types.ThemeView3D.speaker` - -bpy.types.Image ---------------- - -Added -^^^^^ - -* :class:`bpy.types.Image.pack` -* :class:`bpy.types.Image.unpack` -* :class:`bpy.types.Image.use_generated_float` - -bpy.types.Curve ---------------- - -Added -^^^^^ - -* :class:`bpy.types.Curve.fill_mode` - -Removed -^^^^^^^ - -* **use_fill_back** -* **use_fill_front** - -bpy.types.KeyMapItem --------------------- - -Added -^^^^^ - -* :class:`bpy.types.KeyMapItem.is_user_modified` - -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.level_height` -* :class:`bpy.types.SceneGameData.obstacle_simulation` -* :class:`bpy.types.SceneGameData.recast_data` -* :class:`bpy.types.SceneGameData.restrict_animation_updates` -* :class:`bpy.types.SceneGameData.show_obstacle_simulation` - -bpy.types.MeshTextureFace -------------------------- - -Removed -^^^^^^^ - -* **use_image** -* **use_object_color** -* **use_blend_shared** - -Moved -^^^^^ - -* **hide** -> :class:`bpy.types.Material.game_settings.invisible` -* **use_collision** -> :class:`bpy.types.Material.game_settings.physics` -* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless` -* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling` -* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text` -* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend` -* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend` -* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation` -* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation` -* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation` - From a80520804a5254acc5653e414b11385d68c823eb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 23:47:05 +0000 Subject: [PATCH 035/113] add '2.58 to 2.59' to changelog (should have done this for 2.59 release) and texface changes for 2.59 -> 2.60. --- doc/python_api/rst/change_log.rst | 173 ++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst index e7db5df4a1f..8b2a74fc075 100644 --- a/doc/python_api/rst/change_log.rst +++ b/doc/python_api/rst/change_log.rst @@ -909,3 +909,176 @@ Added * :class:`bpy.types.SceneGameData.use_glsl_color_management` + +2.58 to 2.59 +============ + +bpy.types.Scene +--------------- + +Function Arguments +^^^^^^^^^^^^^^^^^^ + +* :class:`bpy.types.Scene.fh_damping` (filepath, selected), *was (filepath)* + +bpy.types.MultiresModifier +-------------------------- + +Added +^^^^^ + +* :class:`bpy.types.MultiresModifier.use_subsurf_uv` + +bpy.types.KeyMap +---------------- + +Removed +^^^^^^^ + +* **copy_to_user** + +Renamed +^^^^^^^ + +* **is_user_defined** -> :class:`bpy.types.KeyMap.is_user_modified` + +bpy.types.SceneRenderLayer +-------------------------- + +Added +^^^^^ + +* :class:`bpy.types.SceneRenderLayer.use_pass_material_index` + +bpy.types.ToolSettings +---------------------- + +Renamed +^^^^^^^ + +* **use_snap_project_self** -> :class:`bpy.types.ToolSettings.use_snap_self` + +bpy.types.UserPreferencesInput +------------------------------ + +Added +^^^^^ + +* :class:`bpy.types.UserPreferencesInput.ndof_fly_helicopter` +* :class:`bpy.types.UserPreferencesInput.ndof_lock_horizon` +* :class:`bpy.types.UserPreferencesInput.ndof_orbit_invert_axes` +* :class:`bpy.types.UserPreferencesInput.ndof_sensitivity` +* :class:`bpy.types.UserPreferencesInput.ndof_show_guide` +* :class:`bpy.types.UserPreferencesInput.ndof_zoom_invert` +* :class:`bpy.types.UserPreferencesInput.ndof_zoom_updown` + +Removed +^^^^^^^ + +* **edited_keymaps** +* **ndof_pan_speed** +* **ndof_rotate_speed** + +bpy.types.IDMaterials +--------------------- + +Function Arguments +^^^^^^^^^^^^^^^^^^ + +* :class:`bpy.types.IDMaterials.ndof_rotate_speed` (index, update_data), *was (index)* + +bpy.types.Material +------------------ + +Added +^^^^^ + +* :class:`bpy.types.Material.pass_index` + +bpy.types.RenderLayer +--------------------- + +Added +^^^^^ + +* :class:`bpy.types.RenderLayer.use_pass_material_index` + +bpy.types.Object +---------------- + +Added +^^^^^ + +* :class:`bpy.types.Object.closest_point_on_mesh` + +bpy.types.ThemeNodeEditor +------------------------- + +Added +^^^^^ + +* :class:`bpy.types.ThemeNodeEditor.noodle_curving` + +bpy.types.ChildOfConstraint +--------------------------- + +Added +^^^^^ + +* :class:`bpy.types.ChildOfConstraint.inverse_matrix` + +bpy.types.KeyConfigurations +--------------------------- + +Added +^^^^^ + +* :class:`bpy.types.KeyConfigurations.addon` +* :class:`bpy.types.KeyConfigurations.user` + +bpy.types.Image +--------------- + +Added +^^^^^ + +* :class:`bpy.types.Image.use_generated_float` + +bpy.types.KeyMapItem +-------------------- + +Added +^^^^^ + +* :class:`bpy.types.KeyMapItem.is_user_modified` + + +2.59 to 2.60 +============ + +.. These have been manually added wait until RC to do final changelog! + +bpy.types.MeshTextureFace +------------------------- + +Removed +^^^^^^^ + +* **use_image** +* **use_object_color** +* **use_blend_shared** + +Moved +^^^^^ + +* **hide** -> :class:`bpy.types.Material.game_settings.invisible` +* **use_collision** -> :class:`bpy.types.Material.game_settings.physics` +* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless` +* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling` +* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text` +* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend` +* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend` +* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation` +* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation` +* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation` + From 78968a0fc9851645db4466b918f9d96fcb70f92a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Oct 2011 23:53:41 +0000 Subject: [PATCH 036/113] fix for mistake in api changelog script with function names. --- doc/python_api/rst/change_log.rst | 4 ++-- doc/python_api/sphinx_changelog_gen.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst index 8b2a74fc075..6ab2e98d6bd 100644 --- a/doc/python_api/rst/change_log.rst +++ b/doc/python_api/rst/change_log.rst @@ -919,7 +919,7 @@ bpy.types.Scene Function Arguments ^^^^^^^^^^^^^^^^^^ -* :class:`bpy.types.Scene.fh_damping` (filepath, selected), *was (filepath)* +* :class:`bpy.types.Scene.collada_export` (filepath, selected), *was (filepath)* bpy.types.MultiresModifier -------------------------- @@ -985,7 +985,7 @@ bpy.types.IDMaterials Function Arguments ^^^^^^^^^^^^^^^^^^ -* :class:`bpy.types.IDMaterials.ndof_rotate_speed` (index, update_data), *was (index)* +* :class:`bpy.types.IDMaterials.pop` (index, update_data), *was (index)* bpy.types.Material ------------------ diff --git a/doc/python_api/sphinx_changelog_gen.py b/doc/python_api/sphinx_changelog_gen.py index bc1619ba7bb..3ded1035123 100644 --- a/doc/python_api/sphinx_changelog_gen.py +++ b/doc/python_api/sphinx_changelog_gen.py @@ -302,7 +302,7 @@ def api_changelog(api_from, api_to, api_out): for func_id, args_old, args_new in func_args: args_new = ", ".join(args_new) args_old = ", ".join(args_old) - fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, prop_id, args_new, args_old)) + fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old)) fw("\n") fout.close() From f87ab2e907823754685bb22d45c62c2734721fa4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 01:01:01 +0000 Subject: [PATCH 037/113] minor edit for UI code, pointless short/int mix. --- source/blender/editors/interface/interface.c | 6 +++--- source/blender/editors/interface/interface_handlers.c | 10 +++++----- source/blender/editors/interface/interface_intern.h | 3 ++- source/blender/editors/interface/interface_layout.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a3ae39c8440..5ebdf78e611 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2049,7 +2049,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor wm_subwindow_getsize(window, window->screen->mainwin, &getsizex, &getsizey); block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]); - block->auto_open= 2; + block->auto_open= TRUE; block->flag |= UI_BLOCK_LOOP; /* tag as menu */ } @@ -2291,7 +2291,7 @@ int ui_but_can_align(uiBut *but) return !ELEM3(but->type, LABEL, OPTION, OPTIONN); } -static void ui_block_do_align_but(uiBut *first, int nr) +static void ui_block_do_align_but(uiBut *first, short nr) { uiBut *prev, *but=NULL, *next; int flag= 0, cols=0, rows=0; @@ -2428,7 +2428,7 @@ static void ui_block_do_align_but(uiBut *first, int nr) void ui_block_do_align(uiBlock *block) { uiBut *but; - int nr; + short nr; /* align buttons with same align nr */ for(but=block->buttons.first; but;) { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 929a8bf1dc6..81900b0ba39 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4681,7 +4681,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y) /* check if the mouse is in the region */ if(!BLI_in_rcti(&ar->winrct, x, y)) { for(block=ar->uiblocks.first; block; block=block->next) - block->auto_open= 0; + block->auto_open= FALSE; return 0; } @@ -4868,8 +4868,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s if(data->used_mouse && !data->autoopentimer) { int time; - if(but->block->auto_open==2) time= 1; // test for toolbox - else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open) time= 5*U.menuthreshold2; + if(but->block->auto_open==TRUE) time= 1; // test for toolbox + else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open==TRUE) time= 5*U.menuthreshold2; else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1; else time= -1; @@ -4967,9 +4967,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA /* we disable auto_open in the block after a threshold, because we still * want to allow auto opening adjacent menus even if no button is activated * in between going over to the other button, but only for a short while */ - if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open) + if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open==TRUE) if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer()) - but->block->auto_open= 0; + but->block->auto_open= FALSE; if(type == BUTTON_ACTIVATE_OVER) { data->used_mouse= 1; diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 94eb180bd06..07ff8699b60 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -308,7 +308,8 @@ struct uiBlock { int flag; char direction; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */ - short auto_open; + char pad; + char auto_open; double auto_open_last; const char *lockstr; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ab07cb4bbf6..2f10ebf1d73 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2432,7 +2432,7 @@ static void ui_item_estimate(uiItem *item) } } -static void ui_item_align(uiLayout *litem, int nr) +static void ui_item_align(uiLayout *litem, short nr) { uiItem *item; uiButtonItem *bitem; From b001eeb10deed53ea763f39de718b3558f5f0326 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 01:36:25 +0000 Subject: [PATCH 038/113] Change struct alignment for structs which are intended to be aligned but aren't. remove uiIconImage too since its unused. --- .../editors/interface/interface_intern.h | 30 +++++++------------ source/blender/makesrna/RNA_types.h | 8 ++--- source/blender/windowmanager/WM_types.h | 13 ++++---- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 07ff8699b60..6fb7677da6e 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -136,19 +136,10 @@ typedef enum { /* for scope resize zone */ #define SCOPE_RESIZE_PAD 9 -typedef struct { - short xim, yim; - unsigned int *rect; - short xofs, yofs; -} uiIconImage; - - typedef struct uiLinkLine { /* only for draw/edit */ struct uiLinkLine *next, *prev; - + struct uiBut *from, *to; short flag, pad; - - struct uiBut *from, *to; } uiLinkLine; typedef struct { @@ -164,10 +155,10 @@ typedef struct { struct uiBut { struct uiBut *next, *prev; - short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend; - short alignnr; int flag; - + short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend, alignnr; + short pad1; + char *str; char strdata[UI_MAX_NAME_STR]; char drawstr[UI_MAX_DRAW_STR]; @@ -282,7 +273,7 @@ struct uiBlock { float minx, miny, maxx, maxy; float aspect; - short alignnr; + int puphash; // popup menu hash for memory uiButHandleFunc func; void *func_arg1; @@ -306,10 +297,12 @@ struct uiBlock { void *drawextra_arg2; int flag; + short alignnr; + char direction; char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */ - char pad; char auto_open; + char _pad[7]; double auto_open_last; const char *lockstr; @@ -327,15 +320,12 @@ struct uiBlock { ListBase saferct; // uiSafetyRct list uiPopupBlockHandle *handle; // handle - - int puphash; // popup menu hash for memory void *evil_C; // XXX hack for dynamic operator enums + struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time. float _hsv[3]; // XXX, only access via ui_block_hsv_get() char color_profile; // color profile for correcting linear colors for display - struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time. - }; typedef struct uiSafetyRct { @@ -401,9 +391,9 @@ struct uiPopupBlockHandle { /* for operator popups */ struct wmOperatorType *optype; - int opcontext; ScrArea *ctx_area; ARegion *ctx_region; + int opcontext; /* return values */ int butretval; diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 8e8a2133b89..4e1177996ef 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -230,8 +230,8 @@ typedef struct CollectionPropertyIterator { int level; /* external */ - int valid; PointerRNA ptr; + int valid; } CollectionPropertyIterator; typedef struct CollectionPointerLink { @@ -274,13 +274,13 @@ typedef struct ParameterList { /* storage for parameters */ void *data; + /* function passed at creation time */ + struct FunctionRNA *func; + /* store the parameter size */ int alloc_size; int arg_count, ret_count; - - /* function passed at creation time */ - struct FunctionRNA *func; } ParameterList; typedef struct ParameterIterator { diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index cc3ae3ab753..fec59e97194 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -464,8 +464,6 @@ typedef struct wmOperatorType { /* struct wmOperatorTypeMacro */ ListBase macro; - short flag; - /* pointer to modal keymap, do not free! */ struct wmKeyMap *modalkeymap; @@ -476,6 +474,10 @@ typedef struct wmOperatorType { /* RNA integration */ ExtensionRNA ext; + + /* Flag last for padding */ + short flag; + } wmOperatorType; /* **************** Paint Cursor ******************* */ @@ -540,11 +542,12 @@ typedef struct wmDropBox { /* if poll survives, operator is called */ wmOperatorType *ot; /* not saved in file, so can be pointer */ - short opcontext; /* default invoke */ - - struct IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */ + + struct IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */ struct PointerRNA *ptr; /* rna pointer to access properties */ + short opcontext; /* default invoke */ + } wmDropBox; /* *************** migrated stuff, clean later? ************** */ From 275093324feab04bf31f9fb031e594da94de8149 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 02:49:08 +0000 Subject: [PATCH 039/113] fix [#28023] VSE: Transform Markers doesn't do anything - renamed to 'Sync Markers' to match action editor. - action editor option was broken in the same way as the sequencer. --- .../blender/editors/transform/transform_conversions.c | 10 +++++----- source/blender/makesrna/intern/rna_space.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index e37435a0cd5..c4295b15858 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4780,10 +4780,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t) if(t->mode == TFM_SEQ_SLIDE) { if(t->frame_side == 'B') - ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->vec[0], t->frame_side); + ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->values[0], t->frame_side); } else if (ELEM(t->frame_side, 'L', 'R')) { - ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_EXTEND, t->vec[0], t->frame_side); + ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_EXTEND, t->values[0], t->frame_side); } } @@ -4892,16 +4892,16 @@ void special_aftertrans_update(bContext *C, TransInfo *t) #if 0 if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */ /* same as below */ - ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side); + ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); } else /* TFM_TIME_TRANSLATE */ #endif { - ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side); + ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); } } else if (t->mode == TFM_TIME_SCALE) { - ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side); + ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side); } } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fa98e07da20..560e2dbcd8e 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1751,7 +1751,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); - RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips"); + RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE); From 8b0e44c66e5d7b33fb7c7e2205abfa86238da525 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 03:23:50 +0000 Subject: [PATCH 040/113] fix for own recent commit made color strip use the wrong panel, now hide `Input` rather then effects since the color picker wasnt shown. --- release/scripts/startup/bl_ui/space_sequencer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index c59f9bebb97..b03e7b8c59c 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -408,7 +408,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'PLUGIN', - 'WIPE', 'GLOW', 'TRANSFORM', 'SPEED', + 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED', 'MULTICAM', 'ADJUSTMENT'} def draw(self, context): @@ -547,7 +547,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel): 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'PLUGIN', - 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', + 'WIPE', 'GLOW', 'TRANSFORM', 'MULTICAM', 'SPEED', 'ADJUSTMENT'} def draw(self, context): From 3dd75fa6f17cfe39ab215c5f6712da3da5227d74 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 03:25:05 +0000 Subject: [PATCH 041/113] patch [#27887] LOSSLESS RENDERING: HuffYUV and FFV1 both fail to render losslessly from Troy Sobotka (sobotka) --- source/blender/blenkernel/intern/writeffmpeg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 3cb32f9ad12..6010770e1ee 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -489,6 +489,12 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex c->qmax=51; } + // Keep lossless encodes in the RGB domain. + if (codec_id == CODEC_ID_HUFFYUV || codec_id == CODEC_ID_FFV1) { + /* HUFFYUV was PIX_FMT_YUV422P before */ + c->pix_fmt = PIX_FMT_RGB32; + } + if ((of->oformat->flags & AVFMT_GLOBALHEADER) // || !strcmp(of->oformat->name, "mp4") // || !strcmp(of->oformat->name, "mov") @@ -518,8 +524,8 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex return NULL; } - video_buffersize = 2000000; - video_buffer = (uint8_t*)MEM_mallocN(video_buffersize, + video_buffersize = avpicture_get_size(c->pix_fmt, c->width, c->height); + video_buffer = (uint8_t*)MEM_mallocN(video_buffersize*sizeof(uint8_t), "FFMPEG video buffer"); current_frame = alloc_picture(c->pix_fmt, c->width, c->height); From 8e55780aa75da5a8f93a927ab93f605d7c580625 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 3 Oct 2011 03:32:59 +0000 Subject: [PATCH 042/113] BGE: removing old hack from Dome code. it's no longer needed and it was making dome to fail if using game autostart (<GetWidth(); canvasheight = m_canvas->GetHeight(); - bool fullscreen(false); //XXX HACK - fullscreen = (canvaswidth != m_viewport.GetWidth()); - m_buffersize = (canvaswidth > canvasheight?canvasheight:canvaswidth); m_buffersize = (int)(m_buffersize*m_resbuffer); //reduce buffer size for better performance - if (fullscreen) //XXX HACK - m_buffersize --; - int i = 0; while ((1 << i) <= m_buffersize) i++; @@ -266,10 +252,6 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 warp.bufferwidth = canvaswidth; warp.bufferheight = canvasheight; } - - //XXX HACK - canvaswidth = m_viewport.GetWidth(); - canvasheight = m_viewport.GetHeight(); } bool KX_Dome::CreateDL(){ From d1c99081ea57a9ef55d51dc08ddb700da5f6bbf8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 03:48:48 +0000 Subject: [PATCH 043/113] fix for crash when loading the file selector on startup. --- source/blender/editors/space_file/file_ops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index fd52c3c4199..c265c4ec1a7 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1176,7 +1176,9 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused)) * until this is properly supported just disable it. */ static int file_directory_poll(bContext *C) { - return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL; + /* sfile->files can be NULL on file load */ + SpaceFile *sfile= CTX_wm_space_file(C); + return ED_operator_file_active(C) && sfile->files && filelist_lib(sfile->files); } void FILE_OT_directory(struct wmOperatorType *ot) From f571d1d238372b668eab88bb491eb48bd1327554 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 04:48:14 +0000 Subject: [PATCH 044/113] fix [#27578] Fileselector UI area does not scale with UI (partially hides buttons) --- source/blender/editors/screen/area.c | 3 +++ source/blender/editors/space_file/file_draw.c | 4 ++-- source/blender/editors/space_file/space_file.c | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 041cb9091d9..28f486117b7 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -831,6 +831,9 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int prefsizex= ar->sizex?ar->sizex:ar->type->prefsizex; if(ar->regiontype==RGN_TYPE_HEADER) prefsizey= ar->type->prefsizey; + else if(ar->regiontype==RGN_TYPE_UI && sa->spacetype == SPACE_FILE) { + prefsizey= UI_UNIT_Y * 2 + (UI_UNIT_Y/2); + } else prefsizey= ar->sizey?ar->sizey:ar->type->prefsizey; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index f7abb01546f..611bf79603e 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -111,8 +111,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar) { /* Button layout. */ const int max_x = ar->winx - 10; - const int line1_y = IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN*2; - const int line2_y = IMASEL_BUTTONS_MARGIN; + const int line1_y = ar->winy - (IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN); + const int line2_y = line1_y - (IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN); const int input_minw = 20; const int btn_h = UI_UNIT_Y; const int btn_fn_w = UI_UNIT_X; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 18270bfaa26..f4adc471f70 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -520,9 +520,14 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); + /* scrolling here is just annoying, disable it */ + ar->v2d.cur.ymax= ar->v2d.cur.ymax - ar->v2d.cur.ymin; + ar->v2d.cur.ymin= 0; + /* set view2d view matrix for scrolling (without scrollers) */ UI_view2d_view_ortho(&ar->v2d); + file_draw_buttons(C, ar); UI_view2d_view_restore(C); From 354670e6ed5bcb36a02706b3c97078dc8f4d0b8d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 3 Oct 2011 08:01:07 +0000 Subject: [PATCH 045/113] Minor: Other UI strings typos and tweaks. Also updated french po & mo. --- source/blender/makesrna/intern/rna_armature.c | 32 +++++++++----- source/blender/makesrna/intern/rna_cloth.c | 44 ++++++++++++------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index c8e5faee7c8..e67ab012dc9 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -448,7 +448,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED); if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail"); + RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is stuck to the parent's tail"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop= RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE); @@ -458,7 +458,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop= RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV); - RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence"); + RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", + "When deforming bone, multiply effects of Vertex Group weights with Envelope influence"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop= RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE); @@ -478,7 +479,9 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE); - RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes"); + RNA_def_property_ui_text(prop, "Draw Wire", + "Bone is always drawn as Wireframe regardless of viewport draw mode " + "(useful for non-obstructive custom bone shapes)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop= RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE); @@ -821,7 +824,8 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Uses vertex deformation code optimized for the BGE"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ghost_type_items[] = { - {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, + {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", + "Display Ghosts of poses within a fixed number of frames around the current frame"}, {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"}, {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"}, {0, NULL, 0, NULL, NULL}}; @@ -831,7 +835,8 @@ static void rna_def_armature(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Armature", "ID"); - RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters"); + RNA_def_struct_ui_text(srna, "Armature", + "Armature datablock containing a hierarchy of bones, usually used for rigging characters"); RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA); RNA_def_struct_sdna(srna, "bArmature"); @@ -897,7 +902,8 @@ static void rna_def_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); RNA_def_property_array(prop, 32); - RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo"); + RNA_def_property_ui_text(prop, "Layer Proxy Protection", + "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* flag */ @@ -975,28 +981,34 @@ static void rna_def_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostep"); RNA_def_property_range(prop, 0, 30); - RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skinning method)"); + RNA_def_property_ui_text(prop, "Ghosting Step", + "Number of frame steps on either side of current frame to show as ghosts " + "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostsize"); RNA_def_property_range(prop, 1, 20); - RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)"); + RNA_def_property_ui_text(prop, "Ghosting Frame Step", + "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop= RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostsf"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL); - RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)"); + RNA_def_property_ui_text(prop, "Ghosting Start Frame", + "Starting frame of range of Ghosts to display (not for " + "'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop= RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostef"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL); - RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)"); + RNA_def_property_ui_text(prop, "Ghosting End Frame", + "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); // XXX depreceated ....... old animviz for armatures only diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 1b2396a4215..934a42cfcef 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -271,7 +271,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); + RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", + "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); @@ -305,21 +306,23 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_range(prop, 4, 80); - RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame. (higher is better quality but slower)"); + RNA_def_property_ui_text(prop, "Quality", + "Quality of the simulation in steps per frame (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* springs */ prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); - RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group"); + RNA_def_property_ui_text(prop, "Stiffness Scaling", + "If enabled, stiffness can be scaled along a weight painted vertex group"); RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); - RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity. (higher = more smooth, less jiggling)"); + RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); @@ -336,14 +339,16 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set"); - RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness"); + RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", + "rna_ClothSettings_struct_vgroup_set"); + RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", + "Vertex group for fine control over structural stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_range(prop, 0.0f, 10000.0f); - RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient. (higher = less smaller but more big wrinkles)"); + RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); @@ -354,7 +359,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set"); + RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", + "rna_ClothSettings_bend_vgroup_set"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); @@ -372,8 +378,9 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ShapeKey"); - RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL, NULL); - RNA_def_property_ui_text(prop, "Rest Shade Key", "Shape key to use the rest spring lengths from"); + RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", + "rna_ClothSettings_rest_shape_key_set", NULL, NULL); + RNA_def_property_ui_text(prop, "Rest Shape Key", "Shape key to use the rest spring lengths from"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* unused */ @@ -420,7 +427,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL); - RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects"); + RNA_def_struct_ui_text(srna, "Cloth Collision Settings", + "Cloth simulation settings for self collision and collision with other objects"); RNA_def_struct_sdna(srna, "ClothCollSettings"); RNA_def_struct_path_func(srna, "rna_ClothCollisionSettings_path"); @@ -442,24 +450,27 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "distance_repel"); RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_float_default(prop, 0.005f); - RNA_def_property_ui_text(prop, "Repulsion Distance", "Maximum distance to apply repulsion force, must be greater then minimum distance"); + RNA_def_property_ui_text(prop, "Repulsion Distance", + "Maximum distance to apply repulsion force, must be greater than minimum distance"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); - RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in"); + RNA_def_property_ui_text(prop, "Minimum Distance", + "Minimum distance between collision objects before collision response takes in"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); - RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened. (higher = less movement)"); + RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); - RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); + RNA_def_property_ui_text(prop, "Collision Quality", + "How many collision iterations should be done. (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* self collision */ @@ -483,7 +494,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower)"); + RNA_def_property_ui_text(prop, "Self Collision Quality", + "How many self collision iterations should be done (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); From 7fec67ab40cac18aaa44420216603ddc2b623caa Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Oct 2011 11:04:05 +0000 Subject: [PATCH 046/113] Fix #28780: Undo while painting image sequences issue - Store imbuf file path in UndoImageTile structure, so imbuf can be verified before applying titles on it. - If current image's imbuf file path isn't equal to file path stored in undo block, search for imbuf in ima->ibufs. Probably it can be optimized, but storing all settings which defines needed imbuf (image source type, offset, image file name, current scene frame and so messes up undo code and requires deeper changes which probably better not to start on bcon4). --- .../editors/sculpt_paint/paint_image.c | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index add269c0877..43969f3c19e 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -356,6 +356,7 @@ typedef struct UndoImageTile { struct UndoImageTile *next, *prev; char idname[MAX_ID_NAME]; /* name instead of pointer*/ + char ibufname[IB_FILENAME_SIZE]; void *rect; int x, y; @@ -389,7 +390,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int int allocsize; for(tile=lb->first; tile; tile=tile->next) - if(tile->x == x_tile && tile->y == y_tile && strcmp(tile->idname, ima->id.name)==0) + if(tile->x == x_tile && tile->y == y_tile && strcmp(tile->idname, ima->id.name)==0 && strcmp(tile->ibufname, ibuf->name)==0) return tile->rect; if (*tmpibuf==NULL) @@ -404,6 +405,8 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char); tile->rect= MEM_mapallocN(allocsize, "UndeImageTile.rect"); + strcpy(tile->ibufname, ibuf->name); + undo_copy_tile(tile, *tmpibuf, ibuf, 0); undo_paint_push_count_alloc(UNDO_PAINT_IMAGE, allocsize); @@ -433,6 +436,21 @@ static void image_undo_restore(bContext *C, ListBase *lb) ibuf= BKE_image_get_ibuf(ima, NULL); + if(ima && strcmp(tile->ibufname, ibuf->name)!=0) { + /* current ImBuf filename was changed, probably current frame + was changed when paiting on image sequence, rather than storing + full image user (which isn't so obvious, btw) try to find ImBuf with + matched file name in list of already loaded images */ + + ibuf= ima->ibufs.first; + while(ibuf) { + if(strcmp(tile->ibufname, ibuf->name)==0) + break; + + ibuf= ibuf->next; + } + } + if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) continue; From 758e34b45d3fd3470e847b972897e6aff50954dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 12:56:33 +0000 Subject: [PATCH 047/113] - use BLI_findstring rather then while loop for listbase lookups - remove BLI_assert I recently added to RNA_property_pointer_type since its intentionally called with no type check. --- .../blender/editors/sculpt_paint/paint_image.c | 16 +++++----------- source/blender/makesrna/intern/rna_access.c | 4 +--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 43969f3c19e..d556ff9797f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -427,11 +427,11 @@ static void image_undo_restore(bContext *C, ListBase *lb) for(tile=lb->first; tile; tile=tile->next) { /* find image based on name, pointer becomes invalid with global undo */ - if(ima && strcmp(tile->idname, ima->id.name)==0); + if(ima && strcmp(tile->idname, ima->id.name)==0) { + /* ima is valid */ + } else { - for(ima=bmain->image.first; ima; ima=ima->id.next) - if(strcmp(tile->idname, ima->id.name)==0) - break; + ima= BLI_findstring(&bmain->image, tile->idname, offsetof(ID, name)); } ibuf= BKE_image_get_ibuf(ima, NULL); @@ -442,13 +442,7 @@ static void image_undo_restore(bContext *C, ListBase *lb) full image user (which isn't so obvious, btw) try to find ImBuf with matched file name in list of already loaded images */ - ibuf= ima->ibufs.first; - while(ibuf) { - if(strcmp(tile->ibufname, ibuf->name)==0) - break; - - ibuf= ibuf->next; - } + ibuf= BLI_findstring(&ima->ibufs, tile->ibufname, offsetof(ImBuf, name)); } if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 24e1aa078cf..8047b2df226 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1095,9 +1095,7 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) if(cprop->item_type) return cprop->item_type; } - else { - BLI_assert(0); - } + /* ignore other types, RNA_struct_find_nested calls with unchecked props */ return &RNA_UnknownType; } From 782499717efa2464b700360ded6193a67a170781 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Oct 2011 13:01:24 +0000 Subject: [PATCH 048/113] Fix #27532: Undo test texture after painting gives black blocks. - Do not apply undo tiles on image if source or generated type was changed. - Added null-check in own recent commit in this area. --- .../blender/editors/sculpt_paint/paint_image.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index d556ff9797f..36711d14beb 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -360,6 +360,9 @@ typedef struct UndoImageTile { void *rect; int x, y; + + short source; + char gen_type; } UndoImageTile; static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0}; @@ -390,8 +393,9 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int int allocsize; for(tile=lb->first; tile; tile=tile->next) - if(tile->x == x_tile && tile->y == y_tile && strcmp(tile->idname, ima->id.name)==0 && strcmp(tile->ibufname, ibuf->name)==0) - return tile->rect; + if(tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type && ima->source == tile->source) + if(strcmp(tile->idname, ima->id.name)==0 && strcmp(tile->ibufname, ibuf->name)==0) + return tile->rect; if (*tmpibuf==NULL) *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect); @@ -407,6 +411,9 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int strcpy(tile->ibufname, ibuf->name); + tile->gen_type= ima->gen_type; + tile->source= ima->source; + undo_copy_tile(tile, *tmpibuf, ibuf, 0); undo_paint_push_count_alloc(UNDO_PAINT_IMAGE, allocsize); @@ -436,7 +443,7 @@ static void image_undo_restore(bContext *C, ListBase *lb) ibuf= BKE_image_get_ibuf(ima, NULL); - if(ima && strcmp(tile->ibufname, ibuf->name)!=0) { + if(ima && ibuf && strcmp(tile->ibufname, ibuf->name)!=0) { /* current ImBuf filename was changed, probably current frame was changed when paiting on image sequence, rather than storing full image user (which isn't so obvious, btw) try to find ImBuf with @@ -448,6 +455,9 @@ static void image_undo_restore(bContext *C, ListBase *lb) if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) continue; + if (ima->gen_type != tile->gen_type || ima->source != tile->source) + continue; + undo_copy_tile(tile, tmpibuf, ibuf, 1); GPU_free_image(ima); /* force OpenGL reload */ From e5a11dfcd670f45a467a84b362c7d189cd011fab Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 16:20:05 +0000 Subject: [PATCH 049/113] fix for [#28788] wasn't complete, pose bones scale was ignoring "Individual origins" setting. --- source/blender/editors/transform/transform.c | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 898785fd120..73acd1f9000 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2606,29 +2606,18 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { } /* local constraint shouldn't alter center */ - if (t->around == V3D_LOCAL) { - if (t->flag & T_OBJECT) { - copy_v3_v3(center, td->center); - } - else if (t->flag & T_EDIT) { - - if( (t->settings->selectmode & SCE_SELECT_FACE) || - (t->obedit && t->obedit->type == OB_ARMATURE)) - { - copy_v3_v3(center, td->center); - } - else { - copy_v3_v3(center, t->center); - } - } - else { - copy_v3_v3(center, t->center); - } + if ((t->around == V3D_LOCAL) && + ( (t->flag & (T_OBJECT|T_POSE)) || + ((t->flag & T_EDIT) && (t->settings->selectmode & SCE_SELECT_FACE)) || + (t->obedit && t->obedit->type == OB_ARMATURE)) + ) + { + copy_v3_v3(center, td->center); } else { copy_v3_v3(center, t->center); } - + if (td->ext) { float fsize[3]; From 75621eeff97d5765ecd3cdea1873d5c40baad0d6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 16:55:00 +0000 Subject: [PATCH 050/113] fix [#27526] shared data but different data materials. --- source/blender/editors/space_buttons/buttons_context.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 9d2ac3fd8e2..526859cecd2 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -721,8 +721,12 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if(ptr) { Object *ob= ptr->data; - if(ob && ob->type && (ob->typetotcol) - CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, ob->mat+ob->actcol-1); + if(ob && ob->type && (ob->typetotcol) { + /* a valid actcol isn't ensured [#27526] */ + int matnr= ob->actcol-1; + if(matnr < 0) matnr= 0; + CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, &ob->mat[matnr]); + } } return 1; From 3b996ac1b3fcc93b121a9d4ef6024d5638df780f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 17:29:43 +0000 Subject: [PATCH 051/113] add macro OB_TYPE_SUPPORT_MATERIAL, type checks were being done inline, some comparing range, some using ELEM#(), once was missing metaball check. --- source/blender/blenkernel/intern/object.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/object/object_relations.c | 6 ++++-- source/blender/editors/render/render_preview.c | 2 +- source/blender/editors/space_buttons/buttons_context.c | 4 ++-- source/blender/editors/space_view3d/view3d_buttons.c | 5 ++++- source/blender/makesdna/DNA_object_types.h | 3 +++ source/blender/render/intern/source/convertblender.c | 4 ++-- 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 5530096f8ea..ce4cc284bb0 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1649,7 +1649,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) if(ob->matbits) MEM_freeN(ob->matbits); ob->mat = NULL; ob->matbits= NULL; - if ((target->totcol) && (target->mat) && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { //XXX OB_SUPPORT_MATERIAL + if ((target->totcol) && (target->mat) && OB_TYPE_SUPPORT_MATERIAL(ob->type)) { int i; ob->colbits = target->colbits; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 8ca481655d0..a50dd00ef16 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1368,7 +1368,7 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v strcat (str, "|Object Constraints%x22"); strcat (str, "|NLA Strips%x26"); -// XXX if (OB_SUPPORT_MATERIAL(ob)) { +// XXX if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) { // strcat(str, "|Texture Space%x17"); // } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index ec5aa19d3c0..389c0941cc2 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1243,9 +1243,11 @@ static int allow_make_links_data(int ev, Object *ob, Object *obt) return 1; break; case MAKE_LINKS_MATERIALS: - if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL) && - ELEM5(obt->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL)) + if (OB_TYPE_SUPPORT_MATERIAL(ob->type) && + OB_TYPE_SUPPORT_MATERIAL(obt->type)) + { return 1; + } break; case MAKE_LINKS_ANIMDATA: case MAKE_LINKS_DUPLIGROUP: diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index b937f9a4104..70709a22d3d 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -344,7 +344,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre /* copy over object color, in case material uses it */ copy_v4_v4(base->object->col, sp->col); - if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) { + if(OB_TYPE_SUPPORT_MATERIAL(base->object->type)) { /* don't use assign_material, it changed mat->id.us, which shows in the UI */ Material ***matar= give_matarar(base->object); int actcol= MAX2(base->object->actcol > 0, 1) - 1; diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 526859cecd2..4a2860335fe 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -234,7 +234,7 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture) else if(buttons_context_path_object(path)) { ob= path->ptr[path->len-1].data; - if(ob && ob->type && (ob->typetype)) { ma= give_current_material(ob, ob->actcol); RNA_id_pointer_create(&ma->id, &path->ptr[path->len]); path->len++; @@ -721,7 +721,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if(ptr) { Object *ob= ptr->data; - if(ob && ob->type && (ob->typetotcol) { + if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type) && ob->totcol) { /* a valid actcol isn't ensured [#27526] */ int matnr= ob->actcol-1; if(matnr < 0) matnr= 0; diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index e1fb287d79c..0ad36657196 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -895,8 +895,11 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) if (ptr->type == &RNA_Object) { Object *ob = ptr->data; - if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) + /* dimensions and material support just happen to be the same checks + * later we may want to add dimensions for lattice, armature etc too */ + if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) { uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NONE); + } } } diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index f32f8d626de..f0c7cf8cc45 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -321,6 +321,9 @@ typedef struct DupliObject { /* 23 and 24 are for life and sector (old file compat.) */ #define OB_ARMATURE 25 +/* check if the object type supports materials */ +#define OB_TYPE_SUPPORT_MATERIAL(_type) ((_type) >= OB_MESH && (_type) <= OB_MBALL) + /* partype: first 4 bits: type */ #define PARTYPE 15 #define PAROBJECT 0 diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index f06707c94fe..0ea0725d05d 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4359,9 +4359,9 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset) /* Database */ /* ------------------------------------------------------------------------- */ -static int render_object_type(int type) +static int render_object_type(short type) { - return ELEM5(type, OB_FONT, OB_CURVE, OB_SURF, OB_MESH, OB_MBALL); + return OB_TYPE_SUPPORT_MATERIAL(type); } static void find_dupli_instances(Render *re, ObjectRen *obr) From cdc564064c5d7e442b1accf51670b6287c149ff4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 17:59:33 +0000 Subject: [PATCH 052/113] revert r40738, flipepd enums give quick access to first items, even if it does seem odd to have them flipped. --- source/blender/editors/interface/interface_regions.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index d29e5975afb..622d50752fa 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2322,6 +2322,10 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut pup->popup= 1; pup->block->flag |= UI_BLOCK_NO_FLIP; } + /* some enums reversing is strange, currently we have no good way to + * reverse some enum's but not others, so reverse all so the first menu + * items are always close to the mouse cursor */ +#if 0 else { /* if this is an rna button then we can assume its an enum * flipping enums is generally not good since the order can be @@ -2330,6 +2334,7 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut pup->block->flag |= UI_BLOCK_NO_FLIP; } } +#endif if(str) { /* menu is created from a string */ From 59c0cbbc34869e21bb687eb60506add04e5bf2d0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Oct 2011 18:03:44 +0000 Subject: [PATCH 053/113] fix for missing null check in own recent commit. --- source/blender/editors/interface/interface_handlers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 81900b0ba39..b4970d5933c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5157,7 +5157,9 @@ void uiContextActivePropertyHandle(bContext *C) * currently this is mainly so reset defaults works for the * operator redo panel - campbell */ uiBlock *block= activebut->block; - block->handle_func(C, block->handle_func_arg, 0); + if (block->handle_func) { + block->handle_func(C, block->handle_func_arg, 0); + } } } From 42bde7eaa1372afac642d3465554b7bc7592ff78 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 4 Oct 2011 07:48:56 +0000 Subject: [PATCH 054/113] Minor: Other UI strings typos and tweaks. Also updated french po & mo. --- source/blender/makesrna/intern/rna_fcurve.c | 56 ++++++++++++++------ source/blender/makesrna/intern/rna_mesh.c | 30 +++++++---- source/blender/makesrna/intern/rna_texture.c | 10 ++-- 3 files changed, 65 insertions(+), 31 deletions(-) diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index a08e030215c..43812ad4a01 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -643,7 +643,9 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) /* define common props */ prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); - RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); + RNA_def_property_ui_text(prop, "Additive", + "Values generated by this modifier are applied on top of " + "the existing values instead of overwriting them"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); // XXX this has a special validation func @@ -656,7 +658,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) /* order of the polynomial */ // XXX this has a special validation func prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); + RNA_def_property_ui_text(prop, "Polynomial Order", + "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); /* coefficients array */ @@ -664,7 +667,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_FModifierGenerator_coefficients_get_length"); - RNA_def_property_float_funcs(prop, "rna_FModifierGenerator_coefficients_get", "rna_FModifierGenerator_coefficients_set", NULL); + RNA_def_property_float_funcs(prop, "rna_FModifierGenerator_coefficients_get", + "rna_FModifierGenerator_coefficients_set", NULL); RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0)"); } @@ -708,7 +712,9 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) /* flags */ prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); - RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); + RNA_def_property_ui_text(prop, "Additive", + "Values generated by this modifier are applied on top of " + "the existing values instead of overwriting them"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE); @@ -795,8 +801,10 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) static EnumPropertyItem prop_type_items[] = { {FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything"}, {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is"}, - {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"}, - {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, + {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", + "Repeat keyframe range, but with offset based on gradient between values"}, + {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", + "Alternate between forward and reverse playback of keyframe range"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierCycles", "FModifier"); @@ -950,7 +958,8 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierStepped", "FModifier"); - RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier", "Holds each interpolated value from the F-Curve for several frames without changing the timing"); + RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier", + "Hold each interpolated value from the F-Curve for several frames without changing the timing"); RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data"); /* properties */ @@ -961,7 +970,9 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna) prop= RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); - RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns"); + RNA_def_property_ui_text(prop, "Offset", + "Reference number of frames before frames get held " + "(use to get hold for '1-3' vs '5-7' holding patterns)"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); prop= RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE); @@ -1042,7 +1053,9 @@ static void rna_def_fmodifier(BlenderRNA *brna) /* restricted range */ prop= RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_RANGERESTRICT); - RNA_def_property_ui_text(prop, "Restrict Frame Range", "F-Curve Modifier is only applied for the specified frame range to help mask off effects in order to chain them"); + RNA_def_property_ui_text(prop, "Restrict Frame Range", + "F-Curve Modifier is only applied for the specified frame range to help " + "mask off effects in order to chain them"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation @@ -1106,8 +1119,10 @@ static void rna_def_drivertarget(BlenderRNA *brna) static EnumPropertyItem prop_local_space_items[] = { {0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"}, - {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", "Transforms don't include parenting/restpose or constraints"}, - {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", "Transforms include effects of constraints but not parenting/restpose"}, + {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", + "Transforms don't include parenting/restpose or constraints"}, + {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", + "Transforms include effects of constraints but not parenting/restpose"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DriverTarget", NULL); @@ -1120,7 +1135,8 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); /* note: custom set function is ONLY to avoid rna setting a user for this. */ RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef", NULL); - RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from (id_type property must be set first)"); + RNA_def_property_ui_text(prop, "ID", + "ID-block that the specific property used can be found from (id_type property must be set first)"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); @@ -1134,7 +1150,8 @@ static void rna_def_drivertarget(BlenderRNA *brna) /* Target Properties - Property to Drive */ prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", "rna_DriverTarget_RnaPath_set"); + RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", + "rna_DriverTarget_RnaPath_set"); RNA_def_property_ui_text(prop, "Data Path", "RNA Path (from ID-block) to property used"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); @@ -1176,7 +1193,9 @@ static void rna_def_drivervar(BlenderRNA *brna) /* Variable Name */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); - RNA_def_property_ui_text(prop, "Name", "Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit)"); + RNA_def_property_ui_text(prop, "Name", + "Name to use in scripted expressions/functions (no spaces or dots are allowed, " + "and must start with a letter)"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_name"); // XXX /* Enums */ @@ -1265,7 +1284,8 @@ static void rna_def_channeldriver(BlenderRNA *brna) /* Settings */ prop= RNA_def_property(srna, "show_debug_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_SHOWDEBUG); - RNA_def_property_ui_text(prop, "Show Debug Info", "Show intermediate values for the driver calculations to allow debugging of drivers"); + RNA_def_property_ui_text(prop, "Show Debug Info", + "Show intermediate values for the driver calculations to allow debugging of drivers"); /* State Info (for Debugging) */ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); @@ -1347,7 +1367,8 @@ static void rna_def_fkeyframe(BlenderRNA *brna) prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipo"); RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items); - RNA_def_property_ui_text(prop, "Interpolation", "Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe"); + RNA_def_property_ui_text(prop, "Interpolation", + "Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -1547,7 +1568,8 @@ static void rna_def_fcurve(BlenderRNA *brna) /* State Info (for Debugging) */ prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_DISABLED); - RNA_def_property_ui_text(prop, "Valid", "False when F-Curve could not be evaluated in past, so should be skipped when evaluating"); + RNA_def_property_ui_text(prop, "Valid", + "False when F-Curve could not be evaluated in past, so should be skipped when evaluating"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); /* Collections */ diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index ad4467a6d0b..d35b7ad38fb 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -166,7 +166,8 @@ static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values) MFace *mface= (MFace*)ptr->data; if(mface->v4) - normal_quad_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, me->mvert[mface->v4].co); + normal_quad_v3(values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, + me->mvert[mface->v3].co, me->mvert[mface->v4].co); else normal_tri_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co); } @@ -1226,7 +1227,8 @@ static void rna_def_mvert(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of"); @@ -1348,12 +1350,12 @@ static void rna_def_mface(BlenderRNA *brna) RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_MeshFace_normal_get", NULL, NULL); - RNA_def_property_ui_text(prop, "face normal", "local space unit length normal vector for this face"); + RNA_def_property_ui_text(prop, "Face normal", "Local space unit length normal vector for this face"); prop= RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_MeshFace_area_get", NULL, NULL); - RNA_def_property_ui_text(prop, "face area", "read only area of the face"); + RNA_def_property_ui_text(prop, "Face area", "Read only area of the face"); prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1400,7 +1402,9 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshTextureFace"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshTextureFace", NULL); RNA_def_struct_sdna(srna, "MTFace"); @@ -1512,7 +1516,9 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshColor"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshColorLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshColor", NULL); RNA_def_struct_sdna(srna, "MCol"); @@ -1567,7 +1573,9 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshFloatProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshFloatProperty", NULL); RNA_def_struct_sdna(srna, "MFloatProperty"); @@ -1593,7 +1601,9 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshIntProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshIntProperty", NULL); RNA_def_struct_sdna(srna, "MIntProperty"); @@ -1619,7 +1629,9 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshStringProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL); + RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL); srna= RNA_def_struct(brna, "MeshStringProperty", NULL); RNA_def_struct_sdna(srna, "MStringProperty"); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 21a426640f2..b5e8acb76e5 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -559,7 +559,7 @@ static void rna_def_filter_common(StructRNA *srna) prop= RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP); - RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Uses Gauss filter to sample down MIP maps"); + RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps"); RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); @@ -591,7 +591,7 @@ static void rna_def_filter_common(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "filtersize"); RNA_def_property_range(prop, 0.1, 50.0); RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2); - RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation"); + RNA_def_property_ui_text(prop, "Filter Size", "Multiply the filter size used by MIP Map and Interpolation"); RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -601,9 +601,9 @@ static void rna_def_environment_map(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_source_items[] = { - {ENV_STATIC, "STATIC", 0, "Static", "Calculates environment map only once"}, - {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculates environment map at each rendering"}, - {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Loads a saved environment map image from disk"}, + {ENV_STATIC, "STATIC", 0, "Static", "Calculate environment map only once"}, + {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculate environment map at each rendering"}, + {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mapping_items[] = { From 91c38f0aa0e68e94f51861172862e233716c54d8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 08:20:29 +0000 Subject: [PATCH 055/113] Fix for unix python bundling: config-* directories didn't deleted This is because of passing config-* to rm command in quotes. --- build_files/scons/tools/Blender.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 8e1bdcb1c62..f5e7b4c0fe7 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -625,7 +625,11 @@ def UnixPyBundle(target=None, source=None, env=None): run("rm -rf '%s/distutils'" % py_target) run("rm -rf '%s/lib2to3'" % py_target) run("rm -rf '%s/config'" % py_target) - run("rm -rf '%s/config-*'" % py_target) + + for x in os.listdir(py_target): + if os.path.basename(x).startswith('config-'): + run("rm -rf '%s/%s'" % (py_target, x)) + run("rm -rf '%s/site-packages'" % py_target) run("mkdir '%s/site-packages'" % py_target) # python needs it.' run("rm -rf '%s/idlelib'" % py_target) From 019dca9c54289136b34c688a048ee009e2e852ee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Oct 2011 08:28:37 +0000 Subject: [PATCH 056/113] remove redundant code, also dont bother with os.path.basename(x) for recent scons commit. --- build_files/scons/tools/Blender.py | 6 +++--- source/blender/blenkernel/intern/object.c | 7 ++----- source/blender/blenkernel/intern/seqeffects.c | 6 ++---- source/blender/editors/sculpt_paint/paint_image.c | 8 +++----- source/blender/editors/space_view3d/drawobject.c | 2 -- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index f5e7b4c0fe7..b9632bfffa7 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -626,9 +626,9 @@ def UnixPyBundle(target=None, source=None, env=None): run("rm -rf '%s/lib2to3'" % py_target) run("rm -rf '%s/config'" % py_target) - for x in os.listdir(py_target): - if os.path.basename(x).startswith('config-'): - run("rm -rf '%s/%s'" % (py_target, x)) + for f in os.listdir(py_target): + if f.startswith("config-"): + run("rm -rf '%s/%s'" % (py_target, f)) run("rm -rf '%s/site-packages'" % py_target) run("mkdir '%s/site-packages'" % py_target) # python needs it.' diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index ce4cc284bb0..81a31c83e95 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3060,14 +3060,13 @@ void object_camera_matrix( void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3], float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) { - float aspx, aspy; float facx, facy; float depth; /* aspect correcton */ if (scene) { - aspx= (float) scene->r.xsch*scene->r.xasp; - aspy= (float) scene->r.ysch*scene->r.yasp; + float aspx= (float) scene->r.xsch*scene->r.xasp; + float aspy= (float) scene->r.ysch*scene->r.yasp; if(aspx < aspy) { r_asp[0]= aspx / aspy; @@ -3079,8 +3078,6 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh } } else { - aspx= 1.0f; - aspy= 1.0f; r_asp[0]= 1.0f; r_asp[1]= 1.0f; } diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 70b44792b30..d8d6ed6ea6d 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1639,8 +1639,6 @@ float hyp3,hyp4,b4,b5 if(wipezone->flip) x = xo - x; angle = wipezone->angle; - posy = facf0 * yo; - if(wipe->forward){ posx = facf0 * xo; posy = facf0 * yo; @@ -2320,7 +2318,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, /* Swap buffers */ - swap=temp;temp=map;map=swap; + swap=temp;temp=map; /* map=swap; */ /* UNUSED */ /* Tidy up */ MEM_freeN (filter); @@ -2490,7 +2488,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height, /* Swap buffers */ - swap=temp;temp=map;map=swap; + swap=temp;temp=map; /* map=swap; */ /* UNUSED */ /* Tidy up */ MEM_freeN (filter); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 36711d14beb..1c53be15a0f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -2690,9 +2690,7 @@ static void project_bucket_init(const ProjPaintState *ps, const int thread_index tf = ps->dm_mtface+face_index; if (tpage_last != tf->tpage) { tpage_last = tf->tpage; - - image_index = -1; /* sanity check */ - + for (image_index=0; image_index < ps->image_tot; image_index++) { if (ps->projImages[image_index].ima == tpage_last) { ibuf = ps->projImages[image_index].ibuf; @@ -4900,7 +4898,6 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) time= PIL_check_seconds_timer(); tablet= 0; - pressure= 0; pop->s.blend= pop->s.brush->blend; if(event->custom == EVT_DATA_TABLET) { @@ -4911,8 +4908,9 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) if(wmtab->Active == EVT_TABLET_ERASER) pop->s.blend= IMB_BLEND_ERASE_ALPHA; } - else /* otherwise airbrush becomes 1.0 pressure instantly */ + else { /* otherwise airbrush becomes 1.0 pressure instantly */ pressure= pop->prev_pressure ? pop->prev_pressure : 1.0f; + } if(pop->first) { pop->prevmouse[0]= event->mval[0]; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 35c3e909d84..b84998e6b83 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5103,8 +5103,6 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star } } else { - a= 0; - fac= (float)(CIRCLE_RESOL-1) * tot_inv; x= sinval[start] * fac; y= cosval[start] * fac; From 215ed84779da71ab8c1c580766f1771617e4828d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 12:30:26 +0000 Subject: [PATCH 057/113] Partial fix #27978: Problem exporting OGG Theora-Vorbis video (and other audio codecs) Ogg format does support only vorbis, theora, speex and flac audio codecs. Added check for result of av_write_header() and show info in header about error while initializing streams. This commit also fixed crash when using vorbis audio format. It used to be floating point exception. SOlved by initializing audio_stream->codec->time_base with proper rational value as it's done in FFmpeg sources. --- source/blender/blenkernel/intern/writeffmpeg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 6010770e1ee..21289b07f8d 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -571,6 +571,10 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex return NULL; } + /* need to prevent floating point exception when using vorbis audio codec, + initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */ + st->codec->time_base = (AVRational){1, st->codec->sample_rate}; + audio_outbuf_size = FF_MIN_BUFFER_SIZE; if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD)) @@ -743,7 +747,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report } } - av_write_header(of); + if (av_write_header(of) < 0) { + BKE_report(reports, RPT_ERROR, "Could not initialize streams. Probably unsupported codec combination."); + return 0; + } + outfile = of; av_dump_format(of, 0, name, 1); From f618bc5aca23616cf22c0e9350ae3c2ee23acc5f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 4 Oct 2011 13:24:48 +0000 Subject: [PATCH 058/113] Fix #28202: (only) modifying keymap item properties did not save properly, the update signal for this was missing. Problem is that the operator properties RNA update callback doesn't know the associated keymap item, worked around it with UI template now. --- .../startup/bl_ui/space_userpref_keymap.py | 17 +----- source/blender/editors/include/UI_interface.h | 1 + .../editors/interface/interface_templates.c | 58 +++++++++++++++++++ source/blender/makesrna/intern/rna_ui_api.c | 4 ++ 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index 25f955085f6..c2e3a145f36 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -121,19 +121,6 @@ class InputKeyMapPanel: for entry in children: self.draw_entry(display_keymaps, entry, col, level + 1) - @staticmethod - def draw_kmi_properties(box, properties, title=None): - box.separator() - if title: - box.label(text=title) - flow = box.column_flow(columns=2) - for pname, value in properties.bl_rna.properties.items(): - if pname != "rna_type" and not properties.is_property_hidden(pname): - if isinstance(value, OperatorProperties): - InputKeyMapPanel.draw_kmi_properties(box, value, title=pname) - else: - flow.prop(properties, pname) - def draw_kmi(self, display_keymaps, kc, km, kmi, layout, level): map_type = kmi.map_type @@ -218,9 +205,7 @@ class InputKeyMapPanel: subrow.prop(kmi, "key_modifier", text="", event=True) # Operator properties - props = kmi.properties - if props is not None: - InputKeyMapPanel.draw_kmi_properties(box, props) + box.template_keymap_item_properties(kmi) # Modal key maps attached to this operator if not km.is_modal: diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index a5781ab7267..a06497889d9 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -749,6 +749,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C); void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex); void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C); +void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr); void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index ff6ef41bfb0..4dcdeab2169 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2542,3 +2542,61 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiDefBut(block, LABEL, 0, report->message, UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); } +/********************************* Keymap *************************************/ + +static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused)) +{ + wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p; + WM_keyconfig_update_tag(NULL, kmi); +} + +static void template_keymap_item_properties(uiLayout *layout, const char *title, PointerRNA *ptr) +{ + uiLayout *flow; + + uiItemS(layout); + + if(title) + uiItemL(layout, title, ICON_NONE); + + flow= uiLayoutColumnFlow(layout, 2, 0); + + RNA_STRUCT_BEGIN(ptr, prop) { + int flag= RNA_property_flag(prop); + + if(flag & PROP_HIDDEN) + continue; + + /* recurse for nested properties */ + if(RNA_property_type(prop) == PROP_POINTER) { + PointerRNA propptr= RNA_property_pointer_get(ptr, prop); + const char *name= RNA_property_ui_name(prop); + + if(propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) { + template_keymap_item_properties(layout, name, &propptr); + continue; + } + } + + /* add property */ + uiItemR(flow, ptr, RNA_property_identifier(prop), 0, NULL, ICON_NONE); + } + RNA_STRUCT_END; +} + +void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr) +{ + PointerRNA propptr= RNA_pointer_get(ptr, "properties"); + + if(propptr.data) { + uiBut *but= uiLayoutGetBlock(layout)->buttons.last; + + template_keymap_item_properties(layout, NULL, &propptr); + + /* attach callbacks to compensate for missing properties update, + we don't know which keymap (item) is being modified there */ + for(; but; but=but->next) + uiButSetFunc(but, keymap_item_modified, ptr->data, NULL); + } +} + diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 85ad6b231aa..9e9e64a480d 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -428,6 +428,10 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); + func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties"); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); + func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect"); parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR"); RNA_def_function_return(func, parm); From ffe9824011e34c8ab57c7be89350979e6343ce9f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 15:10:24 +0000 Subject: [PATCH 059/113] Correction for own recent commit -- didn't know it's unsupported in MSVC to do such things. --- source/blender/blenkernel/intern/writeffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 21289b07f8d..425af0272a3 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -573,7 +573,8 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex /* need to prevent floating point exception when using vorbis audio codec, initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */ - st->codec->time_base = (AVRational){1, st->codec->sample_rate}; + st->codec->time_base.num= 1; + st->codec->time_base.den= st->codec->sample_rate; audio_outbuf_size = FF_MIN_BUFFER_SIZE; From 71256629b02a6b41ff35862d77a76453b75b0d5f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 15:21:01 +0000 Subject: [PATCH 060/113] Update blenderplayer stubs to deal with recent keymaps commit. --- source/blenderplayer/bad_level_call_stubs/stubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index c3d389932d1..fe53937ec5a 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -368,6 +368,7 @@ void uiTemplateHistogram(struct uiLayout *layout, struct PointerRNA *ptr, char * void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op){} void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand){} void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand){} +void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){} /* rna render */ struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;} From fdd0d7f9500176ea20a09ce753fb218e54615127 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 4 Oct 2011 17:04:35 +0000 Subject: [PATCH 061/113] Enabling JACK for linux buildbot. --- build_files/buildbot/config/user-config-i686.py | 3 +++ build_files/buildbot/config/user-config-player-i686.py | 3 +++ build_files/buildbot/config/user-config-player-x86_64.py | 3 +++ build_files/buildbot/config/user-config-x86_64.py | 3 +++ 4 files changed, 12 insertions(+) diff --git a/build_files/buildbot/config/user-config-i686.py b/build_files/buildbot/config/user-config-i686.py index 5d337a0db68..f2197a05501 100644 --- a/build_files/buildbot/config/user-config-i686.py +++ b/build_files/buildbot/config/user-config-i686.py @@ -89,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32' WITH_BF_FFTW3 = True WITH_BF_STATICFFTW3 = True +# JACK +WITH_BF_JACK = True + # Compilation and optimization BF_DEBUG = False REL_CFLAGS = ['-O2'] diff --git a/build_files/buildbot/config/user-config-player-i686.py b/build_files/buildbot/config/user-config-player-i686.py index 7c07240caa5..99671ecc072 100644 --- a/build_files/buildbot/config/user-config-player-i686.py +++ b/build_files/buildbot/config/user-config-player-i686.py @@ -80,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True BF_3DMOUSE = '/home/sources/staticlibs/spnav' BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32' +# JACK +WITH_BF_JACK = True + # Compilation and optimization BF_DEBUG = False REL_CFLAGS = ['-O2'] diff --git a/build_files/buildbot/config/user-config-player-x86_64.py b/build_files/buildbot/config/user-config-player-x86_64.py index 0df2a24f603..a1ca38880eb 100644 --- a/build_files/buildbot/config/user-config-player-x86_64.py +++ b/build_files/buildbot/config/user-config-player-x86_64.py @@ -80,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True BF_3DMOUSE = '/home/sources/staticlibs/spnav' BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64' +# JACK +WITH_BF_JACK = True + # Compilation and optimization BF_DEBUG = False REL_CFLAGS = ['-O2'] diff --git a/build_files/buildbot/config/user-config-x86_64.py b/build_files/buildbot/config/user-config-x86_64.py index 9fb9fbd56fa..93fe3ca2e5b 100644 --- a/build_files/buildbot/config/user-config-x86_64.py +++ b/build_files/buildbot/config/user-config-x86_64.py @@ -89,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64' WITH_BF_FFTW3 = True WITH_BF_STATICFFTW3 = True +# JACK +WITH_BF_JACK = True + # Compilation and optimization BF_DEBUG = False REL_CFLAGS = ['-O2'] From 43764c30d20674c9c647f75d1cc7bad5901f54e5 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 4 Oct 2011 18:15:28 +0000 Subject: [PATCH 062/113] bge bugfix: navmesh collision flag disputing with glsl_color_manag. The solution is to make the flag in to an int in oppose to short. This will also help in cucumber where we ran into the same problem. --- source/blender/makesdna/DNA_scene_types.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index f0f346fb759..b2ded4c756a 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -470,7 +470,8 @@ typedef struct GameData { * bit 3: (gameengine): Activity culling is enabled. * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling */ - short mode, flag, matmode, pad[2]; + int flag; + short mode, matmode, pad; short occlusionRes; /* resolution of occlusion Z buffer in pixel */ short physicsEngine; short ticrate, maxlogicstep, physubstep, maxphystep; @@ -520,9 +521,9 @@ typedef struct GameData { #define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12) #define GAME_ENABLE_ANIMATION_RECORD (1 << 13) #define GAME_SHOW_MOUSE (1 << 14) -#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 15) #define GAME_GLSL_NO_COLOR_MANAGEMENT (1 << 15) -/* Note: GameData.flag is a short (max 16 flags). To add more flags, GameData.flag needs to be an int */ +#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16) +/* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */ /* GameData.matmode */ #define GAME_MAT_TEXFACE 0 From 185df0811c3f8bd8246e0f314def008dbaf02b95 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Oct 2011 22:42:49 +0000 Subject: [PATCH 063/113] fix for error when fixing crash in filesel poll function. --- source/blender/editors/space_file/file_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c265c4ec1a7..0955d264ca8 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1178,7 +1178,7 @@ static int file_directory_poll(bContext *C) { /* sfile->files can be NULL on file load */ SpaceFile *sfile= CTX_wm_space_file(C); - return ED_operator_file_active(C) && sfile->files && filelist_lib(sfile->files); + return ED_operator_file_active(C) && (sfile->files==NULL || filelist_lib(sfile->files)==NULL); } void FILE_OT_directory(struct wmOperatorType *ot) From ca906b207d7afdc71459e1f4a730f20fd3219514 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Oct 2011 23:00:38 +0000 Subject: [PATCH 064/113] modify pacman file not to compile templates & presets. --- build_files/package_spec/pacman/PKGBUILD | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build_files/package_spec/pacman/PKGBUILD b/build_files/package_spec/pacman/PKGBUILD index 0f070f3d558..e59d1cf31d7 100644 --- a/build_files/package_spec/pacman/PKGBUILD +++ b/build_files/package_spec/pacman/PKGBUILD @@ -12,10 +12,12 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen # map the version a -> 1 # not to be confused with blender's internal subversions if [ "$blender_version_char" ]; then - blender_version=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char) + blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char) +else + blender_version_full=${blender_version} fi -blender_ver_string=$blender_version+svn$blender_revision +blender_ver_string=$blender_version+svn$blender_version_full pkgname=blender-snapshot pkgver=$blender_ver_string @@ -61,5 +63,8 @@ build() { package() { cd $srcdir/build make DESTDIR="$pkgdir" install - python -m compileall $pkgdir/usr/share/blender + python -m compileall \ + $pkgdir/usr/share/blender/$blender_version/scripts/startup \ + $pkgdir/usr/share/blender/$blender_version/scripts/modules \ + $pkgdir/usr/share/blender/$blender_version/scripts/addons } From 3bdadb6975b6ad92bdc6acd286ba5d5eb961b91c Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 4 Oct 2011 23:42:06 +0000 Subject: [PATCH 065/113] [#28801] Pet doesn't work on the whole mesh Reported by Enrico Valenza Mirror messes up the zone of influence. Disable mirror internally when proportional edit is on. --- source/blender/editors/transform/transform_generics.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index b6651ebd1ff..b5f622b747b 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1187,6 +1187,12 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->options |= CTX_NO_PET; } + // Mirror is not supported with PET, turn it off. + if (t->flag & T_PROP_EDIT) + { + t->flag &= ~T_MIRROR; + } + setTransformViewMatrices(t); initNumInput(&t->num); From 3b8de8db31a98ee2cabf783c5d58888cadab1d53 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 00:19:33 +0000 Subject: [PATCH 066/113] rename rna OperatorTypeMacro --> OperatorMacro, since operators types are just called Operator --- source/blender/makesrna/RNA_access.h | 2 +- source/blender/makesrna/intern/rna_wm.c | 8 ++++---- source/blender/python/intern/bpy_operator_wrap.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 1e9496fdbbb..374b1d93444 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -350,7 +350,7 @@ extern StructRNA RNA_OperatorFileListElement; extern StructRNA RNA_OperatorMousePath; extern StructRNA RNA_OperatorProperties; extern StructRNA RNA_OperatorStrokeElement; -extern StructRNA RNA_OperatorTypeMacro; +extern StructRNA RNA_OperatorMacro; extern StructRNA RNA_OrController; extern StructRNA RNA_OutflowFluidSettings; extern StructRNA RNA_PackedFile; diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 8fa780de498..e9df79acd4a 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -451,7 +451,7 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties); } -static PointerRNA rna_OperatorTypeMacro_properties_get(PointerRNA *ptr) +static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr) { wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data; wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE); @@ -1277,8 +1277,8 @@ static void rna_def_operator_type_macro(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - srna= RNA_def_struct(brna, "OperatorTypeMacro", NULL); - RNA_def_struct_ui_text(srna, "OperatorTypeMacro", "Storage of a sub operator in a macro after it has been added"); + srna= RNA_def_struct(brna, "OperatorMacro", NULL); + RNA_def_struct_ui_text(srna, "Operator Macro", "Storage of a sub operator in a macro after it has been added"); RNA_def_struct_sdna(srna, "wmOperatorTypeMacro"); // prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); @@ -1291,7 +1291,7 @@ static void rna_def_operator_type_macro(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_ui_text(prop, "Properties", ""); - RNA_def_property_pointer_funcs(prop, "rna_OperatorTypeMacro_properties_get", NULL, NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_OperatorMacro_properties_get", NULL, NULL, NULL); } static void rna_def_operator_utils(BlenderRNA *brna) diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index de29cb2aeac..b5ded8b3a65 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -125,7 +125,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args) otmacro= WM_operatortype_macro_define(ot, opname); - RNA_pointer_create(NULL, &RNA_OperatorTypeMacro, otmacro, &ptr_otmacro); + RNA_pointer_create(NULL, &RNA_OperatorMacro, otmacro, &ptr_otmacro); return pyrna_struct_CreatePyObject(&ptr_otmacro); } From f7737153e6c052c53d638d7bce986e4acbf47aad Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 03:39:22 +0000 Subject: [PATCH 067/113] filter RNA classes for translation (removes over 1300 lines from messages.txt) - omit operators tagged as INTERNAL - omit classes for internal use: Event, Context, Property, Function, Window. --- po/update_msg.py | 71 ++++++++++++++++++++- release/scripts/modules/bpy/ops.py | 9 ++- source/blender/python/intern/bpy_operator.c | 41 +++++++++++- 3 files changed, 116 insertions(+), 5 deletions(-) diff --git a/po/update_msg.py b/po/update_msg.py index 9fc9967146d..e91371c1755 100644 --- a/po/update_msg.py +++ b/po/update_msg.py @@ -17,7 +17,7 @@ # # ***** END GPL LICENSE BLOCK ***** -# +# # Write out messages.txt from blender @@ -36,6 +36,71 @@ COMMENT_PREFIX = "#~ " def dump_messages_rna(messages): import bpy + def classBlackList(): + blacklist_rna_class = [ + # core classes + "Context", "Event", "Function", "UILayout", + "BlendData", + # registerable classes + "Panel", "Menu", "Header", "RenderEngine", + "Operator", "OperatorMacro", "UnknownType" + # window classes + "WindowManager", "Window" + ] + + # --------------------------------------------------------------------- + # Collect internal operators + + # extend with all internal operators + # note that this uses internal api introspection functions + # all possible operator names + op_names = list(sorted(set( + [cls.bl_rna.identifier for cls in + bpy.types.OperatorProperties.__subclasses__()] + + [cls.bl_rna.identifier for cls in + bpy.types.Operator.__subclasses__()] + + [cls.bl_rna.identifier for cls in + bpy.types.OperatorMacro.__subclasses__()] + ))) + + get_inatance = __import__("_bpy").ops.get_instance + path_resolve = type(bpy.context).__base__.path_resolve + for idname in op_names: + op = get_inatance(idname) + if 'INTERNAL' in path_resolve(op, "bl_options"): + blacklist_rna_class.append(idname) + + # --------------------------------------------------------------------- + # Collect builtin classes we dont need to doc + blacklist_rna_class.append("Property") + blacklist_rna_class.extend( + [cls.__name__ for cls in + bpy.types.Property.__subclasses__()]) + + # --------------------------------------------------------------------- + # Collect classes which are attached to collections, these are api + # access only. + collection_props = set() + for cls_id in dir(bpy.types): + cls = getattr(bpy.types, cls_id) + for prop in cls.bl_rna.properties: + if prop.type == 'COLLECTION': + prop_cls = prop.srna + if prop_cls is not None: + collection_props.add(prop_cls.identifier) + blacklist_rna_class.extend(sorted(collection_props)) + + return blacklist_rna_class + + blacklist_rna_class = classBlackList() + + def filterRNA(bl_rna): + id = bl_rna.identifier + if id in blacklist_rna_class: + print(" skipping", id) + return True + return False + # ------------------------------------------------------------------------- # Function definitions @@ -70,6 +135,10 @@ def dump_messages_rna(messages): messages.setdefault(item.description, []).append(msgsrc) def walkRNA(bl_rna): + + if filterRNA(bl_rna): + return + msgsrc = "bpy.types.%s" % bl_rna.identifier if bl_rna.name and bl_rna.name != bl_rna.identifier: diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index 64c5a1a5f5f..ba9f6dafd19 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -27,6 +27,7 @@ op_poll = ops_module.poll op_call = ops_module.call op_as_string = ops_module.as_string op_get_rna = ops_module.get_rna +op_get_instance = ops_module.get_instance class BPyOps(object): @@ -184,11 +185,13 @@ class BPyOpsSubModOp(object): return ret def get_rna(self): - ''' - currently only used for 'bl_rna' - ''' + """Internal function for introspection""" return op_get_rna(self.idname()) + def get_instance(self): + """Internal function for introspection""" + return op_get_instance(self.idname()) + def __repr__(self): # useful display, repr(op) import bpy idname = self.idname() diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 7327679cc7e..dedc5df1f1c 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -408,12 +408,51 @@ static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value) return (PyObject *)pyrna; } +static PyObject *pyop_getinstance(PyObject *UNUSED(self), PyObject *value) +{ + wmOperatorType *ot; + wmOperator *op; + PointerRNA ptr; + char *opname= _PyUnicode_AsString(value); + BPy_StructRNA *pyrna= NULL; + + if(opname==NULL) { + PyErr_SetString(PyExc_TypeError, "_bpy.ops.get_instance() expects a string argument"); + return NULL; + } + ot= WM_operatortype_find(opname, TRUE); + if(ot==NULL) { + PyErr_Format(PyExc_KeyError, "_bpy.ops.get_instance(\"%s\") not found", opname); + return NULL; + } + +#ifdef PYRNA_FREE_SUPPORT + op= MEM_callocN(sizeof(wmOperator), __func__); +#else + op= PyMem_MALLOC(sizeof(wmOperator)); + memset(op, 0, sizeof(wmOperator)); +#endif + BLI_strncpy(op->idname, op->idname, sizeof(op->idname)); /* incase its needed */ + op->type= ot; + + RNA_pointer_create(NULL, &RNA_Operator, op, &ptr); + + pyrna= (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr); +#ifdef PYRNA_FREE_SUPPORT + pyrna->freeptr= TRUE; +#endif + op->ptr= &pyrna->ptr; + + return (PyObject *)pyrna; +} + static struct PyMethodDef bpy_ops_methods[]= { {"poll", (PyCFunction) pyop_poll, METH_VARARGS, NULL}, {"call", (PyCFunction) pyop_call, METH_VARARGS, NULL}, {"as_string", (PyCFunction) pyop_as_string, METH_VARARGS, NULL}, {"dir", (PyCFunction) pyop_dir, METH_NOARGS, NULL}, - {"get_rna", (PyCFunction) pyop_getrna, METH_O, NULL}, + {"get_rna", (PyCFunction) pyop_getrna, METH_O, NULL}, /* only for introspection, leaks memory */ + {"get_instance", (PyCFunction) pyop_getinstance, METH_O, NULL}, /* only for introspection, leaks memory */ {"macro_define", (PyCFunction) PYOP_wrap_macro_define, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; From 9d13224e1af758ab2ad2d501ca52f4403ac9adad Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 07:28:59 +0000 Subject: [PATCH 068/113] fix [#28807] Drivers breaking by undo --- source/blender/python/intern/bpy_driver.c | 7 +++++++ source/blender/python/intern/bpy_rna.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index f3ef55d29c4..319790340ca 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -41,6 +41,9 @@ #include "bpy_driver.h" +extern void BPY_update_rna_module(void); + + /* for pydrivers (drivers using one-line Python expressions to express relationships between targets) */ PyObject *bpy_pydriver_Dict= NULL; @@ -164,6 +167,10 @@ float BPY_driver_exec(ChannelDriver *driver) if(use_gil) gilstate= PyGILState_Ensure(); + /* needed since drivers are updated directly after undo where 'main' is + * re-allocated [#28807] */ + BPY_update_rna_module(); + /* init global dictionary for py-driver evaluation settings */ if (!bpy_pydriver_Dict) { if (bpy_pydriver_create_dict() != 0) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index d5a950fc5bb..f79f1d01a96 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5906,7 +5906,11 @@ PyObject *BPY_rna_module(void) void BPY_update_rna_module(void) { +#if 0 RNA_main_pointer_create(G.main, rna_module_ptr); +#else + rna_module_ptr->data= G.main; /* just set data is enough */ +#endif } #if 0 From 7058a8e2aefebe78412fb485870216225ddd9042 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 07:57:33 +0000 Subject: [PATCH 069/113] fix [#28809] Fileselect strange icon display. --- source/blender/editors/space_file/filesel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 1e113abfcd2..645f54a5767 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -246,6 +246,11 @@ short ED_fileselect_set_params(SpaceFile *sfile) sfile->folders_prev = folderlist_new(); folderlist_pushdir(sfile->folders_prev, sfile->params->dir); + /* switching thumbnails needs to recalc layout [#28809] */ + if (sfile->layout) { + sfile->layout->dirty= 1; + } + return 1; } From 39300a507962a536971d4c6b94ce2ec77a050e32 Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Wed, 5 Oct 2011 08:58:32 +0000 Subject: [PATCH 070/113] OSX: Correct copy/paste error and exclude endianess switch from darwin --- SConstruct | 2 +- intern/ghost/SConscript | 2 +- source/blender/quicktime/SConscript | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index eacf18266f0..b2affe1b6b7 100644 --- a/SConstruct +++ b/SConstruct @@ -338,7 +338,7 @@ if env['BF_NO_ELBEEM'] == 1: env['CCFLAGS'].append('-DDISABLE_ELBEEM') -if btools.ENDIAN == "big": +if btools.ENDIAN == "big" and not env['OURPLATFORM']=='darwin': env['CPPFLAGS'].append('-D__BIG_ENDIAN__') env['CXXFLAGS'].append('-D__BIG_ENDIAN__') env['CCFLAGS'].append('-D__BIG_ENDIAN__') diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index 0c3109b1482..9977a7927fc 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -103,7 +103,7 @@ if window_system in ('win32-vc', 'win64-vc'): env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') ) elif env['WITH_GHOST_COCOA']: # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet - env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/gcc-4.2' ) + env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/g++-4.2' ) print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC" else: diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript index 82735dc96bd..a128ded965c 100644 --- a/source/blender/quicktime/SConscript +++ b/source/blender/quicktime/SConscript @@ -35,6 +35,6 @@ defs=['WITH_QUICKTIME'] if env['WITH_GHOST_COCOA']: defs.append('GHOST_COCOA') - env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/gcc-4.2') # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet + env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/g++-4.2') # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet else: env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities) From 388eae9a810a5e742635c70912f024276a7a22b8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 12:20:38 +0000 Subject: [PATCH 071/113] minor edits - use TRUE/FALSE rather than 1/0 - WM_operator_properties_create_ptr rather than WM_operator_properties_create since the pointers available. - remove redundant strlen() --- source/blender/editors/interface/interface.c | 2 +- source/blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/space_file/filesel.c | 13 +++++++------ source/blender/editors/space_file/space_file.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5ebdf78e611..a816c1612a1 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2519,7 +2519,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, but->pos= -1; /* cursor invisible */ if(ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { /* add a space to name */ - slen= strlen(but->str); + /* slen remains unchanged from previous assignment, ensure this stays true */ if(slen>0 && slenstr[slen-1]!=' ') { but->str[slen]= ' '; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 2f10ebf1d73..ba612fc8727 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -768,7 +768,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname if(properties) { PointerRNA tptr; - WM_operator_properties_create(&tptr, opname); + WM_operator_properties_create_ptr(&tptr, ot); if(tptr.data) { IDP_FreeProperty(tptr.data); MEM_freeN(tptr.data); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 645f54a5767..e3571886cf4 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -248,7 +248,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) /* switching thumbnails needs to recalc layout [#28809] */ if (sfile->layout) { - sfile->layout->dirty= 1; + sfile->layout->dirty= TRUE; } return 1; @@ -471,12 +471,13 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar) int maxlen = 0; int numfiles; int textheight; + if (sfile->layout == NULL) { sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout"); - sfile->layout->dirty = 1; - } - - if (!sfile->layout->dirty) return; + sfile->layout->dirty = TRUE; + } else if (sfile->layout->dirty == FALSE) { + return; + } numfiles = filelist_numfiles(sfile->files); textheight = (int)file_font_pointsize(); @@ -543,7 +544,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar) layout->width = sfile->layout->columns * (layout->tile_w + 2*layout->tile_border_x) + layout->tile_border_x*2; layout->flag = FILE_LAYOUT_HOR; } - layout->dirty= 0; + layout->dirty= FALSE; } FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar) diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index f4adc471f70..7a70ed9c0a0 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -154,7 +154,7 @@ static void file_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) SpaceFile *sfile= (SpaceFile*)sa->spacedata.first; //printf("file_init\n"); - if(sfile->layout) sfile->layout->dirty= 1; + if(sfile->layout) sfile->layout->dirty= TRUE; } @@ -242,7 +242,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa)) BLI_strncpy(sfile->params->renameedit, sfile->params->renamefile, sizeof(sfile->params->renameedit)); params->renamefile[0] = '\0'; } - if (sfile->layout) sfile->layout->dirty= 1; + if (sfile->layout) sfile->layout->dirty= TRUE; } From 0a4814a6d01d6cd2e9bda871e30b261d0eff0ed4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 5 Oct 2011 15:28:02 +0000 Subject: [PATCH 072/113] Fix #28766: object properties > display > transparency no longer worked in solid draw mode, after texface changes. --- source/blender/gpu/intern/gpu_draw.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 120c203e7bd..c5d62559056 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1136,6 +1136,9 @@ int GPU_enable_material(int nr, void *attribs) GMS.lastretval = !GMS.lastretval; if(GMS.lastretval) { + /* for alpha pass, use alpha blend */ + alphablend = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID; + if(gattribs && GMS.gmatbuf[nr]) { /* bind glsl material and get attributes */ Material *mat = GMS.gmatbuf[nr]; @@ -1145,7 +1148,11 @@ int GPU_enable_material(int nr, void *attribs) GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT)); GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col); GMS.gboundmat= mat; - alphablend= mat->game.alpha_blend; + + /* for glsl use alpha blend mode, unless it's set to solid and + we are already drawing in an alpha pass */ + if(mat->game.alpha_blend != GPU_BLEND_SOLID) + alphablend= mat->game.alpha_blend; if(GMS.alphapass) glDepthMask(1); } @@ -1154,11 +1161,9 @@ int GPU_enable_material(int nr, void *attribs) glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr].diff); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr].spec); glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, GMS.matbuf[nr].hard); - alphablend= GPU_BLEND_SOLID; } /* set (alpha) blending mode */ - if(!GMS.alphapass) alphablend= GPU_BLEND_SOLID; GPU_set_material_alpha_blend(alphablend); } From 14dd4d19ed36cc79efcf3f97d06b2377783dcb5b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 22:43:00 +0000 Subject: [PATCH 073/113] update generated api changelog for edits since 2.59 --- doc/python_api/rst/change_log.rst | 398 ++++++++++++++++++++++++++++++ 1 file changed, 398 insertions(+) diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst index 6ab2e98d6bd..d332c4faff4 100644 --- a/doc/python_api/rst/change_log.rst +++ b/doc/python_api/rst/change_log.rst @@ -1082,3 +1082,401 @@ Moved * **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation` * **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation` +.. Automatically Generated, 2.59 -> r40804! + +bpy.types.RenderSettings +------------------------ + +Added +^^^^^ + +* :class:`bpy.types.RenderSettings.ffmpeg_audio_channels` + +bpy.types.DriverTarget +---------------------- + +Added +^^^^^ + +* :class:`bpy.types.DriverTarget.transform_space` + +Removed +^^^^^^^ + +* **use_local_space_transform** + +bpy.types.Sound +--------------- + +Added +^^^^^ + +* :class:`bpy.types.Sound.factory` +* :class:`bpy.types.Sound.use_mono` + +bpy.types.Camera +---------------- + +Added +^^^^^ + +* :class:`bpy.types.Camera.view_frame` + +bpy.types.Scene +--------------- + +Added +^^^^^ + +* :class:`bpy.types.Scene.audio_volume` + +bpy.types.KeyingSet +------------------- + +Added +^^^^^ + +* :class:`bpy.types.KeyingSet.refresh` + +bpy.types.Armature +------------------ + +Added +^^^^^ + +* :class:`bpy.types.Armature.deform_method` + +bpy.types.GameObjectSettings +---------------------------- + +Added +^^^^^ + +* :class:`bpy.types.GameObjectSettings.obstacle_radius` +* :class:`bpy.types.GameObjectSettings.use_obstacle_create` + +bpy.types.BlendData +------------------- + +Added +^^^^^ + +* :class:`bpy.types.BlendData.speakers` + +bpy.types.SolidifyModifier +-------------------------- + +Added +^^^^^ + +* :class:`bpy.types.SolidifyModifier.thickness_vertex_group` + +bpy.types.ThemeGraphEditor +-------------------------- + +Added +^^^^^ + +* :class:`bpy.types.ThemeGraphEditor.handle_auto_clamped` +* :class:`bpy.types.ThemeGraphEditor.handle_sel_auto_clamped` + +bpy.types.CompositorNodeIDMask +------------------------------ + +Added +^^^^^ + +* :class:`bpy.types.CompositorNodeIDMask.use_smooth_mask` + +bpy.types.Node +-------------- + +Added +^^^^^ + +* :class:`bpy.types.Node.parent` + +bpy.types.Texture +----------------- + +Added +^^^^^ + +* :class:`bpy.types.Texture.evaluate` + +bpy.types.UILayout +------------------ + +Added +^^^^^ + +* :class:`bpy.types.UILayout.template_keymap_item_properties` + +bpy.types.ToolSettings +---------------------- + +Added +^^^^^ + +* :class:`bpy.types.ToolSettings.use_multipaint` + +bpy.types.UserPreferencesInput +------------------------------ + +Added +^^^^^ + +* :class:`bpy.types.UserPreferencesInput.ndof_panx_invert_axis` +* :class:`bpy.types.UserPreferencesInput.ndof_pany_invert_axis` +* :class:`bpy.types.UserPreferencesInput.ndof_panz_invert_axis` +* :class:`bpy.types.UserPreferencesInput.ndof_roll_invert_axis` +* :class:`bpy.types.UserPreferencesInput.ndof_rotate_invert_axis` +* :class:`bpy.types.UserPreferencesInput.ndof_tilt_invert_axis` + +bpy.types.LockedTrackConstraint +------------------------------- + +Added +^^^^^ + +* :class:`bpy.types.LockedTrackConstraint.head_tail` + +bpy.types.SpaceGraphEditor +-------------------------- + +Moved +^^^^^ + +* use_fancy_drawing -> :class:`bpy.types.SpaceGraphEditor.use_beauty_drawing` + +bpy.types.ParticleSystem +------------------------ + +Added +^^^^^ + +* :class:`bpy.types.ParticleSystem.dt_frac` + +bpy.types.Mesh +-------------- + +Added +^^^^^ + +* :class:`bpy.types.Mesh.use_paint_mask_vertex` + +bpy.types.FCurve +---------------- + +Removed +^^^^^^^ + +* **use_auto_handle_clamp** + +bpy.types.DampedTrackConstraint +------------------------------- + +Added +^^^^^ + +* :class:`bpy.types.DampedTrackConstraint.head_tail` + +bpy.types.ImageTexture +---------------------- + +Added +^^^^^ + +* :class:`bpy.types.ImageTexture.use_derivative_map` + +bpy.types.SoundSequence +----------------------- + +Added +^^^^^ + +* :class:`bpy.types.SoundSequence.pan` +* :class:`bpy.types.SoundSequence.pitch` + +Removed +^^^^^^^ + +* **attenuation** + +bpy.types.FModifier +------------------- + +Added +^^^^^ + +* :class:`bpy.types.FModifier.blend_in` +* :class:`bpy.types.FModifier.blend_out` +* :class:`bpy.types.FModifier.frame_end` +* :class:`bpy.types.FModifier.frame_start` +* :class:`bpy.types.FModifier.influence` +* :class:`bpy.types.FModifier.use_influence` +* :class:`bpy.types.FModifier.use_restricted_range` + +bpy.types.EnvironmentMap +------------------------ + +Added +^^^^^ + +* :class:`bpy.types.EnvironmentMap.clear` +* :class:`bpy.types.EnvironmentMap.is_valid` +* :class:`bpy.types.EnvironmentMap.save` + +bpy.types.UserPreferencesSystem +------------------------------- + +Added +^^^^^ + +* :class:`bpy.types.UserPreferencesSystem.use_translate_interface` + +Removed +^^^^^^^ + +* **use_translate_buttons** +* **use_translate_toolbox** + +bpy.types.LimitDistanceConstraint +--------------------------------- + +Added +^^^^^ + +* :class:`bpy.types.LimitDistanceConstraint.head_tail` +* :class:`bpy.types.LimitDistanceConstraint.use_transform_limit` + +bpy.types.MovieSequence +----------------------- + +Added +^^^^^ + +* :class:`bpy.types.MovieSequence.stream_index` + +bpy.types.Material +------------------ + +Added +^^^^^ + +* :class:`bpy.types.Material.game_settings` + +bpy.types.Object +---------------- + +Added +^^^^^ + +* :class:`bpy.types.Object.matrix_parent_inverse` + +bpy.types.SequenceProxy +----------------------- + +Added +^^^^^ + +* :class:`bpy.types.SequenceProxy.build_100` +* :class:`bpy.types.SequenceProxy.build_25` +* :class:`bpy.types.SequenceProxy.build_50` +* :class:`bpy.types.SequenceProxy.build_75` +* :class:`bpy.types.SequenceProxy.build_free_run` +* :class:`bpy.types.SequenceProxy.build_free_run_rec_date` +* :class:`bpy.types.SequenceProxy.build_record_run` +* :class:`bpy.types.SequenceProxy.quality` +* :class:`bpy.types.SequenceProxy.timecode` + +bpy.types.Sequence +------------------ + +Added +^^^^^ + +* :class:`bpy.types.Sequence.waveform` + +bpy.types.DopeSheet +------------------- + +Added +^^^^^ + +* :class:`bpy.types.DopeSheet.show_datablock_filters` +* :class:`bpy.types.DopeSheet.show_speakers` + +bpy.types.ActionActuator +------------------------ + +Added +^^^^^ + +* :class:`bpy.types.ActionActuator.apply_to_children` +* :class:`bpy.types.ActionActuator.layer` +* :class:`bpy.types.ActionActuator.layer_weight` +* :class:`bpy.types.ActionActuator.use_additive` +* :class:`bpy.types.ActionActuator.use_force` +* :class:`bpy.types.ActionActuator.use_local` + +bpy.types.VertexGroup +--------------------- + +Added +^^^^^ + +* :class:`bpy.types.VertexGroup.lock_weight` + +bpy.types.ThemeView3D +--------------------- + +Added +^^^^^ + +* :class:`bpy.types.ThemeView3D.speaker` + +bpy.types.Image +--------------- + +Added +^^^^^ + +* :class:`bpy.types.Image.pack` +* :class:`bpy.types.Image.unpack` + +bpy.types.Curve +--------------- + +Added +^^^^^ + +* :class:`bpy.types.Curve.fill_mode` + +Removed +^^^^^^^ + +* **use_fill_back** +* **use_fill_front** + +bpy.types.ParticleSettings +-------------------------- + +Added +^^^^^ + +* :class:`bpy.types.ParticleSettings.adaptive_subframes` +* :class:`bpy.types.ParticleSettings.courant_target` + +bpy.types.SceneGameData +----------------------- + +Added +^^^^^ + +* :class:`bpy.types.SceneGameData.level_height` +* :class:`bpy.types.SceneGameData.obstacle_simulation` +* :class:`bpy.types.SceneGameData.recast_data` +* :class:`bpy.types.SceneGameData.restrict_animation_updates` +* :class:`bpy.types.SceneGameData.show_obstacle_simulation` + From bfe27327a0258c34f9e42e422276f1821e8611af Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 23:17:40 +0000 Subject: [PATCH 074/113] revert part of r40800, btools.ENDIAN should be correct, if its not then that needs to be fixed rather then checking on the platform. ./build_files/scons/tools/btools.py:68 - checkEndian() uses pythons struct which knows the systems native endian and will work unless cross compiling (which afaik isnt dont between different endian systems so far). --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index b2affe1b6b7..eacf18266f0 100644 --- a/SConstruct +++ b/SConstruct @@ -338,7 +338,7 @@ if env['BF_NO_ELBEEM'] == 1: env['CCFLAGS'].append('-DDISABLE_ELBEEM') -if btools.ENDIAN == "big" and not env['OURPLATFORM']=='darwin': +if btools.ENDIAN == "big": env['CPPFLAGS'].append('-D__BIG_ENDIAN__') env['CXXFLAGS'].append('-D__BIG_ENDIAN__') env['CCFLAGS'].append('-D__BIG_ENDIAN__') From 427f770d64313cd2986be43759003e77c4865f54 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Oct 2011 23:35:03 +0000 Subject: [PATCH 075/113] scons flags were being set carelessly - CCFLAGS is like setting CFLAGS and CXXFLAGS - in a few cases this was being set redundantly. there are more cases that chould be changed since CPPFLAGS and CCFLAGS are both being set where only one is needed but for now this is safe. --- SConstruct | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/SConstruct b/SConstruct index eacf18266f0..738466d389e 100644 --- a/SConstruct +++ b/SConstruct @@ -30,6 +30,7 @@ # Then read all SConscripts and build # # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds. +# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one. import platform as pltfrm @@ -283,26 +284,21 @@ if env['WITH_BF_OPENMP'] == 1: if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): env['CCFLAGS'].append('/openmp') env['CPPFLAGS'].append('/openmp') - env['CXXFLAGS'].append('/openmp') else: if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case env.Append(LINKFLAGS=['-openmp', '-static-intel']) env['CCFLAGS'].append('-openmp') env['CPPFLAGS'].append('-openmp') - env['CXXFLAGS'].append('-openmp') else: env.Append(CCFLAGS=['-fopenmp']) env.Append(CPPFLAGS=['-fopenmp']) - env.Append(CXXFLAGS=['-fopenmp']) if env['WITH_GHOST_COCOA'] == True: env.Append(CFLAGS=['-DGHOST_COCOA']) - env.Append(CXXFLAGS=['-DGHOST_COCOA']) env.Append(CPPFLAGS=['-DGHOST_COCOA']) if env['USE_QTKIT'] == True: - env.Append(CFLAGS=['-DUSE_QTKIT']) - env.Append(CXXFLAGS=['-DUSE_QTKIT']) + env.Append(CFLAGS=['-DUSE_QTKIT']) env.Append(CPPFLAGS=['-DUSE_QTKIT']) #check for additional debug libnames @@ -334,23 +330,19 @@ if 'blendernogame' in B.targets: # disable elbeem (fluidsim) compilation? if env['BF_NO_ELBEEM'] == 1: env['CPPFLAGS'].append('-DDISABLE_ELBEEM') - env['CXXFLAGS'].append('-DDISABLE_ELBEEM') env['CCFLAGS'].append('-DDISABLE_ELBEEM') if btools.ENDIAN == "big": env['CPPFLAGS'].append('-D__BIG_ENDIAN__') - env['CXXFLAGS'].append('-D__BIG_ENDIAN__') env['CCFLAGS'].append('-D__BIG_ENDIAN__') else: env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__') - env['CXXFLAGS'].append('-D__LITTLE_ENDIAN__') env['CCFLAGS'].append('-D__LITTLE_ENDIAN__') # TODO, make optional env['CPPFLAGS'].append('-DWITH_AUDASPACE') -env['CXXFLAGS'].append('-DWITH_AUDASPACE') env['CCFLAGS'].append('-DWITH_AUDASPACE') # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir From 4b1ba6bef63ce4d4a17f834f8bbd0f60d1a0a008 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 01:29:32 +0000 Subject: [PATCH 076/113] fix for crash when painting normalize with no vertex groups, also minor cleanup to do_weight_paint_auto_normalize_all_groups() --- .../editors/sculpt_paint/paint_vertex.c | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 0c2cb2ee36d..3ba81715b90 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1114,31 +1114,33 @@ static void do_weight_paint_auto_normalize(MDeformVert *dvert, #endif /* the active group should be involved in auto normalize */ -static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *map, char do_auto_normalize) +static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const char *vgroup_validmap, char do_auto_normalize) { -// MDeformWeight *dw = dvert->dw; - float sum=0.0f, fac=0.0f; - int i, tot=0; - - if (do_auto_normalize == FALSE) + if (do_auto_normalize == FALSE) { return; - - for (i=0; itotweight; i++) { - if (map[dvert->dw[i].def_nr]) { - tot += 1; - sum += dvert->dw[i].weight; - } } - - if (!tot || sum == 1.0f) - return; + else { + float sum= 0.0f, fac; + unsigned int i, tot=0; + MDeformWeight *dw; - fac = sum; - fac = fac==0.0f ? 1.0f : 1.0f / fac; + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (vgroup_validmap[dw->def_nr]) { + tot++; + sum += dw->weight; + } + } - for (i=0; itotweight; i++) { - if (map[dvert->dw[i].def_nr]) { - dvert->dw[i].weight *= fac; + if ((tot == 0) || (sum == 1.0f) || (sum == 0.0f)) { + return; + } + + fac= 1.0f / sum; + + for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) { + if (vgroup_validmap[dw->def_nr]) { + dw->weight *= fac; + } } } } @@ -1828,8 +1830,7 @@ static char *wpaint_make_validmap(Object *ob) if (!(md->mode & (eModifierMode_Realtime|eModifierMode_Virtual))) continue; - if (md->type == eModifierType_Armature) - { + if (md->type == eModifierType_Armature) { ArmatureModifierData *amd= (ArmatureModifierData*) md; if(amd->object && amd->object->pose) { @@ -2006,7 +2007,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P wpi.vgroup_validmap= wpd->vgroup_validmap; wpi.do_flip= RNA_boolean_get(itemptr, "pen_flip"); wpi.do_multipaint= (ts->multipaint != 0); - wpi.do_auto_normalize= (ts->auto_normalize != 0); + wpi.do_auto_normalize= ((ts->auto_normalize != 0) && (wpi.vgroup_validmap != NULL)); /* *** done setting up WeightPaintInfo *** */ From 4e6be49ca46f20879c9e1e75ec9cb9340eabf62f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 01:51:01 +0000 Subject: [PATCH 077/113] fix for memory leak when calling wpaint_make_validmap() with no vertex groups. --- .../blender/editors/sculpt_paint/paint_vertex.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 3ba81715b90..c3b575d5d21 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1812,16 +1812,19 @@ static char *wpaint_make_validmap(Object *ob) bDeformGroup *dg; ModifierData *md; char *vgroup_validmap; - GHash *gh = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh"); + GHash *gh; int i = 0, step1=1; - /*add all names to a hash table*/ - for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) { - BLI_ghash_insert(gh, dg->name, NULL); + if(ob->defbase.first == NULL) { + return NULL; } - if (!i) - return NULL; + gh= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh"); + + /*add all names to a hash table*/ + for (dg=ob->defbase.first; dg; dg=dg->next) { + BLI_ghash_insert(gh, dg->name, NULL); + } vgroup_validmap= MEM_callocN(i, "wpaint valid map"); From e1ce98f8ae3dff12608ffd78bc27fc8d9d3a0845 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 02:19:04 +0000 Subject: [PATCH 078/113] fix error in last commit & remove commented code which is now working in 2.5x. --- .../editors/sculpt_paint/paint_vertex.c | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index c3b575d5d21..8040c98bec9 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1813,7 +1813,7 @@ static char *wpaint_make_validmap(Object *ob) ModifierData *md; char *vgroup_validmap; GHash *gh; - int i = 0, step1=1; + int i, step1=1; if(ob->defbase.first == NULL) { return NULL; @@ -1826,7 +1826,7 @@ static char *wpaint_make_validmap(Object *ob) BLI_ghash_insert(gh, dg->name, NULL); } - vgroup_validmap= MEM_callocN(i, "wpaint valid map"); + vgroup_validmap= MEM_callocN(BLI_ghash_size(gh), "wpaint valid map"); /*now loop through the armature modifiers and identify deform bones*/ for (md = ob->modifiers.first; md; md= !md->next && step1 ? (step1=0), modifiers_getVirtualModifierList(ob) : md->next) { @@ -1898,18 +1898,10 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED wpd->auto_normalize = ts->auto_normalize; wpd->defbase_tot = BLI_countlist(&ob->defbase); wpd->lock_flags = gen_lock_flags(ob, wpd->defbase_tot); - if (wpd->auto_normalize || ts->multipaint || wpd->lock_flags) + if (wpd->auto_normalize || ts->multipaint || wpd->lock_flags) { wpd->vgroup_validmap = wpaint_make_validmap(ob); - - // if(qual & LR_CTRLKEY) { - // sample_wpaint(scene, ar, v3d, 0); - // return; - // } - // if(qual & LR_SHIFTKEY) { - // sample_wpaint(scene, ar, v3d, 1); - // return; - // } - + } + /* ALLOCATIONS! no return after this line */ /* painting on subsurfs should give correct points too, this returns me->totvert amount */ wpd->vertexcosnos= mesh_get_mapped_verts_nors(scene, ob); @@ -1937,9 +1929,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED if(ob->defbase.first==NULL) { ED_vgroup_add(ob); } - - // if(ob->lay & v3d->lay); else error("Active object is not in this layer"); - + /* imat for normals */ mul_m4_m4m4(mat, ob->obmat, wpd->vc.rv3d->viewmat); invert_m4_m4(imat, mat); From ce1ac3412ddf15d4da194df976e99021bbcedc18 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 02:29:15 +0000 Subject: [PATCH 079/113] dont define the ghost PREFIX for scons, since this means our portable downloadable binary would find the system blender files (if installed). this should stay disabled until scons supports system/portable installs as with cmake. --- intern/ghost/SConscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index 9977a7927fc..39757c873d8 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -34,7 +34,12 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f sources.remove('intern' + os.sep + f + 'SDL.cpp') except ValueError: pass - defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option + ## removing because scons does not support system installation + ## if this is used for blender.org builds it means our distrobution + ## will find any locally installed blender and double up its script path. + ## So until this is supported properly as with CMake, + ## just dont use the PREFIX. + # defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option defs += ['WITH_X11_XINPUT'] # XXX, make an option elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'): From 6af6cf2055426670795ff8a34cfcfb2f9912a2ea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 03:57:03 +0000 Subject: [PATCH 080/113] cleanup for main weight paint drawing function while looking into a bug - no functional changes. --- .../editors/sculpt_paint/paint_vertex.c | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 8040c98bec9..f91d4a23699 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1582,41 +1582,43 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert ) { Mesh *me= ob->data; + MDeformVert *dv= &me->dvert[index]; MDeformWeight *dw, *uw; int vgroup= ob->actdef-1; if(wp->flag & VP_ONLYVGROUP) { - dw= defvert_find_index(&me->dvert[index], vgroup); + dw= defvert_find_index(dv, vgroup); uw= defvert_find_index(wp->wpaint_prev+index, vgroup); } else { - dw= defvert_verify_index(&me->dvert[index], vgroup); + dw= defvert_verify_index(dv, vgroup); uw= defvert_verify_index(wp->wpaint_prev+index, vgroup); } - if(dw==NULL || uw==NULL) + + if(dw==NULL || uw==NULL) { return; + } /* TODO: De-duplicate the simple weight paint - jason */ /* ... or not, since its <10 SLOC - campbell */ /* If there are no locks or multipaint, * then there is no need to run the more complicated checks */ - if( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) && - (wpi->lock_flags == NULL || has_locked_group(&me->dvert[index], wpi->lock_flags) == FALSE)) + if( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) && + (wpi->lock_flags == NULL || has_locked_group(dv, wpi->lock_flags) == FALSE)) { wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE); - do_weight_paint_auto_normalize_all_groups(&me->dvert[index], wpi->vgroup_validmap, wpi->do_auto_normalize); + do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, index); - if(j>=0) { + int index_mirr= mesh_get_x_mirror_vert(ob, index); + if(index_mirr != -1) { + MDeformVert *dv_mirr= &me->dvert[index_mirr]; /* copy, not paint again */ - uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); - + uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); uw->weight= dw->weight; - - do_weight_paint_auto_normalize_all_groups(me->dvert+j, wpi->vgroup_validmap, wpi->do_auto_normalize); + do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize); } } } @@ -1629,7 +1631,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert float oldChange = 0; int i; MDeformWeight *tdw = NULL, *tuw; - MDeformVert dv= {NULL}; + MDeformVert dv_copy= {NULL}; oldw = dw->weight; wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, wpi->do_multipaint && wpi->defbase_tot_sel >1); @@ -1638,17 +1640,17 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert /* setup multi-paint */ if(wpi->defbase_tot_sel > 1 && wpi->do_multipaint) { - dv.dw= MEM_dupallocN(me->dvert[index].dw); - dv.flag = me->dvert[index].flag; - dv.totweight = me->dvert[index].totweight; + dv_copy.dw= MEM_dupallocN(dv->dw); + dv_copy.flag = dv->flag; + dv_copy.totweight = dv->totweight; tdw = dw; tuw = uw; change = get_mp_change(wp->wpaint_prev+index, wpi->defbase_sel, neww - oldw); if(change) { if(!tdw->weight) { - i = get_first_selected_nonzero_weight(&me->dvert[index], wpi->defbase_sel); + i = get_first_selected_nonzero_weight(dv, wpi->defbase_sel); if(i>=0) { - tdw = &(me->dvert[index].dw[i]); + tdw = &(dv->dw[i]); tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr); } else { @@ -1662,7 +1664,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert if( testw > tuw->weight ) { if(change > oldChange) { /* reset the weights and use the new change */ - reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]); + reset_to_prev(wp->wpaint_prev+index, dv); } else { /* the old change was more significant, so set @@ -1672,7 +1674,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert } else { if(change < oldChange) { - reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]); + reset_to_prev(wp->wpaint_prev+index, dv); } else { change = 0; @@ -1687,25 +1689,24 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert } if(apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) { - reset_to_prev(&dv, &me->dvert[index]); + reset_to_prev(&dv_copy, dv); change = 0; oldChange = 0; } - if(dv.dw) { - MEM_freeN(dv.dw); + if(dv_copy.dw) { + MEM_freeN(dv_copy.dw); } - /* dvert may have been altered greatly */ - dw = defvert_find_index(&me->dvert[index], vgroup); + /* dv may have been altered greatly */ + dw = defvert_find_index(dv, vgroup); if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, index); - if(j>=0) { + int index_mirr= mesh_get_x_mirror_vert(ob, index); + if(index_mirr != -1) { + MDeformVert *dv_mirr= &me->dvert[index_mirr]; /* copy, not paint again */ - uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); - + uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); //uw->weight= dw->weight; - - apply_mp_locks_normalize(me, wpi, j, uw, tdw, change, oldChange, oldw, neww); + apply_mp_locks_normalize(me, wpi, index_mirr, uw, tdw, change, oldChange, oldw, neww); } } } From 2b3ef4b18bfffed6afdba54db29bcea4d3c93d85 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 04:06:47 +0000 Subject: [PATCH 081/113] fix [#26193] Weightpainting on Mesh with Armature-Modifier fails if x-mirror and auto normalize is enabled --- source/blender/editors/sculpt_paint/paint_vertex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f91d4a23699..d724541943b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1618,9 +1618,14 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert /* copy, not paint again */ uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup); uw->weight= dw->weight; - do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize); } } + + /* important to normalize after mirror, otherwise mirror gets wight + * which has already been scaled down in relation to other weights, + * then scales a second time [#26193]. Tricky multi-paint code doesn't + * suffer from this problem - campbell */ + do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize); } else { /* use locks and/or multipaint */ From cb3456e92ae274ef56a732b6f9edc94e11f35f29 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 04:09:48 +0000 Subject: [PATCH 082/113] fix for fix --- source/blender/editors/sculpt_paint/paint_vertex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d724541943b..a4c70a9e803 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1609,7 +1609,6 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert (wpi->lock_flags == NULL || has_locked_group(dv, wpi->lock_flags) == FALSE)) { wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE); - do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */ int index_mirr= mesh_get_x_mirror_vert(ob, index); @@ -1625,7 +1624,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert * which has already been scaled down in relation to other weights, * then scales a second time [#26193]. Tricky multi-paint code doesn't * suffer from this problem - campbell */ - do_weight_paint_auto_normalize_all_groups(dv_mirr, wpi->vgroup_validmap, wpi->do_auto_normalize); + do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); } else { /* use locks and/or multipaint */ From 2bfaf18d393be938d35ab5428d5eb2d3a70b191f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 04:33:00 +0000 Subject: [PATCH 083/113] remove unused struct member & minor edits, no functional change. --- .../editors/sculpt_paint/paint_vertex.c | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index a4c70a9e803..cf90c43f3e1 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -290,7 +290,7 @@ static void make_vertexcol(Object *ob) /* single ob */ } /* mirror_vgroup is set to -1 when invalid */ -static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror) +static int wpaint_mirror_vgroup_ensure(Object *ob) { bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef - 1); @@ -317,13 +317,12 @@ static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror) /* curdef should never be NULL unless this is * a lamp and ED_vgroup_add_name fails */ if(curdef) { - *vgroup_mirror= mirrdef; - return; + return mirrdef; } } } - *vgroup_mirror= -1; + return -1; } static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot) @@ -424,9 +423,9 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight) vgroup= ob->actdef-1; - /* if mirror painting, find the other group */ + /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - wpaint_mirror_vgroup_ensure(ob, &vgroup_mirror); + vgroup_mirror= wpaint_mirror_vgroup_ensure(ob); } copy_wpaint_prev(wp, me->dvert, me->totvert); @@ -1806,7 +1805,6 @@ struct WPaintData { float wpimat[3][3]; /*variables for auto normalize*/ - int auto_normalize; char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/ char *lock_flags; int defbase_tot; @@ -1831,8 +1829,6 @@ static char *wpaint_make_validmap(Object *ob) BLI_ghash_insert(gh, dg->name, NULL); } - vgroup_validmap= MEM_callocN(BLI_ghash_size(gh), "wpaint valid map"); - /*now loop through the armature modifiers and identify deform bones*/ for (md = ob->modifiers.first; md; md= !md->next && step1 ? (step1=0), modifiers_getVirtualModifierList(ob) : md->next) { if (!(md->mode & (eModifierMode_Realtime|eModifierMode_Virtual))) @@ -1857,12 +1853,12 @@ static char *wpaint_make_validmap(Object *ob) } } } - + + vgroup_validmap= MEM_mallocN(BLI_ghash_size(gh), "wpaint valid map"); + /*add all names to a hash table*/ for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) { - if (BLI_ghash_lookup(gh, dg->name) != NULL) { - vgroup_validmap[i] = TRUE; - } + vgroup_validmap[i]= (BLI_ghash_lookup(gh, dg->name) != NULL); } BLI_ghash_free(gh, NULL, NULL); @@ -1900,10 +1896,9 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED /*set up auto-normalize, and generate map for detecting which vgroups affect deform bones*/ - wpd->auto_normalize = ts->auto_normalize; wpd->defbase_tot = BLI_countlist(&ob->defbase); wpd->lock_flags = gen_lock_flags(ob, wpd->defbase_tot); - if (wpd->auto_normalize || ts->multipaint || wpd->lock_flags) { + if (ts->auto_normalize || ts->multipaint || wpd->lock_flags) { wpd->vgroup_validmap = wpaint_make_validmap(ob); } @@ -1942,7 +1937,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED /* if mirror painting, find the other group */ if(me->editflag & ME_EDIT_MIRROR_X) { - wpaint_mirror_vgroup_ensure(ob, &wpd->vgroup_mirror); + wpd->vgroup_mirror= wpaint_mirror_vgroup_ensure(ob); } return 1; From 06e3cadd8f48348f80a39dc71f2e4e85af94d0cd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 05:01:24 +0000 Subject: [PATCH 084/113] fix for weight paint with face mask enabled drawing with lights. --- source/blender/editors/space_view3d/drawmesh.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 546e5ccba5d..3cb55c0c10a 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -309,16 +309,24 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; - int istex, solidtex= 0; + int istex, solidtex; // XXX scene->obedit warning - if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) { + + /* texture draw is abused for mask selection mode, do this so wire draw + * with face selection in weight paint is not lit. */ + if((v3d->drawtype <= OB_WIRE) && (ob->mode & OB_MODE_WEIGHT_PAINT)) { + solidtex= FALSE; + Gtexdraw.islit= 0; + } + else if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) { /* draw with default lights in solid draw mode and edit mode */ - solidtex= 1; + solidtex= TRUE; Gtexdraw.islit= -1; } else { /* draw with lights in the scene otherwise */ + solidtex= FALSE; Gtexdraw.islit= GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); } From 1352803506e852c28e4f44b9b7fb9eeffae4389f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 05:10:09 +0000 Subject: [PATCH 085/113] fix for error in own edits to recently applied select link sequencer patch. --- source/blender/editors/space_sequencer/sequencer_select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 45dd08e3ece..7e718dc176a 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1048,7 +1048,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) } SEQ_END; - seq->tmp= SET_INT_IN_POINTER(TRUE); + actseq->tmp= SET_INT_IN_POINTER(TRUE); for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { seq = iter.seq; From 226d3a87d28ad4327ace3dd2b6602b904fda5449 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 05:45:06 +0000 Subject: [PATCH 086/113] Object Menu Edits: - add quick effects to object menu, these are too useful to hide in search menu. - set/clear track/parent - expand the operators enums in submenus - no advantage in having a further popup after clicking on the menu item. - move 'Join UVs' into Make links menu which is currently being abused to store some copy functions. Do this because the 'Object' menu is getting too big. --- release/scripts/startup/bl_ui/space_view3d.py | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index f9e42862b9c..9b93fd18bac 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -721,11 +721,14 @@ class VIEW3D_MT_object(Menu): layout.separator() + layout.menu("VIEW3D_MT_object_quick_effects") + + layout.separator() + layout.menu("VIEW3D_MT_object_game") layout.separator() - layout.operator("object.join_uvs") layout.operator("object.join") layout.separator() @@ -879,8 +882,8 @@ class VIEW3D_MT_object_parent(Menu): def draw(self, context): layout = self.layout - layout.operator("object.parent_set", text="Set") - layout.operator("object.parent_clear", text="Clear") + layout.operator_menu_enum("object.parent_set", "type", text="Set") + layout.operator_menu_enum("object.parent_clear", "type", text="Clear") class VIEW3D_MT_object_track(Menu): @@ -889,8 +892,8 @@ class VIEW3D_MT_object_track(Menu): def draw(self, context): layout = self.layout - layout.operator("object.track_set", text="Set") - layout.operator("object.track_clear", text="Clear") + layout.operator_menu_enum("object.track_set", "type", text="Set") + layout.operator_menu_enum("object.track_clear", "type", text="Clear") class VIEW3D_MT_object_group(Menu): @@ -919,6 +922,18 @@ class VIEW3D_MT_object_constraints(Menu): layout.operator("object.constraints_clear") +class VIEW3D_MT_object_quick_effects(Menu): + bl_label = "Quick Effects" + + def draw(self, context): + layout = self.layout + + layout.operator("object.quick_fur") + layout.operator("object.quick_explode") + layout.operator("object.quick_smoke") + layout.operator("object.quick_fluid") + + class VIEW3D_MT_object_showhide(Menu): bl_label = "Show/Hide" @@ -968,6 +983,7 @@ class VIEW3D_MT_make_links(Menu): layout.operator_enum("object.make_links_data", "type") # inline + layout.operator("object.join_uvs") # stupid place to add this! class VIEW3D_MT_object_game(Menu): bl_label = "Game" From 0d2b936d622710a1bef2c0253da7c5d08ad067a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 06:16:20 +0000 Subject: [PATCH 087/113] fix [#28113] ZTransp flag is not imported correctly from 2.49 files infact this only changes a setting which is ignored. but may as well keep whats set in 2.4x. --- source/blender/blenloader/intern/readfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 765fe7ada12..95bf44d884c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10384,7 +10384,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma->mode |= MA_TRANSP; } else { - ma->mode |= MA_ZTRANSP; + /* ma->mode |= MA_ZTRANSP; */ /* leave ztransp as is even if its not used [#28113] */ ma->mode &= ~MA_TRANSP; } @@ -11755,7 +11755,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(!mat->mtex[tex_nr]) continue; if(mat->mtex[tex_nr]->mapto & MAP_ALPHA) transp_tex= 1; } - + + /* weak! material alpha could be animated */ if(mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex){ mat->mode |= MA_TRANSP; mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP); From be143cc037ad80dd792546bf0e2bd22b70c32ffe Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 6 Oct 2011 06:56:45 +0000 Subject: [PATCH 088/113] texface fix: if material is not used by mesh set default bge mat flag (backface culling on) report by Mitchell Stokes over IRC, but probably one of the reason people have been asking to expose the Game Settings material panel in the Render engine as well. --- source/blender/blenkernel/intern/material.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 6e1303e375e..a763941cfe9 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1995,6 +1995,11 @@ int do_version_tface(Main *main, int fileload) } } } + /* material is not used by faces with texface + * set the default flag - do it only once */ + else + if (fileload) + ma->game.flag = GEMAT_BACKCULL; } return nowarning; From 8cfc183f8419967877b87cc923f1544750b8952d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 10:06:53 +0000 Subject: [PATCH 089/113] hide 3d view header `use_pivot_point_align` button in editmode since its not used there, also remove unneeded copy() funcs from quick effects. --- .../scripts/startup/bl_operators/object_quick_effects.py | 4 ++-- source/blender/editors/space_view3d/view3d_header.c | 7 ++++++- source/blender/makesrna/intern/rna_space.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index c13a04eb87a..490ee230220 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -462,10 +462,10 @@ class QuickFluid(Operator): if self.style == 'INFLOW': mod.settings.type = 'INFLOW' - mod.settings.inflow_velocity = self.initial_velocity.copy() + mod.settings.inflow_velocity = self.initial_velocity else: mod.settings.type = 'FLUID' - mod.settings.initial_velocity = self.initial_velocity.copy() + mod.settings.initial_velocity = self.initial_velocity obj.hide_render = not self.show_flows if not self.show_flows: diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 44d85af858c..fd27dc65a0e 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -530,7 +530,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) row= uiLayoutRow(layout, 1); uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + + /* pose/object only however we want to allow in weight paint mode too + * so dont be totally strict and just check not-editmode for now */ + if (obedit == NULL) { + uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } /* Transform widget / manipulators */ row= uiLayoutRow(layout, 1); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 560e2dbcd8e..8afcd61b9c8 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1365,7 +1365,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN); - RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only"); + RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)"); RNA_def_property_ui_icon(prop, ICON_ALIGN, 0); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update"); From 38221fa8e6184da76ec6c86e619f79d1749f218e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 11:40:49 +0000 Subject: [PATCH 090/113] set mikktspace functions as static which are not used externally. --- intern/mikktspace/mikktspace.c | 98 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 1bb73553012..ff857e82d8f 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -166,13 +166,13 @@ typedef struct tbool bOrient; } STSpace; -int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); -void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); -void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); -int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn); -tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[], - const int iNrActiveGroups, const int piTriListIn[], const float fThresCos, - const SMikkTSpaceContext * pContext); +static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); +static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); +static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn); +static int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn); +static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[], + const int iNrActiveGroups, const int piTriListIn[], const float fThresCos, + const SMikkTSpaceContext * pContext); static int MakeIndex(const int iFace, const int iVert) { @@ -216,14 +216,14 @@ static STSpace AvgTSpace(const STSpace * pTS0, const STSpace * pTS1) -SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index); -SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index); -SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index); +static SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index); +static SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index); +static SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index); // degen triangles -void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris); -void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris); +static void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris); +static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris); tbool genTangSpaceDefault(const SMikkTSpaceContext * pContext) @@ -450,11 +450,11 @@ NOINLINE int FindGridCell(const float fMin, const float fMax, const float fVal) return iIndexpFaceIndices[pGroup->iNrFaces] = iTriIndex; ++pGroup->iNrFaces; } -tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], +static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int iMyTriIndex, SGroup * pGroup) { STriInfo * pMyTriInfo = &psTriInfos[iMyTriIndex]; @@ -1187,13 +1187,13 @@ tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], ///////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// -tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2); -void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed); -STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive); +static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2); +static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed); +static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive); -tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[], - const int iNrActiveGroups, const int piTriListIn[], const float fThresCos, - const SMikkTSpaceContext * pContext) +static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[], + const int iNrActiveGroups, const int piTriListIn[], const float fThresCos, + const SMikkTSpaceContext * pContext) { STSpace * pSubGroupTspace = NULL; SSubGroup * pUniSubGroups = NULL; @@ -1361,8 +1361,8 @@ tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGro return TTRUE; } -STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], - const SMikkTSpaceContext * pContext, const int iVertexRepresentitive) +static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], + const SMikkTSpaceContext * pContext, const int iVertexRepresentitive) { STSpace res; float fAngleSum = 0; @@ -1435,7 +1435,7 @@ STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[] return res; } -tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2) +static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2) { tbool bStillSame=TTRUE; int i=0; @@ -1448,7 +1448,7 @@ tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2) return bStillSame; } -void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed) +static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed) { int iL, iR, n, index, iMid, iTmp; @@ -1492,10 +1492,10 @@ void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed) ///////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////// -void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed); -void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in); +static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed); +static void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in); -void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn) +static void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn) { // build array of edges unsigned int uSeed = INTERNAL_RND_SORT_SEED; // could replace with a random seed? @@ -1590,7 +1590,7 @@ void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriLis } } -void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn) +static void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn) { int f=0, i=0; for(f=0; f Date: Thu, 6 Oct 2011 12:51:33 +0000 Subject: [PATCH 091/113] Fix #28805: Add mesh, align to view, un check align to view. not updating. Re-set rotation property when "Lock to View" property changes. This makes proper updates without breaking behavior. --- source/blender/editors/object/object_add.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 0292977f816..5d8781e0a6d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -175,12 +175,18 @@ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, fl /********************* Add Object Operator ********************/ +void view_align_update(struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr) +{ + RNA_struct_idprops_unset(ptr, "rotation"); +} + void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode) { PropertyRNA *prop; /* note: this property gets hidden for add-camera operator */ - RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view"); + prop= RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view"); + RNA_def_property_update_runtime(prop, view_align_update); if(do_editmode) { prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object"); From b87161811621c38961bd14d2cf04d84f407a64bd Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 6 Oct 2011 14:55:30 +0000 Subject: [PATCH 092/113] Fix #28819: Normal Maps appear inverted in GLSL shader and offline renderer (2.6rc1) Caused by recent bump maps flip commit. If texture is used as Normal Map it's normal factor shouldn't be flipped. --- source/blender/blenloader/intern/readfile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 95bf44d884c..ce5805921dc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12122,8 +12122,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(mtex) { if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) { if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) { - mtex->norfac= -mtex->norfac; - mtex->texflag|= MTEX_BUMP_FLIPPED; + Tex *tex= newlibadr(fd, lib, mtex->tex); + + if(!tex || (tex->imaflag&TEX_NORMALMAP)==0) { + mtex->norfac= -mtex->norfac; + mtex->texflag|= MTEX_BUMP_FLIPPED; + } } } } From 1f90b4299982c3d6e7a8e839bf035b717b9a58d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 16:07:05 +0000 Subject: [PATCH 093/113] fix [#27071] Random crashes when altering a mesh vertex vector in BGE thanks to Chris Holland (topher77) for supplying the fix. --- source/gameengine/Ketsji/KX_VertexProxy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 5589d35f44a..e92351ad110 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -436,10 +436,14 @@ KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex) : m_vertex(vertex), m_mesh(mesh) { + /* see bug [#27071] */ + Py_INCREF(m_mesh->GetProxy()); } KX_VertexProxy::~KX_VertexProxy() { + /* see bug [#27071] */ + Py_DECREF(m_mesh->GetProxy()); } From f9ea19ac129deb9d3cb5ce9c7a4ea81b86e77680 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 22:02:50 +0000 Subject: [PATCH 094/113] spaces -> tabs (only whitespace changes) --- intern/container/CTR_List.h | 20 +- intern/container/CTR_Map.h | 240 +++++++++--------- intern/ghost/GHOST_Types.h | 16 +- intern/ghost/intern/GHOST_Buttons.h | 54 ++-- intern/ghost/intern/GHOST_ModifierKeys.h | 76 +++--- intern/ghost/intern/GHOST_SystemCarbon.h | 128 +++++----- intern/ghost/intern/GHOST_SystemCocoa.h | 122 ++++----- intern/ghost/intern/GHOST_SystemPathsCarbon.h | 24 +- intern/ghost/intern/GHOST_SystemPathsCocoa.h | 18 +- intern/ghost/intern/GHOST_TaskbarWin32.h | 38 +-- intern/ghost/intern/GHOST_Window.h | 10 +- intern/ghost/intern/GHOST_WindowCarbon.h | 64 ++--- intern/ghost/test/gears/GHOST_C-Test.c | 80 +++--- intern/string/STR_String.h | 10 +- 14 files changed, 450 insertions(+), 450 deletions(-) diff --git a/intern/container/CTR_List.h b/intern/container/CTR_List.h index 83252e05fae..79af9ea5abc 100644 --- a/intern/container/CTR_List.h +++ b/intern/container/CTR_List.h @@ -37,18 +37,18 @@ class CTR_Link { public: - CTR_Link( + CTR_Link( ) ; - CTR_Link( + CTR_Link( CTR_Link *next, CTR_Link *prev ) ; - + CTR_Link * getNext( ) const ; - + CTR_Link * getPrev( ) const ; @@ -76,14 +76,14 @@ public: ) ; private: - CTR_Link *m_next; - CTR_Link *m_prev; + CTR_Link *m_next; + CTR_Link *m_prev; }; class CTR_List { public: - CTR_List( + CTR_List( ) ; CTR_Link * @@ -103,10 +103,10 @@ public: addTail( CTR_Link *link ) ; - + private: - CTR_Link m_head; - CTR_Link m_tail; + CTR_Link m_head; + CTR_Link m_tail; }; #endif diff --git a/intern/container/CTR_Map.h b/intern/container/CTR_Map.h index 1991ec19e3a..08aa26eb9e2 100644 --- a/intern/container/CTR_Map.h +++ b/intern/container/CTR_Map.h @@ -37,24 +37,24 @@ template class CTR_Map { private: - struct Entry { - Entry (Entry *next, Key key, Value value) : - m_next(next), - m_key(key), - m_value(value) {} + struct Entry { + Entry (Entry *next, Key key, Value value) : + m_next(next), + m_key(key), + m_value(value) {} + + Entry *m_next; + Key m_key; + Value m_value; + }; - Entry *m_next; - Key m_key; - Value m_value; - }; - public: - CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) { - m_buckets = new Entry *[num_buckets]; - for (int i = 0; i < num_buckets; ++i) { - m_buckets[i] = 0; - } - } + CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) { + m_buckets = new Entry *[num_buckets]; + for (int i = 0; i < num_buckets; ++i) { + m_buckets[i] = 0; + } + } CTR_Map(const CTR_Map& map) { @@ -68,114 +68,114 @@ public: insert(entry->m_key, entry->m_value); } } - - int size() { - int count=0; - for (int i=0;im_next; - count++; - } - } - return count; - } - - Value* at(int index) { - int count=0; - for (int i=0;im_value; - } - bucket = bucket->m_next; - count++; - } - } - return 0; - } - Key* getKey(int index) { - int count=0; - for (int i=0;im_key; - } - bucket = bucket->m_next; - count++; - } - } - return 0; - } - - void clear() { - for (int i = 0; i < m_num_buckets; ++i) { - Entry *entry_ptr = m_buckets[i]; - - while (entry_ptr != 0) { - Entry *tmp_ptr = entry_ptr->m_next; - delete entry_ptr; - entry_ptr = tmp_ptr; - } - m_buckets[i] = 0; - } - } - - ~CTR_Map() { - clear(); - delete [] m_buckets; - } - - void insert(const Key& key, const Value& value) { - Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets]; - while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) { - entry_ptr = entry_ptr->m_next; - } - - if (entry_ptr != 0) { - entry_ptr->m_value = value; - } - else { - Entry **bucket = &m_buckets[key.hash() % m_num_buckets]; - *bucket = new Entry(*bucket, key, value); - } - } + int size() { + int count=0; + for (int i=0;im_next; + count++; + } + } + return count; + } - void remove(const Key& key) { - Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets]; - while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) { - entry_ptr = &(*entry_ptr)->m_next; - } - - if (*entry_ptr != 0) { - Entry *tmp_ptr = (*entry_ptr)->m_next; - delete *entry_ptr; - *entry_ptr = tmp_ptr; - } - } + Value* at(int index) { + int count=0; + for (int i=0;im_value; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } + + Key* getKey(int index) { + int count=0; + for (int i=0;im_key; + } + bucket = bucket->m_next; + count++; + } + } + return 0; + } + + void clear() { + for (int i = 0; i < m_num_buckets; ++i) { + Entry *entry_ptr = m_buckets[i]; + + while (entry_ptr != 0) { + Entry *tmp_ptr = entry_ptr->m_next; + delete entry_ptr; + entry_ptr = tmp_ptr; + } + m_buckets[i] = 0; + } + } + + ~CTR_Map() { + clear(); + delete [] m_buckets; + } + + void insert(const Key& key, const Value& value) { + Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets]; + while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) { + entry_ptr = entry_ptr->m_next; + } + + if (entry_ptr != 0) { + entry_ptr->m_value = value; + } + else { + Entry **bucket = &m_buckets[key.hash() % m_num_buckets]; + *bucket = new Entry(*bucket, key, value); + } + } + + void remove(const Key& key) { + Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets]; + while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) { + entry_ptr = &(*entry_ptr)->m_next; + } + + if (*entry_ptr != 0) { + Entry *tmp_ptr = (*entry_ptr)->m_next; + delete *entry_ptr; + *entry_ptr = tmp_ptr; + } + } + + Value *operator[](Key key) { + Entry *bucket = m_buckets[key.hash() % m_num_buckets]; + while ((bucket != 0) && !(key == bucket->m_key)) { + bucket = bucket->m_next; + } + return bucket != 0 ? &bucket->m_value : 0; + } - Value *operator[](Key key) { - Entry *bucket = m_buckets[key.hash() % m_num_buckets]; - while ((bucket != 0) && !(key == bucket->m_key)) { - bucket = bucket->m_next; - } - return bucket != 0 ? &bucket->m_value : 0; - } - private: - int m_num_buckets; - Entry **m_buckets; + int m_num_buckets; + Entry **m_buckets; }; #endif diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index f24ab00acd3..dd399a7aa95 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -96,14 +96,14 @@ typedef enum { } GHOST_TFireTimeConstant; typedef enum { - GHOST_kModifierKeyLeftShift = 0, - GHOST_kModifierKeyRightShift, - GHOST_kModifierKeyLeftAlt, - GHOST_kModifierKeyRightAlt, - GHOST_kModifierKeyLeftControl, - GHOST_kModifierKeyRightControl, - GHOST_kModifierKeyOS, - GHOST_kModifierKeyNumMasks + GHOST_kModifierKeyLeftShift = 0, + GHOST_kModifierKeyRightShift, + GHOST_kModifierKeyLeftAlt, + GHOST_kModifierKeyRightAlt, + GHOST_kModifierKeyLeftControl, + GHOST_kModifierKeyRightControl, + GHOST_kModifierKeyOS, + GHOST_kModifierKeyNumMasks } GHOST_TModifierKeyMask; diff --git a/intern/ghost/intern/GHOST_Buttons.h b/intern/ghost/intern/GHOST_Buttons.h index bf5bdb19d7f..d231a254596 100644 --- a/intern/ghost/intern/GHOST_Buttons.h +++ b/intern/ghost/intern/GHOST_Buttons.h @@ -44,35 +44,35 @@ * @date May 15, 2001 */ struct GHOST_Buttons { - /** - * Constructor. - */ - GHOST_Buttons(); + /** + * Constructor. + */ + GHOST_Buttons(); virtual ~GHOST_Buttons(); - - /** - * Returns the state of a single button. - * @param mask. Key button to return. - * @return The state of the button (pressed == true). - */ - virtual bool get(GHOST_TButtonMask mask) const; - - /** - * Updates the state of a single button. - * @param mask. Button state to update. - * @param down. The new state of the button. - */ - virtual void set(GHOST_TButtonMask mask, bool down); - - /** - * Sets the state of all buttons to up. - */ - virtual void clear(); - - GHOST_TUns8 m_ButtonLeft : 1; - GHOST_TUns8 m_ButtonMiddle : 1; - GHOST_TUns8 m_ButtonRight : 1; + + /** + * Returns the state of a single button. + * @param mask. Key button to return. + * @return The state of the button (pressed == true). + */ + virtual bool get(GHOST_TButtonMask mask) const; + + /** + * Updates the state of a single button. + * @param mask. Button state to update. + * @param down. The new state of the button. + */ + virtual void set(GHOST_TButtonMask mask, bool down); + + /** + * Sets the state of all buttons to up. + */ + virtual void clear(); + + GHOST_TUns8 m_ButtonLeft : 1; + GHOST_TUns8 m_ButtonMiddle : 1; + GHOST_TUns8 m_ButtonRight : 1; }; #endif // _GHOST_BUTTONS_H_ diff --git a/intern/ghost/intern/GHOST_ModifierKeys.h b/intern/ghost/intern/GHOST_ModifierKeys.h index 08fe277d55a..0109fe7b7c6 100644 --- a/intern/ghost/intern/GHOST_ModifierKeys.h +++ b/intern/ghost/intern/GHOST_ModifierKeys.h @@ -44,10 +44,10 @@ */ struct GHOST_ModifierKeys { - /** - * Constructor. - */ - GHOST_ModifierKeys(); + /** + * Constructor. + */ + GHOST_ModifierKeys(); virtual ~GHOST_ModifierKeys(); @@ -58,25 +58,25 @@ struct GHOST_ModifierKeys */ static GHOST_TKey getModifierKeyCode(GHOST_TModifierKeyMask mask); - - /** - * Returns the state of a single modifier key. - * @param mask. Key state to return. - * @return The state of the key (pressed == true). - */ - virtual bool get(GHOST_TModifierKeyMask mask) const; - - /** - * Updates the state of a single modifier key. - * @param mask. Key state to update. - * @param down. The new state of the key. - */ - virtual void set(GHOST_TModifierKeyMask mask, bool down); - - /** - * Sets the state of all modifier keys to up. - */ - virtual void clear(); + + /** + * Returns the state of a single modifier key. + * @param mask. Key state to return. + * @return The state of the key (pressed == true). + */ + virtual bool get(GHOST_TModifierKeyMask mask) const; + + /** + * Updates the state of a single modifier key. + * @param mask. Key state to update. + * @param down. The new state of the key. + */ + virtual void set(GHOST_TModifierKeyMask mask, bool down); + + /** + * Sets the state of all modifier keys to up. + */ + virtual void clear(); /** * Determines whether to modifier key states are equal. @@ -84,21 +84,21 @@ struct GHOST_ModifierKeys * @return Indication of equality. */ virtual bool equals(const GHOST_ModifierKeys& keys) const; - - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_LeftShift : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_RightShift : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_LeftAlt : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_RightAlt : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_LeftControl : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_RightControl : 1; - /** Bitfield that stores the appropriate key state. */ - GHOST_TUns8 m_OS : 1; + + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_LeftShift : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_RightShift : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_LeftAlt : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_RightAlt : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_LeftControl : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_RightControl : 1; + /** Bitfield that stores the appropriate key state. */ + GHOST_TUns8 m_OS : 1; }; #endif // _GHOST_MODIFIER_KEYS_H_ diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h index b0cf622f709..dd21d033c6f 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.h +++ b/intern/ghost/intern/GHOST_SystemCarbon.h @@ -55,16 +55,16 @@ class GHOST_EventWindow; */ class GHOST_SystemCarbon : public GHOST_System { public: - /** - * Constructor. - */ - GHOST_SystemCarbon(); - - /** - * Destructor. - */ - ~GHOST_SystemCarbon(); - + /** + * Constructor. + */ + GHOST_SystemCarbon(); + + /** + * Destructor. + */ + ~GHOST_SystemCarbon(); + /*************************************************************************************** ** Time(r) functionality ***************************************************************************************/ @@ -211,54 +211,54 @@ protected: virtual GHOST_TSuccess exit(); - /** - * Handles a tablet event. - * @param event A Mac event. - * @return Indication whether the event was handled. - */ - OSStatus handleTabletEvent(EventRef event); - /** - * Handles a mouse event. - * @param event A Mac event. - * @return Indication whether the event was handled. - */ - OSStatus handleMouseEvent(EventRef event); + /** + * Handles a tablet event. + * @param event A Mac event. + * @return Indication whether the event was handled. + */ + OSStatus handleTabletEvent(EventRef event); + /** + * Handles a mouse event. + * @param event A Mac event. + * @return Indication whether the event was handled. + */ + OSStatus handleMouseEvent(EventRef event); - /** - * Handles a key event. - * @param event A Mac event. - * @return Indication whether the event was handled. - */ - OSStatus handleKeyEvent(EventRef event); + /** + * Handles a key event. + * @param event A Mac event. + * @return Indication whether the event was handled. + */ + OSStatus handleKeyEvent(EventRef event); - /** - * Handles a window event. - * @param event A Mac event. - * @return Indication whether the event was handled. - */ - OSStatus handleWindowEvent(EventRef event); + /** + * Handles a window event. + * @param event A Mac event. + * @return Indication whether the event was handled. + */ + OSStatus handleWindowEvent(EventRef event); - /** - * Handles all basic Mac application stuff for a mouse down event. - * @param event A Mac event. - * @return Indication whether the event was handled. - */ - bool handleMouseDown(EventRef event); + /** + * Handles all basic Mac application stuff for a mouse down event. + * @param event A Mac event. + * @return Indication whether the event was handled. + */ + bool handleMouseDown(EventRef event); - /** - * Handles a Mac menu command. - * @param menuResult A Mac menu/item identifier. - * @return Indication whether the event was handled. - */ - bool handleMenuCommand(GHOST_TInt32 menuResult); - - /* callback for blender generated events */ -// static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData); + /** + * Handles a Mac menu command. + * @param menuResult A Mac menu/item identifier. + * @return Indication whether the event was handled. + */ + bool handleMenuCommand(GHOST_TInt32 menuResult); + + /* callback for blender generated events */ + // static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData); - /** - * Callback for Carbon when it has events. - */ + /** + * Callback for Carbon when it has events. + */ static OSStatus sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData); /** Apple Event Handlers */ @@ -267,23 +267,23 @@ protected: static OSErr sAEHandlerPrintDocs(const AppleEvent *event, AppleEvent *reply, SInt32 refCon); static OSErr sAEHandlerQuit(const AppleEvent *event, AppleEvent *reply, SInt32 refCon); - /** - * Callback for Mac Timer tasks that expire. - * @param tmTask Pointer to the timer task that expired. - */ - //static void s_timerCallback(TMTaskPtr tmTask); - - /** Event handler reference. */ - EventHandlerRef m_handler; + /** + * Callback for Mac Timer tasks that expire. + * @param tmTask Pointer to the timer task that expired. + */ + //static void s_timerCallback(TMTaskPtr tmTask); + + /** Event handler reference. */ + EventHandlerRef m_handler; /** Start time at initialization. */ GHOST_TUns64 m_start_time; - /** State of the modifiers. */ - UInt32 m_modifierMask; + /** State of the modifiers. */ + UInt32 m_modifierMask; - /** Ignores window size messages (when window is dragged). */ - bool m_ignoreWindowSizedMessages; + /** Ignores window size messages (when window is dragged). */ + bool m_ignoreWindowSizedMessages; }; #endif // _GHOST_SYSTEM_CARBON_H_ diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h index d20aed63f42..fc4f02e3fd6 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.h +++ b/intern/ghost/intern/GHOST_SystemCocoa.h @@ -52,16 +52,16 @@ class GHOST_WindowCocoa; class GHOST_SystemCocoa : public GHOST_System { public: - /** - * Constructor. - */ - GHOST_SystemCocoa(); - - /** - * Destructor. - */ - ~GHOST_SystemCocoa(); - + /** + * Constructor. + */ + GHOST_SystemCocoa(); + + /** + * Destructor. + */ + ~GHOST_SystemCocoa(); + /*************************************************************************************** ** Time(r) functionality ***************************************************************************************/ @@ -92,7 +92,7 @@ public: /** * Create a new window. - * The new window is added to the list of windows managed. + * The new window is added to the list of windows managed. * Never explicitly delete the window, use disposeWindow() instead. * @param title The name of the window (displayed in the title bar of the window if the OS supports it). * @param left The coordinate of the left edge of the window. @@ -107,17 +107,17 @@ public: * @return The new window (or 0 if creation failed). */ virtual GHOST_IWindow* createWindow( - const STR_String& title, - GHOST_TInt32 left, - GHOST_TInt32 top, - GHOST_TUns32 width, - GHOST_TUns32 height, - GHOST_TWindowState state, - GHOST_TDrawingContextType type, - const bool stereoVisual = false, - const GHOST_TUns16 numOfAASamples = 0, - const GHOST_TEmbedderWindowID parentWindow = 0 - ); + const STR_String& title, + GHOST_TInt32 left, + GHOST_TInt32 top, + GHOST_TUns32 width, + GHOST_TUns32 height, + GHOST_TWindowState state, + GHOST_TDrawingContextType type, + const bool stereoVisual = false, + const GHOST_TUns16 numOfAASamples = 0, + const GHOST_TEmbedderWindowID parentWindow = 0 + ); /*************************************************************************************** ** Event management functionality @@ -140,19 +140,19 @@ public: * Handle Cocoa openFile event * Display confirmation request panel if changes performed since last save */ - bool handleOpenDocumentRequest(void *filepathStr); + bool handleOpenDocumentRequest(void *filepathStr); /** - * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass - * @param eventType The type of drag'n'drop event + * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass + * @param eventType The type of drag'n'drop event * @param draggedObjectType The type object concerned (currently array of file names, string, TIFF image) * @param mouseX x mouse coordinate (in cocoa base window coordinates) * @param mouseY y mouse coordinate * @param window The window on which the event occurred - * @return Indication whether the event was handled. - */ + * @return Indication whether the event was handled. + */ GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, - GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data); + GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data); /*************************************************************************************** ** Cursor management functionality @@ -207,18 +207,18 @@ public: virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const; /** - * Handles a window event. Called by GHOST_WindowCocoa window delegate - * @param eventType The type of window event + * Handles a window event. Called by GHOST_WindowCocoa window delegate + * @param eventType The type of window event * @param window The window on which the event occurred - * @return Indication whether the event was handled. - */ - GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window); + * @return Indication whether the event was handled. + */ + GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window); /** - * Handles the Cocoa event telling the application has become active (again) - * @return Indication whether the event was handled. - */ - GHOST_TSuccess handleApplicationBecomeActiveEvent(); + * Handles the Cocoa event telling the application has become active (again) + * @return Indication whether the event was handled. + */ + GHOST_TSuccess handleApplicationBecomeActiveEvent(); /** * External objects should call this when they send an event outside processEvents. @@ -239,28 +239,28 @@ protected: */ virtual GHOST_TSuccess init(); - /** - * Handles a tablet event. - * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) - * @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event - * @return Indication whether the event was handled. - */ - GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType); - /** - * Handles a mouse event. - * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) - * @return Indication whether the event was handled. - */ - GHOST_TSuccess handleMouseEvent(void *eventPtr); + * Handles a tablet event. + * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) + * @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event + * @return Indication whether the event was handled. + */ + GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType); + + /** + * Handles a mouse event. + * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) + * @return Indication whether the event was handled. + */ + GHOST_TSuccess handleMouseEvent(void *eventPtr); + + /** + * Handles a key event. + * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) + * @return Indication whether the event was handled. + */ + GHOST_TSuccess handleKeyEvent(void *eventPtr); - /** - * Handles a key event. - * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++) - * @return Indication whether the event was handled. - */ - GHOST_TSuccess handleKeyEvent(void *eventPtr); - /** * Performs the actual cursor position update (location in screen coordinates). * @param x The x-coordinate of the cursor. @@ -281,11 +281,11 @@ protected: /** Mouse buttons state */ GHOST_TUns32 m_pressedMouseButtons; - /** State of the modifiers. */ - GHOST_TUns32 m_modifierMask; + /** State of the modifiers. */ + GHOST_TUns32 m_modifierMask; - /** Ignores window size messages (when window is dragged). */ - bool m_ignoreWindowSizedMessages; + /** Ignores window size messages (when window is dragged). */ + bool m_ignoreWindowSizedMessages; /** Stores the mouse cursor delta due to setting a new cursor position * Needed because cocoa event delta cursor move takes setCursorPosition changes too. diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.h b/intern/ghost/intern/GHOST_SystemPathsCarbon.h index b48ab6c033b..957300f6586 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCarbon.h +++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.h @@ -50,16 +50,16 @@ */ class GHOST_SystemPathsCarbon : public GHOST_SystemPaths { public: - /** - * Constructor. - */ - GHOST_SystemPathsCarbon(); - - /** - * Destructor. - */ - ~GHOST_SystemPathsCarbon(); - + /** + * Constructor. + */ + GHOST_SystemPathsCarbon(); + + /** + * Destructor. + */ + ~GHOST_SystemPathsCarbon(); + /** * Determine the base dir in which shared resources are located. It will first try to use * "unpack and run" path, then look for properly installed path, not including versioning. @@ -78,12 +78,12 @@ public: * Determine the directory of the current binary * @return Unsigned char string pointing to the binary dir */ - virtual const GHOST_TUns8* getBinaryDir() const; + virtual const GHOST_TUns8* getBinaryDir() const; /** * Add the file to the operating system most recently used files */ - void addToSystemRecentFiles(const char* filename) const; + void addToSystemRecentFiles(const char* filename) const; }; #endif // _GHOST_SYSTEM_CARBON_H_ diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.h b/intern/ghost/intern/GHOST_SystemPathsCocoa.h index b270896a8ca..bfdf92b4274 100644 --- a/intern/ghost/intern/GHOST_SystemPathsCocoa.h +++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.h @@ -44,15 +44,15 @@ class GHOST_SystemPathsCocoa : public GHOST_SystemPaths { public: - /** - * Constructor. - */ - GHOST_SystemPathsCocoa(); - - /** - * Destructor. - */ - ~GHOST_SystemPathsCocoa(); + /** + * Constructor. + */ + GHOST_SystemPathsCocoa(); + + /** + * Destructor. + */ + ~GHOST_SystemPathsCocoa(); /** * Determine the base dir in which shared resources are located. It will first try to use diff --git a/intern/ghost/intern/GHOST_TaskbarWin32.h b/intern/ghost/intern/GHOST_TaskbarWin32.h index eddff8bb91b..8f301edce31 100644 --- a/intern/ghost/intern/GHOST_TaskbarWin32.h +++ b/intern/ghost/intern/GHOST_TaskbarWin32.h @@ -21,25 +21,25 @@ #define __ITaskbarList_INTERFACE_DEFINED__ extern "C" {const GUID CLSID_TaskbarList = {0x56FDF344, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; const GUID IID_ITaskbarList = {0x56FDF342, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; } - class ITaskbarList : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0; - virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0; - }; + class ITaskbarList : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0; + virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0; + virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0; + virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0; + virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0; + }; #endif /* ITaskbarList */ #ifndef __ITaskbarList2_INTERFACE_DEFINED__ #define __ITaskbarList2_INTERFACE_DEFINED__ extern "C" {const GUID IID_ITaskbarList2 = {0x602D4995, 0xB13A, 0x429b, {0xA6, 0x6E, 0x19, 0x35, 0xE4, 0x4F, 0x43, 0x17} }; } - class ITaskbarList2 : public ITaskbarList - { - public: - virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0; - }; + class ITaskbarList2 : public ITaskbarList + { + public: + virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0; + }; #endif /* ITaskbarList2 */ #ifndef __ITaskbarList3_INTERFACE_DEFINED__ @@ -51,9 +51,9 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA #define THBN_CLICKED 0x1800 extern "C" {const GUID IID_ITaskList3 = { 0xEA1AFB91, 0x9E28, 0x4B86, {0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF} };} - class ITaskbarList3 : public ITaskbarList2 - { - public: + class ITaskbarList3 : public ITaskbarList2 + { + public: virtual HRESULT STDMETHODCALLTYPE SetProgressValue (HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0; virtual HRESULT STDMETHODCALLTYPE SetProgressState (HWND hwnd, TBPFLAG tbpFlags) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterTab (HWND hwndTab, HWND hwndMDI) = 0; @@ -62,11 +62,11 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA virtual HRESULT STDMETHODCALLTYPE SetTabActive (HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0; virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0; virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0; + virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0; virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon (HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0; virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip (HWND hwnd, LPCWSTR pszTip) = 0; virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip (HWND hwnd, RECT *prcClip) = 0; - }; + }; #endif /* ITaskbarList3 */ #endif /*GHOST_TASKBARWIN32_H_*/ diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h index 66990abb555..341c1e23463 100644 --- a/intern/ghost/intern/GHOST_Window.h +++ b/intern/ghost/intern/GHOST_Window.h @@ -339,11 +339,11 @@ protected: /** Number of samples used in anti-aliasing, set to 0 if no AA **/ GHOST_TUns16 m_numOfAASamples; - - /** Full-screen width */ - GHOST_TUns32 m_fullScreenWidth; - /** Full-screen height */ - GHOST_TUns32 m_fullScreenHeight; + + /** Full-screen width */ + GHOST_TUns32 m_fullScreenWidth; + /** Full-screen height */ + GHOST_TUns32 m_fullScreenHeight; }; diff --git a/intern/ghost/intern/GHOST_WindowCarbon.h b/intern/ghost/intern/GHOST_WindowCarbon.h index 650788d5c70..a4386ce884b 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.h +++ b/intern/ghost/intern/GHOST_WindowCarbon.h @@ -200,12 +200,12 @@ public: virtual GHOST_TSuccess activateDrawingContext(); virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const; - - /** - * Returns the dirty state of the window when in full-screen mode. - * @return Whether it is dirty. - */ - virtual bool getFullScreenDirty(); + + /** + * Returns the dirty state of the window when in full-screen mode. + * @return Whether it is dirty. + */ + virtual bool getFullScreenDirty(); /* accessor for fullscreen window */ virtual void setMac_windowState(short value); @@ -257,24 +257,24 @@ protected: int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color); virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY); - - /** - * Converts a string object to a Mac Pascal string. - * @param in The string object to be converted. - * @param out The converted string. - */ - virtual void gen2mac(const STR_String& in, Str255 out) const; - /** - * Converts a Mac Pascal string to a string object. - * @param in The string to be converted. - * @param out The converted string object. - */ - virtual void mac2gen(const Str255 in, STR_String& out) const; + /** + * Converts a string object to a Mac Pascal string. + * @param in The string object to be converted. + * @param out The converted string. + */ + virtual void gen2mac(const STR_String& in, Str255 out) const; + + /** + * Converts a Mac Pascal string to a string object. + * @param in The string to be converted. + * @param out The converted string object. + */ + virtual void mac2gen(const Str255 in, STR_String& out) const; - WindowRef m_windowRef; - CGrafPtr m_grafPtr; - AGLContext m_aglCtx; + WindowRef m_windowRef; + CGrafPtr m_grafPtr; + AGLContext m_aglCtx; /** The first created OpenGL context (for sharing display lists) */ static AGLContext s_firstaglCtx; @@ -282,9 +282,9 @@ protected: Cursor* m_customCursor; GHOST_TabletData m_tablet; - - /** When running in full-screen this tells whether to refresh the window. */ - bool m_fullScreenDirty; + + /** When running in full-screen this tells whether to refresh the window. */ + bool m_fullScreenDirty; /** specific MacOs X full screen window setting as we use partially system mechanism values : 0 not maximizable default @@ -295,17 +295,17 @@ protected: in order to be unified with GHOST fullscreen/maximised settings (lukep) - **/ - + **/ + short mac_windowState; - /** - * The width/height of the size rectangle in the lower right corner of a - * Mac/Carbon window. This is also the height of the gutter area. - */ + /** + * The width/height of the size rectangle in the lower right corner of a + * Mac/Carbon window. This is also the height of the gutter area. + */ #ifdef GHOST_DRAW_CARBON_GUTTER - static const GHOST_TInt32 s_sizeRectSize; + static const GHOST_TInt32 s_sizeRectSize; #endif // GHOST_DRAW_CARBON_GUTTER }; diff --git a/intern/ghost/test/gears/GHOST_C-Test.c b/intern/ghost/test/gears/GHOST_C-Test.c index c582d205258..190857403bd 100644 --- a/intern/ghost/test/gears/GHOST_C-Test.c +++ b/intern/ghost/test/gears/GHOST_C-Test.c @@ -190,16 +190,16 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL static void drawGearGL(int id) { - static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f }; - static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f }; - static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f }; - static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f }; + static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f }; + static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f }; + static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f }; + static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f }; - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); + glLightfv(GL_LIGHT0, GL_POSITION, pos); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_DEPTH_TEST); switch (id) { @@ -218,40 +218,40 @@ static void drawGearGL(int id) default: break; } - glEnable(GL_NORMALIZE); + glEnable(GL_NORMALIZE); } static void drawGL(void) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix(); + glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); + glRotatef(view_rotx, 1.0, 0.0, 0.0); + glRotatef(view_roty, 0.0, 1.0, 0.0); + glRotatef(view_rotz, 0.0, 0.0, 1.0); - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(fAngle, 0.0, 0.0, 1.0); - drawGearGL(1); - glPopMatrix(); + glPushMatrix(); + glTranslatef(-3.0, -2.0, 0.0); + glRotatef(fAngle, 0.0, 0.0, 1.0); + drawGearGL(1); + glPopMatrix(); - glPushMatrix(); - glTranslatef(3.1f, -2.0f, 0.0f); - glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0); - drawGearGL(2); - glPopMatrix(); + glPushMatrix(); + glTranslatef(3.1f, -2.0f, 0.0f); + glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0); + drawGearGL(2); + glPopMatrix(); - glPushMatrix(); - glTranslatef(-3.1f, 2.2f, -1.8f); - glRotatef(90.0f, 1.0f, 0.0f, 0.0f); - glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0); - drawGearGL(3); - glPopMatrix(); + glPushMatrix(); + glTranslatef(-3.1f, 2.2f, -1.8f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0); + drawGearGL(3); + glPopMatrix(); - glPopMatrix(); + glPopMatrix(); } @@ -260,21 +260,21 @@ static void setViewPortGL(GHOST_WindowHandle hWindow) GHOST_RectangleHandle hRect = NULL; GLfloat w, h; - GHOST_ActivateWindowDrawingContext(hWindow); - hRect = GHOST_GetClientBounds(hWindow); + GHOST_ActivateWindowDrawingContext(hWindow); + hRect = GHOST_GetClientBounds(hWindow); - w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect); - h = 1.0; + w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect); + h = 1.0; glViewport(0, 0, GHOST_GetWidthRectangle(hRect), GHOST_GetHeightRectangle(hRect)); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glFrustum(-w, w, -h, h, 5.0, 60.0); + glFrustum(-w, w, -h, h, 5.0, 60.0); /* glOrtho(0, bnds.getWidth(), 0, bnds.getHeight(), -10, 10); */ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); + glTranslatef(0.0, 0.0, -40.0); glClearColor(.2f,0.0f,0.0f,0.0f); glClear(GL_COLOR_BUFFER_BIT); @@ -541,8 +541,8 @@ int main(int argc, char** argv) static void gearsTimerProc(GHOST_TimerTaskHandle hTask, GHOST_TUns64 time) { GHOST_WindowHandle hWindow = NULL; - fAngle += 2.0; - view_roty += 1.0; + fAngle += 2.0; + view_roty += 1.0; hWindow = (GHOST_WindowHandle)GHOST_GetTimerTaskUserData(hTask); if (GHOST_GetFullScreen(shSystem)) { diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index 9c687407512..2b5ba449602 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -95,11 +95,11 @@ public: STR_String& Format(const char *fmt, ...); // Set formatted text to string STR_String& FormatAdd(const char *fmt, ...); // Add formatted text to string inline void Clear() { Len = pData[0] = 0; } - inline const STR_String & Reverse() - { - for (int i1=0, i2=Len-1; i1 Date: Thu, 6 Oct 2011 22:04:01 +0000 Subject: [PATCH 095/113] spaces -> tabs (whitespace only changes) --- source/blender/editors/space_node/drawnode.c | 2 +- .../editors/space_view3d/drawarmature.c | 44 +++++++++--------- .../imbuf/intern/openexr/openexr_api.cpp | 14 +++--- .../blender/python/intern/bpy_app_handlers.c | 2 +- source/blender/python/intern/bpy_props.c | 6 +-- .../gameengine/Converter/BlenderWorldInfo.h | 20 ++++---- source/gameengine/Expressions/PyObjectPlus.h | 8 ++-- .../GameLogic/SCA_2DFilterActuator.cpp | 2 +- .../GameLogic/SCA_2DFilterActuator.h | 2 +- source/gameengine/Ketsji/KX_Dome.h | 45 +++++++++--------- .../Ketsji/KX_OrientationInterpolator.h | 12 ++--- .../Physics/Bullet/CcdPhysicsEnvironment.h | 2 +- .../gameengine/Rasterizer/RAS_IRasterizer.h | 2 +- .../RAS_OpenGLFilters/RAS_GrayScale2DFilter.h | 2 +- .../RAS_OpenGLFilters/RAS_Invert2DFilter.h | 4 +- .../RAS_OpenGLRasterizer.h | 2 +- source/gameengine/SceneGraph/SG_DList.h | 6 +-- source/gameengine/VideoTexture/ImageRender.h | 46 +++++++++---------- .../gameengine/VideoTexture/ImageViewport.h | 6 +-- 19 files changed, 113 insertions(+), 114 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5f443509801..150847ce825 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1939,7 +1939,7 @@ static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), Poin /* only once called */ static void node_texture_set_butfunc(bNodeType *ntype) { - ntype->uifuncbut = NULL; + ntype->uifuncbut = NULL; if( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) { ntype->uifunc = node_texture_buts_proc; } diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 3f45e32937d..83a695ba72a 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -438,39 +438,39 @@ static void draw_bonevert_solid(void) } static float bone_octahedral_verts[6][3]= { - { 0.0f, 0.0f, 0.0f}, - { 0.1f, 0.1f, 0.1f}, - { 0.1f, 0.1f, -0.1f}, - {-0.1f, 0.1f, -0.1f}, - {-0.1f, 0.1f, 0.1f}, - { 0.0f, 1.0f, 0.0f} + { 0.0f, 0.0f, 0.0f}, + { 0.1f, 0.1f, 0.1f}, + { 0.1f, 0.1f, -0.1f}, + {-0.1f, 0.1f, -0.1f}, + {-0.1f, 0.1f, 0.1f}, + { 0.0f, 1.0f, 0.0f} }; static unsigned int bone_octahedral_wire_sides[8]= {0, 1, 5, 3, 0, 4, 5, 2}; static unsigned int bone_octahedral_wire_square[8]= {1, 2, 3, 4, 1}; static unsigned int bone_octahedral_solid_tris[8][3]= { - {2, 1, 0}, /* bottom */ - {3, 2, 0}, - {4, 3, 0}, - {1, 4, 0}, + {2, 1, 0}, /* bottom */ + {3, 2, 0}, + {4, 3, 0}, + {1, 4, 0}, - {5, 1, 2}, /* top */ - {5, 2, 3}, - {5, 3, 4}, - {5, 4, 1} + {5, 1, 2}, /* top */ + {5, 2, 3}, + {5, 3, 4}, + {5, 4, 1} }; /* aligned with bone_octahedral_solid_tris */ static float bone_octahedral_solid_normals[8][3]= { - { 0.70710683f, -0.70710683f, 0.00000000f}, - {-0.00000000f, -0.70710683f, -0.70710683f}, - {-0.70710683f, -0.70710683f, 0.00000000f}, - { 0.00000000f, -0.70710683f, 0.70710683f}, - { 0.99388373f, 0.11043154f, -0.00000000f}, - { 0.00000000f, 0.11043154f, -0.99388373f}, - {-0.99388373f, 0.11043154f, 0.00000000f}, - { 0.00000000f, 0.11043154f, 0.99388373f} + { 0.70710683f, -0.70710683f, 0.00000000f}, + {-0.00000000f, -0.70710683f, -0.70710683f}, + {-0.70710683f, -0.70710683f, 0.00000000f}, + { 0.00000000f, -0.70710683f, 0.70710683f}, + { 0.99388373f, 0.11043154f, -0.00000000f}, + { 0.00000000f, 0.11043154f, -0.99388373f}, + {-0.99388373f, 0.11043154f, 0.00000000f}, + { 0.00000000f, 0.11043154f, 0.99388373f} }; static void draw_bone_octahedral(void) diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 88f6508d356..e064d7f760d 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -98,7 +98,7 @@ class Mem_IStream: public IStream public: Mem_IStream (unsigned char *exrbuf, size_t exrsize): - IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } + IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } virtual bool read (char c[], int n); virtual Int64 tellg (); @@ -107,8 +107,8 @@ public: //virtual ~Mem_IStream() {}; // unused private: - - Int64 _exrpos; + + Int64 _exrpos; Int64 _exrsize; unsigned char *_exrbuf; }; @@ -116,11 +116,11 @@ private: bool Mem_IStream::read (char c[], int n) { if (n + _exrpos <= _exrsize) - { + { memcpy(c, (void *)(&_exrbuf[_exrpos]), n); _exrpos += n; return true; - } + } else return false; } @@ -308,7 +308,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags delete [] pixels; } catch (const std::exception &exc) - { + { printf("OpenEXR-save: ERROR: %s\n", exc.what()); if (ibuf) IMB_freeImBuf(ibuf); @@ -365,7 +365,7 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag delete file; } catch (const std::exception &exc) - { + { printf("OpenEXR-save: ERROR: %s\n", exc.what()); if (ibuf) IMB_freeImBuf(ibuf); diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 6aaeb4d9807..cd3d78410f2 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -40,7 +40,7 @@ void bpy_app_generic_callback(struct Main *main, struct ID *id, void *arg); static PyTypeObject BlenderAppCbType; static PyStructSequence_Field app_cb_info_fields[]= { - {(char *)"frame_change_pre", NULL}, + {(char *)"frame_change_pre", NULL}, {(char *)"frame_change_post", NULL}, {(char *)"render_pre", NULL}, {(char *)"render_post", NULL}, diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 88383ce84d5..5c668590dff 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -56,13 +56,13 @@ extern BPy_StructRNA *bpy_context_module; static EnumPropertyItem property_flag_items[]= { {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, - {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, + {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem property_flag_enum_items[]= { {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, - {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, + {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, {PROP_ENUM_FLAG, "ENUM_FLAG", 0, "Enum Flag", ""}, {0, NULL, 0, NULL, NULL}}; @@ -72,7 +72,7 @@ static EnumPropertyItem property_subtype_string_items[]= { {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, {PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""}, {PROP_FILENAME, "FILENAME", 0, "Filename", ""}, - {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, + {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h index e7b8784a076..45737bd41bc 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.h +++ b/source/gameengine/Converter/BlenderWorldInfo.h @@ -54,22 +54,22 @@ public: ~BlenderWorldInfo(); bool hasWorld(); - bool hasMist(); - float getBackColorRed(); - float getBackColorGreen(); - float getBackColorBlue(); + bool hasMist(); + float getBackColorRed(); + float getBackColorGreen(); + float getBackColorBlue(); float getAmbientColorRed(); float getAmbientColorGreen(); float getAmbientColorBlue(); - float getMistStart(); - float getMistDistance(); - float getMistColorRed(); - float getMistColorGreen(); - float getMistColorBlue(); + float getMistStart(); + float getMistDistance(); + float getMistColorRed(); + float getMistColorGreen(); + float getMistColorBlue(); - void + void setBackColor( float r, float g, diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index d3b2eacbb4d..dd4c9a880fd 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -215,7 +215,7 @@ typedef struct PyObjectPlus_Proxy { if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ }; \ - static const char method_name##_doc[]; \ + static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ PyObject* Py##method_name(PyObject* args); \ @@ -223,7 +223,7 @@ typedef struct PyObjectPlus_Proxy { if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ }; \ - static const char method_name##_doc[]; \ + static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_O(class_name, method_name) \ PyObject* Py##method_name(PyObject* value); \ @@ -231,7 +231,7 @@ typedef struct PyObjectPlus_Proxy { if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ }; \ - static const char method_name##_doc[]; \ + static const char method_name##_doc[]; \ #define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ PyObject* Py##method_name(); \ @@ -239,7 +239,7 @@ typedef struct PyObjectPlus_Proxy { if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ }; \ - static const char method_name##_doc[]; \ + static const char method_name##_doc[]; \ /* The line above should remain empty */ diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 7c1824cd4eb..33d7ec5b4fc 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -134,7 +134,7 @@ PyTypeObject SCA_2DFilterActuator::Type = { PyMethodDef SCA_2DFilterActuator::Methods[] = { /* add python functions to deal with m_msg... */ - {NULL,NULL} + {NULL,NULL} }; PyAttributeDef SCA_2DFilterActuator::Attributes[] = { diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 82c82ac3be5..01396839291 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -38,7 +38,7 @@ class SCA_2DFilterActuator : public SCA_IActuator { - Py_Header; + Py_Header; private: vector m_propNames; diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 844f40f0578..009fb0b92ea 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -57,22 +57,21 @@ class KX_Dome { public: /// constructor - KX_Dome ( - RAS_ICanvas* m_canvas, - /// rasterizer - RAS_IRasterizer* m_rasterizer, - /// render tools - RAS_IRenderTools* m_rendertools, - /// engine - KX_KetsjiEngine* m_engine, + KX_Dome (RAS_ICanvas* m_canvas, + /// rasterizer + RAS_IRasterizer* m_rasterizer, + /// render tools + RAS_IRenderTools* m_rendertools, + /// engine + KX_KetsjiEngine* m_engine, - short res, - short mode, - short angle, - float resbuf, - short tilt, - struct Text* warptext - ); + short res, + short mode, + short angle, + float resbuf, + short tilt, + struct Text* warptext + ); /// destructor virtual ~KX_Dome (void); @@ -180,14 +179,14 @@ protected: /// rendered scene KX_Scene * m_scene; - /// canvas - RAS_ICanvas* m_canvas; - /// rasterizer - RAS_IRasterizer* m_rasterizer; - /// render tools - RAS_IRenderTools* m_rendertools; - /// engine - KX_KetsjiEngine* m_engine; + /// canvas + RAS_ICanvas* m_canvas; + /// rasterizer + RAS_IRasterizer* m_rasterizer; + /// render tools + RAS_IRenderTools* m_rendertools; + /// engine + KX_KetsjiEngine* m_engine; #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h index 2ae7b00cb86..8bbe888f74f 100644 --- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h +++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h @@ -41,12 +41,12 @@ class KX_IScalarInterpolator; class KX_OrientationInterpolator : public KX_IInterpolator { public: - KX_OrientationInterpolator(MT_Matrix3x3& target, - KX_IScalarInterpolator **ipos) - : m_target(target) - { - m_ipos[0] = ipos[0]; - m_ipos[1] = ipos[1]; + KX_OrientationInterpolator(MT_Matrix3x3& target, + KX_IScalarInterpolator **ipos) + : m_target(target) + { + m_ipos[0] = ipos[0]; + m_ipos[1] = ipos[1]; m_ipos[2] = ipos[2]; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index c34a00513bf..1eed0665564 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -66,7 +66,7 @@ protected: btIDebugDraw* m_debugDrawer; class btDefaultCollisionConfiguration* m_collisionConfiguration; - class btBroadphaseInterface* m_broadphase; // broadphase for dynamic world + class btBroadphaseInterface* m_broadphase; // broadphase for dynamic world // for culling only btOverlappingPairCache* m_cullingCache; struct btDbvtBroadphase* m_cullingTree; // broadphase for culling diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 2988aa4effb..478aa0ab03c 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -207,7 +207,7 @@ public: * @return true if stereo mode is enabled. */ virtual bool Stereo()=0; - virtual StereoMode GetStereoMode()=0; + virtual StereoMode GetStereoMode()=0; virtual bool InterlacedStereo()=0; /** * Sets which eye buffer subsequent primitives will be rendered to. diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h index 422d6dfa1b3..baf3d9c1166 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h @@ -39,7 +39,7 @@ void main(void) { vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); float gray = dot(texcolor.rgb, vec3(0.299, 0.587, 0.114)); - gl_FragColor = vec4(gray, gray, gray, texcolor.a); + gl_FragColor = vec4(gray, gray, gray, texcolor.a); } ); #endif diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h index 475f3506c2c..7df271c15e4 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h @@ -37,9 +37,9 @@ uniform sampler2D bgl_RenderedTexture; void main(void) { - vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); + vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); gl_FragColor.rgb = 1.0 - texcolor.rgb; - gl_FragColor.a = texcolor.a; + gl_FragColor.a = texcolor.a; } ); #endif diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index cbfa49510a5..c28db2fd91c 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -149,7 +149,7 @@ public: virtual void SetRenderArea(); virtual void SetStereoMode(const StereoMode stereomode); - virtual RAS_IRasterizer::StereoMode GetStereoMode(); + virtual RAS_IRasterizer::StereoMode GetStereoMode(); virtual bool Stereo(); virtual bool InterlacedStereo(); virtual void SetEye(const StereoEye eye); diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index 9e7e514b27a..3fb4eb7b55b 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -245,10 +245,10 @@ public: } } virtual ~SG_DListHead() {} - T* Remove() - { + T* Remove() + { return static_cast(SG_DList::Remove()); - } + } }; diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h index 1101fbbc2d4..4dfd701ac3d 100644 --- a/source/gameengine/VideoTexture/ImageRender.h +++ b/source/gameengine/VideoTexture/ImageRender.h @@ -52,42 +52,42 @@ public: virtual ~ImageRender (void); /// get background color - int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); } + int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); } /// set background color void setBackground (int red, int green, int blue, int alpha); /// clipping distance float getClip (void) { return m_clip; } /// set whole buffer use - void setClip (float clip) { m_clip = clip; } + void setClip (float clip) { m_clip = clip; } protected: - /// true if ready to render - bool m_render; + /// true if ready to render + bool m_render; /// rendered scene KX_Scene * m_scene; /// camera for render KX_Camera * m_camera; - /// do we own the camera? - bool m_owncamera; - /// for mirror operation - KX_GameObject * m_observer; - KX_GameObject * m_mirror; + /// do we own the camera? + bool m_owncamera; + /// for mirror operation + KX_GameObject * m_observer; + KX_GameObject * m_mirror; float m_clip; // clipping distance - float m_mirrorHalfWidth; // mirror width in mirror space - float m_mirrorHalfHeight; // mirror height in mirror space - MT_Point3 m_mirrorPos; // mirror center position in local space - MT_Vector3 m_mirrorZ; // mirror Z axis in local space - MT_Vector3 m_mirrorY; // mirror Y axis in local space - MT_Vector3 m_mirrorX; // mirror X axis in local space - /// canvas - RAS_ICanvas* m_canvas; - /// rasterizer - RAS_IRasterizer* m_rasterizer; - /// render tools - RAS_IRenderTools* m_rendertools; - /// engine - KX_KetsjiEngine* m_engine; + float m_mirrorHalfWidth; // mirror width in mirror space + float m_mirrorHalfHeight; // mirror height in mirror space + MT_Point3 m_mirrorPos; // mirror center position in local space + MT_Vector3 m_mirrorZ; // mirror Z axis in local space + MT_Vector3 m_mirrorY; // mirror Y axis in local space + MT_Vector3 m_mirrorX; // mirror X axis in local space + /// canvas + RAS_ICanvas* m_canvas; + /// rasterizer + RAS_IRasterizer* m_rasterizer; + /// render tools + RAS_IRenderTools* m_rendertools; + /// engine + KX_KetsjiEngine* m_engine; /// background color float m_background[4]; diff --git a/source/gameengine/VideoTexture/ImageViewport.h b/source/gameengine/VideoTexture/ImageViewport.h index 1b415fc58be..70c52b0781c 100644 --- a/source/gameengine/VideoTexture/ImageViewport.h +++ b/source/gameengine/VideoTexture/ImageViewport.h @@ -51,7 +51,7 @@ public: /// is alpha channel used bool getAlpha (void) { return m_alpha; } /// set whole buffer use - void setAlpha (bool alpha) { m_alpha = alpha; } + void setAlpha (bool alpha) { m_alpha = alpha; } /// get capture size in viewport short * getCaptureSize (void) { return m_capSize; } @@ -71,8 +71,8 @@ protected: short m_capSize[2]; /// use whole viewport bool m_whole; - /// use alpha channel - bool m_alpha; + /// use alpha channel + bool m_alpha; /// position of capture rectangle in viewport GLint m_position[2]; From 16ee427576608e3b04cef71909e4dbf2c2105034 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 23:16:12 +0000 Subject: [PATCH 096/113] rna_ParticleDupliWeight_name_length was returning an incorrect value. Zealous debug checks are testing the (buf[len] == '\0') --- source/blender/makesrna/intern/rna_particle.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 8eb25290b18..f0f782fede2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -691,14 +691,13 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int } } +static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str); + static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr) { - ParticleDupliWeight *dw= ptr->data; - - if(dw->ob) - return strlen(dw->ob->id.name+2) + 7; - else - return 9 + 7; + char tstr[32]; + rna_ParticleDupliWeight_name_get(ptr, tstr); + return strlen(tstr); } static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str) From cfb154ca58edd8fca7970626c23ed14a086ede78 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Oct 2011 00:08:40 +0000 Subject: [PATCH 097/113] fix [#28800] Scene NULL in frame change callback, crashes on property update. --- source/blender/makesrna/intern/rna_object.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3141369fcd4..fc1272be0e0 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -250,16 +250,20 @@ void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_tag_update(ptr->id.data, OB_RECALC_OB); - DAG_scene_sort(bmain, scene); + if (scene) { + DAG_scene_sort(bmain, scene); + } WM_main_add_notifier(NC_OBJECT|ND_PARENT, ptr->id.data); } /* when changing the selection flag the scene needs updating */ static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - Object *ob= (Object*)ptr->id.data; - short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT; - ED_base_object_select(object_in_scene(ob, scene), mode); + if (scene) { + Object *ob= (Object*)ptr->id.data; + short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT; + ED_base_object_select(object_in_scene(ob, scene), mode); + } } static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) From 47253d0a2cd7dd5e1aee41eecb1898f490ac4b61 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Oct 2011 00:26:04 +0000 Subject: [PATCH 098/113] fix for own bad mistake, broke vector curve handles. --- source/blender/blenkernel/intern/colortools.c | 6 ++---- source/blender/blenkernel/intern/curve.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 7747e4750b7..7e92a09ce99 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -419,12 +419,10 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex } if(bezt->h1==HD_VECT) { /* vector */ - mul_v2_fl(dvec_a, 1.0f/3.0f); - sub_v2_v2v2(p2-3, p2, dvec_a); + madd_v2_v2v2fl(p2-3, p2, dvec_a, -1.0f/3.0f); } if(bezt->h2==HD_VECT) { - mul_v2_fl(dvec_b, 1.0f/3.0f); - sub_v2_v2v2(p2+3, p2, dvec_b); + madd_v2_v2v2fl(p2+3, p2, dvec_b, 1.0f/3.0f); } } diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index b703c33f174..c69ced86a6c 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2595,12 +2595,10 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } if(bezt->h1==HD_VECT) { /* vector */ - mul_v3_fl(dvec_a, 1.0f/3.0f); - sub_v3_v3v3(p2-3, p2, dvec_a); + madd_v3_v3v3fl(p2-3, p2, dvec_a, -1.0f/3.0f); } if(bezt->h2==HD_VECT) { - mul_v3_fl(dvec_b, 1.0f/3.0f); - sub_v3_v3v3(p2+3, p2, dvec_b); + madd_v3_v3v3fl(p2+3, p2, dvec_b, 1.0f/3.0f); } len_b= len_v3v3(p2, p2+3); From aac598303b31ab42ef508438157e1239134508c1 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 7 Oct 2011 05:19:21 +0000 Subject: [PATCH 099/113] Scene.GameData DNA alignment nitpicking * "structures are always multiples of 8 bytes in size" (adding two pads for RecastData) removing some unecessary pads. Moving others to make pad counting easy. (although this patch is not highly needed in trunk it will help cucumber merging) This could probably fixed the problem address at rev.40084 --- source/blender/makesdna/DNA_scene_types.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index b2ded4c756a..cb70a8274bd 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -426,8 +426,7 @@ typedef struct GameFraming { #define SCE_GAMEFRAMING_EXTEND 1 #define SCE_GAMEFRAMING_SCALE 2 -typedef struct RecastData -{ +typedef struct RecastData { float cellsize; float cellheight; float agentmaxslope; @@ -441,6 +440,7 @@ typedef struct RecastData int vertsperpoly; float detailsampledist; float detailsamplemaxerror; + short pad1, pad2; } RecastData; typedef struct GameData { @@ -453,8 +453,7 @@ typedef struct GameData { /* stereo/dome mode */ struct GameDome dome; short stereoflag, stereomode; - short pad2, pad3; - float eyeseparation, pad1; + float eyeseparation; RecastData recastData; @@ -471,11 +470,12 @@ typedef struct GameData { * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling */ int flag; - short mode, matmode, pad; + short mode, matmode; short occlusionRes; /* resolution of occlusion Z buffer in pixel */ short physicsEngine; + short pad[2]; short ticrate, maxlogicstep, physubstep, maxphystep; - short obstacleSimulation; + short obstacleSimulation, pad1; float levelHeight; } GameData; From cc43a5bbde5fd74d848009d0dc5d35779230b12c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 7 Oct 2011 08:57:08 +0000 Subject: [PATCH 100/113] Added Macro and KeyingSetInfo to blacklisted msg classes. Also updated french po & mo. --- po/update_msg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/po/update_msg.py b/po/update_msg.py index e91371c1755..ca19e036637 100644 --- a/po/update_msg.py +++ b/po/update_msg.py @@ -43,7 +43,8 @@ def dump_messages_rna(messages): "BlendData", # registerable classes "Panel", "Menu", "Header", "RenderEngine", - "Operator", "OperatorMacro", "UnknownType" + "Operator", "OperatorMacro", "Macro", + "KeyingSetInfo", "UnknownType", # window classes "WindowManager", "Window" ] From 8c229c060d12a44f9fd2abdd439cfaae509d1b54 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 7 Oct 2011 18:25:54 +0000 Subject: [PATCH 101/113] Patch [#28660] x64 thumbnail handler not being installed in CMake builds by Tom Edwards. --- source/creator/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index d36bd3cd344..0650a5678b2 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -582,12 +582,12 @@ elseif(WIN32) FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll DESTINATION ${TARGETDIR} ) - else() - install( - FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll - DESTINATION ${TARGETDIR} - ) endif() + + install( # x86 builds can run on x64 Windows, so this is required at all times + FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll + DESTINATION ${TARGETDIR} + ) elseif(APPLE) set(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) From 9a51266f3569eebca06c18d1af4ed8151d93aca7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Oct 2011 20:53:54 +0000 Subject: [PATCH 102/113] fix for align objects with non mesh objects. --- release/scripts/startup/bl_operators/object_align.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index 50e9bfb5b98..dd052c36ade 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -140,7 +140,7 @@ def align_objects(align_x, for obj, bb_world in objs: - if bb_quality: + if bb_quality and obj.type == 'MESH': GBB = GlobalBB_HQ(obj) else: GBB = GlobalBB_LQ(bb_world) @@ -204,7 +204,7 @@ def align_objects(align_x, matrix_world = obj.matrix_world.copy() bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box] - if bb_quality: + if bb_quality and obj.type == 'MESH': GBB = GlobalBB_HQ(obj) else: GBB = GlobalBB_LQ(bb_world) From 011a3645bf1d587101ec7cb9bf6a0a0d1421802a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Oct 2011 11:02:58 +0000 Subject: [PATCH 103/113] fix [#28846] Relative paths on linked scene fails --- source/blender/blenkernel/BKE_font.h | 5 ++-- source/blender/blenkernel/BKE_packedFile.h | 2 +- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenkernel/intern/displist.c | 2 +- source/blender/blenkernel/intern/font.c | 28 +++++++++---------- source/blender/blenkernel/intern/image.c | 4 +-- source/blender/blenkernel/intern/packedFile.c | 10 +++---- source/blender/editors/curve/editfont.c | 9 ++++-- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/sound/sound_ops.c | 3 +- .../blender/editors/space_image/image_ops.c | 3 +- source/blender/makesdna/DNA_ID.h | 2 ++ .../blender/makesrna/intern/rna_image_api.c | 2 +- source/blender/makesrna/intern/rna_main_api.c | 4 +-- 14 files changed, 43 insertions(+), 35 deletions(-) diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h index 2195b370a5f..e4e8805164a 100644 --- a/source/blender/blenkernel/BKE_font.h +++ b/source/blender/blenkernel/BKE_font.h @@ -46,6 +46,7 @@ struct Curve; struct objfnt; struct TmpFont; struct CharInfo; +struct Main; struct chartrans { float xof, yof; @@ -77,10 +78,10 @@ void BKE_font_register_builtin(void *mem, int size); void free_vfont(struct VFont *sc); void free_ttfont(void); struct VFont *get_builtin_font(void); -struct VFont *load_vfont(const char *name); +struct VFont *load_vfont(struct Main *bmain, const char *name); struct TmpFont *vfont_find_tmpfont(struct VFont *vfont); -struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode); +struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode); int BKE_font_getselection(struct Object *ob, int *start, int *end); diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 541c581e762..556ff26e621 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -45,7 +45,7 @@ struct ReportList; struct VFont; /* pack */ -struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename); +struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase); struct PackedFile *newPackedFileMemory(void *mem, int memlen); void packAll(struct Main *bmain, struct ReportList *reports); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 824bbb8f70d..3accceb5464 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1514,7 +1514,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i /* in par the family name is stored, use this to find the other objects */ - chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI); + chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI); if(chartransdata==NULL) return; cu= par->data; diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index acc900d0b71..6704d06be52 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1207,7 +1207,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba if(cu->path) free_path(cu->path); cu->path= NULL; - if(ob->type==OB_FONT) BKE_text_to_curve(scene, ob, 0); + if(ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0); if(!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 6898615c753..c82aa855a7b 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -284,7 +284,7 @@ struct TmpFont *vfont_find_tmpfont(VFont *vfont) return tmpfnt; } -static VFontData *vfont_get_data(VFont *vfont) +static VFontData *vfont_get_data(Main *bmain, VFont *vfont) { struct TmpFont *tmpfnt = NULL; PackedFile *tpf; @@ -319,11 +319,11 @@ static VFontData *vfont_get_data(VFont *vfont) BLI_addtail(&ttfdata, tmpfnt); } } else { - pf= newPackedFile(NULL, vfont->name); + pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); if(!tmpfnt) { - tpf= newPackedFile(NULL, vfont->name); + tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id)); // Add temporary packed file to globals tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); @@ -351,7 +351,7 @@ static VFontData *vfont_get_data(VFont *vfont) return vfont->data; } -VFont *load_vfont(const char *name) +VFont *load_vfont(Main *bmain, const char *name) { char filename[FILE_MAXFILE]; VFont *vfont= NULL; @@ -371,8 +371,8 @@ VFont *load_vfont(const char *name) BLI_strncpy(dir, name, sizeof(dir)); BLI_splitdirstring(dir, filename); - pf= newPackedFile(NULL, name); - tpf= newPackedFile(NULL, name); + pf= newPackedFile(NULL, name, bmain->name); + tpf= newPackedFile(NULL, name, bmain->name); is_builtin= 0; } @@ -382,7 +382,7 @@ VFont *load_vfont(const char *name) vfd= BLI_vfontdata_from_freetypefont(pf); if (vfd) { - vfont = alloc_libblock(&G.main->vfont, ID_VF, filename); + vfont = alloc_libblock(&bmain->vfont, ID_VF, filename); vfont->data = vfd; /* if there's a font name, use it for the ID name */ @@ -439,7 +439,7 @@ VFont *get_builtin_font(void) if (strcmp(vf->name, FO_BUILTIN_NAME)==0) return vf; - return load_vfont(FO_BUILTIN_NAME); + return load_vfont(G.main, FO_BUILTIN_NAME); } static VChar *find_vfont_char(VFontData *vfd, intptr_t character) @@ -500,7 +500,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i } -static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx) +static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx) { BezTriple *bezt1, *bezt2; Nurb *nu1 = NULL, *nu2 = NULL; @@ -509,7 +509,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float VChar *che = NULL; int i; - vfd= vfont_get_data(which_vfont(cu, info)); + vfd= vfont_get_data(bmain, which_vfont(cu, info)); if (!vfd) return; /* @@ -662,7 +662,7 @@ static float char_width(Curve *cu, VChar *che, CharInfo *info) } } -struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) +struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int mode) { VFont *vfont, *oldvfont; VFontData *vfd= NULL; @@ -714,7 +714,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) if (cu->tb==NULL) cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBox compat"); - vfd= vfont_get_data(vfont); + vfd= vfont_get_data(bmain, vfont); /* The VFont Data can not be found */ if(!vfd) { @@ -792,7 +792,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) } if (vfont != oldvfont) { - vfd= vfont_get_data(vfont); + vfd= vfont_get_data(bmain, vfont); oldvfont = vfont; } @@ -1157,7 +1157,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) } // We do not want to see any character for \n or \r if(cha != '\n' && cha != '\r') - buildchar(cu, cha, info, ct->xof, ct->yof, ct->rot, i); + buildchar(bmain, cu, cha, info, ct->xof, ct->yof, ct->rot, i); if ((info->flag & CU_CHINFO_UNDERLINE) && (cu->textoncurve == NULL) && (cha != '\n') && (cha != '\r')) { float ulwidth, uloverlap= 0.0f; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d764826cd47..834961bf6e7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1480,7 +1480,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal) /* try to repack file */ if(ima->packedfile) { PackedFile *pf; - pf = newPackedFile(NULL, ima->name); + pf = newPackedFile(NULL, ima->name, ID_BLEND_PATH(G.main, &ima->id)); if (pf) { freePackedFile(ima->packedfile); ima->packedfile = pf; @@ -1860,7 +1860,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* make packed file for autopack */ if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK)) - ima->packedfile = newPackedFile(NULL, str); + ima->packedfile = newPackedFile(NULL, str, ID_BLEND_PATH(G.main, &ima->id)); } } else diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index ed729d819b7..4bc40bde949 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -168,7 +168,7 @@ PackedFile *newPackedFileMemory(void *mem, int memlen) return pf; } -PackedFile *newPackedFile(ReportList *reports, const char *filename) +PackedFile *newPackedFile(ReportList *reports, const char *filename, const char *basepath) { PackedFile *pf = NULL; int file, filelen; @@ -185,7 +185,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename) // convert relative filenames to absolute filenames strcpy(name, filename); - BLI_path_abs(name, G.main->name); + BLI_path_abs(name, basepath); // open the file // and create a PackedFile structure @@ -224,7 +224,7 @@ void packAll(Main *bmain, ReportList *reports) for(ima=bmain->image.first; ima; ima=ima->id.next) { if(ima->packedfile == NULL && ima->id.lib==NULL) { if(ima->source==IMA_SRC_FILE) { - ima->packedfile = newPackedFile(reports, ima->name); + ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id)); } else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2); @@ -234,11 +234,11 @@ void packAll(Main *bmain, ReportList *reports) for(vf=bmain->vfont.first; vf; vf=vf->id.next) if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0) - vf->packedfile = newPackedFile(reports, vf->name); + vf->packedfile = newPackedFile(reports, vf->name, bmain->name); for(sound=bmain->sound.first; sound; sound=sound->id.next) if(sound->packedfile == NULL && sound->id.lib==NULL) - sound->packedfile = newPackedFile(reports, sound->name); + sound->packedfile = newPackedFile(reports, sound->name, bmain->name); } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index fcac070f84e..d8257c524c1 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -259,6 +259,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c) static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int recalc, int mode) { + struct Main *bmain= CTX_data_main(C); Curve *cu= obedit->data; EditFont *ef= cu->editfont; cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0]; @@ -269,7 +270,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re if(mode == FO_EDIT) update_string(cu); - BKE_text_to_curve(scene, obedit, mode); + BKE_text_to_curve(bmain, scene, obedit, mode); if(recalc) DAG_id_tag_update(obedit->data, 0); @@ -928,9 +929,10 @@ static int move_cursor(bContext *C, int type, int select) if(select == 0) { if(cu->selstart) { + struct Main *bmain= CTX_data_main(C); cu->selstart = cu->selend = 0; update_string(cu); - BKE_text_to_curve(scene, obedit, FO_SELCHANGE); + BKE_text_to_curve(bmain, scene, obedit, FO_SELCHANGE); } } @@ -1644,13 +1646,14 @@ static int open_cancel(bContext *UNUSED(C), wmOperator *op) static int open_exec(bContext *C, wmOperator *op) { + struct Main *bmain= CTX_data_main(C); VFont *font; PropertyPointerRNA *pprop; PointerRNA idptr; char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); - font= load_vfont(filepath); + font= load_vfont(bmain, filepath); if(!font) { if(op->customdata) MEM_freeN(op->customdata); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index a50dd00ef16..76cbfdc88e7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1221,7 +1221,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) cu1->vfontbi= cu->vfontbi; id_us_plus((ID *)cu1->vfontbi); - BKE_text_to_curve(scene, base->object, 0); /* needed? */ + BKE_text_to_curve(bmain, scene, base->object, 0); /* needed? */ BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family)); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 5b72e87f95a..d03c2b19300 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -519,6 +519,7 @@ static int sound_poll(bContext *C) static int pack_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Editing* ed = CTX_data_scene(C)->ed; bSound* sound; @@ -530,7 +531,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(!sound || sound->packedfile) return OPERATOR_CANCELLED; - sound->packedfile= newPackedFile(op->reports, sound->name); + sound->packedfile= newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id)); sound_load(CTX_data_main(C), sound); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 45bd1d58a53..33c3ae45a58 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1567,6 +1567,7 @@ static int pack_test(bContext *C, wmOperator *op) static int pack_exec(bContext *C, wmOperator *op) { + struct Main *bmain= CTX_data_main(C); Image *ima= CTX_data_edit_image(C); ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); int as_png= RNA_boolean_get(op->ptr, "as_png"); @@ -1582,7 +1583,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(as_png) BKE_image_memorypack(ima); else - ima->packedfile= newPackedFile(op->reports, ima->name); + ima->packedfile= newPackedFile(op->reports, ima->name, ID_BLEND_PATH(bmain, &ima->id)); WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index f81a05f5625..9c8a0231907 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -206,6 +206,8 @@ typedef struct PreviewImage { #define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) +#define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : (_bmain)->name) + #ifdef GS #undef GS #endif diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index b7827989a94..50ce816d7a1 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -142,7 +142,7 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png) BKE_image_memorypack(image); } else { - image->packedfile= newPackedFile(reports, image->name); + image->packedfile= newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id)); } } } diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 54bae59ae93..7b26a8cb783 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -344,12 +344,12 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall mb->id.name+2, ID_REAL_USERS(mb)); } -VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath) +VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath) { VFont *font; errno= 0; - font= load_vfont(filepath); + font= load_vfont(bmain, filepath); if(!font) BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath, From 21eb8b92a0acaaeebfe54073de1f3fd076174d10 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Oct 2011 11:11:54 +0000 Subject: [PATCH 104/113] use newly added ID_BLEND_PATH() in more places. --- source/blender/blenkernel/intern/customdata.c | 4 +--- source/blender/blenkernel/intern/image.c | 17 ++++------------- source/blender/blenkernel/intern/sound.c | 9 +-------- .../python/generic/bpy_internal_import.c | 2 +- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 30da2e01011..d407bbee602 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -2383,10 +2383,8 @@ int CustomData_verify_versions(struct CustomData *data, int index) static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external) { - char *path = (id->lib)? id->lib->filepath: G.main->name; - BLI_strncpy(filename, external->filename, FILE_MAX); - BLI_path_abs(filename, path); + BLI_path_abs(filename, ID_BLEND_PATH(G.main, id)); } void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 834961bf6e7..f6210d3a516 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1653,10 +1653,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame) BLI_stringdec(name, head, tail, &numlen); BLI_stringenc(name, head, tail, numlen, frame); - if(ima->id.lib) - BLI_path_abs(name, ima->id.lib->filepath); - else - BLI_path_abs(name, G.main->name); + BLI_path_abs(name, ID_BLEND_PATH(G.main, &ima->id)); flag= IB_rect|IB_multilayer; if(ima->flag & IMA_DO_PREMUL) @@ -1768,11 +1765,8 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) char str[FILE_MAX]; BLI_strncpy(str, ima->name, FILE_MAX); - if(ima->id.lib) - BLI_path_abs(str, ima->id.lib->filepath); - else - BLI_path_abs(str, G.main->name); - + BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id)); + /* FIXME: make several stream accessible in image editor, too*/ ima->anim = openanim(str, IB_rect, 0); @@ -1834,10 +1828,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* get the right string */ BLI_strncpy(str, ima->name, sizeof(str)); - if(ima->id.lib) - BLI_path_abs(str, ima->id.lib->filepath); - else - BLI_path_abs(str, G.main->name); + BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id)); /* read ibuf */ ibuf = IMB_loadiffname(str, flag); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 73d0d70778f..f2d92154c66 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -340,20 +340,13 @@ void sound_load(struct Main *bmain, struct bSound* sound) #endif { char fullpath[FILE_MAX]; - char *path; /* load sound */ PackedFile* pf = sound->packedfile; /* dont modify soundact->sound->name, only change a copy */ BLI_strncpy(fullpath, sound->name, sizeof(fullpath)); - - if(sound->id.lib) - path = sound->id.lib->filepath; - else - path = bmain->name; - - BLI_path_abs(fullpath, path); + BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id)); /* but we need a packed file then */ if (pf) diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 90260100c83..d29bc798399 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -93,7 +93,7 @@ void bpy_import_main_set(struct Main *maggie) /* returns a dummy filename for a textblock so we can tell what file a text block comes from */ void bpy_text_filename_get(char *fn, size_t fn_len, Text *text) { - BLI_snprintf(fn, fn_len, "%s%c%s", text->id.lib ? text->id.lib->filepath : bpy_import_main->name, SEP, text->id.name+2); + BLI_snprintf(fn, fn_len, "%s%c%s", ID_BLEND_PATH(bpy_import_main, &text->id), SEP, text->id.name+2); } PyObject *bpy_text_import(Text *text) From 35fedac565426a8ada30c620888e5a1739bd9219 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Oct 2011 12:27:52 +0000 Subject: [PATCH 105/113] fix [#28821] Whole Character keying set ignores non animatable propertyflag --- release/scripts/startup/keyingsets_builtins.py | 7 ++++++- source/blender/makesrna/intern/rna_rna.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index 6b12c95e072..e99966ce58f 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -360,7 +360,12 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): continue # for now, just add all of 'em - ksi.addProp(ks, bone, '["%s"]' % (prop)) + prop_rna = type(bone).bl_rna.properties.get(prop, None) + if prop_rna is None: + ksi.addProp(ks, bone, '["%s"]' % prop) + elif prop_rna.is_animatable: + ksi.addProp(ks, bone, prop) + ############################### diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 454fd6275d9..376b0c529d0 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -506,6 +506,13 @@ static int rna_Property_readonly_get(PointerRNA *ptr) return prop->flag & PROP_EDITABLE ? 0:1; } +static int rna_Property_animatable_get(PointerRNA *ptr) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + + return (prop->flag & PROP_ANIMATABLE) != 0; +} + static int rna_Property_use_output_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -1066,6 +1073,11 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL); RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA"); + prop= RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Property_animatable_get", NULL); + RNA_def_property_ui_text(prop, "Animatable", "Property is animatable through RNA"); + prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL); From a016fdd499ae93329e42a5446ae3e25639f23c0b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 00:35:31 +0000 Subject: [PATCH 106/113] fix [#28848] Editing object name (e.g.), Ctrl-Shift-Arrows don't work as Ctrl-Arrows. --- .../editors/interface/interface_handlers.c | 153 ++++++++---------- 1 file changed, 71 insertions(+), 82 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b4970d5933c..a3d072c3220 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1370,47 +1370,24 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump) { - char *str; - int len; + const char *str= data->str; + const int len= strlen(str); + const int pos_prev= but->pos; + const int has_sel= (but->selend - but->selsta) > 0; - str= data->str; - len= strlen(str); - - if(direction) { /* right*/ - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(select) { - if (!data->selextend) { - data->selextend = EXTEND_RIGHT; - } - if (data->selextend == EXTEND_RIGHT) { - but->selend++; - if (but->selend > len) but->selend = len; - } else if (data->selextend == EXTEND_LEFT) { - but->selsta++; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - data->selextend = EXTEND_RIGHT; - } - } - } else { - but->selsta = but->pos = but->selend; - data->selextend = 0; - } - } else { - if(select) { - /* make a selection, starting from the cursor position */ - int tlen; - but->selsta = but->pos; - - but->pos++; - if(but->pos > (tlen= strlen(str))) but->pos= tlen; - - but->selend = but->pos; - } else if(jump) { + /* special case, quit selection and set cursor */ + if (has_sel && !select) { + if (direction) { + but->selsta = but->pos = but->selend; + } + else { + but->pos = but->selend = but->selsta; + } + data->selextend = 0; + } + else { + if(direction) { /* right*/ + if(jump) { /* jump betweenn special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ @@ -1418,47 +1395,14 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction but->pos++; if(test_special_char(str[but->pos])) break; } - } else { - int tlen; + } + else { but->pos++; - if(but->pos > (tlen= strlen(str))) but->pos= tlen; + if(but->pos > len) but->pos= len; } } - } - else { /* left */ - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(select) { - if (!data->selextend) { - data->selextend = EXTEND_LEFT; - } - if (data->selextend == EXTEND_LEFT) { - but->selsta--; - if (but->selsta < 0) but->selsta = 0; - } else if (data->selextend == EXTEND_RIGHT) { - but->selend--; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - data->selextend = EXTEND_LEFT; - } - } - } else { - but->pos = but->selend = but->selsta; - data->selextend = 0; - } - } else { - if(select) { - /* make a selection, starting from the cursor position */ - but->selend = but->pos; - - but->pos--; - if(but->pos<0) but->pos= 0; - - but->selsta = but->pos; - } else if(jump) { + else { /* left */ + if(jump) { /* jump betweenn special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ @@ -1466,18 +1410,63 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction but->pos--; if(test_special_char(str[but->pos])) break; } - } else { + } + else { if(but->pos>0) but->pos--; } } + + + if(select) { + /* existing selection */ + if (has_sel) { + + if(data->selextend == 0) { + data->selextend= EXTEND_RIGHT; + } + + if (direction) { + if (data->selextend == EXTEND_RIGHT) { + but->selend= but->pos; + } + else { + but->selsta= but->pos; + } + } + else { + if (data->selextend == EXTEND_LEFT) { + but->selsta= but->pos; + } + else { + but->selend= but->pos; + } + } + + if (but->selend < but->selsta) { + SWAP(short, but->selsta, but->selend); + data->selextend= (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT; + } + + } /* new selection */ + else { + if (direction) { + data->selextend= EXTEND_RIGHT; + but->selend= but->pos; + but->selsta= pos_prev; + } + else { + data->selextend= EXTEND_LEFT; + but->selend= pos_prev; + but->selsta= but->pos; + } + } + } } } static void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select) { - char *str; - - str= data->str; + const char *str= data->str; if(direction) { /* right */ if(select) { From db4b3742a1e1ed51ee50bba4ca45c748ce09fabb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 00:45:26 +0000 Subject: [PATCH 107/113] button text editing: home/end were not moving the cursor position, only the selecton. --- .../editors/interface/interface_handlers.c | 49 ++++++------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a3d072c3220..f18370fdb46 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1368,7 +1368,7 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc return changed; } -static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump) +static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all) { const char *str= data->str; const int len= strlen(str); @@ -1377,11 +1377,16 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction /* special case, quit selection and set cursor */ if (has_sel && !select) { - if (direction) { - but->selsta = but->pos = but->selend; + if (jump_all) { + but->selsta = but->selend= but->pos = direction ? len : 0; } else { - but->pos = but->selend = but->selsta; + if (direction) { + but->selsta = but->pos = but->selend; + } + else { + but->pos = but->selend = but->selsta; + } } data->selextend = 0; } @@ -1393,7 +1398,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction * list of special character, ctr -> */ while(but->pos < len) { but->pos++; - if(test_special_char(str[but->pos])) break; + if(!jump_all && test_special_char(str[but->pos])) break; } } else { @@ -1408,7 +1413,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction * list of special character, ctr -> */ while(but->pos > 0){ but->pos--; - if(test_special_char(str[but->pos])) break; + if(!jump_all && test_special_char(str[but->pos])) break; } } else { @@ -1464,30 +1469,6 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction } } -static void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select) -{ - const char *str= data->str; - - if(direction) { /* right */ - if(select) { - but->selsta = but->pos; - but->selend = strlen(str); - data->selextend = EXTEND_RIGHT; - } else { - but->selsta = but->selend = but->pos= strlen(str); - } - } - else { /* left */ - if(select) { - but->selend = but->pos; - but->selsta = 0; - data->selextend = EXTEND_LEFT; - } else { - but->selsta = but->selend = but->pos= 0; - } - } -} - static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, int all) { char *str; @@ -1820,11 +1801,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } break; case RIGHTARROWKEY: - ui_textedit_move(but, data, 1, event->shift, event->ctrl); + ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE); retval= WM_UI_HANDLER_BREAK; break; case LEFTARROWKEY: - ui_textedit_move(but, data, 0, event->shift, event->ctrl); + ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE); retval= WM_UI_HANDLER_BREAK; break; case DOWNARROWKEY: @@ -1834,7 +1815,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } /* pass on purposedly */ case ENDKEY: - ui_textedit_move_end(but, data, 1, event->shift); + ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE); retval= WM_UI_HANDLER_BREAK; break; case UPARROWKEY: @@ -1844,7 +1825,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } /* pass on purposedly */ case HOMEKEY: - ui_textedit_move_end(but, data, 0, event->shift); + ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE); retval= WM_UI_HANDLER_BREAK; break; case PADENTER: From e50a4858367cbd51be7e4ed0f4f6e9756bf684d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 00:54:41 +0000 Subject: [PATCH 108/113] text editing: make jumping left/right both act the same way (was skipping an extra char when jumping left). --- .../editors/interface/interface_handlers.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f18370fdb46..8855bbd8e64 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1393,7 +1393,7 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction else { if(direction) { /* right*/ if(jump) { - /* jump betweenn special characters (/,\,_,-, etc.), + /* jump between special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ while(but->pos < len) { @@ -1408,13 +1408,25 @@ static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction } else { /* left */ if(jump) { - /* jump betweenn special characters (/,\,_,-, etc.), + + /* left only: compensate for index/change in direction */ + if(but->pos > 0) { + but->pos--; + } + + /* jump between special characters (/,\,_,-, etc.), * look at function test_special_char() for complete * list of special character, ctr -> */ while(but->pos > 0){ but->pos--; if(!jump_all && test_special_char(str[but->pos])) break; } + + /* left only: compensate for index/change in direction */ + if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) { + but->pos++; + } + } else { if(but->pos>0) but->pos--; From a378668ac2c0220863311df4bc5e1aa8114e6bd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 01:11:07 +0000 Subject: [PATCH 109/113] text edit: selecting zoomed in text with the mouse had an incorrect offset. --- source/blender/editors/interface/interface_handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8855bbd8e64..9ad828f91c1 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1307,12 +1307,12 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho } /* mouse inside the widget */ else if (x >= startx) { - float aspect= (but->block->aspect); + const float aspect_sqrt= sqrtf(but->block->aspect); but->pos= strlen(origstr)-but->ofs; /* XXX does not take zoom level into account */ - while (startx + aspect*BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) { + while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) { if (but->pos <= 0) break; but->pos--; origstr[but->pos+but->ofs] = 0; From ee8078fb12f3697a9f8d49b35a4de21d3f7e32ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 02:11:43 +0000 Subject: [PATCH 110/113] fix for BUILTIN_KSI_WholeCharacter keying custom string/collection/group properties --- release/scripts/startup/keyingsets_builtins.py | 11 +++++++++-- source/blender/python/intern/bpy_rna.c | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index e99966ce58f..c7922a0dfa1 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -353,8 +353,13 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # custom properties def doCustomProps(ksi, ks, bone): + + prop_type_compat = {bpy.types.BooleanProperty, + bpy.types.IntProperty, + bpy.types.FloatProperty} + # go over all custom properties for bone - for prop, val in bone.items(): + for prop in bone.keys(): # ignore special "_RNA_UI" used for UI editing if prop == "_RNA_UI": continue @@ -362,7 +367,9 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): # for now, just add all of 'em prop_rna = type(bone).bl_rna.properties.get(prop, None) if prop_rna is None: - ksi.addProp(ks, bone, '["%s"]' % prop) + prop_path = '["%s"]' % prop + if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: + ksi.addProp(ks, bone, prop_path) elif prop_rna.is_animatable: ksi.addProp(ks, bone, prop) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f79f1d01a96..4bdcc7838f1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3655,12 +3655,22 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) Py_RETURN_NONE; } +static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) +{ + PointerRNA tptr; + RNA_pointer_create(NULL, &RNA_Property, self->prop, &tptr); + return pyrna_struct_Subtype(&tptr); +} + + + /*****************************************************************************/ /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[]= { {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; From e60a7fbc579763e4a0f32b0f9607034e604a2ac4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 02:24:51 +0000 Subject: [PATCH 111/113] correction to RNA class api references (only used for docs) --- source/blender/python/intern/bpy_rna.c | 21 +++++++++++---------- source/blender/python/intern/bpy_rna_anim.c | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 4bdcc7838f1..cb68f9cf2dc 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -84,6 +84,11 @@ static PyObject* pyrna_struct_Subtype(PointerRNA *ptr); static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self); +#define BPY_DOC_ID_PROP_TYPE_NOTE \ +" .. note:: Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \ +" :class:`bpy.types.PoseBone` classes support custom properties.\n" + + int pyrna_struct_validity_check(BPy_StructRNA *pysrna) { if(pysrna->ptr.type) @@ -2746,8 +2751,7 @@ PyDoc_STRVAR(pyrna_struct_keys_doc, " :return: custom property keys.\n" " :rtype: list of strings\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes\n" -" support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self) { @@ -2775,8 +2779,7 @@ PyDoc_STRVAR(pyrna_struct_items_doc, " :return: custom property key, value pairs.\n" " :rtype: list of key, value tuples\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_items(BPy_PropertyRNA *self) { @@ -2804,8 +2807,7 @@ PyDoc_STRVAR(pyrna_struct_values_doc, " :return: custom property values.\n" " :rtype: list\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_values(BPy_PropertyRNA *self) { @@ -3669,14 +3671,14 @@ static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self) /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; static PyGetSetDef pyrna_struct_getseters[]= { - {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL}, {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; @@ -3783,8 +3785,7 @@ PyDoc_STRVAR(pyrna_struct_get_doc, " *key* is not found.\n" " :type default: Undefined\n" "\n" -" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n" -" classes support custom properties.\n" +BPY_DOC_ID_PROP_TYPE_NOTE ); static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args) { diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 8bde1db96ca..d766acc098e 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -273,7 +273,7 @@ char pyrna_struct_driver_add_doc[] = " :arg index: array index of the property drive. Defaults to -1 for all indices or a single channel if the property is not an array.\n" " :type index: int\n" " :return: The driver(s) added.\n" -" :rtype: :class:`FCurve` or list if index is -1 with an array property.\n" +" :rtype: :class:`bpy.types.FCurve` or list if index is -1 with an array property.\n" ; PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args) { From 6778f7ae056bcf529820ea3fc8238dda0473eb33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 04:11:18 +0000 Subject: [PATCH 112/113] clear some warnings. --- source/gameengine/Ketsji/KX_GameObject.cpp | 4 +- .../Ketsji/KX_ObstacleSimulation.cpp | 4 +- .../gameengine/Ketsji/KX_SteeringActuator.cpp | 64 +++++++++---------- .../gameengine/Ketsji/KX_SteeringActuator.h | 4 +- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 853b36b54f7..e5e9c3330e5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -110,9 +110,9 @@ KX_GameObject::KX_GameObject( m_pGraphicController(NULL), m_xray(false), m_pHitObject(NULL), + m_pObstacleSimulation(NULL), m_actionManager(NULL), - m_isDeformable(false), - m_pObstacleSimulation(NULL) + m_isDeformable(false) #ifdef WITH_PYTHON , m_attr_dict(NULL) #endif diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp index 5f78d9a3722..c2b53fb71ba 100644 --- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp +++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp @@ -633,7 +633,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM const float ivmax = 1.0f / vmax; - float adir[2], adist; + float adir[2] /*, adist */; vcpy(adir, activeObst->pvel); if (vlen(adir) > 0.01f) vnorm(adir); @@ -641,7 +641,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM vset(adir,0,0); float activeObstPos[2]; vset(activeObstPos, activeObst->m_pos.x(), activeObst->m_pos.y()); - adist = vdot(adir, activeObstPos); + /* adist = vdot(adir, activeObstPos); */ float minPenalty = FLT_MAX; diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index 1edecdf44d2..f998da18f83 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -46,38 +46,38 @@ /* ------------------------------------------------------------------------- */ KX_SteeringActuator::KX_SteeringActuator(SCA_IObject *gameobj, - int mode, - KX_GameObject *target, - KX_GameObject *navmesh, - float distance, - float velocity, - float acceleration, - float turnspeed, - bool isSelfTerminated, - int pathUpdatePeriod, - KX_ObstacleSimulation* simulation, - short facingmode, - bool normalup, - bool enableVisualization) : - SCA_IActuator(gameobj, KX_ACT_STEERING), - m_mode(mode), - m_target(target), - m_distance(distance), - m_velocity(velocity), - m_acceleration(acceleration), - m_turnspeed(turnspeed), - m_isSelfTerminated(isSelfTerminated), - m_pathUpdatePeriod(pathUpdatePeriod), - m_updateTime(0), - m_isActive(false), - m_simulation(simulation), - m_enableVisualization(enableVisualization), - m_facingMode(facingmode), - m_normalUp(normalup), - m_obstacle(NULL), - m_pathLen(0), - m_wayPointIdx(-1), - m_steerVec(MT_Vector3(0, 0, 0)) + int mode, + KX_GameObject *target, + KX_GameObject *navmesh, + float distance, + float velocity, + float acceleration, + float turnspeed, + bool isSelfTerminated, + int pathUpdatePeriod, + KX_ObstacleSimulation* simulation, + short facingmode, + bool normalup, + bool enableVisualization) + : SCA_IActuator(gameobj, KX_ACT_STEERING), + m_target(target), + m_mode(mode), + m_distance(distance), + m_velocity(velocity), + m_acceleration(acceleration), + m_turnspeed(turnspeed), + m_simulation(simulation), + m_updateTime(0), + m_obstacle(NULL), + m_isActive(false), + m_isSelfTerminated(isSelfTerminated), + m_enableVisualization(enableVisualization), + m_facingMode(facingmode), + m_normalUp(normalup), + m_pathLen(0), + m_pathUpdatePeriod(pathUpdatePeriod), + m_wayPointIdx(-1), + m_steerVec(MT_Vector3(0, 0, 0)) { m_navmesh = static_cast(navmesh); if (m_navmesh) diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h index 4f8303107f7..d337799976b 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.h +++ b/source/gameengine/Ketsji/KX_SteeringActuator.h @@ -56,12 +56,12 @@ class KX_SteeringActuator : public SCA_IActuator int m_mode; float m_distance; float m_velocity; - float m_acceleration; + float m_acceleration; float m_turnspeed; KX_ObstacleSimulation* m_simulation; - KX_Obstacle* m_obstacle; double m_updateTime; + KX_Obstacle* m_obstacle; bool m_isActive; bool m_isSelfTerminated; bool m_enableVisualization; From 8714fb7019e853703ce8b102edac43d84b7bbe14 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 06:03:38 +0000 Subject: [PATCH 113/113] replace sprintf with strcpy where no formatting is done and return value isn't used. --- source/blender/blenkernel/intern/gpencil.c | 2 +- source/blender/blenkernel/intern/library.c | 4 ++-- source/blender/blenkernel/intern/nla.c | 8 ++++---- source/blender/blenlib/intern/winstuff.c | 2 +- source/blender/editors/animation/anim_draw.c | 4 ++-- source/blender/editors/animation/anim_ipo_utils.c | 4 ++-- source/blender/editors/util/ed_util.c | 2 +- source/blender/makesrna/intern/rna_fluidsim.c | 4 ++-- source/blender/makesrna/intern/rna_modifier.c | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index c2e94cc97db..d56c9a63a91 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -182,7 +182,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd) gpl->thickness = 3; /* auto-name */ - sprintf(gpl->info, "GP_Layer"); + strcpy(gpl->info, "GP_Layer"); BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info)); /* make this one the active one */ diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 677a2922666..1dc53811fc0 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -941,9 +941,9 @@ static void get_flags_for_id(ID *id, char *buf) isnode= ((Tex *)id)->use_nodes; if (id->us<0) - sprintf(buf, "-1W "); + strcpy(buf, "-1W "); else if (!id->lib && !isfake && id->us && !isnode) - sprintf(buf, " "); + strcpy(buf, " "); else if(isnode) sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' '); else diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 6ce80342dd6..9c5cf9f05fa 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1284,16 +1284,16 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip) if (strip->name[0]==0) { switch (strip->type) { case NLASTRIP_TYPE_CLIP: /* act-clip */ - sprintf(strip->name, "%s", (strip->act)?(strip->act->id.name+2):("")); + BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):(""), sizeof(strip->name)); break; case NLASTRIP_TYPE_TRANSITION: /* transition */ - sprintf(strip->name, "Transition"); + BLI_strncpy(strip->name, "Transition", sizeof(strip->name)); break; case NLASTRIP_TYPE_META: /* meta */ - sprintf(strip->name, "Meta"); + BLI_strncpy(strip->name, "Meta", sizeof(strip->name)); break; default: - sprintf(strip->name, "NLA Strip"); + BLI_strncpy(strip->name, "NLA Strip", sizeof(strip->name)); break; } } diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index bf816a91fb3..3b14abb0bee 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -109,7 +109,7 @@ void RegisterBlendExtension(void) { lresult = RegCreateKeyEx(root, "blendfile", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd); if (lresult == ERROR_SUCCESS) { - sprintf(buffer,"%s","Blender File"); + strcpy(buffer,"Blender File"); lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1); RegCloseKey(hkey); } diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index d2b1fcc4abd..2774bd2cda4 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -71,12 +71,12 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short if (timecodes) { int hours=0, minutes=0, seconds=0, frames=0; float raw_seconds= cfra; - char neg[2]= ""; + char neg[2]= {'\0'}; /* get cframes */ if (cfra < 0) { /* correction for negative cfraues */ - sprintf(neg, "-"); + neg[0]= '-'; cfra = -cfra; } if (cfra >= 3600) { diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 9c43671cdf4..383e0bac796 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -63,9 +63,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) return icon; else if ELEM3(NULL, id, fcu, fcu->rna_path) { if (fcu == NULL) - sprintf(name, ""); + strcpy(name, ""); else if (fcu->rna_path == NULL) - sprintf(name, ""); + strcpy(name, ""); else /* id == NULL */ BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index); } diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 3dd7514429e..d46f4b0ed30 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -171,7 +171,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE); layout= uiPupMenuLayout(pup); - sprintf(line, "Remove Pack"); + strcpy(line, "Remove Pack"); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_REMOVE); RNA_string_set(&props_ptr, "id", id_name); diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 82911ebb3be..ba90aca47a3 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -141,12 +141,12 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA psys->part= part; psys->pointcache= BKE_ptcache_add(&psys->ptcaches); psys->flag |= PSYS_ENABLED; - sprintf(psys->name, "FluidParticles"); + BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name)); BLI_addtail(&ob->particlesystem,psys); /* add modifier */ psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem); - sprintf(psmd->modifier.name, "FluidParticleSystem" ); + BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); psmd->psys= psys; BLI_addtail(&ob->modifiers, psmd); modifier_unique_name(&ob->modifiers, (ModifierData *)psmd); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 5259ee1f6d1..f7d1b5d20cf 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -275,7 +275,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) part->end = 250.0f; part->ren_as = PART_DRAW_NOT; part->draw_as = PART_DRAW_DOT; - sprintf(psys->name, "SmokeParticles"); + BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name)); psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS); DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); }